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