{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.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.WGPUTextureDescriptor 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.WGPUTextureDimension
import WGPU.Raw.Generated.Enum.WGPUTextureFormat
import WGPU.Raw.Generated.Struct.WGPUChainedStruct
import WGPU.Raw.Generated.Struct.WGPUExtent3D

data WGPUTextureDescriptor = WGPUTextureDescriptor {
  WGPUTextureDescriptor -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
  WGPUTextureDescriptor -> Ptr CChar
label :: Ptr (CChar),
  WGPUTextureDescriptor -> WGPUTextureUsageFlags
usage :: WGPUTextureUsageFlags,
  WGPUTextureDescriptor -> WGPUTextureDimension
dimension :: WGPUTextureDimension,
  WGPUTextureDescriptor -> WGPUExtent3D
size :: WGPUExtent3D,
  WGPUTextureDescriptor -> WGPUTextureFormat
format :: WGPUTextureFormat,
  WGPUTextureDescriptor -> WGPUTextureUsageFlags
mipLevelCount :: Word32,
  WGPUTextureDescriptor -> WGPUTextureUsageFlags
sampleCount :: Word32
}

instance Storable WGPUTextureDescriptor where
  sizeOf :: WGPUTextureDescriptor -> Int
sizeOf WGPUTextureDescriptor
_ = ((Int
48))
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUTextureDescriptor -> Int
alignment = WGPUTextureDescriptor -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUTextureDescriptor -> IO WGPUTextureDescriptor
peek Ptr WGPUTextureDescriptor
ptr = do
    Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUTextureDescriptor
hsc_ptr -> Ptr WGPUTextureDescriptor -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUTextureDescriptor
hsc_ptr Int
0)) Ptr WGPUTextureDescriptor
ptr
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    usage <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    dimension <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    size <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    format <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) ptr
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    mipLevelCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 40)) ptr
{-# LINE 49 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    sampleCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 44)) ptr
{-# LINE 50 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    pure $! WGPUTextureDescriptor{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUTextureDescriptor -> WGPUTextureDescriptor -> IO ()
poke Ptr WGPUTextureDescriptor
ptr WGPUTextureDescriptor{WGPUTextureUsageFlags
Ptr CChar
Ptr WGPUChainedStruct
WGPUTextureDimension
WGPUTextureFormat
WGPUExtent3D
sampleCount :: WGPUTextureUsageFlags
mipLevelCount :: WGPUTextureUsageFlags
format :: WGPUTextureFormat
size :: WGPUExtent3D
dimension :: WGPUTextureDimension
usage :: WGPUTextureUsageFlags
label :: Ptr CChar
nextInChain :: Ptr WGPUChainedStruct
sampleCount :: WGPUTextureDescriptor -> WGPUTextureUsageFlags
mipLevelCount :: WGPUTextureDescriptor -> WGPUTextureUsageFlags
format :: WGPUTextureDescriptor -> WGPUTextureFormat
size :: WGPUTextureDescriptor -> WGPUExtent3D
dimension :: WGPUTextureDescriptor -> WGPUTextureDimension
usage :: WGPUTextureDescriptor -> WGPUTextureUsageFlags
label :: WGPUTextureDescriptor -> Ptr CChar
nextInChain :: WGPUTextureDescriptor -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUTextureDescriptor
hsc_ptr -> Ptr WGPUTextureDescriptor -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUTextureDescriptor
hsc_ptr Int
0)) Ptr WGPUTextureDescriptor
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 54 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label
{-# LINE 55 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr usage
{-# LINE 56 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr dimension
{-# LINE 57 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr size
{-# LINE 58 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 36)) ptr format
{-# LINE 59 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 40)) ptr mipLevelCount
{-# LINE 60 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 44)) ptr sampleCount
{-# LINE 61 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
  {-# INLINABLE poke #-}