{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- This file was generated by wgpu-raw-hs-codegen on:
--   2021-08-15T08:56:06.968390
-- Using wgpu-native git hash:
--   b10496e7eed9349f0fd541e6dfe5029cb436de74 wgpu-native (v0.9.2.2)

module WGPU.Raw.Generated.Struct.WGPUTextureViewDescriptor 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.WGPUTextureFormat
import WGPU.Raw.Generated.Enum.WGPUTextureViewDimension
import WGPU.Raw.Generated.Enum.WGPUTextureAspect
import WGPU.Raw.Generated.Struct.WGPUChainedStruct

data WGPUTextureViewDescriptor = WGPUTextureViewDescriptor {
  WGPUTextureViewDescriptor -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
  WGPUTextureViewDescriptor -> Ptr CChar
label :: Ptr (CChar),
  WGPUTextureViewDescriptor -> WGPUTextureFormat
format :: WGPUTextureFormat,
  WGPUTextureViewDescriptor -> WGPUTextureViewDimension
dimension :: WGPUTextureViewDimension,
  WGPUTextureViewDescriptor -> Word32
baseMipLevel :: Word32,
  WGPUTextureViewDescriptor -> Word32
mipLevelCount :: Word32,
  WGPUTextureViewDescriptor -> Word32
baseArrayLayer :: Word32,
  WGPUTextureViewDescriptor -> Word32
arrayLayerCount :: Word32,
  WGPUTextureViewDescriptor -> WGPUTextureAspect
aspect :: WGPUTextureAspect
}

instance Storable WGPUTextureViewDescriptor where
  sizeOf :: WGPUTextureViewDescriptor -> Int
sizeOf WGPUTextureViewDescriptor
_ = ((Int
48))
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
  alignment = sizeOf
  peek :: Ptr WGPUTextureViewDescriptor -> IO WGPUTextureViewDescriptor
peek Ptr WGPUTextureViewDescriptor
ptr = do
    Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUTextureViewDescriptor
hsc_ptr -> Ptr WGPUTextureViewDescriptor -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUTextureViewDescriptor
hsc_ptr Int
0)) Ptr WGPUTextureViewDescriptor
ptr
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    format <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    dimension <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    baseMipLevel <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    mipLevelCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) ptr
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    baseArrayLayer <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) ptr
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    arrayLayerCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 36)) ptr
{-# LINE 49 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    aspect <- ((\hsc_ptr -> peekByteOff hsc_ptr 40)) ptr
{-# LINE 50 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    pure $! WGPUTextureViewDescriptor{..}
  poke :: Ptr WGPUTextureViewDescriptor -> WGPUTextureViewDescriptor -> IO ()
poke Ptr WGPUTextureViewDescriptor
ptr WGPUTextureViewDescriptor{Word32
Ptr CChar
Ptr WGPUChainedStruct
WGPUTextureAspect
WGPUTextureFormat
WGPUTextureViewDimension
aspect :: WGPUTextureAspect
arrayLayerCount :: Word32
baseArrayLayer :: Word32
mipLevelCount :: Word32
baseMipLevel :: Word32
dimension :: WGPUTextureViewDimension
format :: WGPUTextureFormat
label :: Ptr CChar
nextInChain :: Ptr WGPUChainedStruct
aspect :: WGPUTextureViewDescriptor -> WGPUTextureAspect
arrayLayerCount :: WGPUTextureViewDescriptor -> Word32
baseArrayLayer :: WGPUTextureViewDescriptor -> Word32
mipLevelCount :: WGPUTextureViewDescriptor -> Word32
baseMipLevel :: WGPUTextureViewDescriptor -> Word32
dimension :: WGPUTextureViewDescriptor -> WGPUTextureViewDimension
format :: WGPUTextureViewDescriptor -> WGPUTextureFormat
label :: WGPUTextureViewDescriptor -> Ptr CChar
nextInChain :: WGPUTextureViewDescriptor -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUTextureViewDescriptor
hsc_ptr -> Ptr WGPUTextureViewDescriptor
-> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUTextureViewDescriptor
hsc_ptr Int
0)) Ptr WGPUTextureViewDescriptor
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 53 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label
{-# LINE 54 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr format
{-# LINE 55 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr dimension
{-# LINE 56 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr baseMipLevel
{-# LINE 57 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 28)) ptr mipLevelCount
{-# LINE 58 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 32)) ptr baseArrayLayer
{-# LINE 59 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 36)) ptr arrayLayerCount
{-# LINE 60 "src/WGPU/Raw/Generated/Struct/WGPUTextureViewDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 40)) ptr aspect