{-# 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(..)
, 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
, PipelineLayoutCreateFlagBits(..)
, PipelineLayoutCreateFlags
, 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 {-# SOURCE #-} Vulkan.Extensions.VK_EXT_debug_utils (DebugUtilsObjectNameInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_depth_bias_control (DepthBiasRepresentationInfoEXT)
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 {-# SOURCE #-} Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer (ExternalFormatANDROID)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.FrontFace (FrontFace)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_graphics_pipeline_library (GraphicsPipelineLibraryCreateInfoEXT)
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_KHR_maintenance5 (PipelineCreateFlags2CreateInfoKHR)
import {-# SOURCE #-} Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_feedback (PipelineCreationFeedbackCreateInfo)
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 {-# SOURCE #-} Vulkan.Extensions.VK_KHR_pipeline_library (PipelineLibraryCreateInfoKHR)
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.Core13.Promoted_From_VK_KHR_dynamic_rendering (PipelineRenderingCreateInfo)
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_representative_fragment_test (PipelineRepresentativeFragmentTestStateCreateInfoNV)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_pipeline_robustness (PipelineRobustnessCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_sample_locations (PipelineSampleLocationsStateCreateInfoEXT)
import Vulkan.Core10.Enums.PipelineShaderStageCreateFlagBits (PipelineShaderStageCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_shader_module_identifier (PipelineShaderStageModuleIdentifierCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_AMDX_shader_enqueue (PipelineShaderStageNodeCreateInfoAMDX)
import {-# SOURCE #-} Vulkan.Core13.Promoted_From_VK_EXT_subgroup_size_control (PipelineShaderStageRequiredSubgroupSizeCreateInfo)
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 {-# SOURCE #-} Vulkan.Core10.Shader (ShaderModuleCreateInfo)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_validation_cache (ShaderModuleValidationCacheCreateInfoEXT)
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.PipelineLayoutCreateFlagBits (PipelineLayoutCreateFlagBits(..))
import Vulkan.Core10.Enums.PipelineLayoutCreateFlagBits (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 :: 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)
createInfos
"allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT 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)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ 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 forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateGraphicsPipelines is null" forall a. Maybe a
Nothing 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 <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(GraphicsPipelineCreateInfo _) ((forall a. Vector a -> Int
Data.Vector.length ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) forall a. Num a => a -> a -> a
* Int
144)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct GraphicsPipelineCreateInfo
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (GraphicsPipelineCreateInfo Any)
pPCreateInfos forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
144 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (GraphicsPipelineCreateInfo _))) (SomeStruct GraphicsPipelineCreateInfo
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pPipelines" ::: Ptr Pipeline
pPPipelines <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Pipeline ((forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) :: Word32))) forall a. Num a => a -> a -> a
* Int
8)) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ 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)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) :: Word32))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (GraphicsPipelineCreateInfo Any)
pPCreateInfos))
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator
("pPipelines" ::: Ptr Pipeline
pPPipelines))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"pipelines" ::: Vector Pipeline
pPipelines <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct GraphicsPipelineCreateInfo)
createInfos)) :: Word32))) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Pipeline (("pPipelines" ::: Ptr Pipeline
pPPipelines forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 :: forall (io :: * -> *) r.
MonadIO io =>
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 (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) -> forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
(a -> f b) -> t a -> f ()
traverse_ (\Pipeline
o1Elem -> 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 :: 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)
createInfos
"allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT 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)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ 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 forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateComputePipelines is null" forall a. Maybe a
Nothing 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 <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(ComputePipelineCreateInfo _) ((forall a. Vector a -> Int
Data.Vector.length ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) forall a. Num a => a -> a -> a
* Int
96)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct ComputePipelineCreateInfo
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ComputePipelineCreateInfo Any)
pPCreateInfos forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
96 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ComputePipelineCreateInfo _))) (SomeStruct ComputePipelineCreateInfo
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pPipelines" ::: Ptr Pipeline
pPPipelines <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @Pipeline ((forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) :: Word32))) forall a. Num a => a -> a -> a
* Int
8)) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ 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)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) :: Word32))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ComputePipelineCreateInfo Any)
pPCreateInfos))
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator
("pPipelines" ::: Ptr Pipeline
pPPipelines))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"pipelines" ::: Vector Pipeline
pPipelines <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfos" ::: Vector (SomeStruct ComputePipelineCreateInfo)
createInfos)) :: Word32))) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Pipeline (("pPipelines" ::: Ptr Pipeline
pPPipelines forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 :: forall (io :: * -> *) r.
MonadIO io =>
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 (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) -> forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
(a -> f b) -> t a -> f ()
traverse_ (\Pipeline
o1Elem -> 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 :: forall (io :: * -> *).
MonadIO io =>
Device
-> Pipeline -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
destroyPipeline Device
device Pipeline
pipeline "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT 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)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Pipeline -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ())
vkDestroyPipelinePtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroyPipeline is null" forall a. Maybe a
Nothing 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ 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)
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
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 :: forall b. Viewport -> (Ptr Viewport -> IO b) -> IO b
withCStruct Viewport
x Ptr Viewport -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr Viewport
p -> 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 :: forall b. 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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
x))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
y))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
width))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
height))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minDepth))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p 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 :: forall b. Ptr Viewport -> IO b -> IO b
pokeZeroCStruct Ptr Viewport
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr CFloat)) (Float -> CFloat
CFloat (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 <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr CFloat))
CFloat
y <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat))
CFloat
width <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat))
CFloat
height <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat))
CFloat
minDepth <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CFloat))
CFloat
maxDepth <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr Viewport
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr CFloat))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Float -> Float -> Float -> Float -> Float -> Float -> Viewport
Viewport
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
x)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
y)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
width)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
height)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
minDepth)
(coerce :: forall a b. Coercible a b => a -> b
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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr Viewport -> Viewport -> IO ()
poke Ptr Viewport
ptr Viewport
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr Viewport
ptr Viewport
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero Viewport where
zero :: Viewport
zero = Float -> Float -> Float -> Float -> Float -> Float -> Viewport
Viewport
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
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
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 :: forall b.
SpecializationMapEntry
-> (Ptr SpecializationMapEntry -> IO b) -> IO b
withCStruct SpecializationMapEntry
x Ptr SpecializationMapEntry -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr SpecializationMapEntry
p -> 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 :: forall b.
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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
constantID)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
offset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p 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 :: forall b. Ptr SpecializationMapEntry -> IO b -> IO b
pokeZeroCStruct Ptr SpecializationMapEntry
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CSize)) (Word64 -> CSize
CSize (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 <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
"createInfoCount" ::: Word32
offset <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
CSize
size <- forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr SpecializationMapEntry
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CSize))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> Word64
-> SpecializationMapEntry
SpecializationMapEntry
"createInfoCount" ::: Word32
constantID "createInfoCount" ::: Word32
offset (coerce :: forall a b. Coercible a b => a -> b
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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SpecializationMapEntry -> SpecializationMapEntry -> IO ()
poke Ptr SpecializationMapEntry
ptr SpecializationMapEntry
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SpecializationMapEntry
ptr SpecializationMapEntry
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SpecializationMapEntry where
zero :: SpecializationMapEntry
zero = ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> Word64
-> SpecializationMapEntry
SpecializationMapEntry
forall a. Zero a => a
zero
forall a. Zero a => a
zero
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 :: forall b.
SpecializationInfo -> (Ptr SpecializationInfo -> IO b) -> IO b
withCStruct SpecializationInfo
x Ptr SpecializationInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr SpecializationInfo
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector SpecializationMapEntry
mapEntries)) :: Word32))
Ptr SpecializationMapEntry
pPMapEntries' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @SpecializationMapEntry ((forall a. Vector a -> Int
Data.Vector.length (Vector SpecializationMapEntry
mapEntries)) forall a. Num a => a -> a -> a
* Int
16)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SpecializationMapEntry
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SpecializationMapEntry
pPMapEntries' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SpecializationMapEntry) (SpecializationMapEntry
e)) (Vector SpecializationMapEntry
mapEntries)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr SpecializationMapEntry))) (Ptr SpecializationMapEntry
pPMapEntries')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
dataSize))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) (Ptr ()
data')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr SpecializationInfo -> IO b -> IO b
pokeZeroCStruct Ptr SpecializationInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: 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 <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
Ptr SpecializationMapEntry
pMapEntries <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr SpecializationMapEntry) ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr SpecializationMapEntry)))
Vector SpecializationMapEntry
pMapEntries' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
mapEntryCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SpecializationMapEntry ((Ptr SpecializationMapEntry
pMapEntries forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SpecializationMapEntry)))
CSize
dataSize <- forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize))
Ptr ()
pData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr SpecializationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ())))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector SpecializationMapEntry
-> Word64 -> Ptr () -> SpecializationInfo
SpecializationInfo
Vector SpecializationMapEntry
pMapEntries' (coerce :: forall a b. Coercible a b => a -> b
coerce @CSize @Word64 CSize
dataSize) Ptr ()
pData
instance Zero SpecializationInfo where
zero :: SpecializationInfo
zero = Vector SpecializationMapEntry
-> Word64 -> Ptr () -> SpecializationInfo
SpecializationInfo
forall a. Monoid a => a
mempty
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineShaderStageCreateInfo (es :: [Type]) = PipelineShaderStageCreateInfo
{
forall (es :: [*]). PipelineShaderStageCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineShaderStageCreateInfo es -> PipelineShaderStageCreateFlags
flags :: PipelineShaderStageCreateFlags
,
forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderStageFlagBits
stage :: ShaderStageFlagBits
,
forall (es :: [*]).
PipelineShaderStageCreateInfo es -> ShaderModule
module' :: ShaderModule
,
forall (es :: [*]). PipelineShaderStageCreateInfo es -> ByteString
name :: ByteString
,
forall (es :: [*]).
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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]). 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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineShaderStageCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: PipelineShaderStageNodeCreateInfoAMDX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineShaderStageNodeCreateInfoAMDX = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: PipelineRobustnessCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRobustnessCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: PipelineShaderStageModuleIdentifierCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineShaderStageModuleIdentifierCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: PipelineShaderStageRequiredSubgroupSizeCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineShaderStageRequiredSubgroupSizeCreateInfo = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: DebugUtilsObjectNameInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @DebugUtilsObjectNameInfoEXT = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: ShaderModuleValidationCacheCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ShaderModuleValidationCacheCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Just e :~: ShaderModuleCreateInfo '[]
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @(ShaderModuleCreateInfo '[]) = forall a. a -> Maybe a
Just Extends PipelineShaderStageCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineShaderStageCreateInfo es
, PokeChain es ) => ToCStruct (PipelineShaderStageCreateInfo es) where
withCStruct :: forall b.
PipelineShaderStageCreateInfo es
-> (Ptr (PipelineShaderStageCreateInfo es) -> IO b) -> IO b
withCStruct PipelineShaderStageCreateInfo es
x Ptr (PipelineShaderStageCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineShaderStageCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineShaderStageCreateFlags)) (PipelineShaderStageCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ShaderStageFlagBits)) (ShaderStageFlagBits
stage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderModule)) (ShaderModule
module')
Ptr CChar
pName'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
useAsCString (ByteString
name)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr CChar))) Ptr CChar
pName''
Ptr SpecializationInfo
pSpecializationInfo'' <- case (Maybe SpecializationInfo
specializationInfo) of
Maybe SpecializationInfo
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SpecializationInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SpecializationInfo
j)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr SpecializationInfo))) Ptr SpecializationInfo
pSpecializationInfo''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (PipelineShaderStageCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineShaderStageCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ShaderStageFlagBits)) (forall a. Zero a => a
zero)
Ptr CChar
pName'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
useAsCString (forall a. Monoid a => a
mempty)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr CChar))) Ptr CChar
pName''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineShaderStageCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineShaderStageCreateFlags ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineShaderStageCreateFlags))
ShaderStageFlagBits
stage <- forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlagBits ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ShaderStageFlagBits))
ShaderModule
module' <- forall a. Storable a => Ptr a -> IO a
peek @ShaderModule ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderModule))
ByteString
pName <- Ptr CChar -> IO ByteString
packCString forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall a. Storable a => Ptr a -> IO a
peek ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr CChar)))
Ptr SpecializationInfo
pSpecializationInfo <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr SpecializationInfo) ((Ptr (PipelineShaderStageCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr SpecializationInfo)))
Maybe SpecializationInfo
pSpecializationInfo' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr SpecializationInfo
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SpecializationInfo (Ptr SpecializationInfo
j)) Ptr SpecializationInfo
pSpecializationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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 = forall (es :: [*]).
Chain es
-> PipelineShaderStageCreateFlags
-> ShaderStageFlagBits
-> ShaderModule
-> ByteString
-> Maybe SpecializationInfo
-> PipelineShaderStageCreateInfo es
PipelineShaderStageCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Maybe a
Nothing
data ComputePipelineCreateInfo (es :: [Type]) = ComputePipelineCreateInfo
{
forall (es :: [*]). ComputePipelineCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
ComputePipelineCreateInfo es -> PipelineCreateFlags
flags :: PipelineCreateFlags
,
forall (es :: [*]).
ComputePipelineCreateInfo es
-> SomeStruct PipelineShaderStageCreateInfo
stage :: SomeStruct PipelineShaderStageCreateInfo
,
forall (es :: [*]). ComputePipelineCreateInfo es -> PipelineLayout
layout :: PipelineLayout
,
forall (es :: [*]). ComputePipelineCreateInfo es -> Pipeline
basePipelineHandle :: Pipeline
,
forall (es :: [*]). 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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]). 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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends ComputePipelineCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends ComputePipelineCreateInfo e => b
f
| Just e :~: PipelineRobustnessCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRobustnessCreateInfoEXT = forall a. a -> Maybe a
Just Extends ComputePipelineCreateInfo e => b
f
| Just e :~: PipelineCompilerControlCreateInfoAMD
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCompilerControlCreateInfoAMD = forall a. a -> Maybe a
Just Extends ComputePipelineCreateInfo e => b
f
| Just e :~: SubpassShadingPipelineCreateInfoHUAWEI
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SubpassShadingPipelineCreateInfoHUAWEI = forall a. a -> Maybe a
Just Extends ComputePipelineCreateInfo e => b
f
| Just e :~: PipelineCreationFeedbackCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreationFeedbackCreateInfo = forall a. a -> Maybe a
Just Extends ComputePipelineCreateInfo e => b
f
| Just e :~: PipelineCreateFlags2CreateInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreateFlags2CreateInfoKHR = forall a. a -> Maybe a
Just Extends ComputePipelineCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss ComputePipelineCreateInfo es
, PokeChain es ) => ToCStruct (ComputePipelineCreateInfo es) where
withCStruct :: forall b.
ComputePipelineCreateInfo es
-> (Ptr (ComputePipelineCreateInfo es) -> IO b) -> IO b
withCStruct ComputePipelineCreateInfo es
x Ptr (ComputePipelineCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
96 forall a b. (a -> b) -> a -> b
$ \Ptr (ComputePipelineCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags)) (PipelineCreateFlags
flags)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (PipelineShaderStageCreateInfo _)))) (SomeStruct PipelineShaderStageCreateInfo
stage) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PipelineLayout)) (PipelineLayout
layout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Pipeline)) (Pipeline
basePipelineHandle)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr Int32)) (Int32
basePipelineIndex)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
96
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (ComputePipelineCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (ComputePipelineCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (PipelineShaderStageCreateInfo _)))) ((forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PipelineLayout)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr Int32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineCreateFlags ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags))
SomeStruct PipelineShaderStageCreateInfo
stage <- forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (PipelineShaderStageCreateInfo _))))
PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PipelineLayout))
Pipeline
basePipelineHandle <- forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Pipeline))
Int32
basePipelineIndex <- forall a. Storable a => Ptr a -> IO a
peek @Int32 ((Ptr (ComputePipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr Int32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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 = forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> SomeStruct PipelineShaderStageCreateInfo
-> PipelineLayout
-> Pipeline
-> Int32
-> ComputePipelineCreateInfo es
ComputePipelineCreateInfo
()
forall a. Zero a => a
zero
(forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)
forall a. Zero a => a
zero
forall a. Zero a => a
zero
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
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 :: forall b.
VertexInputBindingDescription
-> (Ptr VertexInputBindingDescription -> IO b) -> IO b
withCStruct VertexInputBindingDescription
x Ptr VertexInputBindingDescription -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
12 forall a b. (a -> b) -> a -> b
$ \Ptr VertexInputBindingDescription
p -> 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 :: forall b.
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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
binding)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
stride)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p 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 :: forall b. Ptr VertexInputBindingDescription -> IO b -> IO b
pokeZeroCStruct Ptr VertexInputBindingDescription
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr 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 <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
"createInfoCount" ::: Word32
stride <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
VertexInputRate
inputRate <- forall a. Storable a => Ptr a -> IO a
peek @VertexInputRate ((Ptr VertexInputBindingDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VertexInputRate))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VertexInputBindingDescription
-> VertexInputBindingDescription -> IO ()
poke Ptr VertexInputBindingDescription
ptr VertexInputBindingDescription
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputBindingDescription
ptr VertexInputBindingDescription
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VertexInputBindingDescription where
zero :: VertexInputBindingDescription
zero = ("createInfoCount" ::: Word32)
-> ("createInfoCount" ::: Word32)
-> VertexInputRate
-> VertexInputBindingDescription
VertexInputBindingDescription
forall a. Zero a => a
zero
forall a. Zero a => a
zero
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
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 :: forall b.
VertexInputAttributeDescription
-> (Ptr VertexInputAttributeDescription -> IO b) -> IO b
withCStruct VertexInputAttributeDescription
x Ptr VertexInputAttributeDescription -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr VertexInputAttributeDescription
p -> 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 :: forall b.
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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) ("createInfoCount" ::: Word32
location)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) ("createInfoCount" ::: Word32
binding)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Format)) (Format
format)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p 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 :: forall b. Ptr VertexInputAttributeDescription -> IO b -> IO b
pokeZeroCStruct Ptr VertexInputAttributeDescription
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Format)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr 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 <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
"createInfoCount" ::: Word32
binding <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
Format
format <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Format))
"createInfoCount" ::: Word32
offset <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VertexInputAttributeDescription
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VertexInputAttributeDescription
-> VertexInputAttributeDescription -> IO ()
poke Ptr VertexInputAttributeDescription
ptr VertexInputAttributeDescription
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VertexInputAttributeDescription
ptr VertexInputAttributeDescription
poked (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
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineVertexInputStateCreateInfo (es :: [Type]) = PipelineVertexInputStateCreateInfo
{
forall (es :: [*]).
PipelineVertexInputStateCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> PipelineVertexInputStateCreateFlags
flags :: PipelineVertexInputStateCreateFlags
,
forall (es :: [*]).
PipelineVertexInputStateCreateInfo es
-> Vector VertexInputBindingDescription
vertexBindingDescriptions :: Vector VertexInputBindingDescription
,
forall (es :: [*]).
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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]).
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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineVertexInputStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineVertexInputStateCreateInfo e => b
f
| Just e :~: PipelineVertexInputDivisorStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineVertexInputDivisorStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineVertexInputStateCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineVertexInputStateCreateInfo es
, PokeChain es ) => ToCStruct (PipelineVertexInputStateCreateInfo es) where
withCStruct :: forall b.
PipelineVertexInputStateCreateInfo es
-> (Ptr (PipelineVertexInputStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineVertexInputStateCreateInfo es
x Ptr (PipelineVertexInputStateCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineVertexInputStateCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineVertexInputStateCreateFlags)) (PipelineVertexInputStateCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector VertexInputBindingDescription
vertexBindingDescriptions)) :: Word32))
Ptr VertexInputBindingDescription
pPVertexBindingDescriptions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @VertexInputBindingDescription ((forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputBindingDescription
vertexBindingDescriptions)) forall a. Num a => a -> a -> a
* Int
12)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i VertexInputBindingDescription
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr VertexInputBindingDescription
pPVertexBindingDescriptions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
12 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDescription) (VertexInputBindingDescription
e)) (Vector VertexInputBindingDescription
vertexBindingDescriptions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr VertexInputBindingDescription))) (Ptr VertexInputBindingDescription
pPVertexBindingDescriptions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector VertexInputAttributeDescription
vertexAttributeDescriptions)) :: Word32))
Ptr VertexInputAttributeDescription
pPVertexAttributeDescriptions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @VertexInputAttributeDescription ((forall a. Vector a -> Int
Data.Vector.length (Vector VertexInputAttributeDescription
vertexAttributeDescriptions)) forall a. Num a => a -> a -> a
* Int
16)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i VertexInputAttributeDescription
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr VertexInputAttributeDescription
pPVertexAttributeDescriptions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputAttributeDescription) (VertexInputAttributeDescription
e)) (Vector VertexInputAttributeDescription
vertexAttributeDescriptions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr VertexInputAttributeDescription))) (Ptr VertexInputAttributeDescription
pPVertexAttributeDescriptions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr (PipelineVertexInputStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineVertexInputStateCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineVertexInputStateCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineVertexInputStateCreateFlags ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineVertexInputStateCreateFlags))
"createInfoCount" ::: Word32
vertexBindingDescriptionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr VertexInputBindingDescription
pVertexBindingDescriptions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr VertexInputBindingDescription) ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr VertexInputBindingDescription)))
Vector VertexInputBindingDescription
pVertexBindingDescriptions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
vertexBindingDescriptionCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VertexInputBindingDescription ((Ptr VertexInputBindingDescription
pVertexBindingDescriptions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
12 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputBindingDescription)))
"createInfoCount" ::: Word32
vertexAttributeDescriptionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
Ptr VertexInputAttributeDescription
pVertexAttributeDescriptions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr VertexInputAttributeDescription) ((Ptr (PipelineVertexInputStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr VertexInputAttributeDescription)))
Vector VertexInputAttributeDescription
pVertexAttributeDescriptions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
vertexAttributeDescriptionCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VertexInputAttributeDescription ((Ptr VertexInputAttributeDescription
pVertexAttributeDescriptions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr VertexInputAttributeDescription)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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 = forall (es :: [*]).
Chain es
-> PipelineVertexInputStateCreateFlags
-> Vector VertexInputBindingDescription
-> Vector VertexInputAttributeDescription
-> PipelineVertexInputStateCreateInfo es
PipelineVertexInputStateCreateInfo
()
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
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
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 :: forall b.
PipelineInputAssemblyStateCreateInfo
-> (Ptr PipelineInputAssemblyStateCreateInfo -> IO b) -> IO b
withCStruct PipelineInputAssemblyStateCreateInfo
x Ptr PipelineInputAssemblyStateCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineInputAssemblyStateCreateInfo
p -> 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 :: forall b.
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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineInputAssemblyStateCreateFlags)) (PipelineInputAssemblyStateCreateFlags
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PrimitiveTopology)) (PrimitiveTopology
topology)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p 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 :: forall b. Ptr PipelineInputAssemblyStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineInputAssemblyStateCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PrimitiveTopology)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (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 <- forall a. Storable a => Ptr a -> IO a
peek @PipelineInputAssemblyStateCreateFlags ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineInputAssemblyStateCreateFlags))
PrimitiveTopology
topology <- forall a. Storable a => Ptr a -> IO a
peek @PrimitiveTopology ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PrimitiveTopology))
Bool32
primitiveRestartEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineInputAssemblyStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineInputAssemblyStateCreateInfo
-> PipelineInputAssemblyStateCreateInfo -> IO ()
poke Ptr PipelineInputAssemblyStateCreateInfo
ptr PipelineInputAssemblyStateCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineInputAssemblyStateCreateInfo
ptr PipelineInputAssemblyStateCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PipelineInputAssemblyStateCreateInfo where
zero :: PipelineInputAssemblyStateCreateInfo
zero = PipelineInputAssemblyStateCreateFlags
-> PrimitiveTopology
-> Bool
-> PipelineInputAssemblyStateCreateInfo
PipelineInputAssemblyStateCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineTessellationStateCreateInfo (es :: [Type]) = PipelineTessellationStateCreateInfo
{
forall (es :: [*]).
PipelineTessellationStateCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineTessellationStateCreateInfo es
-> PipelineTessellationStateCreateFlags
flags :: PipelineTessellationStateCreateFlags
,
forall (es :: [*]).
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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]).
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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineTessellationStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineTessellationStateCreateInfo e => b
f
| Just e :~: PipelineTessellationDomainOriginStateCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineTessellationDomainOriginStateCreateInfo = forall a. a -> Maybe a
Just Extends PipelineTessellationStateCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineTessellationStateCreateInfo es
, PokeChain es ) => ToCStruct (PipelineTessellationStateCreateInfo es) where
withCStruct :: forall b.
PipelineTessellationStateCreateInfo es
-> (Ptr (PipelineTessellationStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineTessellationStateCreateInfo es
x Ptr (PipelineTessellationStateCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineTessellationStateCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineTessellationStateCreateFlags)) (PipelineTessellationStateCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
patchControlPoints)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr (PipelineTessellationStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineTessellationStateCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineTessellationStateCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineTessellationStateCreateFlags ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineTessellationStateCreateFlags))
"createInfoCount" ::: Word32
patchControlPoints <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineTessellationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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 = forall (es :: [*]).
Chain es
-> PipelineTessellationStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> PipelineTessellationStateCreateInfo es
PipelineTessellationStateCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineViewportStateCreateInfo (es :: [Type]) = PipelineViewportStateCreateInfo
{
forall (es :: [*]). PipelineViewportStateCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineViewportStateCreateInfo es
-> PipelineViewportStateCreateFlags
flags :: PipelineViewportStateCreateFlags
,
forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
viewportCount :: Word32
,
forall (es :: [*]).
PipelineViewportStateCreateInfo es -> Vector Viewport
viewports :: Vector Viewport
,
forall (es :: [*]).
PipelineViewportStateCreateInfo es -> "createInfoCount" ::: Word32
scissorCount :: Word32
,
forall (es :: [*]).
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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]). 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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineViewportStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportDepthClipControlCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportDepthClipControlCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportCoarseSampleOrderStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportCoarseSampleOrderStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportShadingRateImageStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportShadingRateImageStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportExclusiveScissorStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportExclusiveScissorStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportSwizzleStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportSwizzleStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineViewportStateCreateInfo e => b
f
| Just e :~: PipelineViewportWScalingStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineViewportWScalingStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineViewportStateCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineViewportStateCreateInfo es
, PokeChain es ) => ToCStruct (PipelineViewportStateCreateInfo es) where
withCStruct :: forall b.
PipelineViewportStateCreateInfo es
-> (Ptr (PipelineViewportStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineViewportStateCreateInfo es
x Ptr (PipelineViewportStateCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineViewportStateCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineViewportStateCreateFlags)) (PipelineViewportStateCreateFlags
flags)
let pViewportsLength :: Int
pViewportsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Viewport
viewports)
"createInfoCount" ::: Word32
viewportCount'' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ if ("createInfoCount" ::: Word32
viewportCount) forall a. Eq a => a -> a -> Bool
== "createInfoCount" ::: Word32
0
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pViewportsLength
else do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pViewportsLength forall a. Eq a => a -> a -> Bool
== ("createInfoCount" ::: Word32
viewportCount) Bool -> Bool -> Bool
|| Int
pViewportsLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pViewports must be empty or have 'viewportCount' elements" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("createInfoCount" ::: Word32
viewportCount)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
viewportCount'')
Ptr Viewport
pViewports'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector Viewport
viewports)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr Viewport
pPViewports <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Viewport (((forall a. Vector a -> Int
Data.Vector.length (Vector Viewport
viewports))) forall a. Num a => a -> a -> a
* Int
24)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Viewport
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Viewport
pPViewports forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Viewport) (Viewport
e)) ((Vector Viewport
viewports))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr Viewport
pPViewports
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport))) Ptr Viewport
pViewports''
let pScissorsLength :: Int
pScissorsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Rect2D
scissors)
"createInfoCount" ::: Word32
scissorCount'' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ if ("createInfoCount" ::: Word32
scissorCount) forall a. Eq a => a -> a -> Bool
== "createInfoCount" ::: Word32
0
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pScissorsLength
else do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pScissorsLength forall a. Eq a => a -> a -> Bool
== ("createInfoCount" ::: Word32
scissorCount) Bool -> Bool -> Bool
|| Int
pScissorsLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pScissors must be empty or have 'scissorCount' elements" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("createInfoCount" ::: Word32
scissorCount)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ("createInfoCount" ::: Word32
scissorCount'')
Ptr Rect2D
pScissors'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector Rect2D
scissors)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr Rect2D
pPScissors <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Rect2D (((forall a. Vector a -> Int
Data.Vector.length (Vector Rect2D
scissors))) forall a. Num a => a -> a -> a
* Int
16)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Rect2D
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Rect2D
pPScissors forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D) (Rect2D
e)) ((Vector Rect2D
scissors))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr Rect2D
pPScissors
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Rect2D))) Ptr Rect2D
pScissors''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (PipelineViewportStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineViewportStateCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineViewportStateCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineViewportStateCreateFlags ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineViewportStateCreateFlags))
"createInfoCount" ::: Word32
viewportCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr Viewport
pViewports <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Viewport) ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport)))
let pViewportsLength :: Int
pViewportsLength = if Ptr Viewport
pViewports forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
viewportCount)
Vector Viewport
pViewports' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pViewportsLength (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Viewport ((Ptr Viewport
pViewports forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Viewport)))
"createInfoCount" ::: Word32
scissorCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
Ptr Rect2D
pScissors <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Rect2D) ((Ptr (PipelineViewportStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Rect2D)))
let pScissorsLength :: Int
pScissorsLength = if Ptr Rect2D
pScissors forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
scissorCount)
Vector Rect2D
pScissors' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pScissorsLength (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Rect2D ((Ptr Rect2D
pScissors forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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 = forall (es :: [*]).
Chain es
-> PipelineViewportStateCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector Viewport
-> ("createInfoCount" ::: Word32)
-> Vector Rect2D
-> PipelineViewportStateCreateInfo es
PipelineViewportStateCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data PipelineRasterizationStateCreateInfo (es :: [Type]) = PipelineRasterizationStateCreateInfo
{
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es
-> PipelineRasterizationStateCreateFlags
flags :: PipelineRasterizationStateCreateFlags
,
forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
depthClampEnable :: Bool
,
forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
rasterizerDiscardEnable :: Bool
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> PolygonMode
polygonMode :: PolygonMode
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> CullModeFlags
cullMode :: CullModeFlags
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> FrontFace
frontFace :: FrontFace
,
forall (es :: [*]). PipelineRasterizationStateCreateInfo es -> Bool
depthBiasEnable :: Bool
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
depthBiasConstantFactor :: Float
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
depthBiasClamp :: Float
,
forall (es :: [*]).
PipelineRasterizationStateCreateInfo es -> Float
depthBiasSlopeFactor :: Float
,
forall (es :: [*]).
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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]).
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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineRasterizationStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: DepthBiasRepresentationInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @DepthBiasRepresentationInfoEXT = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationProvokingVertexStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationProvokingVertexStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationLineStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationLineStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationDepthClipStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationDepthClipStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationStateStreamCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationStateStreamCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationConservativeStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationConservativeStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Just e :~: PipelineRasterizationStateRasterizationOrderAMD
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRasterizationStateRasterizationOrderAMD = forall a. a -> Maybe a
Just Extends PipelineRasterizationStateCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineRasterizationStateCreateInfo es
, PokeChain es ) => ToCStruct (PipelineRasterizationStateCreateInfo es) where
withCStruct :: forall b.
PipelineRasterizationStateCreateInfo es
-> (Ptr (PipelineRasterizationStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineRasterizationStateCreateInfo es
x Ptr (PipelineRasterizationStateCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineRasterizationStateCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineRasterizationStateCreateFlags)) (PipelineRasterizationStateCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthClampEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
rasterizerDiscardEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PolygonMode)) (PolygonMode
polygonMode)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CullModeFlags)) (CullModeFlags
cullMode)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr FrontFace)) (FrontFace
frontFace)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthBiasEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
depthBiasConstantFactor))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
depthBiasClamp))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
depthBiasSlopeFactor))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
lineWidth))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr (PipelineRasterizationStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineRasterizationStateCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PolygonMode)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr FrontFace)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineRasterizationStateCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineRasterizationStateCreateFlags ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineRasterizationStateCreateFlags))
Bool32
depthClampEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Bool32
rasterizerDiscardEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
PolygonMode
polygonMode <- forall a. Storable a => Ptr a -> IO a
peek @PolygonMode ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PolygonMode))
CullModeFlags
cullMode <- forall a. Storable a => Ptr a -> IO a
peek @CullModeFlags ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CullModeFlags))
FrontFace
frontFace <- forall a. Storable a => Ptr a -> IO a
peek @FrontFace ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr FrontFace))
Bool32
depthBiasEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32))
CFloat
depthBiasConstantFactor <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr CFloat))
CFloat
depthBiasClamp <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr CFloat))
CFloat
depthBiasSlopeFactor <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr CFloat))
CFloat
lineWidth <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineRasterizationStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CFloat))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
depthBiasConstantFactor)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
depthBiasClamp)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
depthBiasSlopeFactor)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
lineWidth)
instance es ~ '[] => Zero (PipelineRasterizationStateCreateInfo es) where
zero :: PipelineRasterizationStateCreateInfo es
zero = forall (es :: [*]).
Chain es
-> PipelineRasterizationStateCreateFlags
-> Bool
-> Bool
-> PolygonMode
-> CullModeFlags
-> FrontFace
-> Bool
-> Float
-> Float
-> Float
-> Float
-> PipelineRasterizationStateCreateInfo es
PipelineRasterizationStateCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineMultisampleStateCreateInfo (es :: [Type]) = PipelineMultisampleStateCreateInfo
{
forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> PipelineMultisampleStateCreateFlags
flags :: PipelineMultisampleStateCreateFlags
,
forall (es :: [*]).
PipelineMultisampleStateCreateInfo es -> SampleCountFlagBits
rasterizationSamples :: SampleCountFlagBits
,
forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
sampleShadingEnable :: Bool
,
forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Float
minSampleShading :: Float
,
forall (es :: [*]).
PipelineMultisampleStateCreateInfo es
-> Vector ("createInfoCount" ::: Word32)
sampleMask :: Vector SampleMask
,
forall (es :: [*]). PipelineMultisampleStateCreateInfo es -> Bool
alphaToCoverageEnable :: Bool
,
forall (es :: [*]). 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 :: forall (ds :: [*]) (es :: [*]).
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{$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 :: forall (es :: [*]).
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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineMultisampleStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineCoverageReductionStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCoverageReductionStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineCoverageModulationStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCoverageModulationStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineSampleLocationsStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineSampleLocationsStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineMultisampleStateCreateInfo e => b
f
| Just e :~: PipelineCoverageToColorStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCoverageToColorStateCreateInfoNV = forall a. a -> Maybe a
Just Extends PipelineMultisampleStateCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineMultisampleStateCreateInfo es
, PokeChain es ) => ToCStruct (PipelineMultisampleStateCreateInfo es) where
withCStruct :: forall b.
PipelineMultisampleStateCreateInfo es
-> (Ptr (PipelineMultisampleStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineMultisampleStateCreateInfo es
x Ptr (PipelineMultisampleStateCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineMultisampleStateCreateInfo es)
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineMultisampleStateCreateFlags)) (PipelineMultisampleStateCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
rasterizationSamples)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
sampleShadingEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minSampleShading))
Ptr ("createInfoCount" ::: Word32)
pSampleMask'' <- case forall a. Vector a -> Int
Data.Vector.length (Vector ("createInfoCount" ::: Word32)
sampleMask) of
Int
0 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Int
vecLen -> do
let requiredLen :: "createInfoCount" ::: Word32
requiredLen = case (SampleCountFlagBits
rasterizationSamples) of
SampleCountFlagBits "createInfoCount" ::: Word32
n -> ("createInfoCount" ::: Word32
n forall a. Num a => a -> a -> a
+ "createInfoCount" ::: Word32
31) forall a. Integral a => a -> a -> a
`quot` "createInfoCount" ::: Word32
32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ("createInfoCount" ::: Word32
requiredLen forall a. Eq a => a -> a -> Bool
== forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
vecLen) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError 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'" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
do
Ptr ("createInfoCount" ::: Word32)
pPSampleMask' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @SampleMask ((forall a. Vector a -> Int
Data.Vector.length ((Vector ("createInfoCount" ::: Word32)
sampleMask))) forall a. Num a => a -> a -> a
* Int
4)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "createInfoCount" ::: Word32
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("createInfoCount" ::: Word32)
pPSampleMask' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleMask) ("createInfoCount" ::: Word32
e)) ((Vector ("createInfoCount" ::: Word32)
sampleMask))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr ("createInfoCount" ::: Word32)
pPSampleMask'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr SampleMask))) Ptr ("createInfoCount" ::: Word32)
pSampleMask''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
alphaToCoverageEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
alphaToOneEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr (PipelineMultisampleStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineMultisampleStateCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SampleCountFlagBits)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineMultisampleStateCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineMultisampleStateCreateFlags ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineMultisampleStateCreateFlags))
SampleCountFlagBits
rasterizationSamples <- forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlagBits ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr SampleCountFlagBits))
Bool32
sampleShadingEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
CFloat
minSampleShading <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CFloat))
Ptr ("createInfoCount" ::: Word32)
pSampleMask <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr SampleMask) ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr SampleMask)))
Vector ("createInfoCount" ::: Word32)
pSampleMask' <- if Ptr ("createInfoCount" ::: Word32)
pSampleMask forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Monoid a => a
mempty
else forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (case SampleCountFlagBits
rasterizationSamples of
SampleCountFlagBits "createInfoCount" ::: Word32
n -> (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
n forall a. Num a => a -> a -> a
+ Int
31) forall a. Integral a => a -> a -> a
`quot` Int
32) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @SampleMask (((Ptr ("createInfoCount" ::: Word32)
pSampleMask) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SampleMask)))
Bool32
alphaToCoverageEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Bool32))
Bool32
alphaToOneEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineMultisampleStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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)
(coerce :: forall a b. Coercible a b => a -> b
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 = forall (es :: [*]).
Chain es
-> PipelineMultisampleStateCreateFlags
-> SampleCountFlagBits
-> Bool
-> Float
-> Vector ("createInfoCount" ::: Word32)
-> Bool
-> Bool
-> PipelineMultisampleStateCreateInfo es
PipelineMultisampleStateCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Zero a => a
zero
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
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 :: forall b.
PipelineColorBlendAttachmentState
-> (Ptr PipelineColorBlendAttachmentState -> IO b) -> IO b
withCStruct PipelineColorBlendAttachmentState
x Ptr PipelineColorBlendAttachmentState -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineColorBlendAttachmentState
p -> 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 :: forall b.
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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
blendEnable))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr BlendFactor)) (BlendFactor
srcColorBlendFactor)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr BlendFactor)) (BlendFactor
dstColorBlendFactor)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr BlendOp)) (BlendOp
colorBlendOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BlendFactor)) (BlendFactor
srcAlphaBlendFactor)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BlendFactor)) (BlendFactor
dstAlphaBlendFactor)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr BlendOp)) (BlendOp
alphaBlendOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p 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 :: forall b. Ptr PipelineColorBlendAttachmentState -> IO b -> IO b
pokeZeroCStruct Ptr PipelineColorBlendAttachmentState
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr BlendFactor)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr BlendFactor)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr BlendOp)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BlendFactor)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BlendFactor)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr 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 <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Bool32))
BlendFactor
srcColorBlendFactor <- forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr BlendFactor))
BlendFactor
dstColorBlendFactor <- forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr BlendFactor))
BlendOp
colorBlendOp <- forall a. Storable a => Ptr a -> IO a
peek @BlendOp ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr BlendOp))
BlendFactor
srcAlphaBlendFactor <- forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BlendFactor))
BlendFactor
dstAlphaBlendFactor <- forall a. Storable a => Ptr a -> IO a
peek @BlendFactor ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr BlendFactor))
BlendOp
alphaBlendOp <- forall a. Storable a => Ptr a -> IO a
peek @BlendOp ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr BlendOp))
ColorComponentFlags
colorWriteMask <- forall a. Storable a => Ptr a -> IO a
peek @ColorComponentFlags ((Ptr PipelineColorBlendAttachmentState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ColorComponentFlags))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineColorBlendAttachmentState
-> PipelineColorBlendAttachmentState -> IO ()
poke Ptr PipelineColorBlendAttachmentState
ptr PipelineColorBlendAttachmentState
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineColorBlendAttachmentState
ptr PipelineColorBlendAttachmentState
poked (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
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PipelineColorBlendStateCreateInfo (es :: [Type]) = PipelineColorBlendStateCreateInfo
{
forall (es :: [*]).
PipelineColorBlendStateCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> PipelineColorBlendStateCreateFlags
flags :: PipelineColorBlendStateCreateFlags
,
forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> Bool
logicOpEnable :: Bool
,
forall (es :: [*]). PipelineColorBlendStateCreateInfo es -> LogicOp
logicOp :: LogicOp
,
forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> "createInfoCount" ::: Word32
attachmentCount :: Word32
,
forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> Vector PipelineColorBlendAttachmentState
attachments :: Vector PipelineColorBlendAttachmentState
,
forall (es :: [*]).
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 :: forall (ds :: [*]) (es :: [*]).
PipelineColorBlendStateCreateInfo ds
-> Chain es -> PipelineColorBlendStateCreateInfo es
setNext PipelineColorBlendStateCreateInfo{Bool
"createInfoCount" ::: Word32
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
Chain ds
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
attachmentCount :: "createInfoCount" ::: Word32
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:attachmentCount:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> "createInfoCount" ::: Word32
$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{$sel:next:PipelineColorBlendStateCreateInfo :: Chain es
next = Chain es
next', Bool
"createInfoCount" ::: Word32
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
attachmentCount :: "createInfoCount" ::: Word32
logicOp :: LogicOp
logicOpEnable :: Bool
flags :: PipelineColorBlendStateCreateFlags
$sel:blendConstants:PipelineColorBlendStateCreateInfo :: (Float, Float, Float, Float)
$sel:attachments:PipelineColorBlendStateCreateInfo :: Vector PipelineColorBlendAttachmentState
$sel:attachmentCount:PipelineColorBlendStateCreateInfo :: "createInfoCount" ::: Word32
$sel:logicOp:PipelineColorBlendStateCreateInfo :: LogicOp
$sel:logicOpEnable:PipelineColorBlendStateCreateInfo :: Bool
$sel:flags:PipelineColorBlendStateCreateInfo :: PipelineColorBlendStateCreateFlags
..}
getNext :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es -> Chain es
getNext PipelineColorBlendStateCreateInfo{Bool
"createInfoCount" ::: Word32
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
Chain es
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
attachmentCount :: "createInfoCount" ::: Word32
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:attachmentCount:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> "createInfoCount" ::: Word32
$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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PipelineColorBlendStateCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends PipelineColorBlendStateCreateInfo e => b
f
| Just e :~: PipelineColorWriteCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineColorWriteCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineColorBlendStateCreateInfo e => b
f
| Just e :~: PipelineColorBlendAdvancedStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineColorBlendAdvancedStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends PipelineColorBlendStateCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss PipelineColorBlendStateCreateInfo es
, PokeChain es ) => ToCStruct (PipelineColorBlendStateCreateInfo es) where
withCStruct :: forall b.
PipelineColorBlendStateCreateInfo es
-> (Ptr (PipelineColorBlendStateCreateInfo es) -> IO b) -> IO b
withCStruct PipelineColorBlendStateCreateInfo es
x Ptr (PipelineColorBlendStateCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineColorBlendStateCreateInfo es)
p -> 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 :: forall b.
Ptr (PipelineColorBlendStateCreateInfo es)
-> PipelineColorBlendStateCreateInfo es -> IO b -> IO b
pokeCStruct Ptr (PipelineColorBlendStateCreateInfo es)
p PipelineColorBlendStateCreateInfo{Bool
"createInfoCount" ::: Word32
(Float, Float, Float, Float)
Vector PipelineColorBlendAttachmentState
Chain es
LogicOp
PipelineColorBlendStateCreateFlags
blendConstants :: (Float, Float, Float, Float)
attachments :: Vector PipelineColorBlendAttachmentState
attachmentCount :: "createInfoCount" ::: Word32
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:attachmentCount:PipelineColorBlendStateCreateInfo :: forall (es :: [*]).
PipelineColorBlendStateCreateInfo es
-> "createInfoCount" ::: Word32
$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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineColorBlendStateCreateFlags)) (PipelineColorBlendStateCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
logicOpEnable))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr LogicOp)) (LogicOp
logicOp)
let pAttachmentsLength :: Int
pAttachmentsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector PipelineColorBlendAttachmentState
attachments)
"createInfoCount" ::: Word32
attachmentCount'' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ if ("createInfoCount" ::: Word32
attachmentCount) forall a. Eq a => a -> a -> Bool
== "createInfoCount" ::: Word32
0
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pAttachmentsLength
else do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pAttachmentsLength forall a. Eq a => a -> a -> Bool
== ("createInfoCount" ::: Word32
attachmentCount) Bool -> Bool -> Bool
|| Int
pAttachmentsLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pAttachments must be empty or have 'attachmentCount' elements" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("createInfoCount" ::: Word32
attachmentCount)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ("createInfoCount" ::: Word32
attachmentCount'')
Ptr PipelineColorBlendAttachmentState
pAttachments'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector PipelineColorBlendAttachmentState
attachments)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr PipelineColorBlendAttachmentState
pPAttachments <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @PipelineColorBlendAttachmentState (((forall a. Vector a -> Int
Data.Vector.length (Vector PipelineColorBlendAttachmentState
attachments))) forall a. Num a => a -> a -> a
* Int
32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i PipelineColorBlendAttachmentState
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr PipelineColorBlendAttachmentState
pPAttachments forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineColorBlendAttachmentState) (PipelineColorBlendAttachmentState
e)) ((Vector PipelineColorBlendAttachmentState
attachments))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr PipelineColorBlendAttachmentState
pPAttachments
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineColorBlendAttachmentState))) Ptr PipelineColorBlendAttachmentState
pAttachments''
let pBlendConstants' :: Ptr CFloat
pBlendConstants' = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (FixedArray 4 CFloat)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ case ((Float, Float, Float, Float)
blendConstants) of
(Float
e0, Float
e1, Float
e2, Float
e3) -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr (PipelineColorBlendStateCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PipelineColorBlendStateCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr LogicOp)) (forall a. Zero a => a
zero)
let pBlendConstants' :: Ptr CFloat
pBlendConstants' = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (FixedArray 4 CFloat)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ case ((forall a. Zero a => a
zero, forall a. Zero a => a
zero, forall a. Zero a => a
zero, forall a. Zero a => a
zero)) of
(Float
e0, Float
e1, Float
e2, Float
e3) -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e0))
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e1))
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e2))
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr CFloat
pBlendConstants' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CFloat) (Float -> CFloat
CFloat (Float
e3))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineColorBlendStateCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineColorBlendStateCreateFlags ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineColorBlendStateCreateFlags))
Bool32
logicOpEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
LogicOp
logicOp <- forall a. Storable a => Ptr a -> IO a
peek @LogicOp ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr LogicOp))
"createInfoCount" ::: Word32
attachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
Ptr PipelineColorBlendAttachmentState
pAttachments <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineColorBlendAttachmentState) ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr PipelineColorBlendAttachmentState)))
let pAttachmentsLength :: Int
pAttachmentsLength = if Ptr PipelineColorBlendAttachmentState
pAttachments forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
attachmentCount)
Vector PipelineColorBlendAttachmentState
pAttachments' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pAttachmentsLength (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineColorBlendAttachmentState ((Ptr PipelineColorBlendAttachmentState
pAttachments forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PipelineColorBlendAttachmentState)))
let pblendConstants :: Ptr CFloat
pblendConstants = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @CFloat ((Ptr (PipelineColorBlendStateCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (FixedArray 4 CFloat)))
CFloat
blendConstants0 <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
0 :: Ptr CFloat))
CFloat
blendConstants1 <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
4 :: Ptr CFloat))
CFloat
blendConstants2 <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
8 :: Ptr CFloat))
CFloat
blendConstants3 <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr CFloat
pblendConstants forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
12 :: Ptr CFloat))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> ("createInfoCount" ::: Word32)
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
PipelineColorBlendStateCreateInfo
Chain es
next
PipelineColorBlendStateCreateFlags
flags
(Bool32 -> Bool
bool32ToBool Bool32
logicOpEnable)
LogicOp
logicOp
"createInfoCount" ::: Word32
attachmentCount
Vector PipelineColorBlendAttachmentState
pAttachments'
(( (coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
blendConstants0)
, (coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
blendConstants1)
, (coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
blendConstants2)
, (coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
blendConstants3) ))
instance es ~ '[] => Zero (PipelineColorBlendStateCreateInfo es) where
zero :: PipelineColorBlendStateCreateInfo es
zero = forall (es :: [*]).
Chain es
-> PipelineColorBlendStateCreateFlags
-> Bool
-> LogicOp
-> ("createInfoCount" ::: Word32)
-> Vector PipelineColorBlendAttachmentState
-> (Float, Float, Float, Float)
-> PipelineColorBlendStateCreateInfo es
PipelineColorBlendStateCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
(forall a. Zero a => a
zero, forall a. Zero a => a
zero, forall a. Zero a => a
zero, 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 :: forall b.
PipelineDynamicStateCreateInfo
-> (Ptr PipelineDynamicStateCreateInfo -> IO b) -> IO b
withCStruct PipelineDynamicStateCreateInfo
x Ptr PipelineDynamicStateCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineDynamicStateCreateInfo
p -> 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 :: forall b.
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 = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDynamicStateCreateFlags)) (PipelineDynamicStateCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector DynamicState
dynamicStates)) :: Word32))
Ptr DynamicState
pPDynamicStates' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DynamicState ((forall a. Vector a -> Int
Data.Vector.length (Vector DynamicState
dynamicStates)) forall a. Num a => a -> a -> a
* Int
4)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i DynamicState
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DynamicState
pPDynamicStates' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DynamicState) (DynamicState
e)) (Vector DynamicState
dynamicStates)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr DynamicState))) (Ptr DynamicState
pPDynamicStates')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PipelineDynamicStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineDynamicStateCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: 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 <- forall a. Storable a => Ptr a -> IO a
peek @PipelineDynamicStateCreateFlags ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDynamicStateCreateFlags))
"createInfoCount" ::: Word32
dynamicStateCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr DynamicState
pDynamicStates <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr DynamicState) ((Ptr PipelineDynamicStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr DynamicState)))
Vector DynamicState
pDynamicStates' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
dynamicStateCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @DynamicState ((Ptr DynamicState
pDynamicStates forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DynamicState)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
forall a. Zero a => a
zero
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
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 :: forall b. StencilOpState -> (Ptr StencilOpState -> IO b) -> IO b
withCStruct StencilOpState
x Ptr StencilOpState -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
28 forall a b. (a -> b) -> a -> b
$ \Ptr StencilOpState
p -> 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 :: forall b. 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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StencilOp)) (StencilOp
failOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr StencilOp)) (StencilOp
passOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr StencilOp)) (StencilOp
depthFailOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CompareOp)) (CompareOp
compareOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("createInfoCount" ::: Word32
compareMask)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
writeMask)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p 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 :: forall b. Ptr StencilOpState -> IO b -> IO b
pokeZeroCStruct Ptr StencilOpState
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StencilOp)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr StencilOp)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr StencilOp)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CompareOp)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr 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 <- forall a. Storable a => Ptr a -> IO a
peek @StencilOp ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StencilOp))
StencilOp
passOp <- forall a. Storable a => Ptr a -> IO a
peek @StencilOp ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr StencilOp))
StencilOp
depthFailOp <- forall a. Storable a => Ptr a -> IO a
peek @StencilOp ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr StencilOp))
CompareOp
compareOp <- forall a. Storable a => Ptr a -> IO a
peek @CompareOp ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr CompareOp))
"createInfoCount" ::: Word32
compareMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
"createInfoCount" ::: Word32
writeMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
"createInfoCount" ::: Word32
reference <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr StencilOpState
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr StencilOpState -> StencilOpState -> IO ()
poke Ptr StencilOpState
ptr StencilOpState
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr StencilOpState
ptr StencilOpState
poked (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
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
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 :: forall b.
PipelineDepthStencilStateCreateInfo
-> (Ptr PipelineDepthStencilStateCreateInfo -> IO b) -> IO b
withCStruct PipelineDepthStencilStateCreateInfo
x Ptr PipelineDepthStencilStateCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
104 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineDepthStencilStateCreateInfo
p -> 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 :: forall b.
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
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDepthStencilStateCreateFlags)) (PipelineDepthStencilStateCreateFlags
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthTestEnable))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthWriteEnable))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CompareOp)) (CompareOp
depthCompareOp)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthBoundsTestEnable))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
stencilTestEnable))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr StencilOpState)) (StencilOpState
front)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr StencilOpState)) (StencilOpState
back)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
minDepthBounds))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p 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 :: forall b. Ptr PipelineDepthStencilStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineDepthStencilStateCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CompareOp)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr StencilOpState)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr StencilOpState)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr CFloat)) (Float -> CFloat
CFloat (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 <- forall a. Storable a => Ptr a -> IO a
peek @PipelineDepthStencilStateCreateFlags ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineDepthStencilStateCreateFlags))
Bool32
depthTestEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Bool32
depthWriteEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
CompareOp
depthCompareOp <- forall a. Storable a => Ptr a -> IO a
peek @CompareOp ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr CompareOp))
Bool32
depthBoundsTestEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32))
Bool32
stencilTestEnable <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32))
StencilOpState
front <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @StencilOpState ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr StencilOpState))
StencilOpState
back <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @StencilOpState ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr StencilOpState))
CFloat
minDepthBounds <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr CFloat))
CFloat
maxDepthBounds <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr PipelineDepthStencilStateCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr CFloat))
forall (f :: * -> *) a. Applicative f => a -> f a
pure 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
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
minDepthBounds)
(coerce :: forall a b. Coercible a b => a -> b
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 = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PipelineDepthStencilStateCreateInfo
-> PipelineDepthStencilStateCreateInfo -> IO ()
poke Ptr PipelineDepthStencilStateCreateInfo
ptr PipelineDepthStencilStateCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineDepthStencilStateCreateInfo
ptr PipelineDepthStencilStateCreateInfo
poked (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
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data GraphicsPipelineCreateInfo (es :: [Type]) = GraphicsPipelineCreateInfo
{
forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
flags :: PipelineCreateFlags
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
stageCount :: Word32
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineInputAssemblyStateCreateInfo
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
rasterizationState :: Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
multisampleState :: Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDepthStencilStateCreateInfo
depthStencilState :: Maybe PipelineDepthStencilStateCreateInfo
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
colorBlendState :: Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es
-> Maybe PipelineDynamicStateCreateInfo
dynamicState :: Maybe PipelineDynamicStateCreateInfo
,
forall (es :: [*]). GraphicsPipelineCreateInfo es -> PipelineLayout
layout :: PipelineLayout
,
forall (es :: [*]). GraphicsPipelineCreateInfo es -> RenderPass
renderPass :: RenderPass
,
forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
subpass :: Word32
,
forall (es :: [*]). GraphicsPipelineCreateInfo es -> Pipeline
basePipelineHandle :: Pipeline
,
forall (es :: [*]). 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 :: forall (ds :: [*]) (es :: [*]).
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 PipelineRasterizationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain ds
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
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 :: Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
stageCount :: "createInfoCount" ::: Word32
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
-> Maybe (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:stageCount:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
$sel:flags:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
$sel:next:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
..} Chain es
next' = 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 PipelineRasterizationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
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 :: Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
stageCount :: "createInfoCount" ::: Word32
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 :: Maybe (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:stageCount:GraphicsPipelineCreateInfo :: "createInfoCount" ::: Word32
$sel:flags:GraphicsPipelineCreateInfo :: PipelineCreateFlags
..}
getNext :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
getNext GraphicsPipelineCreateInfo{Int32
Maybe PipelineInputAssemblyStateCreateInfo
Maybe PipelineDynamicStateCreateInfo
Maybe PipelineDepthStencilStateCreateInfo
Maybe (SomeStruct PipelineViewportStateCreateInfo)
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain es
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
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 :: Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
stageCount :: "createInfoCount" ::: Word32
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
-> Maybe (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:stageCount:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
$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 :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends GraphicsPipelineCreateInfo e => b) -> Maybe b
extends proxy e
_ Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineRobustnessCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRobustnessCreateInfoEXT = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: GraphicsPipelineLibraryCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @GraphicsPipelineLibraryCreateInfoEXT = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: MultiviewPerViewAttributesInfoNVX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @MultiviewPerViewAttributesInfoNVX = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: AttachmentSampleCountInfoAMD
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @AttachmentSampleCountInfoAMD = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineRenderingCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRenderingCreateInfo = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineFragmentShadingRateEnumStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineFragmentShadingRateEnumStateCreateInfoNV = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineFragmentShadingRateStateCreateInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineFragmentShadingRateStateCreateInfoKHR = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineLibraryCreateInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineLibraryCreateInfoKHR = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineCompilerControlCreateInfoAMD
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCompilerControlCreateInfoAMD = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineCreationFeedbackCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreationFeedbackCreateInfo = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineRepresentativeFragmentTestStateCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineRepresentativeFragmentTestStateCreateInfoNV = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: ExternalFormatANDROID
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExternalFormatANDROID = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineDiscardRectangleStateCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineDiscardRectangleStateCreateInfoEXT = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: GraphicsPipelineShaderGroupsCreateInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @GraphicsPipelineShaderGroupsCreateInfoNV = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Just e :~: PipelineCreateFlags2CreateInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @PipelineCreateFlags2CreateInfoKHR = forall a. a -> Maybe a
Just Extends GraphicsPipelineCreateInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss GraphicsPipelineCreateInfo es
, PokeChain es ) => ToCStruct (GraphicsPipelineCreateInfo es) where
withCStruct :: forall b.
GraphicsPipelineCreateInfo es
-> (Ptr (GraphicsPipelineCreateInfo es) -> IO b) -> IO b
withCStruct GraphicsPipelineCreateInfo es
x Ptr (GraphicsPipelineCreateInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
144 forall a b. (a -> b) -> a -> b
$ \Ptr (GraphicsPipelineCreateInfo es)
p -> 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 :: forall b.
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 PipelineRasterizationStateCreateInfo)
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
"createInfoCount" ::: Word32
Vector (SomeStruct PipelineShaderStageCreateInfo)
Chain es
RenderPass
PipelineLayout
Pipeline
PipelineCreateFlags
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 :: Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
viewportState :: Maybe (SomeStruct PipelineViewportStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
inputAssemblyState :: Maybe PipelineInputAssemblyStateCreateInfo
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
stageCount :: "createInfoCount" ::: Word32
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
-> Maybe (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:stageCount:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> "createInfoCount" ::: Word32
$sel:flags:GraphicsPipelineCreateInfo :: forall (es :: [*]).
GraphicsPipelineCreateInfo es -> PipelineCreateFlags
$sel:next:GraphicsPipelineCreateInfo :: forall (es :: [*]). GraphicsPipelineCreateInfo es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags)) (PipelineCreateFlags
flags)
let pStagesLength :: Int
pStagesLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)
"createInfoCount" ::: Word32
stageCount'' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ if ("createInfoCount" ::: Word32
stageCount) forall a. Eq a => a -> a -> Bool
== "createInfoCount" ::: Word32
0
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pStagesLength
else do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pStagesLength forall a. Eq a => a -> a -> Bool
== ("createInfoCount" ::: Word32
stageCount) Bool -> Bool -> Bool
|| Int
pStagesLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pStages must be empty or have 'stageCount' elements" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (f :: * -> *) a. Applicative f => a -> f a
pure ("createInfoCount" ::: Word32
stageCount)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ("createInfoCount" ::: Word32
stageCount'')
Ptr (PipelineShaderStageCreateInfo Any)
pStages'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr (PipelineShaderStageCreateInfo Any)
pPStages <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(PipelineShaderStageCreateInfo _) (((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages))) forall a. Num a => a -> a -> a
* Int
48)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct PipelineShaderStageCreateInfo
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineShaderStageCreateInfo Any)
pPStages forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _))) (SomeStruct PipelineShaderStageCreateInfo
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ((Vector (SomeStruct PipelineShaderStageCreateInfo)
stages))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr (PipelineShaderStageCreateInfo Any)
pPStages
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _)))) Ptr (PipelineShaderStageCreateInfo Any)
pStages''
Ptr (PipelineVertexInputStateCreateInfo '[])
pVertexInputState'' <- case (Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
vertexInputState) of
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct PipelineVertexInputStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineVertexInputStateCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b
cont -> 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 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just PipelineInputAssemblyStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineInputAssemblyStateCreateInfo
j)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct PipelineTessellationStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineTessellationStateCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b
cont -> 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 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct PipelineViewportStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineViewportStateCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineViewportStateCreateInfo '[]) -> IO b
cont -> 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 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (PipelineViewportStateCreateInfo _)))) Ptr (PipelineViewportStateCreateInfo '[])
pViewportState''
Ptr (PipelineRasterizationStateCreateInfo '[])
pRasterizationState'' <- case (Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
rasterizationState) of
Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct PipelineRasterizationStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineRasterizationStateCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b
cont -> 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
j) (Ptr (PipelineRasterizationStateCreateInfo '[]) -> IO b
cont forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct PipelineMultisampleStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineMultisampleStateCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineMultisampleStateCreateInfo '[]) -> IO b
cont -> 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 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just PipelineDepthStencilStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineDepthStencilStateCreateInfo
j)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct PipelineColorBlendStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineColorBlendStateCreateInfo '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (PipelineColorBlendStateCreateInfo '[]) -> IO b
cont -> 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 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p 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 -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just PipelineDynamicStateCreateInfo
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PipelineDynamicStateCreateInfo
j)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr (Ptr PipelineDynamicStateCreateInfo))) Ptr PipelineDynamicStateCreateInfo
pDynamicState''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PipelineLayout)) (PipelineLayout
layout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr RenderPass)) (RenderPass
renderPass)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32)) ("createInfoCount" ::: Word32
subpass)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr Pipeline)) (Pipeline
basePipelineHandle)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr Int32)) (Int32
basePipelineIndex)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
144
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (GraphicsPipelineCreateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (GraphicsPipelineCreateInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr Int32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift 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 <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
PipelineCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @PipelineCreateFlags ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineCreateFlags))
"createInfoCount" ::: Word32
stageCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr (PipelineShaderStageCreateInfo Any)
pStages <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineShaderStageCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _))))
let pStagesLength :: Int
pStagesLength = if Ptr (PipelineShaderStageCreateInfo Any)
pStages forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral "createInfoCount" ::: Word32
stageCount)
Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pStagesLength (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (PipelineShaderStageCreateInfo Any)
pStages forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _)))))
Ptr (PipelineVertexInputStateCreateInfo Any)
pVertexInputState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineVertexInputStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr (PipelineVertexInputStateCreateInfo _))))
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
pVertexInputState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineVertexInputStateCreateInfo Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineVertexInputStateCreateInfo Any)
j))) Ptr (PipelineVertexInputStateCreateInfo Any)
pVertexInputState
Ptr PipelineInputAssemblyStateCreateInfo
pInputAssemblyState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineInputAssemblyStateCreateInfo) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr PipelineInputAssemblyStateCreateInfo)))
Maybe PipelineInputAssemblyStateCreateInfo
pInputAssemblyState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr PipelineInputAssemblyStateCreateInfo
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineInputAssemblyStateCreateInfo (Ptr PipelineInputAssemblyStateCreateInfo
j)) Ptr PipelineInputAssemblyStateCreateInfo
pInputAssemblyState
Ptr (PipelineTessellationStateCreateInfo Any)
pTessellationState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineTessellationStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (PipelineTessellationStateCreateInfo _))))
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
pTessellationState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineTessellationStateCreateInfo Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineTessellationStateCreateInfo Any)
j))) Ptr (PipelineTessellationStateCreateInfo Any)
pTessellationState
Ptr (PipelineViewportStateCreateInfo Any)
pViewportState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineViewportStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (PipelineViewportStateCreateInfo _))))
Maybe (SomeStruct PipelineViewportStateCreateInfo)
pViewportState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineViewportStateCreateInfo Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineViewportStateCreateInfo Any)
j))) Ptr (PipelineViewportStateCreateInfo Any)
pViewportState
Ptr (PipelineRasterizationStateCreateInfo Any)
pRasterizationState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineRasterizationStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr (PipelineRasterizationStateCreateInfo _))))
Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
pRasterizationState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineRasterizationStateCreateInfo Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineRasterizationStateCreateInfo Any)
j))) Ptr (PipelineRasterizationStateCreateInfo Any)
pRasterizationState
Ptr (PipelineMultisampleStateCreateInfo Any)
pMultisampleState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineMultisampleStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr (PipelineMultisampleStateCreateInfo _))))
Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
pMultisampleState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineMultisampleStateCreateInfo Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineMultisampleStateCreateInfo Any)
j))) Ptr (PipelineMultisampleStateCreateInfo Any)
pMultisampleState
Ptr PipelineDepthStencilStateCreateInfo
pDepthStencilState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineDepthStencilStateCreateInfo) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr PipelineDepthStencilStateCreateInfo)))
Maybe PipelineDepthStencilStateCreateInfo
pDepthStencilState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr PipelineDepthStencilStateCreateInfo
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineDepthStencilStateCreateInfo (Ptr PipelineDepthStencilStateCreateInfo
j)) Ptr PipelineDepthStencilStateCreateInfo
pDepthStencilState
Ptr (PipelineColorBlendStateCreateInfo Any)
pColorBlendState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineColorBlendStateCreateInfo _)) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr (Ptr (PipelineColorBlendStateCreateInfo _))))
Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
pColorBlendState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (PipelineColorBlendStateCreateInfo Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineColorBlendStateCreateInfo Any)
j))) Ptr (PipelineColorBlendStateCreateInfo Any)
pColorBlendState
Ptr PipelineDynamicStateCreateInfo
pDynamicState <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PipelineDynamicStateCreateInfo) ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr (Ptr PipelineDynamicStateCreateInfo)))
Maybe PipelineDynamicStateCreateInfo
pDynamicState' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr PipelineDynamicStateCreateInfo
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PipelineDynamicStateCreateInfo (Ptr PipelineDynamicStateCreateInfo
j)) Ptr PipelineDynamicStateCreateInfo
pDynamicState
PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PipelineLayout))
RenderPass
renderPass <- forall a. Storable a => Ptr a -> IO a
peek @RenderPass ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr RenderPass))
"createInfoCount" ::: Word32
subpass <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32))
Pipeline
basePipelineHandle <- forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr Pipeline))
Int32
basePipelineIndex <- forall a. Storable a => Ptr a -> IO a
peek @Int32 ((Ptr (GraphicsPipelineCreateInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr Int32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> Maybe (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
"createInfoCount" ::: Word32
stageCount
Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages'
Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
pVertexInputState'
Maybe PipelineInputAssemblyStateCreateInfo
pInputAssemblyState'
Maybe (SomeStruct PipelineTessellationStateCreateInfo)
pTessellationState'
Maybe (SomeStruct PipelineViewportStateCreateInfo)
pViewportState'
Maybe (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 = forall (es :: [*]).
Chain es
-> PipelineCreateFlags
-> ("createInfoCount" ::: Word32)
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe PipelineInputAssemblyStateCreateInfo
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> Maybe (SomeStruct PipelineViewportStateCreateInfo)
-> Maybe (SomeStruct PipelineRasterizationStateCreateInfo)
-> Maybe (SomeStruct PipelineMultisampleStateCreateInfo)
-> Maybe PipelineDepthStencilStateCreateInfo
-> Maybe (SomeStruct PipelineColorBlendStateCreateInfo)
-> Maybe PipelineDynamicStateCreateInfo
-> PipelineLayout
-> RenderPass
-> ("createInfoCount" ::: Word32)
-> Pipeline
-> Int32
-> GraphicsPipelineCreateInfo es
GraphicsPipelineCreateInfo
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero