{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUChainedStruct.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- This file was generated by wgpu-raw-hs-codegen on:
--   2021-08-25T10:02:03.522705
-- Using wgpu-native git hash:
--   b10496e7eed9349f0fd541e6dfe5029cb436de74 wgpu-native (v0.9.2.2)

module WGPU.Raw.Generated.Struct.WGPUChainedStruct where



import Data.Word (Word16, Word32, Word64)
import Data.Int (Int32)
import Foreign
import Foreign.C.Types
import WGPU.Raw.Types
import Prelude (pure, ($!))
import WGPU.Raw.Generated.Enum.WGPUSType

data WGPUChainedStruct = WGPUChainedStruct {
  WGPUChainedStruct -> Ptr WGPUChainedStruct
next :: Ptr (WGPUChainedStruct),
  WGPUChainedStruct -> WGPUSType
sType :: WGPUSType
}

instance Storable WGPUChainedStruct where
  sizeOf :: WGPUChainedStruct -> Int
sizeOf WGPUChainedStruct
_ = ((Int
16))
{-# LINE 29 "src/WGPU/Raw/Generated/Struct/WGPUChainedStruct.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUChainedStruct -> Int
alignment = WGPUChainedStruct -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUChainedStruct -> IO WGPUChainedStruct
peek Ptr WGPUChainedStruct
ptr = do
    Ptr WGPUChainedStruct
next <- ((\Ptr WGPUChainedStruct
hsc_ptr -> Ptr WGPUChainedStruct -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUChainedStruct
hsc_ptr Int
0)) Ptr WGPUChainedStruct
ptr
{-# LINE 34 "src/WGPU/Raw/Generated/Struct/WGPUChainedStruct.hsc" #-}
    sType <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 35 "src/WGPU/Raw/Generated/Struct/WGPUChainedStruct.hsc" #-}
    pure $! WGPUChainedStruct{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUChainedStruct -> WGPUChainedStruct -> IO ()
poke Ptr WGPUChainedStruct
ptr WGPUChainedStruct{Ptr WGPUChainedStruct
WGPUSType
sType :: WGPUSType
next :: Ptr WGPUChainedStruct
sType :: WGPUChainedStruct -> WGPUSType
next :: WGPUChainedStruct -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUChainedStruct
hsc_ptr -> Ptr WGPUChainedStruct -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUChainedStruct
hsc_ptr Int
0)) Ptr WGPUChainedStruct
ptr Ptr WGPUChainedStruct
next
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUChainedStruct.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr sType
{-# LINE 40 "src/WGPU/Raw/Generated/Struct/WGPUChainedStruct.hsc" #-}
  {-# INLINABLE poke #-}