{-# language CPP #-}
module Vulkan.Core10.Pipeline ( createGraphicsPipelines
, withGraphicsPipelines
, createComputePipelines
, withComputePipelines
, destroyPipeline
, Viewport(..)
, SpecializationMapEntry(..)
, SpecializationInfo(..)
, PipelineShaderStageCreateInfo(..)
, ComputePipelineCreateInfo(..)
, VertexInputBindingDescription(..)
, VertexInputAttributeDescription(..)
, PipelineVertexInputStateCreateInfo(..)
, PipelineInputAssemblyStateCreateInfo(..)
, PipelineTessellationStateCreateInfo(..)
, PipelineViewportStateCreateInfo(..)
, PipelineRasterizationStateCreateInfo(..)
, PipelineMultisampleStateCreateInfo(..)
, PipelineColorBlendAttachmentState(..)
, PipelineColorBlendStateCreateInfo(..)
, PipelineDynamicStateCreateInfo(..)
, StencilOpState(..)
, PipelineDepthStencilStateCreateInfo(..)
, GraphicsPipelineCreateInfo(..)
, Pipeline(..)
, PipelineLayoutCreateFlags(..)
, PipelineDynamicStateCreateFlags(..)
, PipelineMultisampleStateCreateFlags(..)
, PipelineRasterizationStateCreateFlags(..)
, PipelineViewportStateCreateFlags(..)
, PipelineTessellationStateCreateFlags(..)
, PipelineInputAssemblyStateCreateFlags(..)
, PipelineVertexInputStateCreateFlags(..)
, PrimitiveTopology(..)
, CompareOp(..)
, PolygonMode(..)
, FrontFace(..)
, BlendFactor(..)
, BlendOp(..)
, StencilOp(..)
, LogicOp(..)
, VertexInputRate(..)
, DynamicState(..)
, CullModeFlagBits(..)
, CullModeFlags
, ShaderStageFlagBits(..)
, ShaderStageFlags
, PipelineCreateFlagBits(..)
, PipelineCreateFlags
, PipelineShaderStageCreateFlagBits(..)
, PipelineShaderStageCreateFlags
, ColorComponentFlagBits(..)
, ColorComponentFlags
, PipelineColorBlendStateCreateFlagBits(..)
, PipelineColorBlendStateCreateFlags
, PipelineDepthStencilStateCreateFlagBits(..)
, PipelineDepthStencilStateCreateFlags
, SampleMask
) where
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Foldable (traverse_)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import Foreign.Marshal.Utils (maybePeek)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import qualified Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.ByteString (packCString)
import Data.ByteString (useAsCString)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(..))
import Foreign.C.Types (CFloat(CFloat))
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Word (Word64)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_dynamic_rendering (AttachmentSampleCountInfoAMD)
import Vulkan.Core10.Enums.BlendFactor (BlendFactor)
import Vulkan.Core10.Enums.BlendOp (BlendOp)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Enums.ColorComponentFlagBits (ColorComponentFlags)
import Vulkan.Core10.Enums.CompareOp (CompareOp)
import Vulkan.Core10.Enums.CullModeFlagBits (CullModeFlags)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCreateComputePipelines))
import Vulkan.Dynamic (DeviceCmds(pVkCreateGraphicsPipelines))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyPipeline))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.Enums.DynamicState (DynamicState)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.FrontFace (FrontFace)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_device_generated_commands (GraphicsPipelineShaderGroupsCreateInfoNV)
import Vulkan.Core10.Enums.LogicOp (LogicOp)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_dynamic_rendering (MultiviewPerViewAttributesInfoNVX)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Handles (Pipeline)
import Vulkan.Core10.Handles (Pipeline(..))
import Vulkan.Core10.Handles (PipelineCache)
import Vulkan.Core10.Handles (PipelineCache(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_blend_operation_advanced (PipelineColorBlendAdvancedStateCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineColorBlendStateCreateFlagBits (PipelineColorBlendStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_color_write_enable (PipelineColorWriteCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_AMD_pipeline_compiler_control (PipelineCompilerControlCreateInfoAMD)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_framebuffer_mixed_samples (PipelineCoverageModulationStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_coverage_reduction_mode (PipelineCoverageReductionStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_fragment_coverage_to_color (PipelineCoverageToColorStateCreateInfoNV)
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_pipeline_creation_feedback (PipelineCreationFeedbackCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineDepthStencilStateCreateFlagBits (PipelineDepthStencilStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_discard_rectangles (PipelineDiscardRectangleStateCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineDynamicStateCreateFlags (PipelineDynamicStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_fragment_shading_rate_enums (PipelineFragmentShadingRateEnumStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_fragment_shading_rate (PipelineFragmentShadingRateStateCreateInfoKHR)
import Vulkan.Core10.Enums.PipelineInputAssemblyStateCreateFlags (PipelineInputAssemblyStateCreateFlags)
import Vulkan.Core10.Handles (PipelineLayout)
import Vulkan.Core10.Enums.PipelineMultisampleStateCreateFlags (PipelineMultisampleStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_conservative_rasterization (PipelineRasterizationConservativeStateCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_depth_clip_enable (PipelineRasterizationDepthClipStateCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_line_rasterization (PipelineRasterizationLineStateCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_provoking_vertex (PipelineRasterizationProvokingVertexStateCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineRasterizationStateCreateFlags (PipelineRasterizationStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_AMD_rasterization_order (PipelineRasterizationStateRasterizationOrderAMD)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_transform_feedback (PipelineRasterizationStateStreamCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_dynamic_rendering (PipelineRenderingCreateInfoKHR)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_representative_fragment_test (PipelineRepresentativeFragmentTestStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_sample_locations (PipelineSampleLocationsStateCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineShaderStageCreateFlagBits (PipelineShaderStageCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subgroup_size_control (PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Core11.Promoted_From_VK_KHR_maintenance2 (PipelineTessellationDomainOriginStateCreateInfo)
import Vulkan.Core10.Enums.PipelineTessellationStateCreateFlags (PipelineTessellationStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_vertex_attribute_divisor (PipelineVertexInputDivisorStateCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineVertexInputStateCreateFlags (PipelineVertexInputStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_shading_rate_image (PipelineViewportCoarseSampleOrderStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_depth_clip_control (PipelineViewportDepthClipControlCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_scissor_exclusive (PipelineViewportExclusiveScissorStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_shading_rate_image (PipelineViewportShadingRateImageStateCreateInfoNV)
import Vulkan.Core10.Enums.PipelineViewportStateCreateFlags (PipelineViewportStateCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_viewport_swizzle (PipelineViewportSwizzleStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_clip_space_w_scaling (PipelineViewportWScalingStateCreateInfoNV)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.PolygonMode (PolygonMode)
import Vulkan.Core10.Enums.PrimitiveTopology (PrimitiveTopology)
import Vulkan.Core10.FundamentalTypes (Rect2D)
import Vulkan.Core10.Handles (RenderPass)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits)
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits(SampleCountFlagBits))
import Vulkan.Core10.FundamentalTypes (SampleMask)
import Vulkan.Core10.Handles (ShaderModule)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.CStruct.Extends (SomeStruct(..))
import Vulkan.Core10.Enums.StencilOp (StencilOp)
import Vulkan.Core10.Enums.StructureType (StructureType)
import {-# SOURCE #-} Vulkan.Extensions.VK_HUAWEI_subpass_shading (SubpassShadingPipelineCreateInfoHUAWEI)
import Vulkan.Core10.Enums.VertexInputRate (VertexInputRate)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.Enums.BlendFactor (BlendFactor(..))
import Vulkan.Core10.Enums.BlendOp (BlendOp(..))
import Vulkan.Core10.Enums.ColorComponentFlagBits (ColorComponentFlagBits(..))
import Vulkan.Core10.Enums.ColorComponentFlagBits (ColorComponentFlags)
import Vulkan.Core10.Enums.CompareOp (CompareOp(..))
import Vulkan.Core10.Enums.CullModeFlagBits (CullModeFlagBits(..))
import Vulkan.Core10.Enums.CullModeFlagBits (CullModeFlags)
import Vulkan.Core10.Enums.DynamicState (DynamicState(..))
import Vulkan.Core10.Enums.FrontFace (FrontFace(..))
import Vulkan.Core10.Enums.LogicOp (LogicOp(..))
import Vulkan.Core10.Handles (Pipeline(..))
import Vulkan.Core10.Enums.PipelineColorBlendStateCreateFlagBits (PipelineColorBlendStateCreateFlagBits(..))
import Vulkan.Core10.Enums.PipelineColorBlendStateCreateFlagBits (PipelineColorBlendStateCreateFlags)
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlagBits(..))
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlags)
import Vulkan.Core10.Enums.PipelineDepthStencilStateCreateFlagBits (PipelineDepthStencilStateCreateFlagBits(..))
import Vulkan.Core10.Enums.PipelineDepthStencilStateCreateFlagBits (PipelineDepthStencilStateCreateFlags)
import Vulkan.Core10.Enums.PipelineDynamicStateCreateFlags (PipelineDynamicStateCreateFlags(..))
import Vulkan.Core10.Enums.PipelineInputAssemblyStateCreateFlags (PipelineInputAssemblyStateCreateFlags(..))
import Vulkan.Core10.Enums.PipelineLayoutCreateFlags (PipelineLayoutCreateFlags(..))
import Vulkan.Core10.Enums.PipelineMultisampleStateCreateFlags (PipelineMultisampleStateCreateFlags(..))
import Vulkan.Core10.Enums.PipelineRasterizationStateCreateFlags (PipelineRasterizationStateCreateFlags(..))
import Vulkan.Core10.Enums.PipelineShaderStageCreateFlagBits (PipelineShaderStageCreateFlagBits(..))
import Vulkan.Core10.Enums.PipelineShaderStageCreateFlagBits (PipelineShaderStageCreateFlags)
import Vulkan.Core10.Enums.PipelineTessellationStateCreateFlags (PipelineTessellationStateCreateFlags(..))
import Vulkan.Core10.Enums.PipelineVertexInputStateCreateFlags (PipelineVertexInputStateCreateFlags(..))
import Vulkan.Core10.Enums.PipelineViewportStateCreateFlags (PipelineViewportStateCreateFlags(..))
import Vulkan.Core10.Enums.PolygonMode (PolygonMode(..))
import Vulkan.Core10.Enums.PrimitiveTopology (PrimitiveTopology(..))
import Vulkan.Core10.FundamentalTypes (SampleMask)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlagBits(..))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.StencilOp (StencilOp(..))
import Vulkan.Core10.Enums.VertexInputRate (VertexInputRate(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateGraphicsPipelines
:: FunPtr (Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct GraphicsPipelineCreateInfo) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result) -> Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct GraphicsPipelineCreateInfo) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result
createGraphicsPipelines :: forall io
. (MonadIO io)
=>
Device
->
PipelineCache
->
("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, ("pipelines" ::: Vector Pipeline))
createGraphicsPipelines :: Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createGraphicsPipelines Device
device PipelineCache
pipelineCache "createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos "allocator" ::: Maybe AllocationCallbacks
allocator = IO (Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline))
-> (ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ do
let vkCreateGraphicsPipelinesPtr :: FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateGraphicsPipelinesPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
pVkCreateGraphicsPipelines (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateGraphicsPipelinesPtr FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateGraphicsPipelines is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateGraphicsPipelines' :: Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateGraphicsPipelines' = FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
mkVkCreateGraphicsPipelines FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateGraphicsPipelinesPtr
Ptr (GraphicsPipelineCreateInfo Any)
pPCreateInfos <- ((Ptr (GraphicsPipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (GraphicsPipelineCreateInfo Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (GraphicsPipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (GraphicsPipelineCreateInfo Any)))
-> ((Ptr (GraphicsPipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (GraphicsPipelineCreateInfo Any))
forall a b. (a -> b) -> a -> b
$ Int
-> (Ptr (GraphicsPipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(GraphicsPipelineCreateInfo _) ((("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
144)
(Int
-> SomeStruct GraphicsPipelineCreateInfo
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct GraphicsPipelineCreateInfo
e -> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> SomeStruct GraphicsPipelineCreateInfo
-> IO (Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (GraphicsPipelineCreateInfo Any)
-> "pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (GraphicsPipelineCreateInfo Any)
pPCreateInfos Ptr (GraphicsPipelineCreateInfo Any)
-> Int -> Ptr (GraphicsPipelineCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
144 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (GraphicsPipelineCreateInfo _))) (SomeStruct GraphicsPipelineCreateInfo
e) (IO (Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> (() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> () -> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ ())) ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pPipelines" ::: Ptr Pipeline
pPPipelines <- ((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline))
-> ((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline)
forall a b. (a -> b) -> a -> b
$ IO ("pPipelines" ::: Ptr Pipeline)
-> (("pPipelines" ::: Ptr Pipeline) -> IO ())
-> (("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPipelines" ::: Ptr Pipeline)
forall a. Int -> IO (Ptr a)
callocBytes @Pipeline ((("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) :: Word32))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)) ("pPipelines" ::: Ptr Pipeline) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result)
-> IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateGraphicsPipelines" (Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateGraphicsPipelines' (Device -> Ptr Device_T
deviceHandle (Device
device)) (PipelineCache
pipelineCache) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) :: Word32)) (Ptr (GraphicsPipelineCreateInfo Any)
-> "pCreateInfos" ::: Ptr (SomeStruct GraphicsPipelineCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (GraphicsPipelineCreateInfo Any)
pPCreateInfos)) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pPipelines" ::: Ptr Pipeline
pPPipelines))
IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"pipelines" ::: Vector Pipeline
pPipelines <- IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline))
-> IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ Int -> (Int -> IO Pipeline) -> IO ("pipelines" ::: Vector Pipeline)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) :: Word32))) (\Int
i -> ("pPipelines" ::: Ptr Pipeline) -> IO Pipeline
forall a. Storable a => Ptr a -> IO a
peek @Pipeline (("pPipelines" ::: Ptr Pipeline
pPPipelines ("pPipelines" ::: Ptr Pipeline)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
(Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline))
-> (Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ (Result
r, "pipelines" ::: Vector Pipeline
pPipelines)
withGraphicsPipelines :: forall io r . MonadIO io => Device -> PipelineCache -> Vector (SomeStruct GraphicsPipelineCreateInfo) -> Maybe AllocationCallbacks -> (io (Result, Vector Pipeline) -> ((Result, Vector Pipeline) -> io ()) -> r) -> r
withGraphicsPipelines :: Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r)
-> r
withGraphicsPipelines Device
device PipelineCache
pipelineCache "createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
pCreateInfos "allocator" ::: Maybe AllocationCallbacks
pAllocator io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r
b =
io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r
b (Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct GraphicsPipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createGraphicsPipelines Device
device PipelineCache
pipelineCache "createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
pCreateInfos "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(Result
_, "pipelines" ::: Vector Pipeline
o1) -> (Pipeline -> io ()) -> ("pipelines" ::: Vector Pipeline) -> io ()
forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
(a -> f b) -> t a -> f ()
traverse_ (\Pipeline
o1Elem -> Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
destroyPipeline Device
device Pipeline
o1Elem "allocator" ::: Maybe AllocationCallbacks
pAllocator) "pipelines" ::: Vector Pipeline
o1)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateComputePipelines
:: FunPtr (Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct ComputePipelineCreateInfo) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result) -> Ptr Device_T -> PipelineCache -> Word32 -> Ptr (SomeStruct ComputePipelineCreateInfo) -> Ptr AllocationCallbacks -> Ptr Pipeline -> IO Result
createComputePipelines :: forall io
. (MonadIO io)
=>
Device
->
PipelineCache
->
("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, ("pipelines" ::: Vector Pipeline))
createComputePipelines :: Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createComputePipelines Device
device PipelineCache
pipelineCache "createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos "allocator" ::: Maybe AllocationCallbacks
allocator = IO (Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline))
-> (ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ do
let vkCreateComputePipelinesPtr :: FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateComputePipelinesPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
pVkCreateComputePipelines (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateComputePipelinesPtr FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateComputePipelines is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateComputePipelines' :: Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateComputePipelines' = FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
-> Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
mkVkCreateComputePipelines FunPtr
(Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result)
vkCreateComputePipelinesPtr
Ptr (ComputePipelineCreateInfo Any)
pPCreateInfos <- ((Ptr (ComputePipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (ComputePipelineCreateInfo Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (ComputePipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (ComputePipelineCreateInfo Any)))
-> ((Ptr (ComputePipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Ptr (ComputePipelineCreateInfo Any))
forall a b. (a -> b) -> a -> b
$ Int
-> (Ptr (ComputePipelineCreateInfo Any)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(ComputePipelineCreateInfo _) ((("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
96)
(Int
-> SomeStruct ComputePipelineCreateInfo
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct ComputePipelineCreateInfo
e -> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> SomeStruct ComputePipelineCreateInfo
-> IO (Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (ComputePipelineCreateInfo Any)
-> "pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ComputePipelineCreateInfo Any)
pPCreateInfos Ptr (ComputePipelineCreateInfo Any)
-> Int -> Ptr (ComputePipelineCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
96 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ComputePipelineCreateInfo _))) (SomeStruct ComputePipelineCreateInfo
e) (IO (Result, "pipelines" ::: Vector Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> (() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO (Result, "pipelines" ::: Vector Pipeline))
-> () -> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ ())) ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pPipelines" ::: Ptr Pipeline
pPPipelines <- ((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline))
-> ((("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pPipelines" ::: Ptr Pipeline)
forall a b. (a -> b) -> a -> b
$ IO ("pPipelines" ::: Ptr Pipeline)
-> (("pPipelines" ::: Ptr Pipeline) -> IO ())
-> (("pPipelines" ::: Ptr Pipeline)
-> IO (Result, "pipelines" ::: Vector Pipeline))
-> IO (Result, "pipelines" ::: Vector Pipeline)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pPipelines" ::: Ptr Pipeline)
forall a. Int -> IO (Ptr a)
callocBytes @Pipeline ((("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) :: Word32))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)) ("pPipelines" ::: Ptr Pipeline) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result)
-> IO Result
-> ContT (Result, "pipelines" ::: Vector Pipeline) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateComputePipelines" (Ptr Device_T
-> PipelineCache
-> ("createInfoCount" ::: Word32)
-> ("pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pPipelines" ::: Ptr Pipeline)
-> IO Result
vkCreateComputePipelines' (Device -> Ptr Device_T
deviceHandle (Device
device)) (PipelineCache
pipelineCache) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) :: Word32)) (Ptr (ComputePipelineCreateInfo Any)
-> "pCreateInfos" ::: Ptr (SomeStruct ComputePipelineCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ComputePipelineCreateInfo Any)
pPCreateInfos)) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pPipelines" ::: Ptr Pipeline
pPPipelines))
IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ())
-> IO () -> ContT (Result, "pipelines" ::: Vector Pipeline) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"pipelines" ::: Vector Pipeline
pPipelines <- IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline))
-> IO ("pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
("pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ Int -> (Int -> IO Pipeline) -> IO ("pipelines" ::: Vector Pipeline)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a. Vector a -> Int
Data.Vector.length (("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int)
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> Int
forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) :: Word32))) (\Int
i -> ("pPipelines" ::: Ptr Pipeline) -> IO Pipeline
forall a. Storable a => Ptr a -> IO a
peek @Pipeline (("pPipelines" ::: Ptr Pipeline
pPPipelines ("pPipelines" ::: Ptr Pipeline)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
(Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline))
-> (Result, "pipelines" ::: Vector Pipeline)
-> ContT
(Result, "pipelines" ::: Vector Pipeline)
IO
(Result, "pipelines" ::: Vector Pipeline)
forall a b. (a -> b) -> a -> b
$ (Result
r, "pipelines" ::: Vector Pipeline
pPipelines)
withComputePipelines :: forall io r . MonadIO io => Device -> PipelineCache -> Vector (SomeStruct ComputePipelineCreateInfo) -> Maybe AllocationCallbacks -> (io (Result, Vector Pipeline) -> ((Result, Vector Pipeline) -> io ()) -> r) -> r
withComputePipelines :: Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r)
-> r
withComputePipelines Device
device PipelineCache
pipelineCache "createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
pCreateInfos "allocator" ::: Maybe AllocationCallbacks
pAllocator io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r
b =
io (Result, "pipelines" ::: Vector Pipeline)
-> ((Result, "pipelines" ::: Vector Pipeline) -> io ()) -> r
b (Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
forall (io :: * -> *).
MonadIO io =>
Device
-> PipelineCache
-> ("createInfos"
::: Vector (SomeStruct ComputePipelineCreateInfo))
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io (Result, "pipelines" ::: Vector Pipeline)
createComputePipelines Device
device PipelineCache
pipelineCache "createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
pCreateInfos "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(Result
_, "pipelines" ::: Vector Pipeline
o1) -> (Pipeline -> io ()) -> ("pipelines" ::: Vector Pipeline) -> io ()
forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
(a -> f b) -> t a -> f ()
traverse_ (\Pipeline
o1Elem -> Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
destroyPipeline Device
device Pipeline
o1Elem "allocator" ::: Maybe AllocationCallbacks
pAllocator) "pipelines" ::: Vector Pipeline
o1)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyPipeline
:: FunPtr (Ptr Device_T -> Pipeline -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> Pipeline -> Ptr AllocationCallbacks -> IO ()
destroyPipeline :: forall io
. (MonadIO io)
=>
Device
->
Pipeline
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyPipeline :: Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
destroyPipeline Device
device Pipeline
pipeline "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkDestroyPipelinePtr :: FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
vkDestroyPipelinePtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
pVkDestroyPipeline (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
vkDestroyPipelinePtr FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
-> FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroyPipeline is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyPipeline' :: Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
vkDestroyPipeline' = FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
-> Ptr Device_T
-> Pipeline
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyPipeline FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
vkDestroyPipelinePtr
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkDestroyPipeline" (Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
vkDestroyPipeline' (Device -> Ptr Device_T
deviceHandle (Device
device)) (Pipeline
pipeline) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
data Viewport = Viewport
{
Viewport -> Float
x :: Float
,
Viewport -> Float
y :: Float
,
Viewport -> Float
width :: Float
,
Viewport -> Float
height :: Float
,
Viewport -> Float
minDepth :: Float
,
Viewport -> Float
maxDepth :: Float
}
deriving (Typeable, Viewport -> Viewport -> Bool
(Viewport -> Viewport -> Bool)
-> (Viewport -> Viewport -> Bool) -> Eq Viewport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Viewport -> Viewport -> Bool
$c/= :: Viewport -> Viewport -> Bool
== :: Viewport -> Viewport -> Bool
$c== :: Viewport -> Viewport -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (Viewport)
#endif
deriving instance Show Viewport
instance ToCStruct Viewport where
withCStruct :: Viewport -> (Ptr Viewport -> IO b) -> IO b
withCStruct Viewport
x Ptr Viewport -> IO b
f = Int -> (Ptr Viewport -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr Viewport -> IO b) -> IO b) -> (Ptr Viewport -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr Viewport
p -> Ptr Viewport -> Viewport -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr Viewport
p Viewport
x (Ptr Viewport -> IO b
f Ptr Viewport
p)
pokeCStruct :: Ptr Viewport -> Viewport -> IO b -> IO b
pokeCStruct Ptr Viewport
p Viewport{Float
maxDepth :: Float
minDepth :: Float
height :: Float
width :: Float
y :: Float
x :: Float
$sel:maxDepth:Viewport :: Viewport -> Float
$sel:minDepth:Viewport :: Viewport -> Float
$sel:height:Viewport :: Viewport -> Float
$sel:width:Viewport :: Viewport -> Float
$sel:y:Viewport :: Viewport -> Float
$sel:x:Viewport :: Viewport -> Float
..} IO b
f = do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
x))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
y))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
width))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
height))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minDepth))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
maxDepth))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr Viewport -> IO b -> IO b
pokeZeroCStruct Ptr Viewport
p IO b
f = do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct Viewport where
peekCStruct :: Ptr Viewport -> IO Viewport
peekCStruct Ptr Viewport
p = do
CFloat
x <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CFloat))
CFloat
y <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat))
CFloat
width <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat))
CFloat
height <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat))
CFloat
minDepth <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CFloat))
CFloat
maxDepth <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p Ptr Viewport -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr CFloat))
Viewport -> IO Viewport
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Viewport -> IO Viewport) -> Viewport -> IO Viewport
forall a b. (a -> b) -> a -> b
$ Float -> Float -> Float -> Float -> Float -> Float -> Viewport
Viewport
(CFloat -> Float
coerce @CFloat @Float CFloat
x) (CFloat -> Float
coerce @CFloat @Float CFloat
y) (CFloat -> Float
coerce @CFloat @Float CFloat
width) (CFloat -> Float
coerce @CFloat @Float CFloat
height) (CFloat -> Float
coerce @CFloat @Float CFloat
minDepth) (CFloat -> Float
coerce @CFloat @Float CFloat
maxDepth)
instance Storable Viewport where
sizeOf :: Viewport -> Int
sizeOf ~Viewport
_ = Int
24
alignment :: Viewport -> Int
alignment ~Viewport
_ = Int
4
peek :: Ptr Viewport -> IO Viewport
peek = Ptr Viewport -> IO Viewport
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr Viewport -> Viewport -> IO ()
poke Ptr Viewport
ptr Viewport
poked = Ptr Viewport -> Viewport -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr Viewport
ptr Viewport
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero Viewport where
zero :: Viewport
zero = Float -> Float -> Float -> Float -> Float -> Float -> Viewport
Viewport
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
data SpecializationMapEntry = SpecializationMapEntry
{
SpecializationMapEntry -> "createInfoCount" ::: Word32
constantID :: Word32
,
SpecializationMapEntry -> "createInfoCount" ::: Word32
offset :: Word32
,
SpecializationMapEntry -> Word64
size :: Word64
}
deriving (Typeable, SpecializationMapEntry -> SpecializationMapEntry -> Bool
(SpecializationMapEntry -> SpecializationMapEntry -> Bool)
-> (SpecializationMapEntry -> SpecializationMapEntry -> Bool)
-> Eq SpecializationMapEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SpecializationMapEntry -> SpecializationMapEntry -> Bool
$c/= :: SpecializationMapEntry -> SpecializationMapEntry -> Bool
== :: SpecializationMapEntry -> SpecializationMapEntry -> Bool
$c== :: SpecializationMapEntry -> SpecializationMapEntry -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SpecializationMapEntry)
#endif
deriving instance Show SpecializationMapEntry
instance ToCStruct SpecializationMapEntry where
withCStruct :: SpecializationMapEntry
-> (Ptr SpecializationMapEntry -> IO b) -> IO b
withCStruct SpecializationMapEntry
x Ptr SpecializationMapEntry -> IO b
f = Int -> (Ptr SpecializationMapEntry -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr SpecializationMapEntry -> IO b) -> IO b)
-> (Ptr SpecializationMapEntry -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SpecializationMapEntry
p -> Ptr SpecializationMapEntry
-> SpecializationMapEntry -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SpecializationMapEntry
p SpecializationMapEntry
x (Ptr SpecializationMapEntry -> IO b
f Ptr SpecializationMapEntry
p)
pokeCStruct :: Ptr SpecializationMapEntry
-> SpecializationMapEntry -> IO b -> IO b
pokeCStruct Ptr SpecializationMapEntry
p SpecializationMapEntry{"createInfoCount" ::: Word32
Word64
size :: Word64
offset :: "createInfoCount" ::: Word32
constantID :: "createInfoCount" ::: Word32
$sel:size:SpecializationMapEntry :: SpecializationMapEntry -> Word64
$sel:offset:SpecializationMapEntry :: SpecializationMapEntry -> "createInfoCount" ::: Word32
$sel:constantID:SpecializationMapEntry :: SpecializationMapEntry -> "createInfoCount" ::: Word32
..} IO b
f = do
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
constantID)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
offset)
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
size))
IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr SpecializationMapEntry -> IO b -> IO b
pokeZeroCStruct Ptr SpecializationMapEntry
p IO b
f = do
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct SpecializationMapEntry where
peekCStruct :: Ptr SpecializationMapEntry -> IO SpecializationMapEntry
peekCStruct Ptr SpecializationMapEntry
p = do
"createInfoCount" ::: Word32
constantID <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
"createInfoCount" ::: Word32
offset <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
CSize
size <- Ptr CSize -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr SpecializationMapEntry
p Ptr SpecializationMapEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CSize))
SpecializationMapEntry -> IO SpecializationMapEntry
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SpecializationMapEntry -> IO SpecializationMapEntry)
-> SpecializationMapEntry -> IO SpecializationMapEntry
forall a b. (a -> b) -> a -> b
$ ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> Word64
-> SpecializationMapEntry
SpecializationMapEntry
"createInfoCount" ::: Word32
constantID "createInfoCount" ::: Word32
offset (CSize -> Word64
coerce @CSize @Word64 CSize
size)
instance Storable SpecializationMapEntry where
sizeOf :: SpecializationMapEntry -> Int
sizeOf ~SpecializationMapEntry
_ = Int
16
alignment :: SpecializationMapEntry -> Int
alignment ~SpecializationMapEntry
_ = Int
8
peek :: Ptr SpecializationMapEntry -> IO SpecializationMapEntry
peek = Ptr SpecializationMapEntry -> IO SpecializationMapEntry
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SpecializationMapEntry -> SpecializationMapEntry -> IO ()
poke Ptr SpecializationMapEntry
ptr SpecializationMapEntry
poked = Ptr SpecializationMapEntry
-> SpecializationMapEntry -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SpecializationMapEntry
ptr SpecializationMapEntry
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SpecializationMapEntry where
zero :: SpecializationMapEntry
zero = ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> Word64
-> SpecializationMapEntry
SpecializationMapEntry
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
data SpecializationInfo = SpecializationInfo
{
SpecializationInfo -> Vector SpecializationMapEntry
mapEntries :: Vector SpecializationMapEntry
,
SpecializationInfo -> Word64
dataSize :: Word64
,
SpecializationInfo -> Ptr ()
data' :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SpecializationInfo)
#endif
deriving instance Show SpecializationInfo
instance ToCStruct SpecializationInfo where
withCStruct :: SpecializationInfo -> (Ptr SpecializationInfo -> IO b) -> IO b
withCStruct SpecializationInfo
x Ptr SpecializationInfo -> IO b
f = Int -> (Ptr SpecializationInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr SpecializationInfo -> IO b) -> IO b)
-> (Ptr SpecializationInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr SpecializationInfo
p -> Ptr SpecializationInfo -> SpecializationInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SpecializationInfo
p SpecializationInfo
x (Ptr SpecializationInfo -> IO b
f Ptr SpecializationInfo
p)
pokeCStruct :: Ptr SpecializationInfo -> SpecializationInfo -> IO b -> IO b
pokeCStruct Ptr SpecializationInfo
p SpecializationInfo{Word64
Ptr ()
Vector SpecializationMapEntry
data' :: Ptr ()
dataSize :: Word64
mapEntries :: Vector SpecializationMapEntry
$sel:data':SpecializationInfo :: SpecializationInfo -> Ptr ()
$sel:dataSize:SpecializationInfo :: SpecializationInfo -> Word64
$sel:mapEntries:SpecializationInfo :: SpecializationInfo -> Vector SpecializationMapEntry
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector SpecializationMapEntry -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector SpecializationMapEntry -> Int)
-> Vector SpecializationMapEntry -> Int
forall a b. (a -> b) -> a -> b
$ (Vector SpecializationMapEntry
mapEntries)) :: Word32))
Ptr SpecializationMapEntry
pPMapEntries' <- ((Ptr SpecializationMapEntry -> IO b) -> IO b)
-> ContT b IO (Ptr SpecializationMapEntry)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SpecializationMapEntry -> IO b) -> IO b)
-> ContT b IO (Ptr SpecializationMapEntry))
-> ((Ptr SpecializationMapEntry -> IO b) -> IO b)
-> ContT b IO (Ptr SpecializationMapEntry)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr SpecializationMapEntry -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @SpecializationMapEntry ((Vector SpecializationMapEntry -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector SpecializationMapEntry
mapEntries)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
16)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> SpecializationMapEntry -> IO ())
-> Vector SpecializationMapEntry -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SpecializationMapEntry
e -> Ptr SpecializationMapEntry -> SpecializationMapEntry -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SpecializationMapEntry
pPMapEntries' Ptr SpecializationMapEntry -> Int -> Ptr SpecializationMapEntry
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SpecializationMapEntry) (SpecializationMapEntry
e)) (Vector SpecializationMapEntry
mapEntries)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr SpecializationMapEntry)
-> Ptr SpecializationMapEntry -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr (Ptr SpecializationMapEntry)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr SpecializationMapEntry))) (Ptr SpecializationMapEntry
pPMapEntries')
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
dataSize))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) (Ptr ()
data')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr SpecializationInfo -> IO b -> IO b
pokeZeroCStruct Ptr SpecializationInfo
p IO b
f = do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) (Ptr ()
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SpecializationInfo where
peekCStruct :: Ptr SpecializationInfo -> IO SpecializationInfo
peekCStruct Ptr SpecializationInfo
p = do
"createInfoCount" ::: Word32
mapEntryCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
Ptr SpecializationMapEntry
pMapEntries <- Ptr (Ptr SpecializationMapEntry) -> IO (Ptr SpecializationMapEntry)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr SpecializationMapEntry) ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr (Ptr SpecializationMapEntry)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr SpecializationMapEntry)))
Vector SpecializationMapEntry
pMapEntries' <- Int
-> (Int -> IO SpecializationMapEntry)
-> IO (Vector SpecializationMapEntry)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
mapEntryCount) (\Int
i -> Ptr SpecializationMapEntry -> IO SpecializationMapEntry
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SpecializationMapEntry ((Ptr SpecializationMapEntry
pMapEntries Ptr SpecializationMapEntry -> Int -> Ptr SpecializationMapEntry
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SpecializationMapEntry)))
CSize
dataSize <- Ptr CSize -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize))
Ptr ()
pData <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr SpecializationInfo
p Ptr SpecializationInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ())))
SpecializationInfo -> IO SpecializationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SpecializationInfo -> IO SpecializationInfo)
-> SpecializationInfo -> IO SpecializationInfo
forall a b. (a -> b) -> a -> b
$ Vector SpecializationMapEntry
-> Word64 -> Ptr () -> SpecializationInfo
SpecializationInfo
Vector SpecializationMapEntry
pMapEntries' (CSize -> Word64
coerce @CSize @Word64 CSize
dataSize) Ptr ()
pData
instance Zero SpecializationInfo where
zero :: SpecializationInfo
zero = Vector SpecializationMapEntry
-> Word64 -> Ptr () -> SpecializationInfo
SpecializationInfo
Vector SpecializationMapEntry
forall a. Monoid a => a
mempty
Word64
forall a. Zero a => a
zero
Ptr ()
forall a. Zero a => a
zero
data PipelineShaderStageCreateInfo (es :: [Type]) = PipelineShaderStageCreateInfo
{
PipelineShaderStageCreateInfo es -> Chain es
next :: Chain es
,
PipelineShaderStageCreateInfo es -> PipelineShaderStageCreateFlags
flags :: PipelineShaderStageCreateFlags
,
PipelineShaderStageCreateInfo es -> ShaderStageFlagBits
stage :: ShaderStageFlagBits
,
PipelineShaderStageCreateInfo es -> ShaderModule
module' :: ShaderModule
,
PipelineShaderStageCreateInfo es -> ByteString
name :: ByteString
,
PipelineShaderStageCreateInfo es -> Maybe SpecializationInfo
specializationInfo :: Maybe SpecializationInfo
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineShaderStageCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineShaderStageCreateInfo es)
instance Extensible PipelineShaderStageCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineShaderStageCreateInfo"
setNext :: PipelineShaderStageCreateInfo ds
-> Chain es -> PipelineShaderStageCreateInfo es
setNext PipelineShaderStageCreateInfo{Maybe SpecializationInfo
ByteString
Chain ds
ShaderStageFlagBits
ShaderModule
PipelineShaderStageCreateFlags
specializationInfo :: Maybe SpecializationInfo
name :: ByteString
module' :: ShaderModule
stage :: ShaderStageFlagBits
flags :: PipelineShaderStageCreateFlags
next :: Chain ds
$sel:specializationInfo:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> Maybe SpecializationInfo
$sel:name:PipelineShaderStageCreateInfo :: forall (es :: [*]). PipelineShaderStageCreateInfo es -> ByteString
$sel:module':PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderModule
$sel:stage:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderStageFlagBits
$sel:flags:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> PipelineShaderStageCreateFlags
$sel:next:PipelineShaderStageCreateInfo :: forall (es :: [*]). PipelineShaderStageCreateInfo es -> Chain es
..} Chain es
next' = PipelineShaderStageCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineShaderStageCreateFlags
-> ShaderStageFlagBits
-> ShaderModule
-> ByteString
-> Maybe SpecializationInfo
-> PipelineShaderStageCreateInfo es
PipelineShaderStageCreateInfo{$sel:next:PipelineShaderStageCreateInfo :: Chain es
next = Chain es
next', Maybe SpecializationInfo
ByteString
ShaderStageFlagBits
ShaderModule
PipelineShaderStageCreateFlags
specializationInfo :: Maybe SpecializationInfo
name :: ByteString
module' :: ShaderModule
stage :: ShaderStageFlagBits
flags :: PipelineShaderStageCreateFlags
$sel:specializationInfo:PipelineShaderStageCreateInfo :: Maybe SpecializationInfo
$sel:name:PipelineShaderStageCreateInfo :: ByteString
$sel:module':PipelineShaderStageCreateInfo :: ShaderModule
$sel:stage:PipelineShaderStageCreateInfo :: ShaderStageFlagBits
$sel:flags:PipelineShaderStageCreateInfo :: PipelineShaderStageCreateFlags
..}
getNext :: PipelineShaderStageCreateInfo es -> Chain es
getNext PipelineShaderStageCreateInfo{Maybe SpecializationInfo
ByteString
Chain es
ShaderStageFlagBits
ShaderModule
PipelineShaderStageCreateFlags
specializationInfo :: Maybe SpecializationInfo
name :: ByteString
module' :: ShaderModule
stage :: ShaderStageFlagBits
flags :: PipelineShaderStageCreateFlags
next :: Chain es
$sel:specializationInfo:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> Maybe SpecializationInfo
$sel:name:PipelineShaderStageCreateInfo :: forall (es :: [*]). PipelineShaderStageCreateInfo es -> ByteString
$sel:module':PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderModule
$sel:stage:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderStageFlagBits
$sel:flags:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> PipelineShaderStageCreateFlags
$sel:next:PipelineShaderStageCreateInfo :: forall (es :: [*]). PipelineShaderStageCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineShaderStageCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineShaderStageCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT) =>
Maybe (e :~: PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineShaderStageCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineShaderStageCreateInfo es, PokeChain es) => ToCStruct (PipelineShaderStageCreateInfo es) where
withCStruct :: PipelineShaderStageCreateInfo es
-> (Ptr (PipelineShaderStageCreateInfo es) -> IO b) -> IO b
withCStruct PipelineShaderStageCreateInfo es
x Ptr (PipelineShaderStageCreateInfo es) -> IO b
f = Int -> (Ptr (PipelineShaderStageCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PipelineShaderStageCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineShaderStageCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineShaderStageCreateInfo es)
p -> Ptr (PipelineShaderStageCreateInfo es)
-> PipelineShaderStageCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineShaderStageCreateInfo es)
p PipelineShaderStageCreateInfo es
x (Ptr (PipelineShaderStageCreateInfo es) -> IO b
f Ptr (PipelineShaderStageCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineShaderStageCreateInfo es)
-> PipelineShaderStageCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineShaderStageCreateInfo es)
p PipelineShaderStageCreateInfo{Maybe SpecializationInfo
ByteString
Chain es
ShaderStageFlagBits
ShaderModule
PipelineShaderStageCreateFlags
specializationInfo :: Maybe SpecializationInfo
name :: ByteString
module' :: ShaderModule
stage :: ShaderStageFlagBits
flags :: PipelineShaderStageCreateFlags
next :: Chain es
$sel:specializationInfo:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> Maybe SpecializationInfo
$sel:name:PipelineShaderStageCreateInfo :: forall (es :: [*]). PipelineShaderStageCreateInfo es -> ByteString
$sel:module':PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderModule
$sel:stage:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderStageFlagBits
$sel:flags:PipelineShaderStageCreateInfo :: forall (es :: [*]).
PipelineShaderStageCreateInfo es -> PipelineShaderStageCreateFlags
$sel:next:PipelineShaderStageCreateInfo :: forall (es :: [*]). PipelineShaderStageCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineShaderStageCreateFlags
-> PipelineShaderStageCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr PipelineShaderStageCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineShaderStageCreateFlags)) (PipelineShaderStageCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderStageFlagBits -> ShaderStageFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr ShaderStageFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ShaderStageFlagBits)) (ShaderStageFlagBits
stage)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderModule -> ShaderModule -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr ShaderModule
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderModule)) (ShaderModule
module')
CString
pName'' <- ((CString -> IO b) -> IO b) -> ContT b IO CString
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((CString -> IO b) -> IO b) -> ContT b IO CString)
-> ((CString -> IO b) -> IO b) -> ContT b IO CString
forall a b. (a -> b) -> a -> b
$ ByteString -> (CString -> IO b) -> IO b
forall a. ByteString -> (CString -> IO a) -> IO a
useAsCString (ByteString
name)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr CChar))) CString
pName''
Ptr SpecializationInfo
pSpecializationInfo'' <- case (Maybe SpecializationInfo
specializationInfo) of
Maybe SpecializationInfo
Nothing -> Ptr SpecializationInfo -> ContT b IO (Ptr SpecializationInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr SpecializationInfo
forall a. Ptr a
nullPtr
Just SpecializationInfo
j -> ((Ptr SpecializationInfo -> IO b) -> IO b)
-> ContT b IO (Ptr SpecializationInfo)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SpecializationInfo -> IO b) -> IO b)
-> ContT b IO (Ptr SpecializationInfo))
-> ((Ptr SpecializationInfo -> IO b) -> IO b)
-> ContT b IO (Ptr SpecializationInfo)
forall a b. (a -> b) -> a -> b
$ SpecializationInfo -> (Ptr SpecializationInfo -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SpecializationInfo
j)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr SpecializationInfo) -> Ptr SpecializationInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr (Ptr SpecializationInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr SpecializationInfo))) Ptr SpecializationInfo
pSpecializationInfo''
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineShaderStageCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineShaderStageCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderStageFlagBits -> ShaderStageFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr ShaderStageFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ShaderStageFlagBits)) (ShaderStageFlagBits
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderModule -> ShaderModule -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr ShaderModule
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderModule)) (ShaderModule
forall a. Zero a => a
zero)
CString
pName'' <- ((CString -> IO b) -> IO b) -> ContT b IO CString
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((CString -> IO b) -> IO b) -> ContT b IO CString)
-> ((CString -> IO b) -> IO b) -> ContT b IO CString
forall a b. (a -> b) -> a -> b
$ ByteString -> (CString -> IO b) -> IO b
forall a. ByteString -> (CString -> IO a) -> IO a
useAsCString (ByteString
forall a. Monoid a => a
mempty)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr CChar))) CString
pName''
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineShaderStageCreateInfo es, PeekChain es) => FromCStruct (PipelineShaderStageCreateInfo es) where
peekCStruct :: Ptr (PipelineShaderStageCreateInfo es)
-> IO (PipelineShaderStageCreateInfo es)
peekCStruct Ptr (PipelineShaderStageCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineShaderStageCreateFlags
flags <- Ptr PipelineShaderStageCreateFlags
-> IO PipelineShaderStageCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineShaderStageCreateFlags ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr PipelineShaderStageCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineShaderStageCreateFlags))
ShaderStageFlagBits
stage <- Ptr ShaderStageFlagBits -> IO ShaderStageFlagBits
forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlagBits ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr ShaderStageFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ShaderStageFlagBits))
ShaderModule
module' <- Ptr ShaderModule -> IO ShaderModule
forall a. Storable a => Ptr a -> IO a
peek @ShaderModule ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr ShaderModule
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderModule))
ByteString
pName <- CString -> IO ByteString
packCString (CString -> IO ByteString) -> IO CString -> IO ByteString
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es) -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr CChar)))
Ptr SpecializationInfo
pSpecializationInfo <- Ptr (Ptr SpecializationInfo) -> IO (Ptr SpecializationInfo)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr SpecializationInfo) ((Ptr (PipelineShaderStageCreateInfo es)
p Ptr (PipelineShaderStageCreateInfo es)
-> Int -> Ptr (Ptr SpecializationInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr SpecializationInfo)))
Maybe SpecializationInfo
pSpecializationInfo' <- (Ptr SpecializationInfo -> IO SpecializationInfo)
-> Ptr SpecializationInfo -> IO (Maybe SpecializationInfo)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr SpecializationInfo
j -> Ptr SpecializationInfo -> IO SpecializationInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SpecializationInfo (Ptr SpecializationInfo
j)) Ptr SpecializationInfo
pSpecializationInfo
PipelineShaderStageCreateInfo es
-> IO (PipelineShaderStageCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineShaderStageCreateInfo es
-> IO (PipelineShaderStageCreateInfo es))
-> PipelineShaderStageCreateInfo es
-> IO (PipelineShaderStageCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineShaderStageCreateFlags
-> ShaderStageFlagBits
-> ShaderModule
-> ByteString
-> Maybe SpecializationInfo
-> PipelineShaderStageCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineShaderStageCreateFlags
-> ShaderStageFlagBits
-> ShaderModule
-> ByteString
-> Maybe SpecializationInfo
-> PipelineShaderStageCreateInfo es
PipelineShaderStageCreateInfo
Chain es
next PipelineShaderStageCreateFlags
flags ShaderStageFlagBits
stage ShaderModule
module' ByteString
pName Maybe SpecializationInfo
pSpecializationInfo'
instance es ~ '[] => Zero (PipelineShaderStageCreateInfo es) where
zero :: PipelineShaderStageCreateInfo es
zero = Chain es
-> PipelineShaderStageCreateFlags
-> ShaderStageFlagBits
-> ShaderModule
-> ByteString
-> Maybe SpecializationInfo
-> PipelineShaderStageCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineShaderStageCreateFlags
-> ShaderStageFlagBits
-> ShaderModule
-> ByteString
-> Maybe SpecializationInfo
-> PipelineShaderStageCreateInfo es
PipelineShaderStageCreateInfo
()
PipelineShaderStageCreateFlags
forall a. Zero a => a
zero
ShaderStageFlagBits
forall a. Zero a => a
zero
ShaderModule
forall a. Zero a => a
zero
ByteString
forall a. Monoid a => a
mempty
Maybe SpecializationInfo
forall a. Maybe a
Nothing
data ComputePipelineCreateInfo (es :: [Type]) = ComputePipelineCreateInfo
{
ComputePipelineCreateInfo es -> Chain es
next :: Chain es
,
ComputePipelineCreateInfo es -> PipelineCreateFlags
flags :: PipelineCreateFlags
,
ComputePipelineCreateInfo es
-> SomeStruct PipelineShaderStageCreateInfo
stage :: SomeStruct PipelineShaderStageCreateInfo
,
ComputePipelineCreateInfo es -> PipelineLayout
layout :: PipelineLayout
,
ComputePipelineCreateInfo es -> Pipeline
basePipelineHandle :: Pipeline
,
ComputePipelineCreateInfo es -> Int32
basePipelineIndex :: Int32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ComputePipelineCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ComputePipelineCreateInfo es)
instance Extensible ComputePipelineCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"ComputePipelineCreateInfo"
setNext :: ComputePipelineCreateInfo ds
-> Chain es -> ComputePipelineCreateInfo es
setNext ComputePipelineCreateInfo{Int32
Chain ds
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineShaderStageCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
stage :: SomeStruct PipelineShaderStageCreateInfo
flags :: PipelineCreateFlags
next :: Chain ds
$sel:basePipelineIndex:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Int32
$sel:basePipelineHandle:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Pipeline
$sel:layout:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> PipelineLayout
$sel:stage:ComputePipelineCreateInfo :: forall (es :: [*]).
ComputePipelineCreateInfo es
-> SomeStruct PipelineShaderStageCreateInfo
$sel:flags:ComputePipelineCreateInfo :: forall (es :: [*]).
ComputePipelineCreateInfo es -> PipelineCreateFlags
$sel:next:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Chain es
..} Chain es
next' = ComputePipelineCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> SomeStruct PipelineShaderStageCreateInfo
-> PipelineLayout
-> Pipeline
-> Int32
-> ComputePipelineCreateInfo es
ComputePipelineCreateInfo{$sel:next:ComputePipelineCreateInfo :: Chain es
next = Chain es
next', Int32
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineShaderStageCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
stage :: SomeStruct PipelineShaderStageCreateInfo
flags :: PipelineCreateFlags
$sel:basePipelineIndex:ComputePipelineCreateInfo :: Int32
$sel:basePipelineHandle:ComputePipelineCreateInfo :: Pipeline
$sel:layout:ComputePipelineCreateInfo :: PipelineLayout
$sel:stage:ComputePipelineCreateInfo :: SomeStruct PipelineShaderStageCreateInfo
$sel:flags:ComputePipelineCreateInfo :: PipelineCreateFlags
..}
getNext :: ComputePipelineCreateInfo es -> Chain es
getNext ComputePipelineCreateInfo{Int32
Chain es
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineShaderStageCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
stage :: SomeStruct PipelineShaderStageCreateInfo
flags :: PipelineCreateFlags
next :: Chain es
$sel:basePipelineIndex:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Int32
$sel:basePipelineHandle:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Pipeline
$sel:layout:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> PipelineLayout
$sel:stage:ComputePipelineCreateInfo :: forall (es :: [*]).
ComputePipelineCreateInfo es
-> SomeStruct PipelineShaderStageCreateInfo
$sel:flags:ComputePipelineCreateInfo :: forall (es :: [*]).
ComputePipelineCreateInfo es -> PipelineCreateFlags
$sel:next:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends ComputePipelineCreateInfo e => b) -> Maybe b
extends :: proxy e -> (Extends ComputePipelineCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends ComputePipelineCreateInfo e => b
f
| Just e :~: PipelineCompilerControlCreateInfoAMD
Refl <- (Typeable e, Typeable PipelineCompilerControlCreateInfoAMD) =>
Maybe (e :~: PipelineCompilerControlCreateInfoAMD)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCompilerControlCreateInfoAMD = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ComputePipelineCreateInfo e => b
f
| Just e :~: SubpassShadingPipelineCreateInfoHUAWEI
Refl <- (Typeable e, Typeable SubpassShadingPipelineCreateInfoHUAWEI) =>
Maybe (e :~: SubpassShadingPipelineCreateInfoHUAWEI)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SubpassShadingPipelineCreateInfoHUAWEI = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ComputePipelineCreateInfo e => b
f
| Just e :~: PipelineCreationFeedbackCreateInfoEXT
Refl <- (Typeable e, Typeable PipelineCreationFeedbackCreateInfoEXT) =>
Maybe (e :~: PipelineCreationFeedbackCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreationFeedbackCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ComputePipelineCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss ComputePipelineCreateInfo es, PokeChain es) => ToCStruct (ComputePipelineCreateInfo es) where
withCStruct :: ComputePipelineCreateInfo es
-> (Ptr (ComputePipelineCreateInfo es) -> IO b) -> IO b
withCStruct ComputePipelineCreateInfo es
x Ptr (ComputePipelineCreateInfo es) -> IO b
f = Int -> (Ptr (ComputePipelineCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
96 ((Ptr (ComputePipelineCreateInfo es) -> IO b) -> IO b)
-> (Ptr (ComputePipelineCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (ComputePipelineCreateInfo es)
p -> Ptr (ComputePipelineCreateInfo es)
-> ComputePipelineCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ComputePipelineCreateInfo es)
p ComputePipelineCreateInfo es
x (Ptr (ComputePipelineCreateInfo es) -> IO b
f Ptr (ComputePipelineCreateInfo es)
p)
pokeCStruct :: Ptr (ComputePipelineCreateInfo es)
-> ComputePipelineCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (ComputePipelineCreateInfo es)
p ComputePipelineCreateInfo{Int32
Chain es
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineShaderStageCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
layout :: PipelineLayout
stage :: SomeStruct PipelineShaderStageCreateInfo
flags :: PipelineCreateFlags
next :: Chain es
$sel:basePipelineIndex:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Int32
$sel:basePipelineHandle:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Pipeline
$sel:layout:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> PipelineLayout
$sel:stage:ComputePipelineCreateInfo :: forall (es :: [*]).
ComputePipelineCreateInfo es
-> SomeStruct PipelineShaderStageCreateInfo
$sel:flags:ComputePipelineCreateInfo :: forall (es :: [*]).
ComputePipelineCreateInfo es -> PipelineCreateFlags
$sel:next:ComputePipelineCreateInfo :: forall (es :: [*]). ComputePipelineCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineCreateFlags -> PipelineCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> Ptr PipelineCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags)) (PipelineCreateFlags
flags)
((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> SomeStruct PipelineShaderStageCreateInfo -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> Ptr (PipelineShaderStageCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (PipelineShaderStageCreateInfo _)))) (SomeStruct PipelineShaderStageCreateInfo
stage) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PipelineLayout)) (PipelineLayout
layout)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pPipelines" ::: Ptr Pipeline) -> Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Pipeline)) (Pipeline
basePipelineHandle)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr Int32)) (Int32
basePipelineIndex)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
96
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (ComputePipelineCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (ComputePipelineCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> SomeStruct PipelineShaderStageCreateInfo -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> Ptr (PipelineShaderStageCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (PipelineShaderStageCreateInfo _)))) ((PipelineShaderStageCreateInfo '[]
-> SomeStruct PipelineShaderStageCreateInfo
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct PipelineShaderStageCreateInfo '[]
forall a. Zero a => a
zero)) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PipelineLayout)) (PipelineLayout
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr Int32)) (Int32
forall a. Zero a => a
zero)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss ComputePipelineCreateInfo es, PeekChain es) => FromCStruct (ComputePipelineCreateInfo es) where
peekCStruct :: Ptr (ComputePipelineCreateInfo es)
-> IO (ComputePipelineCreateInfo es)
peekCStruct Ptr (ComputePipelineCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineCreateFlags
flags <- Ptr PipelineCreateFlags -> IO PipelineCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineCreateFlags ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> Ptr PipelineCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags))
SomeStruct PipelineShaderStageCreateInfo
stage <- Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> IO (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> Ptr (PipelineShaderStageCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (PipelineShaderStageCreateInfo _))))
PipelineLayout
layout <- Ptr PipelineLayout -> IO PipelineLayout
forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PipelineLayout))
Pipeline
basePipelineHandle <- ("pPipelines" ::: Ptr Pipeline) -> IO Pipeline
forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Pipeline))
Int32
basePipelineIndex <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek @Int32 ((Ptr (ComputePipelineCreateInfo es)
p Ptr (ComputePipelineCreateInfo es) -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr Int32))
ComputePipelineCreateInfo es -> IO (ComputePipelineCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ComputePipelineCreateInfo es -> IO (ComputePipelineCreateInfo es))
-> ComputePipelineCreateInfo es
-> IO (ComputePipelineCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineCreateFlags
-> SomeStruct PipelineShaderStageCreateInfo
-> PipelineLayout
-> Pipeline
-> Int32
-> ComputePipelineCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> SomeStruct PipelineShaderStageCreateInfo
-> PipelineLayout
-> Pipeline
-> Int32
-> ComputePipelineCreateInfo es
ComputePipelineCreateInfo
Chain es
next PipelineCreateFlags
flags SomeStruct PipelineShaderStageCreateInfo
stage PipelineLayout
layout Pipeline
basePipelineHandle Int32
basePipelineIndex
instance es ~ '[] => Zero (ComputePipelineCreateInfo es) where
zero :: ComputePipelineCreateInfo es
zero = Chain es
-> PipelineCreateFlags
-> SomeStruct PipelineShaderStageCreateInfo
-> PipelineLayout
-> Pipeline
-> Int32
-> ComputePipelineCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> SomeStruct PipelineShaderStageCreateInfo
-> PipelineLayout
-> Pipeline
-> Int32
-> ComputePipelineCreateInfo es
ComputePipelineCreateInfo
()
PipelineCreateFlags
forall a. Zero a => a
zero
(PipelineShaderStageCreateInfo '[]
-> SomeStruct PipelineShaderStageCreateInfo
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct PipelineShaderStageCreateInfo '[]
forall a. Zero a => a
zero)
PipelineLayout
forall a. Zero a => a
zero
Pipeline
forall a. Zero a => a
zero
Int32
forall a. Zero a => a
zero
data VertexInputBindingDescription = VertexInputBindingDescription
{
VertexInputBindingDescription -> "createInfoCount" ::: Word32
binding :: Word32
,
VertexInputBindingDescription -> "createInfoCount" ::: Word32
stride :: Word32
,
VertexInputBindingDescription -> VertexInputRate
inputRate :: VertexInputRate
}
deriving (Typeable, VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool
(VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool)
-> (VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool)
-> Eq VertexInputBindingDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool
$c/= :: VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool
== :: VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool
$c== :: VertexInputBindingDescription
-> VertexInputBindingDescription -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VertexInputBindingDescription)
#endif
deriving instance Show VertexInputBindingDescription
instance ToCStruct VertexInputBindingDescription where
withCStruct :: VertexInputBindingDescription
-> (Ptr VertexInputBindingDescription -> IO b) -> IO b
withCStruct VertexInputBindingDescription
x Ptr VertexInputBindingDescription -> IO b
f = Int -> (Ptr VertexInputBindingDescription -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
12 ((Ptr VertexInputBindingDescription -> IO b) -> IO b)
-> (Ptr VertexInputBindingDescription -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr VertexInputBindingDescription
p -> Ptr VertexInputBindingDescription
-> VertexInputBindingDescription -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDescription
p VertexInputBindingDescription
x (Ptr VertexInputBindingDescription -> IO b
f Ptr VertexInputBindingDescription
p)
pokeCStruct :: Ptr VertexInputBindingDescription
-> VertexInputBindingDescription -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDescription
p VertexInputBindingDescription{"createInfoCount" ::: Word32
VertexInputRate
inputRate :: VertexInputRate
stride :: "createInfoCount" ::: Word32
binding :: "createInfoCount" ::: Word32
$sel:inputRate:VertexInputBindingDescription :: VertexInputBindingDescription -> VertexInputRate
$sel:stride:VertexInputBindingDescription :: VertexInputBindingDescription -> "createInfoCount" ::: Word32
$sel:binding:VertexInputBindingDescription :: VertexInputBindingDescription -> "createInfoCount" ::: Word32
..} IO b
f = do
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
binding)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
stride)
Ptr VertexInputRate -> VertexInputRate -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription -> Int -> Ptr VertexInputRate
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VertexInputRate)) (VertexInputRate
inputRate)
IO b
f
cStructSize :: Int
cStructSize = Int
12
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr VertexInputBindingDescription -> IO b -> IO b
pokeZeroCStruct Ptr VertexInputBindingDescription
p IO b
f = do
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr VertexInputRate -> VertexInputRate -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription -> Int -> Ptr VertexInputRate
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VertexInputRate)) (VertexInputRate
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VertexInputBindingDescription where
peekCStruct :: Ptr VertexInputBindingDescription
-> IO VertexInputBindingDescription
peekCStruct Ptr VertexInputBindingDescription
p = do
"createInfoCount" ::: Word32
binding <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
"createInfoCount" ::: Word32
stride <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
VertexInputRate
inputRate <- Ptr VertexInputRate -> IO VertexInputRate
forall a. Storable a => Ptr a -> IO a
peek @VertexInputRate ((Ptr VertexInputBindingDescription
p Ptr VertexInputBindingDescription -> Int -> Ptr VertexInputRate
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VertexInputRate))
VertexInputBindingDescription -> IO VertexInputBindingDescription
forall (f :: * -> *) a. Applicative f => a -> f a
pure (VertexInputBindingDescription -> IO VertexInputBindingDescription)
-> VertexInputBindingDescription
-> IO VertexInputBindingDescription
forall a b. (a -> b) -> a -> b
$ ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> VertexInputRate
-> VertexInputBindingDescription
VertexInputBindingDescription
"createInfoCount" ::: Word32
binding "createInfoCount" ::: Word32
stride VertexInputRate
inputRate
instance Storable VertexInputBindingDescription where
sizeOf :: VertexInputBindingDescription -> Int
sizeOf ~VertexInputBindingDescription
_ = Int
12
alignment :: VertexInputBindingDescription -> Int
alignment ~VertexInputBindingDescription
_ = Int
4
peek :: Ptr VertexInputBindingDescription
-> IO VertexInputBindingDescription
peek = Ptr VertexInputBindingDescription
-> IO VertexInputBindingDescription
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VertexInputBindingDescription
-> VertexInputBindingDescription -> IO ()
poke Ptr VertexInputBindingDescription
ptr VertexInputBindingDescription
poked = Ptr VertexInputBindingDescription
-> VertexInputBindingDescription -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDescription
ptr VertexInputBindingDescription
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputBindingDescription where
zero :: VertexInputBindingDescription
zero = ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> VertexInputRate
-> VertexInputBindingDescription
VertexInputBindingDescription
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
VertexInputRate
forall a. Zero a => a
zero
data VertexInputAttributeDescription = VertexInputAttributeDescription
{
VertexInputAttributeDescription -> "createInfoCount" ::: Word32
location :: Word32
,
VertexInputAttributeDescription -> "createInfoCount" ::: Word32
binding :: Word32
,
VertexInputAttributeDescription -> Format
format :: Format
,
VertexInputAttributeDescription -> "createInfoCount" ::: Word32
offset :: Word32
}
deriving (Typeable, VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool
(VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool)
-> (VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool)
-> Eq VertexInputAttributeDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool
$c/= :: VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool
== :: VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool
$c== :: VertexInputAttributeDescription
-> VertexInputAttributeDescription -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VertexInputAttributeDescription)
#endif
deriving instance Show VertexInputAttributeDescription
instance ToCStruct VertexInputAttributeDescription where
withCStruct :: VertexInputAttributeDescription
-> (Ptr VertexInputAttributeDescription -> IO b) -> IO b
withCStruct VertexInputAttributeDescription
x Ptr VertexInputAttributeDescription -> IO b
f = Int -> (Ptr VertexInputAttributeDescription -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr VertexInputAttributeDescription -> IO b) -> IO b)
-> (Ptr VertexInputAttributeDescription -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr VertexInputAttributeDescription
p -> Ptr VertexInputAttributeDescription
-> VertexInputAttributeDescription -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputAttributeDescription
p VertexInputAttributeDescription
x (Ptr VertexInputAttributeDescription -> IO b
f Ptr VertexInputAttributeDescription
p)
pokeCStruct :: Ptr VertexInputAttributeDescription
-> VertexInputAttributeDescription -> IO b -> IO b
pokeCStruct Ptr VertexInputAttributeDescription
p VertexInputAttributeDescription{"createInfoCount" ::: Word32
Format
offset :: "createInfoCount" ::: Word32
format :: Format
binding :: "createInfoCount" ::: Word32
location :: "createInfoCount" ::: Word32
$sel:offset:VertexInputAttributeDescription :: VertexInputAttributeDescription -> "createInfoCount" ::: Word32
$sel:format:VertexInputAttributeDescription :: VertexInputAttributeDescription -> Format
$sel:binding:VertexInputAttributeDescription :: VertexInputAttributeDescription -> "createInfoCount" ::: Word32
$sel:location:VertexInputAttributeDescription :: VertexInputAttributeDescription -> "createInfoCount" ::: Word32
..} IO b
f = do
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
location)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
binding)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Format)) (Format
format)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) ("createInfoCount" ::: Word32
offset)
IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr VertexInputAttributeDescription -> IO b -> IO b
pokeZeroCStruct Ptr VertexInputAttributeDescription
p IO b
f = do
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VertexInputAttributeDescription where
peekCStruct :: Ptr VertexInputAttributeDescription
-> IO VertexInputAttributeDescription
peekCStruct Ptr VertexInputAttributeDescription
p = do
"createInfoCount" ::: Word32
location <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
"createInfoCount" ::: Word32
binding <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
Format
format <- Ptr Format -> IO Format
forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Format))
"createInfoCount" ::: Word32
offset <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputAttributeDescription
p Ptr VertexInputAttributeDescription
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32))
VertexInputAttributeDescription
-> IO VertexInputAttributeDescription
forall (f :: * -> *) a. Applicative f => a -> f a
pure (VertexInputAttributeDescription
-> IO VertexInputAttributeDescription)
-> VertexInputAttributeDescription
-> IO VertexInputAttributeDescription
forall a b. (a -> b) -> a -> b
$ ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> Format
-> ("createInfoCount" ::: Word32)
-> VertexInputAttributeDescription
VertexInputAttributeDescription
"createInfoCount" ::: Word32
location "createInfoCount" ::: Word32
binding Format
format "createInfoCount" ::: Word32
offset
instance Storable VertexInputAttributeDescription where
sizeOf :: VertexInputAttributeDescription -> Int
sizeOf ~VertexInputAttributeDescription
_ = Int
16
alignment :: VertexInputAttributeDescription -> Int
alignment ~VertexInputAttributeDescription
_ = Int
4
peek :: Ptr VertexInputAttributeDescription
-> IO VertexInputAttributeDescription
peek = Ptr VertexInputAttributeDescription
-> IO VertexInputAttributeDescription
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VertexInputAttributeDescription
-> VertexInputAttributeDescription -> IO ()
poke Ptr VertexInputAttributeDescription
ptr VertexInputAttributeDescription
poked = Ptr VertexInputAttributeDescription
-> VertexInputAttributeDescription -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputAttributeDescription
ptr VertexInputAttributeDescription
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputAttributeDescription where
zero :: VertexInputAttributeDescription
zero = ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> Format
-> ("createInfoCount" ::: Word32)
-> VertexInputAttributeDescription
VertexInputAttributeDescription
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
data PipelineVertexInputStateCreateInfo (es :: [Type]) = PipelineVertexInputStateCreateInfo
{
PipelineVertexInputStateCreateInfo es -> Chain es
next :: Chain es
,
PipelineVertexInputStateCreateInfo es
-> PipelineVertexInputStateCreateFlags
flags :: PipelineVertexInputStateCreateFlags
,
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputBindingDescription
vertexBindingDescriptions :: Vector VertexInputBindingDescription
,
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputAttributeDescription
vertexAttributeDescriptions :: Vector VertexInputAttributeDescription
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineVertexInputStateCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineVertexInputStateCreateInfo es)
instance Extensible PipelineVertexInputStateCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineVertexInputStateCreateInfo"
setNext :: PipelineVertexInputStateCreateInfo ds
-> Chain es -> PipelineVertexInputStateCreateInfo es
setNext PipelineVertexInputStateCreateInfo{Vector VertexInputBindingDescription
Vector VertexInputAttributeDescription
Chain ds
PipelineVertexInputStateCreateFlags
vertexAttributeDescriptions :: Vector VertexInputAttributeDescription
vertexBindingDescriptions :: Vector VertexInputBindingDescription
flags :: PipelineVertexInputStateCreateFlags
next :: Chain ds
$sel:vertexAttributeDescriptions:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputAttributeDescription
$sel:vertexBindingDescriptions:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputBindingDescription
$sel:flags:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> PipelineVertexInputStateCreateFlags
$sel:next:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es -> Chain es
..} Chain es
next' = PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineVertexInputStateCreateFlags
-> Vector VertexInputBindingDescription
-> Vector VertexInputAttributeDescription
-> PipelineVertexInputStateCreateInfo es
PipelineVertexInputStateCreateInfo{$sel:next:PipelineVertexInputStateCreateInfo :: Chain es
next = Chain es
next', Vector VertexInputBindingDescription
Vector VertexInputAttributeDescription
PipelineVertexInputStateCreateFlags
vertexAttributeDescriptions :: Vector VertexInputAttributeDescription
vertexBindingDescriptions :: Vector VertexInputBindingDescription
flags :: PipelineVertexInputStateCreateFlags
$sel:vertexAttributeDescriptions:PipelineVertexInputStateCreateInfo :: Vector VertexInputAttributeDescription
$sel:vertexBindingDescriptions:PipelineVertexInputStateCreateInfo :: Vector VertexInputBindingDescription
$sel:flags:PipelineVertexInputStateCreateInfo :: PipelineVertexInputStateCreateFlags
..}
getNext :: PipelineVertexInputStateCreateInfo es -> Chain es
getNext PipelineVertexInputStateCreateInfo{Vector VertexInputBindingDescription
Vector VertexInputAttributeDescription
Chain es
PipelineVertexInputStateCreateFlags
vertexAttributeDescriptions :: Vector VertexInputAttributeDescription
vertexBindingDescriptions :: Vector VertexInputBindingDescription
flags :: PipelineVertexInputStateCreateFlags
next :: Chain es
$sel:vertexAttributeDescriptions:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputAttributeDescription
$sel:vertexBindingDescriptions:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputBindingDescription
$sel:flags:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> PipelineVertexInputStateCreateFlags
$sel:next:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineVertexInputStateCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineVertexInputStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineVertexInputStateCreateInfo e => b
f
| Just e :~: PipelineVertexInputDivisorStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineVertexInputDivisorStateCreateInfoEXT) =>
Maybe (e :~: PipelineVertexInputDivisorStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineVertexInputDivisorStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineVertexInputStateCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineVertexInputStateCreateInfo es, PokeChain es) => ToCStruct (PipelineVertexInputStateCreateInfo es) where
withCStruct :: PipelineVertexInputStateCreateInfo es
-> (Ptr (PipelineVertexInputStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineVertexInputStateCreateInfo es
x Ptr (PipelineVertexInputStateCreateInfo es) -> IO b
f = Int
-> (Ptr (PipelineVertexInputStateCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PipelineVertexInputStateCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineVertexInputStateCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineVertexInputStateCreateInfo es)
p -> Ptr (PipelineVertexInputStateCreateInfo es)
-> PipelineVertexInputStateCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineVertexInputStateCreateInfo es)
p PipelineVertexInputStateCreateInfo es
x (Ptr (PipelineVertexInputStateCreateInfo es) -> IO b
f Ptr (PipelineVertexInputStateCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineVertexInputStateCreateInfo es)
-> PipelineVertexInputStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineVertexInputStateCreateInfo es)
p PipelineVertexInputStateCreateInfo{Vector VertexInputBindingDescription
Vector VertexInputAttributeDescription
Chain es
PipelineVertexInputStateCreateFlags
vertexAttributeDescriptions :: Vector VertexInputAttributeDescription
vertexBindingDescriptions :: Vector VertexInputBindingDescription
flags :: PipelineVertexInputStateCreateFlags
next :: Chain es
$sel:vertexAttributeDescriptions:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputAttributeDescription
$sel:vertexBindingDescriptions:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputBindingDescription
$sel:flags:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> PipelineVertexInputStateCreateFlags
$sel:next:PipelineVertexInputStateCreateInfo :: forall (es :: [*]).
PipelineVertexInputStateCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineVertexInputStateCreateFlags
-> PipelineVertexInputStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr PipelineVertexInputStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineVertexInputStateCreateFlags)) (PipelineVertexInputStateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector VertexInputBindingDescription -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputBindingDescription -> Int)
-> Vector VertexInputBindingDescription -> Int
forall a b. (a -> b) -> a -> b
$ (Vector VertexInputBindingDescription
vertexBindingDescriptions)) :: Word32))
Ptr VertexInputBindingDescription
pPVertexBindingDescriptions' <- ((Ptr VertexInputBindingDescription -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDescription)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr VertexInputBindingDescription -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDescription))
-> ((Ptr VertexInputBindingDescription -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputBindingDescription)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr VertexInputBindingDescription -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @VertexInputBindingDescription ((Vector VertexInputBindingDescription -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputBindingDescription
vertexBindingDescriptions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
12)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> VertexInputBindingDescription -> IO ())
-> Vector VertexInputBindingDescription -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i VertexInputBindingDescription
e -> Ptr VertexInputBindingDescription
-> VertexInputBindingDescription -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr VertexInputBindingDescription
pPVertexBindingDescriptions' Ptr VertexInputBindingDescription
-> Int -> Ptr VertexInputBindingDescription
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
12 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDescription) (VertexInputBindingDescription
e)) (Vector VertexInputBindingDescription
vertexBindingDescriptions)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr VertexInputBindingDescription)
-> Ptr VertexInputBindingDescription -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr (Ptr VertexInputBindingDescription)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr VertexInputBindingDescription))) (Ptr VertexInputBindingDescription
pPVertexBindingDescriptions')
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector VertexInputAttributeDescription -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputAttributeDescription -> Int)
-> Vector VertexInputAttributeDescription -> Int
forall a b. (a -> b) -> a -> b
$ (Vector VertexInputAttributeDescription
vertexAttributeDescriptions)) :: Word32))
Ptr VertexInputAttributeDescription
pPVertexAttributeDescriptions' <- ((Ptr VertexInputAttributeDescription -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputAttributeDescription)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr VertexInputAttributeDescription -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputAttributeDescription))
-> ((Ptr VertexInputAttributeDescription -> IO b) -> IO b)
-> ContT b IO (Ptr VertexInputAttributeDescription)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr VertexInputAttributeDescription -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @VertexInputAttributeDescription ((Vector VertexInputAttributeDescription -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputAttributeDescription
vertexAttributeDescriptions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
16)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> VertexInputAttributeDescription -> IO ())
-> Vector VertexInputAttributeDescription -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i VertexInputAttributeDescription
e -> Ptr VertexInputAttributeDescription
-> VertexInputAttributeDescription -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr VertexInputAttributeDescription
pPVertexAttributeDescriptions' Ptr VertexInputAttributeDescription
-> Int -> Ptr VertexInputAttributeDescription
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputAttributeDescription) (VertexInputAttributeDescription
e)) (Vector VertexInputAttributeDescription
vertexAttributeDescriptions)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr VertexInputAttributeDescription)
-> Ptr VertexInputAttributeDescription -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr (Ptr VertexInputAttributeDescription)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr VertexInputAttributeDescription))) (Ptr VertexInputAttributeDescription
pPVertexAttributeDescriptions')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineVertexInputStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineVertexInputStateCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineVertexInputStateCreateInfo es, PeekChain es) => FromCStruct (PipelineVertexInputStateCreateInfo es) where
peekCStruct :: Ptr (PipelineVertexInputStateCreateInfo es)
-> IO (PipelineVertexInputStateCreateInfo es)
peekCStruct Ptr (PipelineVertexInputStateCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineVertexInputStateCreateFlags
flags <- Ptr PipelineVertexInputStateCreateFlags
-> IO PipelineVertexInputStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineVertexInputStateCreateFlags ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr PipelineVertexInputStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineVertexInputStateCreateFlags))
"createInfoCount" ::: Word32
vertexBindingDescriptionCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr VertexInputBindingDescription
pVertexBindingDescriptions <- Ptr (Ptr VertexInputBindingDescription)
-> IO (Ptr VertexInputBindingDescription)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr VertexInputBindingDescription) ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr (Ptr VertexInputBindingDescription)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr VertexInputBindingDescription)))
Vector VertexInputBindingDescription
pVertexBindingDescriptions' <- Int
-> (Int -> IO VertexInputBindingDescription)
-> IO (Vector VertexInputBindingDescription)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
vertexBindingDescriptionCount) (\Int
i -> Ptr VertexInputBindingDescription
-> IO VertexInputBindingDescription
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VertexInputBindingDescription ((Ptr VertexInputBindingDescription
pVertexBindingDescriptions Ptr VertexInputBindingDescription
-> Int -> Ptr VertexInputBindingDescription
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
12 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDescription)))
"createInfoCount" ::: Word32
vertexAttributeDescriptionCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
Ptr VertexInputAttributeDescription
pVertexAttributeDescriptions <- Ptr (Ptr VertexInputAttributeDescription)
-> IO (Ptr VertexInputAttributeDescription)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr VertexInputAttributeDescription) ((Ptr (PipelineVertexInputStateCreateInfo es)
p Ptr (PipelineVertexInputStateCreateInfo es)
-> Int -> Ptr (Ptr VertexInputAttributeDescription)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr VertexInputAttributeDescription)))
Vector VertexInputAttributeDescription
pVertexAttributeDescriptions' <- Int
-> (Int -> IO VertexInputAttributeDescription)
-> IO (Vector VertexInputAttributeDescription)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
vertexAttributeDescriptionCount) (\Int
i -> Ptr VertexInputAttributeDescription
-> IO VertexInputAttributeDescription
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VertexInputAttributeDescription ((Ptr VertexInputAttributeDescription
pVertexAttributeDescriptions Ptr VertexInputAttributeDescription
-> Int -> Ptr VertexInputAttributeDescription
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputAttributeDescription)))
PipelineVertexInputStateCreateInfo es
-> IO (PipelineVertexInputStateCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineVertexInputStateCreateInfo es
-> IO (PipelineVertexInputStateCreateInfo es))
-> PipelineVertexInputStateCreateInfo es
-> IO (PipelineVertexInputStateCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineVertexInputStateCreateFlags
-> Vector VertexInputBindingDescription
-> Vector VertexInputAttributeDescription
-> PipelineVertexInputStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineVertexInputStateCreateFlags
-> Vector VertexInputBindingDescription
-> Vector VertexInputAttributeDescription
-> PipelineVertexInputStateCreateInfo es
PipelineVertexInputStateCreateInfo
Chain es
next PipelineVertexInputStateCreateFlags
flags Vector VertexInputBindingDescription
pVertexBindingDescriptions' Vector VertexInputAttributeDescription
pVertexAttributeDescriptions'
instance es ~ '[] => Zero (PipelineVertexInputStateCreateInfo es) where
zero :: PipelineVertexInputStateCreateInfo es
zero = Chain es
-> PipelineVertexInputStateCreateFlags
-> Vector VertexInputBindingDescription
-> Vector VertexInputAttributeDescription
-> PipelineVertexInputStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineVertexInputStateCreateFlags
-> Vector VertexInputBindingDescription
-> Vector VertexInputAttributeDescription
-> PipelineVertexInputStateCreateInfo es
PipelineVertexInputStateCreateInfo
()
PipelineVertexInputStateCreateFlags
forall a. Zero a => a
zero
Vector VertexInputBindingDescription
forall a. Monoid a => a
mempty
Vector VertexInputAttributeDescription
forall a. Monoid a => a
mempty
data PipelineInputAssemblyStateCreateInfo = PipelineInputAssemblyStateCreateInfo
{
PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateFlags
flags :: PipelineInputAssemblyStateCreateFlags
,
PipelineInputAssemblyStateCreateInfo -> PrimitiveTopology
topology :: PrimitiveTopology
,
PipelineInputAssemblyStateCreateInfo -> Bool
primitiveRestartEnable :: Bool
}
deriving (Typeable, PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool
(PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool)
-> (PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool)
-> Eq PipelineInputAssemblyStateCreateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool
$c/= :: PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool
== :: PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool
$c== :: PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineInputAssemblyStateCreateInfo)
#endif
deriving instance Show PipelineInputAssemblyStateCreateInfo
instance ToCStruct PipelineInputAssemblyStateCreateInfo where
withCStruct :: PipelineInputAssemblyStateCreateInfo
-> (Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b
withCStruct PipelineInputAssemblyStateCreateInfo
x Ptr PipelineInputAssemblyStateCreateInfo -> IO b
f = Int -> (Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b)
-> (Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineInputAssemblyStateCreateInfo
p -> Ptr PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineInputAssemblyStateCreateInfo
p PipelineInputAssemblyStateCreateInfo
x (Ptr PipelineInputAssemblyStateCreateInfo -> IO b
f Ptr PipelineInputAssemblyStateCreateInfo
p)
pokeCStruct :: Ptr PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> IO b -> IO b
pokeCStruct Ptr PipelineInputAssemblyStateCreateInfo
p PipelineInputAssemblyStateCreateInfo{Bool
PrimitiveTopology
PipelineInputAssemblyStateCreateFlags
primitiveRestartEnable :: Bool
topology :: PrimitiveTopology
flags :: PipelineInputAssemblyStateCreateFlags
$sel:primitiveRestartEnable:PipelineInputAssemblyStateCreateInfo :: PipelineInputAssemblyStateCreateInfo -> Bool
$sel:topology:PipelineInputAssemblyStateCreateInfo :: PipelineInputAssemblyStateCreateInfo -> PrimitiveTopology
$sel:flags:PipelineInputAssemblyStateCreateInfo :: PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateFlags
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineInputAssemblyStateCreateFlags
-> PipelineInputAssemblyStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr PipelineInputAssemblyStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineInputAssemblyStateCreateFlags)) (PipelineInputAssemblyStateCreateFlags
flags)
Ptr PrimitiveTopology -> PrimitiveTopology -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr PrimitiveTopology
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PrimitiveTopology)) (PrimitiveTopology
topology)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
primitiveRestartEnable))
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr PipelineInputAssemblyStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineInputAssemblyStateCreateInfo
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr PrimitiveTopology -> PrimitiveTopology -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr PrimitiveTopology
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PrimitiveTopology)) (PrimitiveTopology
forall a. Zero a => a
zero)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PipelineInputAssemblyStateCreateInfo where
peekCStruct :: Ptr PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo
peekCStruct Ptr PipelineInputAssemblyStateCreateInfo
p = do
PipelineInputAssemblyStateCreateFlags
flags <- Ptr PipelineInputAssemblyStateCreateFlags
-> IO PipelineInputAssemblyStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineInputAssemblyStateCreateFlags ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr PipelineInputAssemblyStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineInputAssemblyStateCreateFlags))
PrimitiveTopology
topology <- Ptr PrimitiveTopology -> IO PrimitiveTopology
forall a. Storable a => Ptr a -> IO a
peek @PrimitiveTopology ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo
-> Int -> Ptr PrimitiveTopology
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PrimitiveTopology))
Bool32
primitiveRestartEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineInputAssemblyStateCreateInfo
p Ptr PipelineInputAssemblyStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo)
-> PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo
forall a b. (a -> b) -> a -> b
$ PipelineInputAssemblyStateCreateFlags
-> PrimitiveTopology
-> Bool
-> PipelineInputAssemblyStateCreateInfo
PipelineInputAssemblyStateCreateInfo
PipelineInputAssemblyStateCreateFlags
flags PrimitiveTopology
topology (Bool32 -> Bool
bool32ToBool Bool32
primitiveRestartEnable)
instance Storable PipelineInputAssemblyStateCreateInfo where
sizeOf :: PipelineInputAssemblyStateCreateInfo -> Int
sizeOf ~PipelineInputAssemblyStateCreateInfo
_ = Int
32
alignment :: PipelineInputAssemblyStateCreateInfo -> Int
alignment ~PipelineInputAssemblyStateCreateInfo
_ = Int
8
peek :: Ptr PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo
peek = Ptr PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> IO ()
poke Ptr PipelineInputAssemblyStateCreateInfo
ptr PipelineInputAssemblyStateCreateInfo
poked = Ptr PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineInputAssemblyStateCreateInfo
ptr PipelineInputAssemblyStateCreateInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineInputAssemblyStateCreateInfo where
zero :: PipelineInputAssemblyStateCreateInfo
zero = PipelineInputAssemblyStateCreateFlags
-> PrimitiveTopology
-> Bool
-> PipelineInputAssemblyStateCreateInfo
PipelineInputAssemblyStateCreateInfo
PipelineInputAssemblyStateCreateFlags
forall a. Zero a => a
zero
PrimitiveTopology
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data PipelineTessellationStateCreateInfo (es :: [Type]) = PipelineTessellationStateCreateInfo
{
PipelineTessellationStateCreateInfo es -> Chain es
next :: Chain es
,
PipelineTessellationStateCreateInfo es
-> PipelineTessellationStateCreateFlags
flags :: PipelineTessellationStateCreateFlags
,
PipelineTessellationStateCreateInfo es
-> "createInfoCount" ::: Word32
patchControlPoints :: Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineTessellationStateCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineTessellationStateCreateInfo es)
instance Extensible PipelineTessellationStateCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineTessellationStateCreateInfo"
setNext :: PipelineTessellationStateCreateInfo ds
-> Chain es -> PipelineTessellationStateCreateInfo es
setNext PipelineTessellationStateCreateInfo{"createInfoCount" ::: Word32
Chain ds
PipelineTessellationStateCreateFlags
patchControlPoints :: "createInfoCount" ::: Word32
flags :: PipelineTessellationStateCreateFlags
next :: Chain ds
$sel:patchControlPoints:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> "createInfoCount" ::: Word32
$sel:flags:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> PipelineTessellationStateCreateFlags
$sel:next:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es -> Chain es
..} Chain es
next' = PipelineTessellationStateCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineTessellationStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> PipelineTessellationStateCreateInfo es
PipelineTessellationStateCreateInfo{$sel:next:PipelineTessellationStateCreateInfo :: Chain es
next = Chain es
next', "createInfoCount" ::: Word32
PipelineTessellationStateCreateFlags
patchControlPoints :: "createInfoCount" ::: Word32
flags :: PipelineTessellationStateCreateFlags
$sel:patchControlPoints:PipelineTessellationStateCreateInfo :: "createInfoCount" ::: Word32
$sel:flags:PipelineTessellationStateCreateInfo :: PipelineTessellationStateCreateFlags
..}
getNext :: PipelineTessellationStateCreateInfo es -> Chain es
getNext PipelineTessellationStateCreateInfo{"createInfoCount" ::: Word32
Chain es
PipelineTessellationStateCreateFlags
patchControlPoints :: "createInfoCount" ::: Word32
flags :: PipelineTessellationStateCreateFlags
next :: Chain es
$sel:patchControlPoints:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> "createInfoCount" ::: Word32
$sel:flags:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> PipelineTessellationStateCreateFlags
$sel:next:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineTessellationStateCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineTessellationStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineTessellationStateCreateInfo e => b
f
| Just e :~: PipelineTessellationDomainOriginStateCreateInfo
Refl <- (Typeable e,
Typeable PipelineTessellationDomainOriginStateCreateInfo) =>
Maybe (e :~: PipelineTessellationDomainOriginStateCreateInfo)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineTessellationDomainOriginStateCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineTessellationStateCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineTessellationStateCreateInfo es, PokeChain es) => ToCStruct (PipelineTessellationStateCreateInfo es) where
withCStruct :: PipelineTessellationStateCreateInfo es
-> (Ptr (PipelineTessellationStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineTessellationStateCreateInfo es
x Ptr (PipelineTessellationStateCreateInfo es) -> IO b
f = Int
-> (Ptr (PipelineTessellationStateCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr (PipelineTessellationStateCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineTessellationStateCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineTessellationStateCreateInfo es)
p -> Ptr (PipelineTessellationStateCreateInfo es)
-> PipelineTessellationStateCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineTessellationStateCreateInfo es)
p PipelineTessellationStateCreateInfo es
x (Ptr (PipelineTessellationStateCreateInfo es) -> IO b
f Ptr (PipelineTessellationStateCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineTessellationStateCreateInfo es)
-> PipelineTessellationStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineTessellationStateCreateInfo es)
p PipelineTessellationStateCreateInfo{"createInfoCount" ::: Word32
Chain es
PipelineTessellationStateCreateFlags
patchControlPoints :: "createInfoCount" ::: Word32
flags :: PipelineTessellationStateCreateFlags
next :: Chain es
$sel:patchControlPoints:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> "createInfoCount" ::: Word32
$sel:flags:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> PipelineTessellationStateCreateFlags
$sel:next:PipelineTessellationStateCreateInfo :: forall (es :: [*]).
PipelineTessellationStateCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineTessellationStateCreateFlags
-> PipelineTessellationStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr PipelineTessellationStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineTessellationStateCreateFlags)) (PipelineTessellationStateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
patchControlPoints)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineTessellationStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineTessellationStateCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineTessellationStateCreateInfo es, PeekChain es) => FromCStruct (PipelineTessellationStateCreateInfo es) where
peekCStruct :: Ptr (PipelineTessellationStateCreateInfo es)
-> IO (PipelineTessellationStateCreateInfo es)
peekCStruct Ptr (PipelineTessellationStateCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineTessellationStateCreateFlags
flags <- Ptr PipelineTessellationStateCreateFlags
-> IO PipelineTessellationStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineTessellationStateCreateFlags ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr PipelineTessellationStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineTessellationStateCreateFlags))
"createInfoCount" ::: Word32
patchControlPoints <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineTessellationStateCreateInfo es)
p Ptr (PipelineTessellationStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
PipelineTessellationStateCreateInfo es
-> IO (PipelineTessellationStateCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineTessellationStateCreateInfo es
-> IO (PipelineTessellationStateCreateInfo es))
-> PipelineTessellationStateCreateInfo es
-> IO (PipelineTessellationStateCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineTessellationStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> PipelineTessellationStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineTessellationStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> PipelineTessellationStateCreateInfo es
PipelineTessellationStateCreateInfo
Chain es
next PipelineTessellationStateCreateFlags
flags "createInfoCount" ::: Word32
patchControlPoints
instance es ~ '[] => Zero (PipelineTessellationStateCreateInfo es) where
zero :: PipelineTessellationStateCreateInfo es
zero = Chain es
-> PipelineTessellationStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> PipelineTessellationStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineTessellationStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> PipelineTessellationStateCreateInfo es
PipelineTessellationStateCreateInfo
()
PipelineTessellationStateCreateFlags
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
data PipelineViewportStateCreateInfo (es :: [Type]) = PipelineViewportStateCreateInfo
{
PipelineViewportStateCreateInfo es -> Chain es
next :: Chain es
,
PipelineViewportStateCreateInfo es
-> PipelineViewportStateCreateFlags
flags :: PipelineViewportStateCreateFlags
,
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
viewportCount :: Word32
,
PipelineViewportStateCreateInfo es -> Vector Viewport
viewports :: Vector Viewport
,
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
scissorCount :: Word32
,
PipelineViewportStateCreateInfo es -> Vector Rect2D
scissors :: Vector Rect2D
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineViewportStateCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineViewportStateCreateInfo es)
instance Extensible PipelineViewportStateCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineViewportStateCreateInfo"
setNext :: PipelineViewportStateCreateInfo ds
-> Chain es -> PipelineViewportStateCreateInfo es
setNext PipelineViewportStateCreateInfo{"createInfoCount" ::: Word32
Vector Rect2D
Vector Viewport
Chain ds
PipelineViewportStateCreateFlags
scissors :: Vector Rect2D
scissorCount :: "createInfoCount" ::: Word32
viewports :: Vector Viewport
viewportCount :: "createInfoCount" ::: Word32
flags :: PipelineViewportStateCreateFlags
next :: Chain ds
$sel:scissors:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Rect2D
$sel:scissorCount:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
$sel:viewports:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Viewport
$sel:viewportCount:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
$sel:flags:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es
-> PipelineViewportStateCreateFlags
$sel:next:PipelineViewportStateCreateInfo :: forall (es :: [*]). PipelineViewportStateCreateInfo es -> Chain es
..} Chain es
next' = PipelineViewportStateCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineViewportStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector Viewport
-> ("createInfoCount" ::: Word32)
-> Vector Rect2D
-> PipelineViewportStateCreateInfo es
PipelineViewportStateCreateInfo{$sel:next:PipelineViewportStateCreateInfo :: Chain es
next = Chain es
next', "createInfoCount" ::: Word32
Vector Rect2D
Vector Viewport
PipelineViewportStateCreateFlags
scissors :: Vector Rect2D
scissorCount :: "createInfoCount" ::: Word32
viewports :: Vector Viewport
viewportCount :: "createInfoCount" ::: Word32
flags :: PipelineViewportStateCreateFlags
$sel:scissors:PipelineViewportStateCreateInfo :: Vector Rect2D
$sel:scissorCount:PipelineViewportStateCreateInfo :: "createInfoCount" ::: Word32
$sel:viewports:PipelineViewportStateCreateInfo :: Vector Viewport
$sel:viewportCount:PipelineViewportStateCreateInfo :: "createInfoCount" ::: Word32
$sel:flags:PipelineViewportStateCreateInfo :: PipelineViewportStateCreateFlags
..}
getNext :: PipelineViewportStateCreateInfo es -> Chain es
getNext PipelineViewportStateCreateInfo{"createInfoCount" ::: Word32
Vector Rect2D
Vector Viewport
Chain es
PipelineViewportStateCreateFlags
scissors :: Vector Rect2D
scissorCount :: "createInfoCount" ::: Word32
viewports :: Vector Viewport
viewportCount :: "createInfoCount" ::: Word32
flags :: PipelineViewportStateCreateFlags
next :: Chain es
$sel:scissors:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Rect2D
$sel:scissorCount:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
$sel:viewports:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Viewport
$sel:viewportCount:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
$sel:flags:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es
-> PipelineViewportStateCreateFlags
$sel:next:PipelineViewportStateCreateInfo :: forall (es :: [*]). PipelineViewportStateCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineViewportStateCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineViewportStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportDepthClipControlCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineViewportDepthClipControlCreateInfoEXT) =>
Maybe (e :~: PipelineViewportDepthClipControlCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportDepthClipControlCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportCoarseSampleOrderStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineViewportCoarseSampleOrderStateCreateInfoNV) =>
Maybe (e :~: PipelineViewportCoarseSampleOrderStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportCoarseSampleOrderStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportShadingRateImageStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineViewportShadingRateImageStateCreateInfoNV) =>
Maybe (e :~: PipelineViewportShadingRateImageStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportShadingRateImageStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportExclusiveScissorStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineViewportExclusiveScissorStateCreateInfoNV) =>
Maybe (e :~: PipelineViewportExclusiveScissorStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportExclusiveScissorStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportSwizzleStateCreateInfoNV
Refl <- (Typeable e, Typeable PipelineViewportSwizzleStateCreateInfoNV) =>
Maybe (e :~: PipelineViewportSwizzleStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportSwizzleStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportWScalingStateCreateInfoNV
Refl <- (Typeable e, Typeable PipelineViewportWScalingStateCreateInfoNV) =>
Maybe (e :~: PipelineViewportWScalingStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportWScalingStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineViewportStateCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineViewportStateCreateInfo es, PokeChain es) => ToCStruct (PipelineViewportStateCreateInfo es) where
withCStruct :: PipelineViewportStateCreateInfo es
-> (Ptr (PipelineViewportStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineViewportStateCreateInfo es
x Ptr (PipelineViewportStateCreateInfo es) -> IO b
f = Int -> (Ptr (PipelineViewportStateCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PipelineViewportStateCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineViewportStateCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineViewportStateCreateInfo es)
p -> Ptr (PipelineViewportStateCreateInfo es)
-> PipelineViewportStateCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineViewportStateCreateInfo es)
p PipelineViewportStateCreateInfo es
x (Ptr (PipelineViewportStateCreateInfo es) -> IO b
f Ptr (PipelineViewportStateCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineViewportStateCreateInfo es)
-> PipelineViewportStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineViewportStateCreateInfo es)
p PipelineViewportStateCreateInfo{"createInfoCount" ::: Word32
Vector Rect2D
Vector Viewport
Chain es
PipelineViewportStateCreateFlags
scissors :: Vector Rect2D
scissorCount :: "createInfoCount" ::: Word32
viewports :: Vector Viewport
viewportCount :: "createInfoCount" ::: Word32
flags :: PipelineViewportStateCreateFlags
next :: Chain es
$sel:scissors:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Rect2D
$sel:scissorCount:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
$sel:viewports:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Viewport
$sel:viewportCount:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
$sel:flags:PipelineViewportStateCreateInfo :: forall (es :: [*]).
PipelineViewportStateCreateInfo es
-> PipelineViewportStateCreateFlags
$sel:next:PipelineViewportStateCreateInfo :: forall (es :: [*]). PipelineViewportStateCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineViewportStateCreateFlags
-> PipelineViewportStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr PipelineViewportStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineViewportStateCreateFlags)) (PipelineViewportStateCreateFlags
flags)
let pViewportsLength :: Int
pViewportsLength = Vector Viewport -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Viewport -> Int) -> Vector Viewport -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Viewport
viewports)
"createInfoCount" ::: Word32
viewportCount'' <- IO ("createInfoCount" ::: Word32)
-> ContT b IO ("createInfoCount" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("createInfoCount" ::: Word32)
-> ContT b IO ("createInfoCount" ::: Word32))
-> IO ("createInfoCount" ::: Word32)
-> ContT b IO ("createInfoCount" ::: Word32)
forall a b. (a -> b) -> a -> b
$ if ("createInfoCount" ::: Word32
viewportCount) ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== "createInfoCount" ::: Word32
0
then ("createInfoCount" ::: Word32) -> IO ("createInfoCount" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32))
-> ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a b. (a -> b) -> a -> b
$ Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pViewportsLength
else do
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pViewportsLength ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== ("createInfoCount" ::: Word32
viewportCount) Bool -> Bool -> Bool
|| Int
pViewportsLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pViewports must be empty or have 'viewportCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
("createInfoCount" ::: Word32) -> IO ("createInfoCount" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("createInfoCount" ::: Word32
viewportCount)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
viewportCount'')
Ptr Viewport
pViewports'' <- if Vector Viewport -> Bool
forall a. Vector a -> Bool
Data.Vector.null (Vector Viewport
viewports)
then Ptr Viewport -> ContT b IO (Ptr Viewport)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Viewport
forall a. Ptr a
nullPtr
else do
Ptr Viewport
pPViewports <- ((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport))
-> ((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr Viewport -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Viewport (((Vector Viewport -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Viewport
viewports))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
24)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Viewport -> IO ()) -> Vector Viewport -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Viewport
e -> Ptr Viewport -> Viewport -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Viewport
pPViewports Ptr Viewport -> Int -> Ptr Viewport
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
24 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Viewport) (Viewport
e)) ((Vector Viewport
viewports))
Ptr Viewport -> ContT b IO (Ptr Viewport)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Ptr Viewport -> ContT b IO (Ptr Viewport))
-> Ptr Viewport -> ContT b IO (Ptr Viewport)
forall a b. (a -> b) -> a -> b
$ Ptr Viewport
pPViewports
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Viewport) -> Ptr Viewport -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr (Ptr Viewport)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport))) Ptr Viewport
pViewports''
let pScissorsLength :: Int
pScissorsLength = Vector Rect2D -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Rect2D -> Int) -> Vector Rect2D -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Rect2D
scissors)
"createInfoCount" ::: Word32
scissorCount'' <- IO ("createInfoCount" ::: Word32)
-> ContT b IO ("createInfoCount" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("createInfoCount" ::: Word32)
-> ContT b IO ("createInfoCount" ::: Word32))
-> IO ("createInfoCount" ::: Word32)
-> ContT b IO ("createInfoCount" ::: Word32)
forall a b. (a -> b) -> a -> b
$ if ("createInfoCount" ::: Word32
scissorCount) ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== "createInfoCount" ::: Word32
0
then ("createInfoCount" ::: Word32) -> IO ("createInfoCount" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32))
-> ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a b. (a -> b) -> a -> b
$ Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pScissorsLength
else do
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pScissorsLength ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== ("createInfoCount" ::: Word32
scissorCount) Bool -> Bool -> Bool
|| Int
pScissorsLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pScissors must be empty or have 'scissorCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
("createInfoCount" ::: Word32) -> IO ("createInfoCount" ::: Word32)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("createInfoCount" ::: Word32
scissorCount)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ("createInfoCount" ::: Word32
scissorCount'')
Ptr Rect2D
pScissors'' <- if Vector Rect2D -> Bool
forall a. Vector a -> Bool
Data.Vector.null (Vector Rect2D
scissors)
then Ptr Rect2D -> ContT b IO (Ptr Rect2D)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Rect2D
forall a. Ptr a
nullPtr
else do
Ptr Rect2D
pPScissors <- ((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D))
-> ((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr Rect2D -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Rect2D (((Vector Rect2D -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Rect2D
scissors))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
16)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Rect2D -> IO ()) -> Vector Rect2D -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Rect2D
e -> Ptr Rect2D -> Rect2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Rect2D
pPScissors Ptr Rect2D -> Int -> Ptr Rect2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D) (Rect2D
e)) ((Vector Rect2D
scissors))
Ptr Rect2D -> ContT b IO (Ptr Rect2D)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Ptr Rect2D -> ContT b IO (Ptr Rect2D))
-> Ptr Rect2D -> ContT b IO (Ptr Rect2D)
forall a b. (a -> b) -> a -> b
$ Ptr Rect2D
pPScissors
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Rect2D) -> Ptr Rect2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es) -> Int -> Ptr (Ptr Rect2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Rect2D))) Ptr Rect2D
pScissors''
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineViewportStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineViewportStateCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineViewportStateCreateInfo es, PeekChain es) => FromCStruct (PipelineViewportStateCreateInfo es) where
peekCStruct :: Ptr (PipelineViewportStateCreateInfo es)
-> IO (PipelineViewportStateCreateInfo es)
peekCStruct Ptr (PipelineViewportStateCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineViewportStateCreateFlags
flags <- Ptr PipelineViewportStateCreateFlags
-> IO PipelineViewportStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineViewportStateCreateFlags ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr PipelineViewportStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineViewportStateCreateFlags))
"createInfoCount" ::: Word32
viewportCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr Viewport
pViewports <- Ptr (Ptr Viewport) -> IO (Ptr Viewport)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Viewport) ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr (Ptr Viewport)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport)))
let pViewportsLength :: Int
pViewportsLength = if Ptr Viewport
pViewports Ptr Viewport -> Ptr Viewport -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Viewport
forall a. Ptr a
nullPtr then Int
0 else (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
viewportCount)
Vector Viewport
pViewports' <- Int -> (Int -> IO Viewport) -> IO (Vector Viewport)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pViewportsLength (\Int
i -> Ptr Viewport -> IO Viewport
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Viewport ((Ptr Viewport
pViewports Ptr Viewport -> Int -> Ptr Viewport
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
24 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Viewport)))
"createInfoCount" ::: Word32
scissorCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
Ptr Rect2D
pScissors <- Ptr (Ptr Rect2D) -> IO (Ptr Rect2D)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Rect2D) ((Ptr (PipelineViewportStateCreateInfo es)
p Ptr (PipelineViewportStateCreateInfo es) -> Int -> Ptr (Ptr Rect2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Rect2D)))
let pScissorsLength :: Int
pScissorsLength = if Ptr Rect2D
pScissors Ptr Rect2D -> Ptr Rect2D -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Rect2D
forall a. Ptr a
nullPtr then Int
0 else (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
scissorCount)
Vector Rect2D
pScissors' <- Int -> (Int -> IO Rect2D) -> IO (Vector Rect2D)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pScissorsLength (\Int
i -> Ptr Rect2D -> IO Rect2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Rect2D ((Ptr Rect2D
pScissors Ptr Rect2D -> Int -> Ptr Rect2D
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D)))
PipelineViewportStateCreateInfo es
-> IO (PipelineViewportStateCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineViewportStateCreateInfo es
-> IO (PipelineViewportStateCreateInfo es))
-> PipelineViewportStateCreateInfo es
-> IO (PipelineViewportStateCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineViewportStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector Viewport
-> ("createInfoCount" ::: Word32)
-> Vector Rect2D
-> PipelineViewportStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineViewportStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector Viewport
-> ("createInfoCount" ::: Word32)
-> Vector Rect2D
-> PipelineViewportStateCreateInfo es
PipelineViewportStateCreateInfo
Chain es
next PipelineViewportStateCreateFlags
flags "createInfoCount" ::: Word32
viewportCount Vector Viewport
pViewports' "createInfoCount" ::: Word32
scissorCount Vector Rect2D
pScissors'
instance es ~ '[] => Zero (PipelineViewportStateCreateInfo es) where
zero :: PipelineViewportStateCreateInfo es
zero = Chain es
-> PipelineViewportStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector Viewport
-> ("createInfoCount" ::: Word32)
-> Vector Rect2D
-> PipelineViewportStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineViewportStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector Viewport
-> ("createInfoCount" ::: Word32)
-> Vector Rect2D
-> PipelineViewportStateCreateInfo es
PipelineViewportStateCreateInfo
()
PipelineViewportStateCreateFlags
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
Vector Viewport
forall a. Monoid a => a
mempty
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
Vector Rect2D
forall a. Monoid a => a
mempty
data PipelineRasterizationStateCreateInfo (es :: [Type]) = PipelineRasterizationStateCreateInfo
{
PipelineRasterizationStateCreateInfo es -> Chain es
next :: Chain es
,
PipelineRasterizationStateCreateInfo es
-> PipelineRasterizationStateCreateFlags
flags :: PipelineRasterizationStateCreateFlags
,
PipelineRasterizationStateCreateInfo es -> Bool
depthClampEnable :: Bool
,
PipelineRasterizationStateCreateInfo es -> Bool
rasterizerDiscardEnable :: Bool
,
PipelineRasterizationStateCreateInfo es -> PolygonMode
polygonMode :: PolygonMode
,
PipelineRasterizationStateCreateInfo es -> CullModeFlags
cullMode :: CullModeFlags
,
PipelineRasterizationStateCreateInfo es -> FrontFace
frontFace :: FrontFace
,
PipelineRasterizationStateCreateInfo es -> Bool
depthBiasEnable :: Bool
,
PipelineRasterizationStateCreateInfo es -> Float
depthBiasConstantFactor :: Float
,
PipelineRasterizationStateCreateInfo es -> Float
depthBiasClamp :: Float
,
PipelineRasterizationStateCreateInfo es -> Float
depthBiasSlopeFactor :: Float
,
PipelineRasterizationStateCreateInfo es -> Float
lineWidth :: Float
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineRasterizationStateCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineRasterizationStateCreateInfo es)
instance Extensible PipelineRasterizationStateCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineRasterizationStateCreateInfo"
setNext :: PipelineRasterizationStateCreateInfo ds
-> Chain es -> PipelineRasterizationStateCreateInfo es
setNext PipelineRasterizationStateCreateInfo{Bool
Float
Chain ds
CullModeFlags
FrontFace
PolygonMode
PipelineRasterizationStateCreateFlags
lineWidth :: Float
depthBiasSlopeFactor :: Float
depthBiasClamp :: Float
depthBiasConstantFactor :: Float
depthBiasEnable :: Bool
frontFace :: FrontFace
cullMode :: CullModeFlags
polygonMode :: PolygonMode
rasterizerDiscardEnable :: Bool
depthClampEnable :: Bool
flags :: PipelineRasterizationStateCreateFlags
next :: Chain ds
$sel:lineWidth:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasSlopeFactor:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasClamp:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasConstantFactor:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:frontFace:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> FrontFace
$sel:cullMode:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> CullModeFlags
$sel:polygonMode:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> PolygonMode
$sel:rasterizerDiscardEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:depthClampEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:flags:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es
-> PipelineRasterizationStateCreateFlags
$sel:next:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Chain es
..} Chain es
next' = PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineRasterizationStateCreateFlags
-> Bool
-> Bool
-> PolygonMode
-> CullModeFlags
-> FrontFace
-> Bool
-> Float
-> Float
-> Float
-> Float
-> PipelineRasterizationStateCreateInfo es
PipelineRasterizationStateCreateInfo{$sel:next:PipelineRasterizationStateCreateInfo :: Chain es
next = Chain es
next', Bool
Float
CullModeFlags
FrontFace
PolygonMode
PipelineRasterizationStateCreateFlags
lineWidth :: Float
depthBiasSlopeFactor :: Float
depthBiasClamp :: Float
depthBiasConstantFactor :: Float
depthBiasEnable :: Bool
frontFace :: FrontFace
cullMode :: CullModeFlags
polygonMode :: PolygonMode
rasterizerDiscardEnable :: Bool
depthClampEnable :: Bool
flags :: PipelineRasterizationStateCreateFlags
$sel:lineWidth:PipelineRasterizationStateCreateInfo :: Float
$sel:depthBiasSlopeFactor:PipelineRasterizationStateCreateInfo :: Float
$sel:depthBiasClamp:PipelineRasterizationStateCreateInfo :: Float
$sel:depthBiasConstantFactor:PipelineRasterizationStateCreateInfo :: Float
$sel:depthBiasEnable:PipelineRasterizationStateCreateInfo :: Bool
$sel:frontFace:PipelineRasterizationStateCreateInfo :: FrontFace
$sel:cullMode:PipelineRasterizationStateCreateInfo :: CullModeFlags
$sel:polygonMode:PipelineRasterizationStateCreateInfo :: PolygonMode
$sel:rasterizerDiscardEnable:PipelineRasterizationStateCreateInfo :: Bool
$sel:depthClampEnable:PipelineRasterizationStateCreateInfo :: Bool
$sel:flags:PipelineRasterizationStateCreateInfo :: PipelineRasterizationStateCreateFlags
..}
getNext :: PipelineRasterizationStateCreateInfo es -> Chain es
getNext PipelineRasterizationStateCreateInfo{Bool
Float
Chain es
CullModeFlags
FrontFace
PolygonMode
PipelineRasterizationStateCreateFlags
lineWidth :: Float
depthBiasSlopeFactor :: Float
depthBiasClamp :: Float
depthBiasConstantFactor :: Float
depthBiasEnable :: Bool
frontFace :: FrontFace
cullMode :: CullModeFlags
polygonMode :: PolygonMode
rasterizerDiscardEnable :: Bool
depthClampEnable :: Bool
flags :: PipelineRasterizationStateCreateFlags
next :: Chain es
$sel:lineWidth:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasSlopeFactor:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasClamp:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasConstantFactor:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:frontFace:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> FrontFace
$sel:cullMode:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> CullModeFlags
$sel:polygonMode:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> PolygonMode
$sel:rasterizerDiscardEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:depthClampEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:flags:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es
-> PipelineRasterizationStateCreateFlags
$sel:next:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineRasterizationStateCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineRasterizationStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationProvokingVertexStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineRasterizationProvokingVertexStateCreateInfoEXT) =>
Maybe
(e :~: PipelineRasterizationProvokingVertexStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationProvokingVertexStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationLineStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineRasterizationLineStateCreateInfoEXT) =>
Maybe (e :~: PipelineRasterizationLineStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationLineStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationDepthClipStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineRasterizationDepthClipStateCreateInfoEXT) =>
Maybe (e :~: PipelineRasterizationDepthClipStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationDepthClipStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationStateStreamCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineRasterizationStateStreamCreateInfoEXT) =>
Maybe (e :~: PipelineRasterizationStateStreamCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationStateStreamCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationConservativeStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineRasterizationConservativeStateCreateInfoEXT) =>
Maybe (e :~: PipelineRasterizationConservativeStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationConservativeStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationStateRasterizationOrderAMD
Refl <- (Typeable e,
Typeable PipelineRasterizationStateRasterizationOrderAMD) =>
Maybe (e :~: PipelineRasterizationStateRasterizationOrderAMD)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationStateRasterizationOrderAMD = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineRasterizationStateCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineRasterizationStateCreateInfo es, PokeChain es) => ToCStruct (PipelineRasterizationStateCreateInfo es) where
withCStruct :: PipelineRasterizationStateCreateInfo es
-> (Ptr (PipelineRasterizationStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineRasterizationStateCreateInfo es
x Ptr (PipelineRasterizationStateCreateInfo es) -> IO b
f = Int
-> (Ptr (PipelineRasterizationStateCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 ((Ptr (PipelineRasterizationStateCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineRasterizationStateCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineRasterizationStateCreateInfo es)
p -> Ptr (PipelineRasterizationStateCreateInfo es)
-> PipelineRasterizationStateCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineRasterizationStateCreateInfo es)
p PipelineRasterizationStateCreateInfo es
x (Ptr (PipelineRasterizationStateCreateInfo es) -> IO b
f Ptr (PipelineRasterizationStateCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineRasterizationStateCreateInfo es)
-> PipelineRasterizationStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineRasterizationStateCreateInfo es)
p PipelineRasterizationStateCreateInfo{Bool
Float
Chain es
CullModeFlags
FrontFace
PolygonMode
PipelineRasterizationStateCreateFlags
lineWidth :: Float
depthBiasSlopeFactor :: Float
depthBiasClamp :: Float
depthBiasConstantFactor :: Float
depthBiasEnable :: Bool
frontFace :: FrontFace
cullMode :: CullModeFlags
polygonMode :: PolygonMode
rasterizerDiscardEnable :: Bool
depthClampEnable :: Bool
flags :: PipelineRasterizationStateCreateFlags
next :: Chain es
$sel:lineWidth:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasSlopeFactor:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasClamp:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasConstantFactor:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
$sel:depthBiasEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:frontFace:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> FrontFace
$sel:cullMode:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> CullModeFlags
$sel:polygonMode:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> PolygonMode
$sel:rasterizerDiscardEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:depthClampEnable:PipelineRasterizationStateCreateInfo :: forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
$sel:flags:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es
-> PipelineRasterizationStateCreateFlags
$sel:next:PipelineRasterizationStateCreateInfo :: forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineRasterizationStateCreateFlags
-> PipelineRasterizationStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr PipelineRasterizationStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineRasterizationStateCreateFlags)) (PipelineRasterizationStateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthClampEnable))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
rasterizerDiscardEnable))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PolygonMode -> PolygonMode -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr PolygonMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PolygonMode)) (PolygonMode
polygonMode)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CullModeFlags -> CullModeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr CullModeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CullModeFlags)) (CullModeFlags
cullMode)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr FrontFace -> FrontFace -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr FrontFace
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr FrontFace)) (FrontFace
frontFace)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthBiasEnable))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
depthBiasConstantFactor))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
depthBiasClamp))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
depthBiasSlopeFactor))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
lineWidth))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineRasterizationStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineRasterizationStateCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PolygonMode -> PolygonMode -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr PolygonMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PolygonMode)) (PolygonMode
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr FrontFace -> FrontFace -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr FrontFace
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr FrontFace)) (FrontFace
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineRasterizationStateCreateInfo es, PeekChain es) => FromCStruct (PipelineRasterizationStateCreateInfo es) where
peekCStruct :: Ptr (PipelineRasterizationStateCreateInfo es)
-> IO (PipelineRasterizationStateCreateInfo es)
peekCStruct Ptr (PipelineRasterizationStateCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineRasterizationStateCreateFlags
flags <- Ptr PipelineRasterizationStateCreateFlags
-> IO PipelineRasterizationStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineRasterizationStateCreateFlags ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr PipelineRasterizationStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineRasterizationStateCreateFlags))
Bool32
depthClampEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Bool32
rasterizerDiscardEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
PolygonMode
polygonMode <- Ptr PolygonMode -> IO PolygonMode
forall a. Storable a => Ptr a -> IO a
peek @PolygonMode ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr PolygonMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PolygonMode))
CullModeFlags
cullMode <- Ptr CullModeFlags -> IO CullModeFlags
forall a. Storable a => Ptr a -> IO a
peek @CullModeFlags ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr CullModeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CullModeFlags))
FrontFace
frontFace <- Ptr FrontFace -> IO FrontFace
forall a. Storable a => Ptr a -> IO a
peek @FrontFace ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es)
-> Int -> Ptr FrontFace
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr FrontFace))
Bool32
depthBiasEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32))
CFloat
depthBiasConstantFactor <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CFloat))
CFloat
depthBiasClamp <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr CFloat))
CFloat
depthBiasSlopeFactor <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr CFloat))
CFloat
lineWidth <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p Ptr (PipelineRasterizationStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CFloat))
PipelineRasterizationStateCreateInfo es
-> IO (PipelineRasterizationStateCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineRasterizationStateCreateInfo es
-> IO (PipelineRasterizationStateCreateInfo es))
-> PipelineRasterizationStateCreateInfo es
-> IO (PipelineRasterizationStateCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineRasterizationStateCreateFlags
-> Bool
-> Bool
-> PolygonMode
-> CullModeFlags
-> FrontFace
-> Bool
-> Float
-> Float
-> Float
-> Float
-> PipelineRasterizationStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineRasterizationStateCreateFlags
-> Bool
-> Bool
-> PolygonMode
-> CullModeFlags
-> FrontFace
-> Bool
-> Float
-> Float
-> Float
-> Float
-> PipelineRasterizationStateCreateInfo es
PipelineRasterizationStateCreateInfo
Chain es
next PipelineRasterizationStateCreateFlags
flags (Bool32 -> Bool
bool32ToBool Bool32
depthClampEnable) (Bool32 -> Bool
bool32ToBool Bool32
rasterizerDiscardEnable) PolygonMode
polygonMode CullModeFlags
cullMode FrontFace
frontFace (Bool32 -> Bool
bool32ToBool Bool32
depthBiasEnable) (CFloat -> Float
coerce @CFloat @Float CFloat
depthBiasConstantFactor) (CFloat -> Float
coerce @CFloat @Float CFloat
depthBiasClamp) (CFloat -> Float
coerce @CFloat @Float CFloat
depthBiasSlopeFactor) (CFloat -> Float
coerce @CFloat @Float CFloat
lineWidth)
instance es ~ '[] => Zero (PipelineRasterizationStateCreateInfo es) where
zero :: PipelineRasterizationStateCreateInfo es
zero = Chain es
-> PipelineRasterizationStateCreateFlags
-> Bool
-> Bool
-> PolygonMode
-> CullModeFlags
-> FrontFace
-> Bool
-> Float
-> Float
-> Float
-> Float
-> PipelineRasterizationStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineRasterizationStateCreateFlags
-> Bool
-> Bool
-> PolygonMode
-> CullModeFlags
-> FrontFace
-> Bool
-> Float
-> Float
-> Float
-> Float
-> PipelineRasterizationStateCreateInfo es
PipelineRasterizationStateCreateInfo
()
PipelineRasterizationStateCreateFlags
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
PolygonMode
forall a. Zero a => a
zero
CullModeFlags
forall a. Zero a => a
zero
FrontFace
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
data PipelineMultisampleStateCreateInfo (es :: [Type]) = PipelineMultisampleStateCreateInfo
{
PipelineMultisampleStateCreateInfo es -> Chain es
next :: Chain es
,
PipelineMultisampleStateCreateInfo es
-> PipelineMultisampleStateCreateFlags
flags :: PipelineMultisampleStateCreateFlags
,
PipelineMultisampleStateCreateInfo es -> SampleCountFlagBits
rasterizationSamples :: SampleCountFlagBits
,
PipelineMultisampleStateCreateInfo es -> Bool
sampleShadingEnable :: Bool
,
PipelineMultisampleStateCreateInfo es -> Float
minSampleShading :: Float
,
PipelineMultisampleStateCreateInfo es
-> Vector ("createInfoCount" ::: Word32)
sampleMask :: Vector SampleMask
,
PipelineMultisampleStateCreateInfo es -> Bool
alphaToCoverageEnable :: Bool
,
PipelineMultisampleStateCreateInfo es -> Bool
alphaToOneEnable :: Bool
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineMultisampleStateCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineMultisampleStateCreateInfo es)
instance Extensible PipelineMultisampleStateCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineMultisampleStateCreateInfo"
setNext :: PipelineMultisampleStateCreateInfo ds
-> Chain es -> PipelineMultisampleStateCreateInfo es
setNext PipelineMultisampleStateCreateInfo{Bool
Float
Vector ("createInfoCount" ::: Word32)
Chain ds
SampleCountFlagBits
PipelineMultisampleStateCreateFlags
alphaToOneEnable :: Bool
alphaToCoverageEnable :: Bool
sampleMask :: Vector ("createInfoCount" ::: Word32)
minSampleShading :: Float
sampleShadingEnable :: Bool
rasterizationSamples :: SampleCountFlagBits
flags :: PipelineMultisampleStateCreateFlags
next :: Chain ds
$sel:alphaToOneEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:alphaToCoverageEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:sampleMask:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> Vector ("createInfoCount" ::: Word32)
$sel:minSampleShading:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Float
$sel:sampleShadingEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:rasterizationSamples:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> SampleCountFlagBits
$sel:flags:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> PipelineMultisampleStateCreateFlags
$sel:next:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> Chain es
..} Chain es
next' = PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineMultisampleStateCreateFlags
-> SampleCountFlagBits
-> Bool
-> Float
-> Vector ("createInfoCount" ::: Word32)
-> Bool
-> Bool
-> PipelineMultisampleStateCreateInfo es
PipelineMultisampleStateCreateInfo{$sel:next:PipelineMultisampleStateCreateInfo :: Chain es
next = Chain es
next', Bool
Float
Vector ("createInfoCount" ::: Word32)
SampleCountFlagBits
PipelineMultisampleStateCreateFlags
alphaToOneEnable :: Bool
alphaToCoverageEnable :: Bool
sampleMask :: Vector ("createInfoCount" ::: Word32)
minSampleShading :: Float
sampleShadingEnable :: Bool
rasterizationSamples :: SampleCountFlagBits
flags :: PipelineMultisampleStateCreateFlags
$sel:alphaToOneEnable:PipelineMultisampleStateCreateInfo :: Bool
$sel:alphaToCoverageEnable:PipelineMultisampleStateCreateInfo :: Bool
$sel:sampleMask:PipelineMultisampleStateCreateInfo :: Vector ("createInfoCount" ::: Word32)
$sel:minSampleShading:PipelineMultisampleStateCreateInfo :: Float
$sel:sampleShadingEnable:PipelineMultisampleStateCreateInfo :: Bool
$sel:rasterizationSamples:PipelineMultisampleStateCreateInfo :: SampleCountFlagBits
$sel:flags:PipelineMultisampleStateCreateInfo :: PipelineMultisampleStateCreateFlags
..}
getNext :: PipelineMultisampleStateCreateInfo es -> Chain es
getNext PipelineMultisampleStateCreateInfo{Bool
Float
Vector ("createInfoCount" ::: Word32)
Chain es
SampleCountFlagBits
PipelineMultisampleStateCreateFlags
alphaToOneEnable :: Bool
alphaToCoverageEnable :: Bool
sampleMask :: Vector ("createInfoCount" ::: Word32)
minSampleShading :: Float
sampleShadingEnable :: Bool
rasterizationSamples :: SampleCountFlagBits
flags :: PipelineMultisampleStateCreateFlags
next :: Chain es
$sel:alphaToOneEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:alphaToCoverageEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:sampleMask:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> Vector ("createInfoCount" ::: Word32)
$sel:minSampleShading:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Float
$sel:sampleShadingEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:rasterizationSamples:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> SampleCountFlagBits
$sel:flags:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> PipelineMultisampleStateCreateFlags
$sel:next:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineMultisampleStateCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineMultisampleStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineCoverageReductionStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineCoverageReductionStateCreateInfoNV) =>
Maybe (e :~: PipelineCoverageReductionStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCoverageReductionStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineCoverageModulationStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineCoverageModulationStateCreateInfoNV) =>
Maybe (e :~: PipelineCoverageModulationStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCoverageModulationStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineSampleLocationsStateCreateInfoEXT
Refl <- (Typeable e, Typeable PipelineSampleLocationsStateCreateInfoEXT) =>
Maybe (e :~: PipelineSampleLocationsStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineSampleLocationsStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineCoverageToColorStateCreateInfoNV
Refl <- (Typeable e, Typeable PipelineCoverageToColorStateCreateInfoNV) =>
Maybe (e :~: PipelineCoverageToColorStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCoverageToColorStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineMultisampleStateCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineMultisampleStateCreateInfo es, PokeChain es) => ToCStruct (PipelineMultisampleStateCreateInfo es) where
withCStruct :: PipelineMultisampleStateCreateInfo es
-> (Ptr (PipelineMultisampleStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineMultisampleStateCreateInfo es
x Ptr (PipelineMultisampleStateCreateInfo es) -> IO b
f = Int
-> (Ptr (PipelineMultisampleStateCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PipelineMultisampleStateCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineMultisampleStateCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineMultisampleStateCreateInfo es)
p -> Ptr (PipelineMultisampleStateCreateInfo es)
-> PipelineMultisampleStateCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineMultisampleStateCreateInfo es)
p PipelineMultisampleStateCreateInfo es
x (Ptr (PipelineMultisampleStateCreateInfo es) -> IO b
f Ptr (PipelineMultisampleStateCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineMultisampleStateCreateInfo es)
-> PipelineMultisampleStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineMultisampleStateCreateInfo es)
p PipelineMultisampleStateCreateInfo{Bool
Float
Vector ("createInfoCount" ::: Word32)
Chain es
SampleCountFlagBits
PipelineMultisampleStateCreateFlags
alphaToOneEnable :: Bool
alphaToCoverageEnable :: Bool
sampleMask :: Vector ("createInfoCount" ::: Word32)
minSampleShading :: Float
sampleShadingEnable :: Bool
rasterizationSamples :: SampleCountFlagBits
flags :: PipelineMultisampleStateCreateFlags
next :: Chain es
$sel:alphaToOneEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:alphaToCoverageEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:sampleMask:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> Vector ("createInfoCount" ::: Word32)
$sel:minSampleShading:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Float
$sel:sampleShadingEnable:PipelineMultisampleStateCreateInfo :: forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
$sel:rasterizationSamples:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> SampleCountFlagBits
$sel:flags:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> PipelineMultisampleStateCreateFlags
$sel:next:PipelineMultisampleStateCreateInfo :: forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineMultisampleStateCreateFlags
-> PipelineMultisampleStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr PipelineMultisampleStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineMultisampleStateCreateFlags)) (PipelineMultisampleStateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
rasterizationSamples)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
sampleShadingEnable))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minSampleShading))
Ptr ("createInfoCount" ::: Word32)
pSampleMask'' <- case Vector ("createInfoCount" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("createInfoCount" ::: Word32)
sampleMask) of
Int
0 -> Ptr ("createInfoCount" ::: Word32)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr ("createInfoCount" ::: Word32)
forall a. Ptr a
nullPtr
Int
vecLen -> do
let requiredLen :: "createInfoCount" ::: Word32
requiredLen = case (SampleCountFlagBits
rasterizationSamples) of
SampleCountFlagBits "createInfoCount" ::: Word32
n -> ("createInfoCount" ::: Word32
n ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> "createInfoCount" ::: Word32
forall a. Num a => a -> a -> a
+ "createInfoCount" ::: Word32
31) ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> "createInfoCount" ::: Word32
forall a. Integral a => a -> a -> a
`quot` "createInfoCount" ::: Word32
32
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ("createInfoCount" ::: Word32
requiredLen ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
vecLen) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"sampleMask must be either empty or contain enough bits to cover all the sample specified by 'rasterizationSamples'" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
do
Ptr ("createInfoCount" ::: Word32)
pPSampleMask' <- ((Ptr ("createInfoCount" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("createInfoCount" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32)))
-> ((Ptr ("createInfoCount" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr ("createInfoCount" ::: Word32) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @SampleMask ((Vector ("createInfoCount" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length ((Vector ("createInfoCount" ::: Word32)
sampleMask))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("createInfoCount" ::: Word32) -> IO ())
-> Vector ("createInfoCount" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "createInfoCount" ::: Word32
e -> Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("createInfoCount" ::: Word32)
pPSampleMask' Ptr ("createInfoCount" ::: Word32)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleMask) ("createInfoCount" ::: Word32
e)) ((Vector ("createInfoCount" ::: Word32)
sampleMask))
Ptr ("createInfoCount" ::: Word32)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Ptr ("createInfoCount" ::: Word32)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32)))
-> Ptr ("createInfoCount" ::: Word32)
-> ContT b IO (Ptr ("createInfoCount" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
pPSampleMask'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("createInfoCount" ::: Word32))
-> Ptr ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr (Ptr ("createInfoCount" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr SampleMask))) Ptr ("createInfoCount" ::: Word32)
pSampleMask''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
alphaToCoverageEnable))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
alphaToOneEnable))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineMultisampleStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineMultisampleStateCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineMultisampleStateCreateInfo es, PeekChain es) => FromCStruct (PipelineMultisampleStateCreateInfo es) where
peekCStruct :: Ptr (PipelineMultisampleStateCreateInfo es)
-> IO (PipelineMultisampleStateCreateInfo es)
peekCStruct Ptr (PipelineMultisampleStateCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineMultisampleStateCreateFlags
flags <- Ptr PipelineMultisampleStateCreateFlags
-> IO PipelineMultisampleStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineMultisampleStateCreateFlags ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr PipelineMultisampleStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineMultisampleStateCreateFlags))
SampleCountFlagBits
rasterizationSamples <- Ptr SampleCountFlagBits -> IO SampleCountFlagBits
forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlagBits ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SampleCountFlagBits))
Bool32
sampleShadingEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
CFloat
minSampleShading <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CFloat))
Ptr ("createInfoCount" ::: Word32)
pSampleMask <- Ptr (Ptr ("createInfoCount" ::: Word32))
-> IO (Ptr ("createInfoCount" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr SampleMask) ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es)
-> Int -> Ptr (Ptr ("createInfoCount" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr SampleMask)))
Vector ("createInfoCount" ::: Word32)
pSampleMask' <- if Ptr ("createInfoCount" ::: Word32)
pSampleMask Ptr ("createInfoCount" ::: Word32)
-> Ptr ("createInfoCount" ::: Word32) -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr ("createInfoCount" ::: Word32)
forall a. Ptr a
nullPtr
then Vector ("createInfoCount" ::: Word32)
-> IO (Vector ("createInfoCount" ::: Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Vector ("createInfoCount" ::: Word32)
forall a. Monoid a => a
mempty
else Int
-> (Int -> IO ("createInfoCount" ::: Word32))
-> IO (Vector ("createInfoCount" ::: Word32))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (case SampleCountFlagBits
rasterizationSamples of
SampleCountFlagBits "createInfoCount" ::: Word32
n -> (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
n Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
31) Int -> Int -> Int
forall a. Integral a => a -> a -> a
`quot` Int
32) (\Int
i -> Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @SampleMask (((Ptr ("createInfoCount" ::: Word32)
pSampleMask) Ptr ("createInfoCount" ::: Word32)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleMask)))
Bool32
alphaToCoverageEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32))
Bool32
alphaToOneEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineMultisampleStateCreateInfo es)
p Ptr (PipelineMultisampleStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Bool32))
PipelineMultisampleStateCreateInfo es
-> IO (PipelineMultisampleStateCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineMultisampleStateCreateInfo es
-> IO (PipelineMultisampleStateCreateInfo es))
-> PipelineMultisampleStateCreateInfo es
-> IO (PipelineMultisampleStateCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineMultisampleStateCreateFlags
-> SampleCountFlagBits
-> Bool
-> Float
-> Vector ("createInfoCount" ::: Word32)
-> Bool
-> Bool
-> PipelineMultisampleStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineMultisampleStateCreateFlags
-> SampleCountFlagBits
-> Bool
-> Float
-> Vector ("createInfoCount" ::: Word32)
-> Bool
-> Bool
-> PipelineMultisampleStateCreateInfo es
PipelineMultisampleStateCreateInfo
Chain es
next PipelineMultisampleStateCreateFlags
flags SampleCountFlagBits
rasterizationSamples (Bool32 -> Bool
bool32ToBool Bool32
sampleShadingEnable) (CFloat -> Float
coerce @CFloat @Float CFloat
minSampleShading) Vector ("createInfoCount" ::: Word32)
pSampleMask' (Bool32 -> Bool
bool32ToBool Bool32
alphaToCoverageEnable) (Bool32 -> Bool
bool32ToBool Bool32
alphaToOneEnable)
instance es ~ '[] => Zero (PipelineMultisampleStateCreateInfo es) where
zero :: PipelineMultisampleStateCreateInfo es
zero = Chain es
-> PipelineMultisampleStateCreateFlags
-> SampleCountFlagBits
-> Bool
-> Float
-> Vector ("createInfoCount" ::: Word32)
-> Bool
-> Bool
-> PipelineMultisampleStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineMultisampleStateCreateFlags
-> SampleCountFlagBits
-> Bool
-> Float
-> Vector ("createInfoCount" ::: Word32)
-> Bool
-> Bool
-> PipelineMultisampleStateCreateInfo es
PipelineMultisampleStateCreateInfo
()
PipelineMultisampleStateCreateFlags
forall a. Zero a => a
zero
SampleCountFlagBits
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Vector ("createInfoCount" ::: Word32)
forall a. Monoid a => a
mempty
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data PipelineColorBlendAttachmentState = PipelineColorBlendAttachmentState
{
PipelineColorBlendAttachmentState -> Bool
blendEnable :: Bool
,
PipelineColorBlendAttachmentState -> BlendFactor
srcColorBlendFactor :: BlendFactor
,
PipelineColorBlendAttachmentState -> BlendFactor
dstColorBlendFactor :: BlendFactor
,
PipelineColorBlendAttachmentState -> BlendOp
colorBlendOp :: BlendOp
,
PipelineColorBlendAttachmentState -> BlendFactor
srcAlphaBlendFactor :: BlendFactor
,
PipelineColorBlendAttachmentState -> BlendFactor
dstAlphaBlendFactor :: BlendFactor
,
PipelineColorBlendAttachmentState -> BlendOp
alphaBlendOp :: BlendOp
,
PipelineColorBlendAttachmentState -> ColorComponentFlags
colorWriteMask :: ColorComponentFlags
}
deriving (Typeable, PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool
(PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool)
-> (PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool)
-> Eq PipelineColorBlendAttachmentState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool
$c/= :: PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool
== :: PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool
$c== :: PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineColorBlendAttachmentState)
#endif
deriving instance Show PipelineColorBlendAttachmentState
instance ToCStruct PipelineColorBlendAttachmentState where
withCStruct :: PipelineColorBlendAttachmentState
-> (Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b
withCStruct PipelineColorBlendAttachmentState
x Ptr PipelineColorBlendAttachmentState -> IO b
f = Int -> (Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b)
-> (Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineColorBlendAttachmentState
p -> Ptr PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineColorBlendAttachmentState
p PipelineColorBlendAttachmentState
x (Ptr PipelineColorBlendAttachmentState -> IO b
f Ptr PipelineColorBlendAttachmentState
p)
pokeCStruct :: Ptr PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> IO b -> IO b
pokeCStruct Ptr PipelineColorBlendAttachmentState
p PipelineColorBlendAttachmentState{Bool
ColorComponentFlags
BlendOp
BlendFactor
colorWriteMask :: ColorComponentFlags
alphaBlendOp :: BlendOp
dstAlphaBlendFactor :: BlendFactor
srcAlphaBlendFactor :: BlendFactor
colorBlendOp :: BlendOp
dstColorBlendFactor :: BlendFactor
srcColorBlendFactor :: BlendFactor
blendEnable :: Bool
$sel:colorWriteMask:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> ColorComponentFlags
$sel:alphaBlendOp:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> BlendOp
$sel:dstAlphaBlendFactor:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> BlendFactor
$sel:srcAlphaBlendFactor:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> BlendFactor
$sel:colorBlendOp:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> BlendOp
$sel:dstColorBlendFactor:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> BlendFactor
$sel:srcColorBlendFactor:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> BlendFactor
$sel:blendEnable:PipelineColorBlendAttachmentState :: PipelineColorBlendAttachmentState -> Bool
..} IO b
f = do
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
blendEnable))
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr BlendFactor)) (BlendFactor
srcColorBlendFactor)
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr BlendFactor)) (BlendFactor
dstColorBlendFactor)
Ptr BlendOp -> BlendOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr BlendOp)) (BlendOp
colorBlendOp)
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BlendFactor)) (BlendFactor
srcAlphaBlendFactor)
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BlendFactor)) (BlendFactor
dstAlphaBlendFactor)
Ptr BlendOp -> BlendOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr BlendOp)) (BlendOp
alphaBlendOp)
Ptr ColorComponentFlags -> ColorComponentFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState
-> Int -> Ptr ColorComponentFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ColorComponentFlags)) (ColorComponentFlags
colorWriteMask)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr PipelineColorBlendAttachmentState -> IO b -> IO b
pokeZeroCStruct Ptr PipelineColorBlendAttachmentState
p IO b
f = do
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr BlendFactor)) (BlendFactor
forall a. Zero a => a
zero)
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr BlendFactor)) (BlendFactor
forall a. Zero a => a
zero)
Ptr BlendOp -> BlendOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr BlendOp)) (BlendOp
forall a. Zero a => a
zero)
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BlendFactor)) (BlendFactor
forall a. Zero a => a
zero)
Ptr BlendFactor -> BlendFactor -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BlendFactor)) (BlendFactor
forall a. Zero a => a
zero)
Ptr BlendOp -> BlendOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr BlendOp)) (BlendOp
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PipelineColorBlendAttachmentState where
peekCStruct :: Ptr PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState
peekCStruct Ptr PipelineColorBlendAttachmentState
p = do
Bool32
blendEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Bool32))
BlendFactor
srcColorBlendFactor <- Ptr BlendFactor -> IO BlendFactor
forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr BlendFactor))
BlendFactor
dstColorBlendFactor <- Ptr BlendFactor -> IO BlendFactor
forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr BlendFactor))
BlendOp
colorBlendOp <- Ptr BlendOp -> IO BlendOp
forall a. Storable a => Ptr a -> IO a
peek @BlendOp ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr BlendOp))
BlendFactor
srcAlphaBlendFactor <- Ptr BlendFactor -> IO BlendFactor
forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BlendFactor))
BlendFactor
dstAlphaBlendFactor <- Ptr BlendFactor -> IO BlendFactor
forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendFactor
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BlendFactor))
BlendOp
alphaBlendOp <- Ptr BlendOp -> IO BlendOp
forall a. Storable a => Ptr a -> IO a
peek @BlendOp ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState -> Int -> Ptr BlendOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr BlendOp))
ColorComponentFlags
colorWriteMask <- Ptr ColorComponentFlags -> IO ColorComponentFlags
forall a. Storable a => Ptr a -> IO a
peek @ColorComponentFlags ((Ptr PipelineColorBlendAttachmentState
p Ptr PipelineColorBlendAttachmentState
-> Int -> Ptr ColorComponentFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ColorComponentFlags))
PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState)
-> PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState
forall a b. (a -> b) -> a -> b
$ Bool
-> BlendFactor
-> BlendFactor
-> BlendOp
-> BlendFactor
-> BlendFactor
-> BlendOp
-> ColorComponentFlags
-> PipelineColorBlendAttachmentState
PipelineColorBlendAttachmentState
(Bool32 -> Bool
bool32ToBool Bool32
blendEnable) BlendFactor
srcColorBlendFactor BlendFactor
dstColorBlendFactor BlendOp
colorBlendOp BlendFactor
srcAlphaBlendFactor BlendFactor
dstAlphaBlendFactor BlendOp
alphaBlendOp ColorComponentFlags
colorWriteMask
instance Storable PipelineColorBlendAttachmentState where
sizeOf :: PipelineColorBlendAttachmentState -> Int
sizeOf ~PipelineColorBlendAttachmentState
_ = Int
32
alignment :: PipelineColorBlendAttachmentState -> Int
alignment ~PipelineColorBlendAttachmentState
_ = Int
4
peek :: Ptr PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState
peek = Ptr PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> IO ()
poke Ptr PipelineColorBlendAttachmentState
ptr PipelineColorBlendAttachmentState
poked = Ptr PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineColorBlendAttachmentState
ptr PipelineColorBlendAttachmentState
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineColorBlendAttachmentState where
zero :: PipelineColorBlendAttachmentState
zero = Bool
-> BlendFactor
-> BlendFactor
-> BlendOp
-> BlendFactor
-> BlendFactor
-> BlendOp
-> ColorComponentFlags
-> PipelineColorBlendAttachmentState
PipelineColorBlendAttachmentState
Bool
forall a. Zero a => a
zero
BlendFactor
forall a. Zero a => a
zero
BlendFactor
forall a. Zero a => a
zero
BlendOp
forall a. Zero a => a
zero
BlendFactor
forall a. Zero a => a
zero
BlendFactor
forall a. Zero a => a
zero
BlendOp
forall a. Zero a => a
zero
ColorComponentFlags
forall a. Zero a => a
zero
data PipelineColorBlendStateCreateInfo (es :: [Type]) = PipelineColorBlendStateCreateInfo
{
PipelineColorBlendStateCreateInfo es -> Chain es
next :: Chain es
,
PipelineColorBlendStateCreateInfo es
-> PipelineColorBlendStateCreateFlags
flags :: PipelineColorBlendStateCreateFlags
,
PipelineColorBlendStateCreateInfo es -> Bool
logicOpEnable :: Bool
,
PipelineColorBlendStateCreateInfo es -> LogicOp
logicOp :: LogicOp
,
PipelineColorBlendStateCreateInfo es
-> Vector PipelineColorBlendAttachmentState
attachments :: Vector PipelineColorBlendAttachmentState
,
PipelineColorBlendStateCreateInfo es
-> (Float, Float, Float, Float)
blendConstants :: (Float, Float, Float, Float)
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineColorBlendStateCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PipelineColorBlendStateCreateInfo es)
instance Extensible PipelineColorBlendStateCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PipelineColorBlendStateCreateInfo"
setNext :: PipelineColorBlendStateCreateInfo ds
-> Chain es -> PipelineColorBlendStateCreateInfo es
setNext PipelineColorBlendStateCreateInfo{Bool
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
Chain ds
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
logicOp :: LogicOp
logicOpEnable :: Bool
flags :: PipelineColorBlendStateCreateFlags
next :: Chain ds
$sel:blendConstants:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> (Float, Float, Float, Float)
$sel:attachments:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> Vector PipelineColorBlendAttachmentState
$sel:logicOp:PipelineColorBlendStateCreateInfo :: forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> LogicOp
$sel:logicOpEnable:PipelineColorBlendStateCreateInfo :: forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> Bool
$sel:flags:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> PipelineColorBlendStateCreateFlags
$sel:next:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es -> Chain es
..} Chain es
next' = PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
PipelineColorBlendStateCreateInfo{$sel:next:PipelineColorBlendStateCreateInfo :: Chain es
next = Chain es
next', Bool
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
logicOp :: LogicOp
logicOpEnable :: Bool
flags :: PipelineColorBlendStateCreateFlags
$sel:blendConstants:PipelineColorBlendStateCreateInfo :: (Float, Float, Float, Float)
$sel:attachments:PipelineColorBlendStateCreateInfo :: Vector PipelineColorBlendAttachmentState
$sel:logicOp:PipelineColorBlendStateCreateInfo :: LogicOp
$sel:logicOpEnable:PipelineColorBlendStateCreateInfo :: Bool
$sel:flags:PipelineColorBlendStateCreateInfo :: PipelineColorBlendStateCreateFlags
..}
getNext :: PipelineColorBlendStateCreateInfo es -> Chain es
getNext PipelineColorBlendStateCreateInfo{Bool
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
Chain es
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
logicOp :: LogicOp
logicOpEnable :: Bool
flags :: PipelineColorBlendStateCreateFlags
next :: Chain es
$sel:blendConstants:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> (Float, Float, Float, Float)
$sel:attachments:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> Vector PipelineColorBlendAttachmentState
$sel:logicOp:PipelineColorBlendStateCreateInfo :: forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> LogicOp
$sel:logicOpEnable:PipelineColorBlendStateCreateInfo :: forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> Bool
$sel:flags:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> PipelineColorBlendStateCreateFlags
$sel:next:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PipelineColorBlendStateCreateInfo e => b) -> Maybe b
extends :: proxy e
-> (Extends PipelineColorBlendStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineColorBlendStateCreateInfo e => b
f
| Just e :~: PipelineColorWriteCreateInfoEXT
Refl <- (Typeable e, Typeable PipelineColorWriteCreateInfoEXT) =>
Maybe (e :~: PipelineColorWriteCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineColorWriteCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineColorBlendStateCreateInfo e => b
f
| Just e :~: PipelineColorBlendAdvancedStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineColorBlendAdvancedStateCreateInfoEXT) =>
Maybe (e :~: PipelineColorBlendAdvancedStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineColorBlendAdvancedStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PipelineColorBlendStateCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss PipelineColorBlendStateCreateInfo es, PokeChain es) => ToCStruct (PipelineColorBlendStateCreateInfo es) where
withCStruct :: PipelineColorBlendStateCreateInfo es
-> (Ptr (PipelineColorBlendStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineColorBlendStateCreateInfo es
x Ptr (PipelineColorBlendStateCreateInfo es) -> IO b
f = Int -> (Ptr (PipelineColorBlendStateCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr (PipelineColorBlendStateCreateInfo es) -> IO b) -> IO b)
-> (Ptr (PipelineColorBlendStateCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineColorBlendStateCreateInfo es)
p -> Ptr (PipelineColorBlendStateCreateInfo es)
-> PipelineColorBlendStateCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PipelineColorBlendStateCreateInfo es)
p PipelineColorBlendStateCreateInfo es
x (Ptr (PipelineColorBlendStateCreateInfo es) -> IO b
f Ptr (PipelineColorBlendStateCreateInfo es)
p)
pokeCStruct :: Ptr (PipelineColorBlendStateCreateInfo es)
-> PipelineColorBlendStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineColorBlendStateCreateInfo es)
p PipelineColorBlendStateCreateInfo{Bool
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
Chain es
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
logicOp :: LogicOp
logicOpEnable :: Bool
flags :: PipelineColorBlendStateCreateFlags
next :: Chain es
$sel:blendConstants:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> (Float, Float, Float, Float)
$sel:attachments:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> Vector PipelineColorBlendAttachmentState
$sel:logicOp:PipelineColorBlendStateCreateInfo :: forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> LogicOp
$sel:logicOpEnable:PipelineColorBlendStateCreateInfo :: forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> Bool
$sel:flags:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> PipelineColorBlendStateCreateFlags
$sel:next:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineColorBlendStateCreateFlags
-> PipelineColorBlendStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr PipelineColorBlendStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineColorBlendStateCreateFlags)) (PipelineColorBlendStateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
logicOpEnable))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr LogicOp -> LogicOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr LogicOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr LogicOp)) (LogicOp
logicOp)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector PipelineColorBlendAttachmentState -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector PipelineColorBlendAttachmentState -> Int)
-> Vector PipelineColorBlendAttachmentState -> Int
forall a b. (a -> b) -> a -> b
$ (Vector PipelineColorBlendAttachmentState
attachments)) :: Word32))
Ptr PipelineColorBlendAttachmentState
pPAttachments' <- ((Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineColorBlendAttachmentState)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineColorBlendAttachmentState))
-> ((Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineColorBlendAttachmentState)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @PipelineColorBlendAttachmentState ((Vector PipelineColorBlendAttachmentState -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector PipelineColorBlendAttachmentState
attachments)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
32)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> PipelineColorBlendAttachmentState -> IO ())
-> Vector PipelineColorBlendAttachmentState -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i PipelineColorBlendAttachmentState
e -> Ptr PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr PipelineColorBlendAttachmentState
pPAttachments' Ptr PipelineColorBlendAttachmentState
-> Int -> Ptr PipelineColorBlendAttachmentState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineColorBlendAttachmentState) (PipelineColorBlendAttachmentState
e)) (Vector PipelineColorBlendAttachmentState
attachments)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr PipelineColorBlendAttachmentState)
-> Ptr PipelineColorBlendAttachmentState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr (Ptr PipelineColorBlendAttachmentState)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineColorBlendAttachmentState))) (Ptr PipelineColorBlendAttachmentState
pPAttachments')
let pBlendConstants' :: Ptr CFloat
pBlendConstants' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (FixedArray 4 CFloat)))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ case ((Float, Float, Float, Float)
blendConstants) of
(Float
e0, Float
e1, Float
e2, Float
e3) -> do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (PipelineColorBlendStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineColorBlendStateCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr LogicOp -> LogicOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr LogicOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr LogicOp)) (LogicOp
forall a. Zero a => a
zero)
let pBlendConstants' :: Ptr CFloat
pBlendConstants' = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (FixedArray 4 CFloat)))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ case ((Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)) of
(Float
e0, Float
e1, Float
e2, Float
e3) -> do
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' Ptr CFloat -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss PipelineColorBlendStateCreateInfo es, PeekChain es) => FromCStruct (PipelineColorBlendStateCreateInfo es) where
peekCStruct :: Ptr (PipelineColorBlendStateCreateInfo es)
-> IO (PipelineColorBlendStateCreateInfo es)
peekCStruct Ptr (PipelineColorBlendStateCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineColorBlendStateCreateFlags
flags <- Ptr PipelineColorBlendStateCreateFlags
-> IO PipelineColorBlendStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineColorBlendStateCreateFlags ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr PipelineColorBlendStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineColorBlendStateCreateFlags))
Bool32
logicOpEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
LogicOp
logicOp <- Ptr LogicOp -> IO LogicOp
forall a. Storable a => Ptr a -> IO a
peek @LogicOp ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es) -> Int -> Ptr LogicOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr LogicOp))
"createInfoCount" ::: Word32
attachmentCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
Ptr PipelineColorBlendAttachmentState
pAttachments <- Ptr (Ptr PipelineColorBlendAttachmentState)
-> IO (Ptr PipelineColorBlendAttachmentState)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineColorBlendAttachmentState) ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr (Ptr PipelineColorBlendAttachmentState)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineColorBlendAttachmentState)))
Vector PipelineColorBlendAttachmentState
pAttachments' <- Int
-> (Int -> IO PipelineColorBlendAttachmentState)
-> IO (Vector PipelineColorBlendAttachmentState)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
attachmentCount) (\Int
i -> Ptr PipelineColorBlendAttachmentState
-> IO PipelineColorBlendAttachmentState
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineColorBlendAttachmentState ((Ptr PipelineColorBlendAttachmentState
pAttachments Ptr PipelineColorBlendAttachmentState
-> Int -> Ptr PipelineColorBlendAttachmentState
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineColorBlendAttachmentState)))
let pblendConstants :: Ptr CFloat
pblendConstants = Ptr (FixedArray 4 CFloat) -> Ptr CFloat
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @CFloat ((Ptr (PipelineColorBlendStateCreateInfo es)
p Ptr (PipelineColorBlendStateCreateInfo es)
-> Int -> Ptr (FixedArray 4 CFloat)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (FixedArray 4 CFloat)))
CFloat
blendConstants0 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
0 :: Ptr CFloat))
CFloat
blendConstants1 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
4 :: Ptr CFloat))
CFloat
blendConstants2 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
8 :: Ptr CFloat))
CFloat
blendConstants3 <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants Ptr CFloat -> Int -> Ptr CFloat
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
12 :: Ptr CFloat))
PipelineColorBlendStateCreateInfo es
-> IO (PipelineColorBlendStateCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineColorBlendStateCreateInfo es
-> IO (PipelineColorBlendStateCreateInfo es))
-> PipelineColorBlendStateCreateInfo es
-> IO (PipelineColorBlendStateCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
PipelineColorBlendStateCreateInfo
Chain es
next PipelineColorBlendStateCreateFlags
flags (Bool32 -> Bool
bool32ToBool Bool32
logicOpEnable) LogicOp
logicOp Vector PipelineColorBlendAttachmentState
pAttachments' (((CFloat -> Float
coerce @CFloat @Float CFloat
blendConstants0), (CFloat -> Float
coerce @CFloat @Float CFloat
blendConstants1), (CFloat -> Float
coerce @CFloat @Float CFloat
blendConstants2), (CFloat -> Float
coerce @CFloat @Float CFloat
blendConstants3)))
instance es ~ '[] => Zero (PipelineColorBlendStateCreateInfo es) where
zero :: PipelineColorBlendStateCreateInfo es
zero = Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
PipelineColorBlendStateCreateInfo
()
PipelineColorBlendStateCreateFlags
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
LogicOp
forall a. Zero a => a
zero
Vector PipelineColorBlendAttachmentState
forall a. Monoid a => a
mempty
(Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero, Float
forall a. Zero a => a
zero)
data PipelineDynamicStateCreateInfo = PipelineDynamicStateCreateInfo
{
PipelineDynamicStateCreateInfo -> PipelineDynamicStateCreateFlags
flags :: PipelineDynamicStateCreateFlags
,
PipelineDynamicStateCreateInfo -> Vector DynamicState
dynamicStates :: Vector DynamicState
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineDynamicStateCreateInfo)
#endif
deriving instance Show PipelineDynamicStateCreateInfo
instance ToCStruct PipelineDynamicStateCreateInfo where
withCStruct :: PipelineDynamicStateCreateInfo
-> (Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b
withCStruct PipelineDynamicStateCreateInfo
x Ptr PipelineDynamicStateCreateInfo -> IO b
f = Int -> (Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b)
-> (Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineDynamicStateCreateInfo
p -> Ptr PipelineDynamicStateCreateInfo
-> PipelineDynamicStateCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineDynamicStateCreateInfo
p PipelineDynamicStateCreateInfo
x (Ptr PipelineDynamicStateCreateInfo -> IO b
f Ptr PipelineDynamicStateCreateInfo
p)
pokeCStruct :: Ptr PipelineDynamicStateCreateInfo
-> PipelineDynamicStateCreateInfo -> IO b -> IO b
pokeCStruct Ptr PipelineDynamicStateCreateInfo
p PipelineDynamicStateCreateInfo{Vector DynamicState
PipelineDynamicStateCreateFlags
dynamicStates :: Vector DynamicState
flags :: PipelineDynamicStateCreateFlags
$sel:dynamicStates:PipelineDynamicStateCreateInfo :: PipelineDynamicStateCreateInfo -> Vector DynamicState
$sel:flags:PipelineDynamicStateCreateInfo :: PipelineDynamicStateCreateInfo -> PipelineDynamicStateCreateFlags
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineDynamicStateCreateFlags
-> PipelineDynamicStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo
-> Int -> Ptr PipelineDynamicStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDynamicStateCreateFlags)) (PipelineDynamicStateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector DynamicState -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DynamicState -> Int) -> Vector DynamicState -> Int
forall a b. (a -> b) -> a -> b
$ (Vector DynamicState
dynamicStates)) :: Word32))
Ptr DynamicState
pPDynamicStates' <- ((Ptr DynamicState -> IO b) -> IO b)
-> ContT b IO (Ptr DynamicState)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DynamicState -> IO b) -> IO b)
-> ContT b IO (Ptr DynamicState))
-> ((Ptr DynamicState -> IO b) -> IO b)
-> ContT b IO (Ptr DynamicState)
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr DynamicState -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DynamicState ((Vector DynamicState -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DynamicState
dynamicStates)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> DynamicState -> IO ()) -> Vector DynamicState -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i DynamicState
e -> Ptr DynamicState -> DynamicState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DynamicState
pPDynamicStates' Ptr DynamicState -> Int -> Ptr DynamicState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DynamicState) (DynamicState
e)) (Vector DynamicState
dynamicStates)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr DynamicState) -> Ptr DynamicState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo -> Int -> Ptr (Ptr DynamicState)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr DynamicState))) (Ptr DynamicState
pPDynamicStates')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr PipelineDynamicStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineDynamicStateCreateInfo
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct PipelineDynamicStateCreateInfo where
peekCStruct :: Ptr PipelineDynamicStateCreateInfo
-> IO PipelineDynamicStateCreateInfo
peekCStruct Ptr PipelineDynamicStateCreateInfo
p = do
PipelineDynamicStateCreateFlags
flags <- Ptr PipelineDynamicStateCreateFlags
-> IO PipelineDynamicStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineDynamicStateCreateFlags ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo
-> Int -> Ptr PipelineDynamicStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDynamicStateCreateFlags))
"createInfoCount" ::: Word32
dynamicStateCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr DynamicState
pDynamicStates <- Ptr (Ptr DynamicState) -> IO (Ptr DynamicState)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr DynamicState) ((Ptr PipelineDynamicStateCreateInfo
p Ptr PipelineDynamicStateCreateInfo -> Int -> Ptr (Ptr DynamicState)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr DynamicState)))
Vector DynamicState
pDynamicStates' <- Int -> (Int -> IO DynamicState) -> IO (Vector DynamicState)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
dynamicStateCount) (\Int
i -> Ptr DynamicState -> IO DynamicState
forall a. Storable a => Ptr a -> IO a
peek @DynamicState ((Ptr DynamicState
pDynamicStates Ptr DynamicState -> Int -> Ptr DynamicState
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DynamicState)))
PipelineDynamicStateCreateInfo -> IO PipelineDynamicStateCreateInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineDynamicStateCreateInfo
-> IO PipelineDynamicStateCreateInfo)
-> PipelineDynamicStateCreateInfo
-> IO PipelineDynamicStateCreateInfo
forall a b. (a -> b) -> a -> b
$ PipelineDynamicStateCreateFlags
-> Vector DynamicState -> PipelineDynamicStateCreateInfo
PipelineDynamicStateCreateInfo
PipelineDynamicStateCreateFlags
flags Vector DynamicState
pDynamicStates'
instance Zero PipelineDynamicStateCreateInfo where
zero :: PipelineDynamicStateCreateInfo
zero = PipelineDynamicStateCreateFlags
-> Vector DynamicState -> PipelineDynamicStateCreateInfo
PipelineDynamicStateCreateInfo
PipelineDynamicStateCreateFlags
forall a. Zero a => a
zero
Vector DynamicState
forall a. Monoid a => a
mempty
data StencilOpState = StencilOpState
{
StencilOpState -> StencilOp
failOp :: StencilOp
,
StencilOpState -> StencilOp
passOp :: StencilOp
,
StencilOpState -> StencilOp
depthFailOp :: StencilOp
,
StencilOpState -> CompareOp
compareOp :: CompareOp
,
StencilOpState -> "createInfoCount" ::: Word32
compareMask :: Word32
,
StencilOpState -> "createInfoCount" ::: Word32
writeMask :: Word32
,
StencilOpState -> "createInfoCount" ::: Word32
reference :: Word32
}
deriving (Typeable, StencilOpState -> StencilOpState -> Bool
(StencilOpState -> StencilOpState -> Bool)
-> (StencilOpState -> StencilOpState -> Bool) -> Eq StencilOpState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StencilOpState -> StencilOpState -> Bool
$c/= :: StencilOpState -> StencilOpState -> Bool
== :: StencilOpState -> StencilOpState -> Bool
$c== :: StencilOpState -> StencilOpState -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (StencilOpState)
#endif
deriving instance Show StencilOpState
instance ToCStruct StencilOpState where
withCStruct :: StencilOpState -> (Ptr StencilOpState -> IO b) -> IO b
withCStruct StencilOpState
x Ptr StencilOpState -> IO b
f = Int -> (Ptr StencilOpState -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
28 ((Ptr StencilOpState -> IO b) -> IO b)
-> (Ptr StencilOpState -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr StencilOpState
p -> Ptr StencilOpState -> StencilOpState -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr StencilOpState
p StencilOpState
x (Ptr StencilOpState -> IO b
f Ptr StencilOpState
p)
pokeCStruct :: Ptr StencilOpState -> StencilOpState -> IO b -> IO b
pokeCStruct Ptr StencilOpState
p StencilOpState{"createInfoCount" ::: Word32
CompareOp
StencilOp
reference :: "createInfoCount" ::: Word32
writeMask :: "createInfoCount" ::: Word32
compareMask :: "createInfoCount" ::: Word32
compareOp :: CompareOp
depthFailOp :: StencilOp
passOp :: StencilOp
failOp :: StencilOp
$sel:reference:StencilOpState :: StencilOpState -> "createInfoCount" ::: Word32
$sel:writeMask:StencilOpState :: StencilOpState -> "createInfoCount" ::: Word32
$sel:compareMask:StencilOpState :: StencilOpState -> "createInfoCount" ::: Word32
$sel:compareOp:StencilOpState :: StencilOpState -> CompareOp
$sel:depthFailOp:StencilOpState :: StencilOpState -> StencilOp
$sel:passOp:StencilOpState :: StencilOpState -> StencilOp
$sel:failOp:StencilOpState :: StencilOpState -> StencilOp
..} IO b
f = do
Ptr StencilOp -> StencilOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StencilOp)) (StencilOp
failOp)
Ptr StencilOp -> StencilOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr StencilOp)) (StencilOp
passOp)
Ptr StencilOp -> StencilOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr StencilOp)) (StencilOp
depthFailOp)
Ptr CompareOp -> CompareOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr CompareOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CompareOp)) (CompareOp
compareOp)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("createInfoCount" ::: Word32
compareMask)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
writeMask)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("createInfoCount" ::: Word32
reference)
IO b
f
cStructSize :: Int
cStructSize = Int
28
cStructAlignment :: Int
cStructAlignment = Int
4
pokeZeroCStruct :: Ptr StencilOpState -> IO b -> IO b
pokeZeroCStruct Ptr StencilOpState
p IO b
f = do
Ptr StencilOp -> StencilOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StencilOp)) (StencilOp
forall a. Zero a => a
zero)
Ptr StencilOp -> StencilOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr StencilOp)) (StencilOp
forall a. Zero a => a
zero)
Ptr StencilOp -> StencilOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr StencilOp)) (StencilOp
forall a. Zero a => a
zero)
Ptr CompareOp -> CompareOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr CompareOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CompareOp)) (CompareOp
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct StencilOpState where
peekCStruct :: Ptr StencilOpState -> IO StencilOpState
peekCStruct Ptr StencilOpState
p = do
StencilOp
failOp <- Ptr StencilOp -> IO StencilOp
forall a. Storable a => Ptr a -> IO a
peek @StencilOp ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StencilOp))
StencilOp
passOp <- Ptr StencilOp -> IO StencilOp
forall a. Storable a => Ptr a -> IO a
peek @StencilOp ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr StencilOp))
StencilOp
depthFailOp <- Ptr StencilOp -> IO StencilOp
forall a. Storable a => Ptr a -> IO a
peek @StencilOp ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr StencilOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr StencilOp))
CompareOp
compareOp <- Ptr CompareOp -> IO CompareOp
forall a. Storable a => Ptr a -> IO a
peek @CompareOp ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr CompareOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CompareOp))
"createInfoCount" ::: Word32
compareMask <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
"createInfoCount" ::: Word32
writeMask <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
"createInfoCount" ::: Word32
reference <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr StencilOpState
p Ptr StencilOpState -> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
StencilOpState -> IO StencilOpState
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StencilOpState -> IO StencilOpState)
-> StencilOpState -> IO StencilOpState
forall a b. (a -> b) -> a -> b
$ StencilOp
-> StencilOp
-> StencilOp
-> CompareOp
-> ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> StencilOpState
StencilOpState
StencilOp
failOp StencilOp
passOp StencilOp
depthFailOp CompareOp
compareOp "createInfoCount" ::: Word32
compareMask "createInfoCount" ::: Word32
writeMask "createInfoCount" ::: Word32
reference
instance Storable StencilOpState where
sizeOf :: StencilOpState -> Int
sizeOf ~StencilOpState
_ = Int
28
alignment :: StencilOpState -> Int
alignment ~StencilOpState
_ = Int
4
peek :: Ptr StencilOpState -> IO StencilOpState
peek = Ptr StencilOpState -> IO StencilOpState
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr StencilOpState -> StencilOpState -> IO ()
poke Ptr StencilOpState
ptr StencilOpState
poked = Ptr StencilOpState -> StencilOpState -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr StencilOpState
ptr StencilOpState
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero StencilOpState where
zero :: StencilOpState
zero = StencilOp
-> StencilOp
-> StencilOp
-> CompareOp
-> ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> StencilOpState
StencilOpState
StencilOp
forall a. Zero a => a
zero
StencilOp
forall a. Zero a => a
zero
StencilOp
forall a. Zero a => a
zero
CompareOp
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
data PipelineDepthStencilStateCreateInfo = PipelineDepthStencilStateCreateInfo
{
PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateFlags
flags :: PipelineDepthStencilStateCreateFlags
,
PipelineDepthStencilStateCreateInfo -> Bool
depthTestEnable :: Bool
,
PipelineDepthStencilStateCreateInfo -> Bool
depthWriteEnable :: Bool
,
PipelineDepthStencilStateCreateInfo -> CompareOp
depthCompareOp :: CompareOp
,
PipelineDepthStencilStateCreateInfo -> Bool
depthBoundsTestEnable :: Bool
,
PipelineDepthStencilStateCreateInfo -> Bool
stencilTestEnable :: Bool
,
PipelineDepthStencilStateCreateInfo -> StencilOpState
front :: StencilOpState
,
PipelineDepthStencilStateCreateInfo -> StencilOpState
back :: StencilOpState
,
PipelineDepthStencilStateCreateInfo -> Float
minDepthBounds :: Float
,
PipelineDepthStencilStateCreateInfo -> Float
maxDepthBounds :: Float
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineDepthStencilStateCreateInfo)
#endif
deriving instance Show PipelineDepthStencilStateCreateInfo
instance ToCStruct PipelineDepthStencilStateCreateInfo where
withCStruct :: PipelineDepthStencilStateCreateInfo
-> (Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b
withCStruct PipelineDepthStencilStateCreateInfo
x Ptr PipelineDepthStencilStateCreateInfo -> IO b
f = Int -> (Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
104 ((Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b)
-> (Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineDepthStencilStateCreateInfo
p -> Ptr PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineDepthStencilStateCreateInfo
p PipelineDepthStencilStateCreateInfo
x (Ptr PipelineDepthStencilStateCreateInfo -> IO b
f Ptr PipelineDepthStencilStateCreateInfo
p)
pokeCStruct :: Ptr PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateInfo -> IO b -> IO b
pokeCStruct Ptr PipelineDepthStencilStateCreateInfo
p PipelineDepthStencilStateCreateInfo{Bool
Float
CompareOp
StencilOpState
PipelineDepthStencilStateCreateFlags
maxDepthBounds :: Float
minDepthBounds :: Float
back :: StencilOpState
front :: StencilOpState
stencilTestEnable :: Bool
depthBoundsTestEnable :: Bool
depthCompareOp :: CompareOp
depthWriteEnable :: Bool
depthTestEnable :: Bool
flags :: PipelineDepthStencilStateCreateFlags
$sel:maxDepthBounds:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> Float
$sel:minDepthBounds:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> Float
$sel:back:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> StencilOpState
$sel:front:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> StencilOpState
$sel:stencilTestEnable:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> Bool
$sel:depthBoundsTestEnable:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> Bool
$sel:depthCompareOp:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> CompareOp
$sel:depthWriteEnable:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> Bool
$sel:depthTestEnable:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo -> Bool
$sel:flags:PipelineDepthStencilStateCreateInfo :: PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateFlags
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineDepthStencilStateCreateFlags
-> PipelineDepthStencilStateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr PipelineDepthStencilStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDepthStencilStateCreateFlags)) (PipelineDepthStencilStateCreateFlags
flags)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthTestEnable))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthWriteEnable))
Ptr CompareOp -> CompareOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CompareOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CompareOp)) (CompareOp
depthCompareOp)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthBoundsTestEnable))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
stencilTestEnable))
Ptr StencilOpState -> StencilOpState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr StencilOpState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr StencilOpState)) (StencilOpState
front)
Ptr StencilOpState -> StencilOpState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr StencilOpState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr StencilOpState)) (StencilOpState
back)
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minDepthBounds))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
maxDepthBounds))
IO b
f
cStructSize :: Int
cStructSize = Int
104
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr PipelineDepthStencilStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineDepthStencilStateCreateInfo
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr CompareOp -> CompareOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CompareOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CompareOp)) (CompareOp
forall a. Zero a => a
zero)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr StencilOpState -> StencilOpState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr StencilOpState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr StencilOpState)) (StencilOpState
forall a. Zero a => a
zero)
Ptr StencilOpState -> StencilOpState -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr StencilOpState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr StencilOpState)) (StencilOpState
forall a. Zero a => a
zero)
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PipelineDepthStencilStateCreateInfo where
peekCStruct :: Ptr PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo
peekCStruct Ptr PipelineDepthStencilStateCreateInfo
p = do
PipelineDepthStencilStateCreateFlags
flags <- Ptr PipelineDepthStencilStateCreateFlags
-> IO PipelineDepthStencilStateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineDepthStencilStateCreateFlags ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr PipelineDepthStencilStateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDepthStencilStateCreateFlags))
Bool32
depthTestEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Bool32
depthWriteEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
CompareOp
depthCompareOp <- Ptr CompareOp -> IO CompareOp
forall a. Storable a => Ptr a -> IO a
peek @CompareOp ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CompareOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CompareOp))
Bool32
depthBoundsTestEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32))
Bool32
stencilTestEnable <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32))
StencilOpState
front <- Ptr StencilOpState -> IO StencilOpState
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @StencilOpState ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr StencilOpState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr StencilOpState))
StencilOpState
back <- Ptr StencilOpState -> IO StencilOpState
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @StencilOpState ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo
-> Int -> Ptr StencilOpState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr StencilOpState))
CFloat
minDepthBounds <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr CFloat))
CFloat
maxDepthBounds <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr PipelineDepthStencilStateCreateInfo
p Ptr PipelineDepthStencilStateCreateInfo -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr CFloat))
PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo)
-> PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo
forall a b. (a -> b) -> a -> b
$ PipelineDepthStencilStateCreateFlags
-> Bool
-> Bool
-> CompareOp
-> Bool
-> Bool
-> StencilOpState
-> StencilOpState
-> Float
-> Float
-> PipelineDepthStencilStateCreateInfo
PipelineDepthStencilStateCreateInfo
PipelineDepthStencilStateCreateFlags
flags (Bool32 -> Bool
bool32ToBool Bool32
depthTestEnable) (Bool32 -> Bool
bool32ToBool Bool32
depthWriteEnable) CompareOp
depthCompareOp (Bool32 -> Bool
bool32ToBool Bool32
depthBoundsTestEnable) (Bool32 -> Bool
bool32ToBool Bool32
stencilTestEnable) StencilOpState
front StencilOpState
back (CFloat -> Float
coerce @CFloat @Float CFloat
minDepthBounds) (CFloat -> Float
coerce @CFloat @Float CFloat
maxDepthBounds)
instance Storable PipelineDepthStencilStateCreateInfo where
sizeOf :: PipelineDepthStencilStateCreateInfo -> Int
sizeOf ~PipelineDepthStencilStateCreateInfo
_ = Int
104
alignment :: PipelineDepthStencilStateCreateInfo -> Int
alignment ~PipelineDepthStencilStateCreateInfo
_ = Int
8
peek :: Ptr PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo
peek = Ptr PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateInfo -> IO ()
poke Ptr PipelineDepthStencilStateCreateInfo
ptr PipelineDepthStencilStateCreateInfo
poked = Ptr PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineDepthStencilStateCreateInfo
ptr PipelineDepthStencilStateCreateInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineDepthStencilStateCreateInfo where
zero :: PipelineDepthStencilStateCreateInfo
zero = PipelineDepthStencilStateCreateFlags
-> Bool
-> Bool
-> CompareOp
-> Bool
-> Bool
-> StencilOpState
-> StencilOpState
-> Float
-> Float
-> PipelineDepthStencilStateCreateInfo
PipelineDepthStencilStateCreateInfo
PipelineDepthStencilStateCreateFlags
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
CompareOp
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
StencilOpState
forall a. Zero a => a
zero
StencilOpState
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
Float
forall a. Zero a => a
zero
data GraphicsPipelineCreateInfo (es :: [Type]) = GraphicsPipelineCreateInfo
{
GraphicsPipelineCreateInfo es -> Chain es
next :: Chain es
,
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
flags :: PipelineCreateFlags
,
GraphicsPipelineCreateInfo es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
,
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
,
GraphicsPipelineCreateInfo es
-> Maybe PipelineInputAssemblyStateCreateInfo
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
,
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
,
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
,
GraphicsPipelineCreateInfo es
-> SomeStruct PipelineRasterizationStateCreateInfo
rasterizationState :: SomeStruct PipelineRasterizationStateCreateInfo
,
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
multisampleState :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
,
GraphicsPipelineCreateInfo es
-> Maybe PipelineDepthStencilStateCreateInfo
depthStencilState :: Maybe PipelineDepthStencilStateCreateInfo
,
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
colorBlendState :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
,
GraphicsPipelineCreateInfo es
-> Maybe PipelineDynamicStateCreateInfo
dynamicState :: Maybe PipelineDynamicStateCreateInfo
,
GraphicsPipelineCreateInfo es -> PipelineLayout
layout :: PipelineLayout
,
GraphicsPipelineCreateInfo es -> RenderPass
renderPass :: RenderPass
,
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
subpass :: Word32
,
GraphicsPipelineCreateInfo es -> Pipeline
basePipelineHandle :: Pipeline
,
GraphicsPipelineCreateInfo es -> Int32
basePipelineIndex :: Int32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsPipelineCreateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (GraphicsPipelineCreateInfo es)
instance Extensible GraphicsPipelineCreateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"GraphicsPipelineCreateInfo"
setNext :: GraphicsPipelineCreateInfo ds
-> Chain es -> GraphicsPipelineCreateInfo es
setNext GraphicsPipelineCreateInfo{Int32
Maybe PipelineInputAssemblyStateCreateInfo
Maybe PipelineDynamicStateCreateInfo
Maybe PipelineDepthStencilStateCreateInfo
Maybe (SomeStruct PipelineViewportStateCreateInfo)
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain ds
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineRasterizationStateCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
subpass :: "createInfoCount" ::: Word32
renderPass :: RenderPass
layout :: PipelineLayout
dynamicState :: Maybe PipelineDynamicStateCreateInfo
colorBlendState :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
depthStencilState :: Maybe PipelineDepthStencilStateCreateInfo
multisampleState :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
rasterizationState :: SomeStruct PipelineRasterizationStateCreateInfo
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
next :: Chain ds
$sel:basePipelineIndex:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Int32
$sel:basePipelineHandle:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Pipeline
$sel:subpass:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
$sel:renderPass:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> RenderPass
$sel:layout:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> PipelineLayout
$sel:dynamicState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDynamicStateCreateInfo
$sel:colorBlendState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
$sel:depthStencilState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDepthStencilStateCreateInfo
$sel:multisampleState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
$sel:rasterizationState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> SomeStruct PipelineRasterizationStateCreateInfo
$sel:viewportState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
$sel:tessellationState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
$sel:inputAssemblyState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineInputAssemblyStateCreateInfo
$sel:vertexInputState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
$sel:stages:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
$sel:next:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
..} Chain es
next' = GraphicsPipelineCreateInfo :: forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> SomeStruct PipelineRasterizationStateCreateInfo
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
-> Maybe PipelineDepthStencilStateCreateInfo
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
-> Maybe PipelineDynamicStateCreateInfo
-> PipelineLayout
-> RenderPass
-> ("createInfoCount" ::: Word32)
-> Pipeline
-> Int32
-> GraphicsPipelineCreateInfo es
GraphicsPipelineCreateInfo{$sel:next:GraphicsPipelineCreateInfo :: Chain es
next = Chain es
next', Int32
Maybe PipelineInputAssemblyStateCreateInfo
Maybe PipelineDynamicStateCreateInfo
Maybe PipelineDepthStencilStateCreateInfo
Maybe (SomeStruct PipelineViewportStateCreateInfo)
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineRasterizationStateCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
subpass :: "createInfoCount" ::: Word32
renderPass :: RenderPass
layout :: PipelineLayout
dynamicState :: Maybe PipelineDynamicStateCreateInfo
colorBlendState :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
depthStencilState :: Maybe PipelineDepthStencilStateCreateInfo
multisampleState :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
rasterizationState :: SomeStruct PipelineRasterizationStateCreateInfo
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
$sel:basePipelineIndex:GraphicsPipelineCreateInfo :: Int32
$sel:basePipelineHandle:GraphicsPipelineCreateInfo :: Pipeline
$sel:subpass:GraphicsPipelineCreateInfo :: "createInfoCount" ::: Word32
$sel:renderPass:GraphicsPipelineCreateInfo :: RenderPass
$sel:layout:GraphicsPipelineCreateInfo :: PipelineLayout
$sel:dynamicState:GraphicsPipelineCreateInfo :: Maybe PipelineDynamicStateCreateInfo
$sel:colorBlendState:GraphicsPipelineCreateInfo :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
$sel:depthStencilState:GraphicsPipelineCreateInfo :: Maybe PipelineDepthStencilStateCreateInfo
$sel:multisampleState:GraphicsPipelineCreateInfo :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
$sel:rasterizationState:GraphicsPipelineCreateInfo :: SomeStruct PipelineRasterizationStateCreateInfo
$sel:viewportState:GraphicsPipelineCreateInfo :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
$sel:tessellationState:GraphicsPipelineCreateInfo :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
$sel:inputAssemblyState:GraphicsPipelineCreateInfo :: Maybe PipelineInputAssemblyStateCreateInfo
$sel:vertexInputState:GraphicsPipelineCreateInfo :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
$sel:stages:GraphicsPipelineCreateInfo :: Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:GraphicsPipelineCreateInfo :: PipelineCreateFlags
..}
getNext :: GraphicsPipelineCreateInfo es -> Chain es
getNext GraphicsPipelineCreateInfo{Int32
Maybe PipelineInputAssemblyStateCreateInfo
Maybe PipelineDynamicStateCreateInfo
Maybe PipelineDepthStencilStateCreateInfo
Maybe (SomeStruct PipelineViewportStateCreateInfo)
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain es
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineRasterizationStateCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
subpass :: "createInfoCount" ::: Word32
renderPass :: RenderPass
layout :: PipelineLayout
dynamicState :: Maybe PipelineDynamicStateCreateInfo
colorBlendState :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
depthStencilState :: Maybe PipelineDepthStencilStateCreateInfo
multisampleState :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
rasterizationState :: SomeStruct PipelineRasterizationStateCreateInfo
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
next :: Chain es
$sel:basePipelineIndex:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Int32
$sel:basePipelineHandle:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Pipeline
$sel:subpass:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
$sel:renderPass:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> RenderPass
$sel:layout:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> PipelineLayout
$sel:dynamicState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDynamicStateCreateInfo
$sel:colorBlendState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
$sel:depthStencilState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDepthStencilStateCreateInfo
$sel:multisampleState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
$sel:rasterizationState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> SomeStruct PipelineRasterizationStateCreateInfo
$sel:viewportState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
$sel:tessellationState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
$sel:inputAssemblyState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineInputAssemblyStateCreateInfo
$sel:vertexInputState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
$sel:stages:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
$sel:next:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends GraphicsPipelineCreateInfo e => b) -> Maybe b
extends :: proxy e -> (Extends GraphicsPipelineCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: MultiviewPerViewAttributesInfoNVX
Refl <- (Typeable e, Typeable MultiviewPerViewAttributesInfoNVX) =>
Maybe (e :~: MultiviewPerViewAttributesInfoNVX)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @MultiviewPerViewAttributesInfoNVX = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: AttachmentSampleCountInfoAMD
Refl <- (Typeable e, Typeable AttachmentSampleCountInfoAMD) =>
Maybe (e :~: AttachmentSampleCountInfoAMD)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @AttachmentSampleCountInfoAMD = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineRenderingCreateInfoKHR
Refl <- (Typeable e, Typeable PipelineRenderingCreateInfoKHR) =>
Maybe (e :~: PipelineRenderingCreateInfoKHR)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRenderingCreateInfoKHR = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineFragmentShadingRateEnumStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineFragmentShadingRateEnumStateCreateInfoNV) =>
Maybe (e :~: PipelineFragmentShadingRateEnumStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineFragmentShadingRateEnumStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineFragmentShadingRateStateCreateInfoKHR
Refl <- (Typeable e,
Typeable PipelineFragmentShadingRateStateCreateInfoKHR) =>
Maybe (e :~: PipelineFragmentShadingRateStateCreateInfoKHR)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineFragmentShadingRateStateCreateInfoKHR = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineCompilerControlCreateInfoAMD
Refl <- (Typeable e, Typeable PipelineCompilerControlCreateInfoAMD) =>
Maybe (e :~: PipelineCompilerControlCreateInfoAMD)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCompilerControlCreateInfoAMD = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineCreationFeedbackCreateInfoEXT
Refl <- (Typeable e, Typeable PipelineCreationFeedbackCreateInfoEXT) =>
Maybe (e :~: PipelineCreationFeedbackCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreationFeedbackCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineRepresentativeFragmentTestStateCreateInfoNV
Refl <- (Typeable e,
Typeable PipelineRepresentativeFragmentTestStateCreateInfoNV) =>
Maybe (e :~: PipelineRepresentativeFragmentTestStateCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRepresentativeFragmentTestStateCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineDiscardRectangleStateCreateInfoEXT
Refl <- (Typeable e,
Typeable PipelineDiscardRectangleStateCreateInfoEXT) =>
Maybe (e :~: PipelineDiscardRectangleStateCreateInfoEXT)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineDiscardRectangleStateCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: GraphicsPipelineShaderGroupsCreateInfoNV
Refl <- (Typeable e, Typeable GraphicsPipelineShaderGroupsCreateInfoNV) =>
Maybe (e :~: GraphicsPipelineShaderGroupsCreateInfoNV)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @GraphicsPipelineShaderGroupsCreateInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends GraphicsPipelineCreateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance (Extendss GraphicsPipelineCreateInfo es, PokeChain es) => ToCStruct (GraphicsPipelineCreateInfo es) where
withCStruct :: GraphicsPipelineCreateInfo es
-> (Ptr (GraphicsPipelineCreateInfo es) -> IO b) -> IO b
withCStruct GraphicsPipelineCreateInfo es
x Ptr (GraphicsPipelineCreateInfo es) -> IO b
f = Int -> (Ptr (GraphicsPipelineCreateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
144 ((Ptr (GraphicsPipelineCreateInfo es) -> IO b) -> IO b)
-> (Ptr (GraphicsPipelineCreateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (GraphicsPipelineCreateInfo es)
p -> Ptr (GraphicsPipelineCreateInfo es)
-> GraphicsPipelineCreateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (GraphicsPipelineCreateInfo es)
p GraphicsPipelineCreateInfo es
x (Ptr (GraphicsPipelineCreateInfo es) -> IO b
f Ptr (GraphicsPipelineCreateInfo es)
p)
pokeCStruct :: Ptr (GraphicsPipelineCreateInfo es)
-> GraphicsPipelineCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (GraphicsPipelineCreateInfo es)
p GraphicsPipelineCreateInfo{Int32
Maybe PipelineInputAssemblyStateCreateInfo
Maybe PipelineDynamicStateCreateInfo
Maybe PipelineDepthStencilStateCreateInfo
Maybe (SomeStruct PipelineViewportStateCreateInfo)
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain es
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
SomeStruct PipelineRasterizationStateCreateInfo
basePipelineIndex :: Int32
basePipelineHandle :: Pipeline
subpass :: "createInfoCount" ::: Word32
renderPass :: RenderPass
layout :: PipelineLayout
dynamicState :: Maybe PipelineDynamicStateCreateInfo
colorBlendState :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
depthStencilState :: Maybe PipelineDepthStencilStateCreateInfo
multisampleState :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
rasterizationState :: SomeStruct PipelineRasterizationStateCreateInfo
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
flags :: PipelineCreateFlags
next :: Chain es
$sel:basePipelineIndex:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Int32
$sel:basePipelineHandle:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Pipeline
$sel:subpass:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
$sel:renderPass:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> RenderPass
$sel:layout:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> PipelineLayout
$sel:dynamicState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDynamicStateCreateInfo
$sel:colorBlendState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
$sel:depthStencilState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDepthStencilStateCreateInfo
$sel:multisampleState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
$sel:rasterizationState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> SomeStruct PipelineRasterizationStateCreateInfo
$sel:viewportState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
$sel:tessellationState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
$sel:inputAssemblyState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineInputAssemblyStateCreateInfo
$sel:vertexInputState:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
$sel:stages:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
$sel:flags:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
$sel:next:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineCreateFlags -> PipelineCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr PipelineCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags)) (PipelineCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((Int -> "createInfoCount" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int)
-> Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)) :: Word32))
Ptr (PipelineShaderStageCreateInfo Any)
pPStages' <- ((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any)))
-> ((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any))
forall a b. (a -> b) -> a -> b
$ Int -> (Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(PipelineShaderStageCreateInfo _) ((Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
48)
(Int -> SomeStruct PipelineShaderStageCreateInfo -> ContT b IO ())
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct PipelineShaderStageCreateInfo
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> SomeStruct PipelineShaderStageCreateInfo -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineShaderStageCreateInfo Any)
pPStages' Ptr (PipelineShaderStageCreateInfo Any)
-> Int -> Ptr (PipelineShaderStageCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _))) (SomeStruct PipelineShaderStageCreateInfo
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineShaderStageCreateInfo Any))
-> Ptr (PipelineShaderStageCreateInfo Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineShaderStageCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _)))) (Ptr (PipelineShaderStageCreateInfo Any)
pPStages')
Ptr (PipelineVertexInputStateCreateInfo '[])
pVertexInputState'' <- case (Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
vertexInputState) of
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Nothing -> Ptr (PipelineVertexInputStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineVertexInputStateCreateInfo '[])
forall a. Ptr a
nullPtr
Just SomeStruct PipelineVertexInputStateCreateInfo
j -> ((Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineVertexInputStateCreateInfo '[])) (((Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[])))
-> ((Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineVertexInputStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineVertexInputStateCreateInfo es, PokeChain es) =>
Ptr (PipelineVertexInputStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineVertexInputStateCreateInfo (SomeStruct PipelineVertexInputStateCreateInfo
j) (Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineVertexInputStateCreateInfo es)
-> Ptr (PipelineVertexInputStateCreateInfo '[]))
-> Ptr (PipelineVertexInputStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineVertexInputStateCreateInfo es)
-> Ptr (PipelineVertexInputStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineVertexInputStateCreateInfo '[]))
-> Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineVertexInputStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr (PipelineVertexInputStateCreateInfo _)))) Ptr (PipelineVertexInputStateCreateInfo '[])
pVertexInputState''
Ptr PipelineInputAssemblyStateCreateInfo
pInputAssemblyState'' <- case (Maybe PipelineInputAssemblyStateCreateInfo
inputAssemblyState) of
Maybe PipelineInputAssemblyStateCreateInfo
Nothing -> Ptr PipelineInputAssemblyStateCreateInfo
-> ContT b IO (Ptr PipelineInputAssemblyStateCreateInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr PipelineInputAssemblyStateCreateInfo
forall a. Ptr a
nullPtr
Just PipelineInputAssemblyStateCreateInfo
j -> ((Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineInputAssemblyStateCreateInfo)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineInputAssemblyStateCreateInfo))
-> ((Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineInputAssemblyStateCreateInfo)
forall a b. (a -> b) -> a -> b
$ PipelineInputAssemblyStateCreateInfo
-> (Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineInputAssemblyStateCreateInfo
j)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr PipelineInputAssemblyStateCreateInfo)
-> Ptr PipelineInputAssemblyStateCreateInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr PipelineInputAssemblyStateCreateInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PipelineInputAssemblyStateCreateInfo))) Ptr PipelineInputAssemblyStateCreateInfo
pInputAssemblyState''
Ptr (PipelineTessellationStateCreateInfo '[])
pTessellationState'' <- case (Maybe (SomeStruct PipelineTessellationStateCreateInfo)
tessellationState) of
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
Nothing -> Ptr (PipelineTessellationStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineTessellationStateCreateInfo '[])
forall a. Ptr a
nullPtr
Just SomeStruct PipelineTessellationStateCreateInfo
j -> ((Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineTessellationStateCreateInfo '[])) (((Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[])))
-> ((Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b)
-> IO b)
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineTessellationStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineTessellationStateCreateInfo es, PokeChain es) =>
Ptr (PipelineTessellationStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineTessellationStateCreateInfo (SomeStruct PipelineTessellationStateCreateInfo
j) (Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineTessellationStateCreateInfo es)
-> Ptr (PipelineTessellationStateCreateInfo '[]))
-> Ptr (PipelineTessellationStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineTessellationStateCreateInfo es)
-> Ptr (PipelineTessellationStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineTessellationStateCreateInfo '[]))
-> Ptr (PipelineTessellationStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineTessellationStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (PipelineTessellationStateCreateInfo _)))) Ptr (PipelineTessellationStateCreateInfo '[])
pTessellationState''
Ptr (PipelineViewportStateCreateInfo '[])
pViewportState'' <- case (Maybe (SomeStruct PipelineViewportStateCreateInfo)
viewportState) of
Maybe (SomeStruct PipelineViewportStateCreateInfo)
Nothing -> Ptr (PipelineViewportStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineViewportStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineViewportStateCreateInfo '[])
forall a. Ptr a
nullPtr
Just SomeStruct PipelineViewportStateCreateInfo
j -> ((Ptr (PipelineViewportStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineViewportStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineViewportStateCreateInfo '[])) (((Ptr (PipelineViewportStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineViewportStateCreateInfo '[])))
-> ((Ptr (PipelineViewportStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineViewportStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineViewportStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineViewportStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineViewportStateCreateInfo es, PokeChain es) =>
Ptr (PipelineViewportStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineViewportStateCreateInfo (SomeStruct PipelineViewportStateCreateInfo
j) (Ptr (PipelineViewportStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineViewportStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineViewportStateCreateInfo es)
-> Ptr (PipelineViewportStateCreateInfo '[]))
-> Ptr (PipelineViewportStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineViewportStateCreateInfo es)
-> Ptr (PipelineViewportStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineViewportStateCreateInfo '[]))
-> Ptr (PipelineViewportStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineViewportStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (PipelineViewportStateCreateInfo _)))) Ptr (PipelineViewportStateCreateInfo '[])
pViewportState''
Ptr (PipelineRasterizationStateCreateInfo '[])
pRasterizationState'' <- ((Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineRasterizationStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineRasterizationStateCreateInfo '[])) (((Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineRasterizationStateCreateInfo '[])))
-> ((Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b)
-> IO b)
-> ContT b IO (Ptr (PipelineRasterizationStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineRasterizationStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineRasterizationStateCreateInfo es, PokeChain es) =>
Ptr (PipelineRasterizationStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineRasterizationStateCreateInfo (SomeStruct PipelineRasterizationStateCreateInfo
rasterizationState) (Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineRasterizationStateCreateInfo es)
-> Ptr (PipelineRasterizationStateCreateInfo '[]))
-> Ptr (PipelineRasterizationStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineRasterizationStateCreateInfo es)
-> Ptr (PipelineRasterizationStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineRasterizationStateCreateInfo '[]))
-> Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineRasterizationStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr (PipelineRasterizationStateCreateInfo _)))) Ptr (PipelineRasterizationStateCreateInfo '[])
pRasterizationState''
Ptr (PipelineMultisampleStateCreateInfo '[])
pMultisampleState'' <- case (Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
multisampleState) of
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Nothing -> Ptr (PipelineMultisampleStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineMultisampleStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineMultisampleStateCreateInfo '[])
forall a. Ptr a
nullPtr
Just SomeStruct PipelineMultisampleStateCreateInfo
j -> ((Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineMultisampleStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineMultisampleStateCreateInfo '[])) (((Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineMultisampleStateCreateInfo '[])))
-> ((Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineMultisampleStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineMultisampleStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineMultisampleStateCreateInfo es, PokeChain es) =>
Ptr (PipelineMultisampleStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineMultisampleStateCreateInfo (SomeStruct PipelineMultisampleStateCreateInfo
j) (Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineMultisampleStateCreateInfo es)
-> Ptr (PipelineMultisampleStateCreateInfo '[]))
-> Ptr (PipelineMultisampleStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineMultisampleStateCreateInfo es)
-> Ptr (PipelineMultisampleStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineMultisampleStateCreateInfo '[]))
-> Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineMultisampleStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr (PipelineMultisampleStateCreateInfo _)))) Ptr (PipelineMultisampleStateCreateInfo '[])
pMultisampleState''
Ptr PipelineDepthStencilStateCreateInfo
pDepthStencilState'' <- case (Maybe PipelineDepthStencilStateCreateInfo
depthStencilState) of
Maybe PipelineDepthStencilStateCreateInfo
Nothing -> Ptr PipelineDepthStencilStateCreateInfo
-> ContT b IO (Ptr PipelineDepthStencilStateCreateInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr PipelineDepthStencilStateCreateInfo
forall a. Ptr a
nullPtr
Just PipelineDepthStencilStateCreateInfo
j -> ((Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineDepthStencilStateCreateInfo)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineDepthStencilStateCreateInfo))
-> ((Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineDepthStencilStateCreateInfo)
forall a b. (a -> b) -> a -> b
$ PipelineDepthStencilStateCreateInfo
-> (Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineDepthStencilStateCreateInfo
j)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr PipelineDepthStencilStateCreateInfo)
-> Ptr PipelineDepthStencilStateCreateInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr PipelineDepthStencilStateCreateInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr PipelineDepthStencilStateCreateInfo))) Ptr PipelineDepthStencilStateCreateInfo
pDepthStencilState''
Ptr (PipelineColorBlendStateCreateInfo '[])
pColorBlendState'' <- case (Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
colorBlendState) of
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
Nothing -> Ptr (PipelineColorBlendStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineColorBlendStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineColorBlendStateCreateInfo '[])
forall a. Ptr a
nullPtr
Just SomeStruct PipelineColorBlendStateCreateInfo
j -> ((Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineColorBlendStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineColorBlendStateCreateInfo '[])) (((Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineColorBlendStateCreateInfo '[])))
-> ((Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineColorBlendStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineColorBlendStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineColorBlendStateCreateInfo es, PokeChain es) =>
Ptr (PipelineColorBlendStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineColorBlendStateCreateInfo (SomeStruct PipelineColorBlendStateCreateInfo
j) (Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineColorBlendStateCreateInfo es)
-> Ptr (PipelineColorBlendStateCreateInfo '[]))
-> Ptr (PipelineColorBlendStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineColorBlendStateCreateInfo es)
-> Ptr (PipelineColorBlendStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineColorBlendStateCreateInfo '[]))
-> Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineColorBlendStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr (Ptr (PipelineColorBlendStateCreateInfo _)))) Ptr (PipelineColorBlendStateCreateInfo '[])
pColorBlendState''
Ptr PipelineDynamicStateCreateInfo
pDynamicState'' <- case (Maybe PipelineDynamicStateCreateInfo
dynamicState) of
Maybe PipelineDynamicStateCreateInfo
Nothing -> Ptr PipelineDynamicStateCreateInfo
-> ContT b IO (Ptr PipelineDynamicStateCreateInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr PipelineDynamicStateCreateInfo
forall a. Ptr a
nullPtr
Just PipelineDynamicStateCreateInfo
j -> ((Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineDynamicStateCreateInfo)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineDynamicStateCreateInfo))
-> ((Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b)
-> ContT b IO (Ptr PipelineDynamicStateCreateInfo)
forall a b. (a -> b) -> a -> b
$ PipelineDynamicStateCreateInfo
-> (Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineDynamicStateCreateInfo
j)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr PipelineDynamicStateCreateInfo)
-> Ptr PipelineDynamicStateCreateInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr PipelineDynamicStateCreateInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr (Ptr PipelineDynamicStateCreateInfo))) Ptr PipelineDynamicStateCreateInfo
pDynamicState''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PipelineLayout)) (PipelineLayout
layout)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr RenderPass -> RenderPass -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr RenderPass
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr RenderPass)) (RenderPass
renderPass)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32)) ("createInfoCount" ::: Word32
subpass)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pPipelines" ::: Ptr Pipeline) -> Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr Pipeline)) (Pipeline
basePipelineHandle)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr Int32)) (Int32
basePipelineIndex)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
144
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr (GraphicsPipelineCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (GraphicsPipelineCreateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
Ptr (PipelineRasterizationStateCreateInfo '[])
pRasterizationState'' <- ((Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineRasterizationStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineRasterizationStateCreateInfo '[])) (((Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineRasterizationStateCreateInfo '[])))
-> ((Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b)
-> IO b)
-> ContT b IO (Ptr (PipelineRasterizationStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineRasterizationStateCreateInfo
-> (forall (es :: [*]).
(Extendss PipelineRasterizationStateCreateInfo es, PokeChain es) =>
Ptr (PipelineRasterizationStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineRasterizationStateCreateInfo ((PipelineRasterizationStateCreateInfo '[]
-> SomeStruct PipelineRasterizationStateCreateInfo
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct PipelineRasterizationStateCreateInfo '[]
forall a. Zero a => a
zero)) (Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineRasterizationStateCreateInfo es)
-> Ptr (PipelineRasterizationStateCreateInfo '[]))
-> Ptr (PipelineRasterizationStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineRasterizationStateCreateInfo es)
-> Ptr (PipelineRasterizationStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineRasterizationStateCreateInfo '[]))
-> Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineRasterizationStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr (PipelineRasterizationStateCreateInfo _)))) Ptr (PipelineRasterizationStateCreateInfo '[])
pRasterizationState''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PipelineLayout)) (PipelineLayout
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32)) ("createInfoCount" ::: Word32
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr Int32)) (Int32
forall a. Zero a => a
zero)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance (Extendss GraphicsPipelineCreateInfo es, PeekChain es) => FromCStruct (GraphicsPipelineCreateInfo es) where
peekCStruct :: Ptr (GraphicsPipelineCreateInfo es)
-> IO (GraphicsPipelineCreateInfo es)
peekCStruct Ptr (GraphicsPipelineCreateInfo es)
p = do
Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineCreateFlags
flags <- Ptr PipelineCreateFlags -> IO PipelineCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineCreateFlags ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr PipelineCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags))
"createInfoCount" ::: Word32
stageCount <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr (PipelineShaderStageCreateInfo Any)
pStages <- Ptr (Ptr (PipelineShaderStageCreateInfo Any))
-> IO (Ptr (PipelineShaderStageCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineShaderStageCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineShaderStageCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _))))
Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages' <- Int
-> (Int -> IO (SomeStruct PipelineShaderStageCreateInfo))
-> IO (Vector (SomeStruct PipelineShaderStageCreateInfo))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("createInfoCount" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
stageCount) (\Int
i -> Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> IO (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (PipelineShaderStageCreateInfo Any)
pStages Ptr (PipelineShaderStageCreateInfo Any)
-> Int -> Ptr (PipelineShaderStageCreateInfo Any)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _)))))
Ptr (PipelineVertexInputStateCreateInfo Any)
pVertexInputState <- Ptr (Ptr (PipelineVertexInputStateCreateInfo Any))
-> IO (Ptr (PipelineVertexInputStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineVertexInputStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineVertexInputStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr (PipelineVertexInputStateCreateInfo _))))
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
pVertexInputState' <- (Ptr (PipelineVertexInputStateCreateInfo Any)
-> IO (SomeStruct PipelineVertexInputStateCreateInfo))
-> Ptr (PipelineVertexInputStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineVertexInputStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineVertexInputStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineVertexInputStateCreateInfo)
-> IO (SomeStruct PipelineVertexInputStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineVertexInputStateCreateInfo Any)
-> Ptr (SomeStruct PipelineVertexInputStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineVertexInputStateCreateInfo Any)
j))) Ptr (PipelineVertexInputStateCreateInfo Any)
pVertexInputState
Ptr PipelineInputAssemblyStateCreateInfo
pInputAssemblyState <- Ptr (Ptr PipelineInputAssemblyStateCreateInfo)
-> IO (Ptr PipelineInputAssemblyStateCreateInfo)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineInputAssemblyStateCreateInfo) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr PipelineInputAssemblyStateCreateInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PipelineInputAssemblyStateCreateInfo)))
Maybe PipelineInputAssemblyStateCreateInfo
pInputAssemblyState' <- (Ptr PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo)
-> Ptr PipelineInputAssemblyStateCreateInfo
-> IO (Maybe PipelineInputAssemblyStateCreateInfo)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr PipelineInputAssemblyStateCreateInfo
j -> Ptr PipelineInputAssemblyStateCreateInfo
-> IO PipelineInputAssemblyStateCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineInputAssemblyStateCreateInfo (Ptr PipelineInputAssemblyStateCreateInfo
j)) Ptr PipelineInputAssemblyStateCreateInfo
pInputAssemblyState
Ptr (PipelineTessellationStateCreateInfo Any)
pTessellationState <- Ptr (Ptr (PipelineTessellationStateCreateInfo Any))
-> IO (Ptr (PipelineTessellationStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineTessellationStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineTessellationStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (PipelineTessellationStateCreateInfo _))))
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
pTessellationState' <- (Ptr (PipelineTessellationStateCreateInfo Any)
-> IO (SomeStruct PipelineTessellationStateCreateInfo))
-> Ptr (PipelineTessellationStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineTessellationStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineTessellationStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineTessellationStateCreateInfo)
-> IO (SomeStruct PipelineTessellationStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineTessellationStateCreateInfo Any)
-> Ptr (SomeStruct PipelineTessellationStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineTessellationStateCreateInfo Any)
j))) Ptr (PipelineTessellationStateCreateInfo Any)
pTessellationState
Ptr (PipelineViewportStateCreateInfo Any)
pViewportState <- Ptr (Ptr (PipelineViewportStateCreateInfo Any))
-> IO (Ptr (PipelineViewportStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineViewportStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineViewportStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (PipelineViewportStateCreateInfo _))))
Maybe (SomeStruct PipelineViewportStateCreateInfo)
pViewportState' <- (Ptr (PipelineViewportStateCreateInfo Any)
-> IO (SomeStruct PipelineViewportStateCreateInfo))
-> Ptr (PipelineViewportStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineViewportStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineViewportStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineViewportStateCreateInfo)
-> IO (SomeStruct PipelineViewportStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineViewportStateCreateInfo Any)
-> Ptr (SomeStruct PipelineViewportStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineViewportStateCreateInfo Any)
j))) Ptr (PipelineViewportStateCreateInfo Any)
pViewportState
SomeStruct PipelineRasterizationStateCreateInfo
pRasterizationState <- Ptr (SomeStruct PipelineRasterizationStateCreateInfo)
-> IO (SomeStruct PipelineRasterizationStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (SomeStruct PipelineRasterizationStateCreateInfo)
-> IO (SomeStruct PipelineRasterizationStateCreateInfo))
-> (Ptr (PipelineRasterizationStateCreateInfo Any)
-> Ptr (SomeStruct PipelineRasterizationStateCreateInfo))
-> Ptr (PipelineRasterizationStateCreateInfo Any)
-> IO (SomeStruct PipelineRasterizationStateCreateInfo)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineRasterizationStateCreateInfo Any)
-> Ptr (SomeStruct PipelineRasterizationStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineRasterizationStateCreateInfo Any)
-> IO (SomeStruct PipelineRasterizationStateCreateInfo))
-> IO (Ptr (PipelineRasterizationStateCreateInfo Any))
-> IO (SomeStruct PipelineRasterizationStateCreateInfo)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr (PipelineRasterizationStateCreateInfo Any))
-> IO (Ptr (PipelineRasterizationStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineRasterizationStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr (PipelineRasterizationStateCreateInfo _))))
Ptr (PipelineMultisampleStateCreateInfo Any)
pMultisampleState <- Ptr (Ptr (PipelineMultisampleStateCreateInfo Any))
-> IO (Ptr (PipelineMultisampleStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineMultisampleStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineMultisampleStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr (PipelineMultisampleStateCreateInfo _))))
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
pMultisampleState' <- (Ptr (PipelineMultisampleStateCreateInfo Any)
-> IO (SomeStruct PipelineMultisampleStateCreateInfo))
-> Ptr (PipelineMultisampleStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineMultisampleStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineMultisampleStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineMultisampleStateCreateInfo)
-> IO (SomeStruct PipelineMultisampleStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineMultisampleStateCreateInfo Any)
-> Ptr (SomeStruct PipelineMultisampleStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineMultisampleStateCreateInfo Any)
j))) Ptr (PipelineMultisampleStateCreateInfo Any)
pMultisampleState
Ptr PipelineDepthStencilStateCreateInfo
pDepthStencilState <- Ptr (Ptr PipelineDepthStencilStateCreateInfo)
-> IO (Ptr PipelineDepthStencilStateCreateInfo)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineDepthStencilStateCreateInfo) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr PipelineDepthStencilStateCreateInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr PipelineDepthStencilStateCreateInfo)))
Maybe PipelineDepthStencilStateCreateInfo
pDepthStencilState' <- (Ptr PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo)
-> Ptr PipelineDepthStencilStateCreateInfo
-> IO (Maybe PipelineDepthStencilStateCreateInfo)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr PipelineDepthStencilStateCreateInfo
j -> Ptr PipelineDepthStencilStateCreateInfo
-> IO PipelineDepthStencilStateCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineDepthStencilStateCreateInfo (Ptr PipelineDepthStencilStateCreateInfo
j)) Ptr PipelineDepthStencilStateCreateInfo
pDepthStencilState
Ptr (PipelineColorBlendStateCreateInfo Any)
pColorBlendState <- Ptr (Ptr (PipelineColorBlendStateCreateInfo Any))
-> IO (Ptr (PipelineColorBlendStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineColorBlendStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr (PipelineColorBlendStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr (Ptr (PipelineColorBlendStateCreateInfo _))))
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
pColorBlendState' <- (Ptr (PipelineColorBlendStateCreateInfo Any)
-> IO (SomeStruct PipelineColorBlendStateCreateInfo))
-> Ptr (PipelineColorBlendStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineColorBlendStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineColorBlendStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineColorBlendStateCreateInfo)
-> IO (SomeStruct PipelineColorBlendStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineColorBlendStateCreateInfo Any)
-> Ptr (SomeStruct PipelineColorBlendStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineColorBlendStateCreateInfo Any)
j))) Ptr (PipelineColorBlendStateCreateInfo Any)
pColorBlendState
Ptr PipelineDynamicStateCreateInfo
pDynamicState <- Ptr (Ptr PipelineDynamicStateCreateInfo)
-> IO (Ptr PipelineDynamicStateCreateInfo)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineDynamicStateCreateInfo) ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr (Ptr PipelineDynamicStateCreateInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr (Ptr PipelineDynamicStateCreateInfo)))
Maybe PipelineDynamicStateCreateInfo
pDynamicState' <- (Ptr PipelineDynamicStateCreateInfo
-> IO PipelineDynamicStateCreateInfo)
-> Ptr PipelineDynamicStateCreateInfo
-> IO (Maybe PipelineDynamicStateCreateInfo)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr PipelineDynamicStateCreateInfo
j -> Ptr PipelineDynamicStateCreateInfo
-> IO PipelineDynamicStateCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineDynamicStateCreateInfo (Ptr PipelineDynamicStateCreateInfo
j)) Ptr PipelineDynamicStateCreateInfo
pDynamicState
PipelineLayout
layout <- Ptr PipelineLayout -> IO PipelineLayout
forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PipelineLayout))
RenderPass
renderPass <- Ptr RenderPass -> IO RenderPass
forall a. Storable a => Ptr a -> IO a
peek @RenderPass ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr RenderPass
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr RenderPass))
"createInfoCount" ::: Word32
subpass <- Ptr ("createInfoCount" ::: Word32)
-> IO ("createInfoCount" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> Ptr ("createInfoCount" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32))
Pipeline
basePipelineHandle <- ("pPipelines" ::: Ptr Pipeline) -> IO Pipeline
forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es)
-> Int -> "pPipelines" ::: Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr Pipeline))
Int32
basePipelineIndex <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek @Int32 ((Ptr (GraphicsPipelineCreateInfo es)
p Ptr (GraphicsPipelineCreateInfo es) -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr Int32))
GraphicsPipelineCreateInfo es -> IO (GraphicsPipelineCreateInfo es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsPipelineCreateInfo es
-> IO (GraphicsPipelineCreateInfo es))
-> GraphicsPipelineCreateInfo es
-> IO (GraphicsPipelineCreateInfo es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> SomeStruct PipelineRasterizationStateCreateInfo
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
-> Maybe PipelineDepthStencilStateCreateInfo
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
-> Maybe PipelineDynamicStateCreateInfo
-> PipelineLayout
-> RenderPass
-> ("createInfoCount" ::: Word32)
-> Pipeline
-> Int32
-> GraphicsPipelineCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> SomeStruct PipelineRasterizationStateCreateInfo
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
-> Maybe PipelineDepthStencilStateCreateInfo
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
-> Maybe PipelineDynamicStateCreateInfo
-> PipelineLayout
-> RenderPass
-> ("createInfoCount" ::: Word32)
-> Pipeline
-> Int32
-> GraphicsPipelineCreateInfo es
GraphicsPipelineCreateInfo
Chain es
next PipelineCreateFlags
flags Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages' Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
pVertexInputState' Maybe PipelineInputAssemblyStateCreateInfo
pInputAssemblyState' Maybe (SomeStruct PipelineTessellationStateCreateInfo)
pTessellationState' Maybe (SomeStruct PipelineViewportStateCreateInfo)
pViewportState' SomeStruct PipelineRasterizationStateCreateInfo
pRasterizationState Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
pMultisampleState' Maybe PipelineDepthStencilStateCreateInfo
pDepthStencilState' Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
pColorBlendState' Maybe PipelineDynamicStateCreateInfo
pDynamicState' PipelineLayout
layout RenderPass
renderPass "createInfoCount" ::: Word32
subpass Pipeline
basePipelineHandle Int32
basePipelineIndex
instance es ~ '[] => Zero (GraphicsPipelineCreateInfo es) where
zero :: GraphicsPipelineCreateInfo es
zero = Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> SomeStruct PipelineRasterizationStateCreateInfo
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
-> Maybe PipelineDepthStencilStateCreateInfo
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
-> Maybe PipelineDynamicStateCreateInfo
-> PipelineLayout
-> RenderPass
-> ("createInfoCount" ::: Word32)
-> Pipeline
-> Int32
-> GraphicsPipelineCreateInfo es
forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> SomeStruct PipelineRasterizationStateCreateInfo
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
-> Maybe PipelineDepthStencilStateCreateInfo
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
-> Maybe PipelineDynamicStateCreateInfo
-> PipelineLayout
-> RenderPass
-> ("createInfoCount" ::: Word32)
-> Pipeline
-> Int32
-> GraphicsPipelineCreateInfo es
GraphicsPipelineCreateInfo
()
PipelineCreateFlags
forall a. Zero a => a
zero
Vector (SomeStruct PipelineShaderStageCreateInfo)
forall a. Monoid a => a
mempty
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
forall a. Maybe a
Nothing
Maybe PipelineInputAssemblyStateCreateInfo
forall a. Maybe a
Nothing
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
forall a. Maybe a
Nothing
Maybe (SomeStruct PipelineViewportStateCreateInfo)
forall a. Maybe a
Nothing
(PipelineRasterizationStateCreateInfo '[]
-> SomeStruct PipelineRasterizationStateCreateInfo
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct PipelineRasterizationStateCreateInfo '[]
forall a. Zero a => a
zero)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
forall a. Maybe a
Nothing
Maybe PipelineDepthStencilStateCreateInfo
forall a. Maybe a
Nothing
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
forall a. Maybe a
Nothing
Maybe PipelineDynamicStateCreateInfo
forall a. Maybe a
Nothing
PipelineLayout
forall a. Zero a => a
zero
RenderPass
forall a. Zero a => a
zero
"createInfoCount" ::: Word32
forall a. Zero a => a
zero
Pipeline
forall a. Zero a => a
zero
Int32
forall a. Zero a => a
zero