{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.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.WGPUBufferDescriptor 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 WGPUBufferDescriptor = WGPUBufferDescriptor {
  WGPUBufferDescriptor -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
  WGPUBufferDescriptor -> Ptr CChar
label :: Ptr (CChar),
  WGPUBufferDescriptor -> WGPUBufferUsageFlags
usage :: WGPUBufferUsageFlags,
  WGPUBufferDescriptor -> Word64
size :: Word64,
  WGPUBufferDescriptor -> CBool
mappedAtCreation :: CBool
}

instance Storable WGPUBufferDescriptor where
  sizeOf :: WGPUBufferDescriptor -> Int
sizeOf WGPUBufferDescriptor
_ = ((Int
40))
{-# LINE 32 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUBufferDescriptor -> Int
alignment = WGPUBufferDescriptor -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUBufferDescriptor -> IO WGPUBufferDescriptor
peek Ptr WGPUBufferDescriptor
ptr = do
    Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUBufferDescriptor
hsc_ptr -> Ptr WGPUBufferDescriptor -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUBufferDescriptor
hsc_ptr Int
0)) Ptr WGPUBufferDescriptor
ptr
{-# LINE 37 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    usage <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    size <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 40 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    mappedAtCreation <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) ptr
{-# LINE 41 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    pure $! WGPUBufferDescriptor{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUBufferDescriptor -> WGPUBufferDescriptor -> IO ()
poke Ptr WGPUBufferDescriptor
ptr WGPUBufferDescriptor{WGPUBufferUsageFlags
Word64
Ptr CChar
Ptr WGPUChainedStruct
CBool
mappedAtCreation :: CBool
size :: Word64
usage :: WGPUBufferUsageFlags
label :: Ptr CChar
nextInChain :: Ptr WGPUChainedStruct
mappedAtCreation :: WGPUBufferDescriptor -> CBool
size :: WGPUBufferDescriptor -> Word64
usage :: WGPUBufferDescriptor -> WGPUBufferUsageFlags
label :: WGPUBufferDescriptor -> Ptr CChar
nextInChain :: WGPUBufferDescriptor -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUBufferDescriptor
hsc_ptr -> Ptr WGPUBufferDescriptor -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUBufferDescriptor
hsc_ptr Int
0)) Ptr WGPUBufferDescriptor
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr usage
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr size
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 32)) ptr mappedAtCreation
{-# LINE 49 "src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc" #-}
  {-# INLINABLE poke #-}