{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUCommandBufferDescriptor.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
module WGPU.Raw.Generated.Struct.WGPUCommandBufferDescriptor 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.Struct.WGPUChainedStruct
data WGPUCommandBufferDescriptor = WGPUCommandBufferDescriptor {
WGPUCommandBufferDescriptor -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
WGPUCommandBufferDescriptor -> Ptr CChar
label :: Ptr (CChar)
}
instance Storable WGPUCommandBufferDescriptor where
sizeOf :: WGPUCommandBufferDescriptor -> Int
sizeOf WGPUCommandBufferDescriptor
_ = ((Int
16))
{-# LINE 29 "src/WGPU/Raw/Generated/Struct/WGPUCommandBufferDescriptor.hsc" #-}
alignment = sizeOf
peek :: Ptr WGPUCommandBufferDescriptor -> IO WGPUCommandBufferDescriptor
peek Ptr WGPUCommandBufferDescriptor
ptr = do
Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUCommandBufferDescriptor
hsc_ptr -> Ptr WGPUCommandBufferDescriptor
-> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUCommandBufferDescriptor
hsc_ptr Int
0)) Ptr WGPUCommandBufferDescriptor
ptr
{-# LINE 32 "src/WGPU/Raw/Generated/Struct/WGPUCommandBufferDescriptor.hsc" #-}
label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 33 "src/WGPU/Raw/Generated/Struct/WGPUCommandBufferDescriptor.hsc" #-}
pure $! WGPUCommandBufferDescriptor{..}
poke :: Ptr WGPUCommandBufferDescriptor
-> WGPUCommandBufferDescriptor -> IO ()
poke Ptr WGPUCommandBufferDescriptor
ptr WGPUCommandBufferDescriptor{Ptr CChar
Ptr WGPUChainedStruct
label :: Ptr CChar
nextInChain :: Ptr WGPUChainedStruct
label :: WGPUCommandBufferDescriptor -> Ptr CChar
nextInChain :: WGPUCommandBufferDescriptor -> Ptr WGPUChainedStruct
..} = do
((\Ptr WGPUCommandBufferDescriptor
hsc_ptr -> Ptr WGPUCommandBufferDescriptor
-> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUCommandBufferDescriptor
hsc_ptr Int
0)) Ptr WGPUCommandBufferDescriptor
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 36 "src/WGPU/Raw/Generated/Struct/WGPUCommandBufferDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label