{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.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.WGPUFragmentState 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
import WGPU.Raw.Generated.Struct.WGPUColorTargetState

data WGPUFragmentState = WGPUFragmentState {
  WGPUFragmentState -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
  WGPUFragmentState -> WGPUShaderModule
shaderModule :: WGPUShaderModule,
  WGPUFragmentState -> Ptr CChar
entryPoint :: Ptr (CChar),
  WGPUFragmentState -> Word32
targetCount :: Word32,
  WGPUFragmentState -> Ptr WGPUColorTargetState
targets :: Ptr (WGPUColorTargetState)
}

instance Storable WGPUFragmentState where
  sizeOf :: WGPUFragmentState -> Int
sizeOf WGPUFragmentState
_ = ((Int
40))
{-# LINE 33 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUFragmentState -> Int
alignment = WGPUFragmentState -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUFragmentState -> IO WGPUFragmentState
peek Ptr WGPUFragmentState
ptr = do
    Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUFragmentState
hsc_ptr -> Ptr WGPUFragmentState -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUFragmentState
hsc_ptr Int
0)) Ptr WGPUFragmentState
ptr
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    shaderModule <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    entryPoint <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 40 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    targetCount <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 41 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    targets <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) ptr
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    pure $! WGPUFragmentState{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUFragmentState -> WGPUFragmentState -> IO ()
poke Ptr WGPUFragmentState
ptr WGPUFragmentState{Word32
Ptr CChar
Ptr WGPUChainedStruct
Ptr WGPUColorTargetState
WGPUShaderModule
targets :: Ptr WGPUColorTargetState
targetCount :: Word32
entryPoint :: Ptr CChar
shaderModule :: WGPUShaderModule
nextInChain :: Ptr WGPUChainedStruct
targets :: WGPUFragmentState -> Ptr WGPUColorTargetState
targetCount :: WGPUFragmentState -> Word32
entryPoint :: WGPUFragmentState -> Ptr CChar
shaderModule :: WGPUFragmentState -> WGPUShaderModule
nextInChain :: WGPUFragmentState -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUFragmentState
hsc_ptr -> Ptr WGPUFragmentState -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUFragmentState
hsc_ptr Int
0)) Ptr WGPUFragmentState
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr shaderModule
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr entryPoint
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr targetCount
{-# LINE 49 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 32)) ptr targets
{-# LINE 50 "src/WGPU/Raw/Generated/Struct/WGPUFragmentState.hsc" #-}
  {-# INLINABLE poke #-}