{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.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.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" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUVertexAttribute -> Int
alignment = WGPUVertexAttribute -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  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 35 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
    offset <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 36 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
    shaderLocation <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 37 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
    pure $! WGPUVertexAttribute{..}
  {-# INLINABLE peek #-}
  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 41 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr offset
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr shaderLocation
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUVertexAttribute.hsc" #-}
  {-# INLINABLE poke #-}