{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
module WGPU.Raw.Generated.Struct.WGPUVertexAttribute 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.WGPUVertexFormat
data WGPUVertexAttribute = WGPUVertexAttribute {
WGPUVertexAttribute -> WGPUVertexFormat
format :: WGPUVertexFormat,
WGPUVertexAttribute -> Word64
offset :: Word64,
WGPUVertexAttribute -> Word32
shaderLocation :: Word32
}
instance Storable WGPUVertexAttribute where
sizeOf :: WGPUVertexAttribute -> Int
sizeOf WGPUVertexAttribute
_ = ((Int
24))
{-# LINE 30 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
alignment = sizeOf
peek :: Ptr WGPUVertexAttribute -> IO WGPUVertexAttribute
peek Ptr WGPUVertexAttribute
ptr = do
WGPUVertexFormat
format <- ((\Ptr WGPUVertexAttribute
hsc_ptr -> Ptr WGPUVertexAttribute -> Int -> IO WGPUVertexFormat
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUVertexAttribute
hsc_ptr Int
0)) Ptr WGPUVertexAttribute
ptr
{-# LINE 33 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
offset <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 34 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
shaderLocation <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 35 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
pure $! WGPUVertexAttribute{..}
poke :: Ptr WGPUVertexAttribute -> WGPUVertexAttribute -> IO ()
poke Ptr WGPUVertexAttribute
ptr WGPUVertexAttribute{Word32
Word64
WGPUVertexFormat
shaderLocation :: Word32
offset :: Word64
format :: WGPUVertexFormat
shaderLocation :: WGPUVertexAttribute -> Word32
offset :: WGPUVertexAttribute -> Word64
format :: WGPUVertexAttribute -> WGPUVertexFormat
..} = do
((\Ptr WGPUVertexAttribute
hsc_ptr -> Ptr WGPUVertexAttribute -> Int -> WGPUVertexFormat -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUVertexAttribute
hsc_ptr Int
0)) Ptr WGPUVertexAttribute
ptr WGPUVertexFormat
format
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr offset
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr shaderLocation