{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
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" #-}
alignment = sizeOf
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 41 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
usage <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
dimension <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
size <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
format <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) ptr
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
mipLevelCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 40)) ptr
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
sampleCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 44)) ptr
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
pure $! WGPUTextureDescriptor{..}
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 51 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label
{-# LINE 52 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr usage
{-# LINE 53 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr dimension
{-# LINE 54 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr size
{-# LINE 55 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 36)) ptr format
{-# LINE 56 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 40)) ptr mipLevelCount
{-# LINE 57 "src/WGPU/Raw/Generated/Struct/WGPUTextureDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 44)) ptr sampleCount