{-# language CPP #-}
module Vulkan.Extensions.VK_NV_device_generated_commands  ( cmdExecuteGeneratedCommandsNV
                                                          , cmdPreprocessGeneratedCommandsNV
                                                          , cmdBindPipelineShaderGroupNV
                                                          , getGeneratedCommandsMemoryRequirementsNV
                                                          , createIndirectCommandsLayoutNV
                                                          , withIndirectCommandsLayoutNV
                                                          , destroyIndirectCommandsLayoutNV
                                                          , PhysicalDeviceDeviceGeneratedCommandsFeaturesNV(..)
                                                          , PhysicalDeviceDeviceGeneratedCommandsPropertiesNV(..)
                                                          , GraphicsShaderGroupCreateInfoNV(..)
                                                          , GraphicsPipelineShaderGroupsCreateInfoNV(..)
                                                          , BindShaderGroupIndirectCommandNV(..)
                                                          , BindIndexBufferIndirectCommandNV(..)
                                                          , BindVertexBufferIndirectCommandNV(..)
                                                          , SetStateFlagsIndirectCommandNV(..)
                                                          , IndirectCommandsStreamNV(..)
                                                          , IndirectCommandsLayoutTokenNV(..)
                                                          , IndirectCommandsLayoutCreateInfoNV(..)
                                                          , GeneratedCommandsInfoNV(..)
                                                          , GeneratedCommandsMemoryRequirementsInfoNV(..)
                                                          , IndirectCommandsLayoutUsageFlagBitsNV( INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV
                                                                                                 , INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV
                                                                                                 , INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV
                                                                                                 , ..
                                                                                                 )
                                                          , IndirectCommandsLayoutUsageFlagsNV
                                                          , IndirectStateFlagBitsNV( INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV
                                                                                   , ..
                                                                                   )
                                                          , IndirectStateFlagsNV
                                                          , IndirectCommandsTokenTypeNV( INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV
                                                                                       , INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV
                                                                                       , ..
                                                                                       )
                                                          , NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION
                                                          , pattern NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION
                                                          , NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME
                                                          , pattern NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME
                                                          , IndirectCommandsLayoutNV(..)
                                                          ) where

import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
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 Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
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 Control.Monad.IO.Class (MonadIO)
import Data.Bits (Bits)
import Data.String (IsString)
import Data.Typeable (Typeable)
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 GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Text.Read.Lex (Lexeme(Ident))
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.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Bool32(..))
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBindPipelineShaderGroupNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdExecuteGeneratedCommandsNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPreprocessGeneratedCommandsNV))
import Vulkan.Dynamic (DeviceCmds(pVkCreateIndirectCommandsLayoutNV))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyIndirectCommandsLayoutNV))
import Vulkan.Dynamic (DeviceCmds(pVkGetGeneratedCommandsMemoryRequirementsNV))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.IndexType (IndexType)
import Vulkan.Extensions.Handles (IndirectCommandsLayoutNV)
import Vulkan.Extensions.Handles (IndirectCommandsLayoutNV(..))
import Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2 (MemoryRequirements2)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.Core10.Handles (Pipeline)
import Vulkan.Core10.Handles (Pipeline(..))
import Vulkan.Core10.Enums.PipelineBindPoint (PipelineBindPoint)
import Vulkan.Core10.Enums.PipelineBindPoint (PipelineBindPoint(..))
import Vulkan.Core10.Handles (PipelineLayout)
import Vulkan.Core10.Pipeline (PipelineShaderStageCreateInfo)
import Vulkan.Core10.Pipeline (PipelineTessellationStateCreateInfo)
import Vulkan.Core10.Pipeline (PipelineVertexInputStateCreateInfo)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (IndirectCommandsLayoutNV(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdExecuteGeneratedCommandsNV
  :: FunPtr (Ptr CommandBuffer_T -> Bool32 -> Ptr GeneratedCommandsInfoNV -> IO ()) -> Ptr CommandBuffer_T -> Bool32 -> Ptr GeneratedCommandsInfoNV -> IO ()

-- | vkCmdExecuteGeneratedCommandsNV - Performs the generation and execution
-- of commands on the device
--
-- == Valid Usage
--
-- -   If a 'Vulkan.Core10.Handles.Sampler' created with @magFilter@ or
--     @minFilter@ equal to 'Vulkan.Core10.Enums.Filter.FILTER_LINEAR' and
--     @compareEnable@ equal to 'Vulkan.Core10.FundamentalTypes.FALSE' is
--     used to sample a 'Vulkan.Core10.Handles.ImageView' as a result of
--     this command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT'
--
-- -   If a 'Vulkan.Core10.Handles.ImageView' is accessed using atomic
--     operations as a result of this command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT'
--
-- -   If a 'Vulkan.Core10.Handles.ImageView' is sampled with
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FILTER_CUBIC_EXT' as a result
--     of this command, then the image view’s
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-view-format-features format features>
--     /must/ contain
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT'
--
-- -   Any 'Vulkan.Core10.Handles.ImageView' being sampled with
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FILTER_CUBIC_EXT' as a result
--     of this command /must/ have a
--     'Vulkan.Core10.Enums.ImageViewType.ImageViewType' and format that
--     supports cubic filtering, as specified by
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FilterCubicImageViewImageFormatPropertiesEXT'::@filterCubic@
--     returned by
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceImageFormatProperties2'
--
-- -   Any 'Vulkan.Core10.Handles.ImageView' being sampled with
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FILTER_CUBIC_EXT' with a
--     reduction mode of either
--     'Vulkan.Core12.Enums.SamplerReductionMode.SAMPLER_REDUCTION_MODE_MIN'
--     or
--     'Vulkan.Core12.Enums.SamplerReductionMode.SAMPLER_REDUCTION_MODE_MAX'
--     as a result of this command /must/ have a
--     'Vulkan.Core10.Enums.ImageViewType.ImageViewType' and format that
--     supports cubic filtering together with minmax filtering, as
--     specified by
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FilterCubicImageViewImageFormatPropertiesEXT'::@filterCubicMinmax@
--     returned by
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceImageFormatProperties2'
--
-- -   Any 'Vulkan.Core10.Handles.Image' created with a
--     'Vulkan.Core10.Image.ImageCreateInfo'::@flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_CORNER_SAMPLED_BIT_NV'
--     sampled as a result of this command /must/ only be sampled using a
--     'Vulkan.Core10.Enums.SamplerAddressMode.SamplerAddressMode' of
--     'Vulkan.Core10.Enums.SamplerAddressMode.SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE'
--
-- -   For each set /n/ that is statically used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     used by this command, a descriptor set /must/ have been bound to /n/
--     at the same pipeline bind point, with a
--     'Vulkan.Core10.Handles.PipelineLayout' that is compatible for set
--     /n/, with the 'Vulkan.Core10.Handles.PipelineLayout' used to create
--     the current 'Vulkan.Core10.Handles.Pipeline', as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-compatibility ???>
--
-- -   For each push constant that is statically used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     used by this command, a push constant value /must/ have been set for
--     the same pipeline bind point, with a
--     'Vulkan.Core10.Handles.PipelineLayout' that is compatible for push
--     constants, with the 'Vulkan.Core10.Handles.PipelineLayout' used to
--     create the current 'Vulkan.Core10.Handles.Pipeline', as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#descriptorsets-compatibility ???>
--
-- -   Descriptors in each bound descriptor set, specified via
--     'Vulkan.Core10.CommandBufferBuilding.cmdBindDescriptorSets', /must/
--     be valid if they are statically used by the
--     'Vulkan.Core10.Handles.Pipeline' bound to the pipeline bind point
--     used by this command
--
-- -   A valid pipeline /must/ be bound to the pipeline bind point used by
--     this command
--
-- -   If the 'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline
--     bind point used by this command requires any dynamic state, that
--     state /must/ have been set for @commandBuffer@, and done so after
--     any previously bound pipeline with the corresponding state not
--     specified as dynamic
--
-- -   There /must/ not have been any calls to dynamic state setting
--     commands for any state not specified as dynamic in the
--     'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline bind
--     point used by this command, since that pipeline was bound
--
-- -   If the 'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline
--     bind point used by this command accesses a
--     'Vulkan.Core10.Handles.Sampler' object that uses unnormalized
--     coordinates, that sampler /must/ not be used to sample from any
--     'Vulkan.Core10.Handles.Image' with a
--     'Vulkan.Core10.Handles.ImageView' of the type
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_3D',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_CUBE',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_1D_ARRAY',
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_2D_ARRAY' or
--     'Vulkan.Core10.Enums.ImageViewType.IMAGE_VIEW_TYPE_CUBE_ARRAY', in
--     any shader stage
--
-- -   If the 'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline
--     bind point used by this command accesses a
--     'Vulkan.Core10.Handles.Sampler' object that uses unnormalized
--     coordinates, that sampler /must/ not be used with any of the SPIR-V
--     @OpImageSample*@ or @OpImageSparseSample*@ instructions with
--     @ImplicitLod@, @Dref@ or @Proj@ in their name, in any shader stage
--
-- -   If the 'Vulkan.Core10.Handles.Pipeline' object bound to the pipeline
--     bind point used by this command accesses a
--     'Vulkan.Core10.Handles.Sampler' object that uses unnormalized
--     coordinates, that sampler /must/ not be used with any of the SPIR-V
--     @OpImageSample*@ or @OpImageSparseSample*@ instructions that
--     includes a LOD bias or any offset values, in any shader stage
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-robustBufferAccess robust buffer access>
--     feature is not enabled, and if the 'Vulkan.Core10.Handles.Pipeline'
--     object bound to the pipeline bind point used by this command
--     accesses a uniform buffer, it /must/ not access values outside of
--     the range of the buffer as specified in the descriptor set bound to
--     the same pipeline bind point
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-robustBufferAccess robust buffer access>
--     feature is not enabled, and if the 'Vulkan.Core10.Handles.Pipeline'
--     object bound to the pipeline bind point used by this command
--     accesses a storage buffer, it /must/ not access values outside of
--     the range of the buffer as specified in the descriptor set bound to
--     the same pipeline bind point
--
-- -   If @commandBuffer@ is an unprotected command buffer, any resource
--     accessed by the 'Vulkan.Core10.Handles.Pipeline' object bound to the
--     pipeline bind point used by this command /must/ not be a protected
--     resource
--
-- -   If a 'Vulkan.Core10.Handles.ImageView' is accessed using
--     @OpImageWrite@ as a result of this command, then the @Type@ of the
--     @Texel@ operand of that instruction /must/ have at least as many
--     components as the image view’s format.
--
-- -   If a 'Vulkan.Core10.Handles.BufferView' is accessed using
--     @OpImageWrite@ as a result of this command, then the @Type@ of the
--     @Texel@ operand of that instruction /must/ have at least as many
--     components as the image view’s format.
--
-- -   If a 'Vulkan.Core10.Handles.ImageView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a 64-bit channel width
--     is accessed as a result of this command, the @SampledType@ of the
--     @OpTypeImage@ operand of that instruction /must/ have a @Width@ of
--     64.
--
-- -   If a 'Vulkan.Core10.Handles.ImageView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a channel width less
--     than 64-bit is accessed as a result of this command, the
--     @SampledType@ of the @OpTypeImage@ operand of that instruction
--     /must/ have a @Width@ of 32.
--
-- -   If a 'Vulkan.Core10.Handles.BufferView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a 64-bit channel width
--     is accessed as a result of this command, the @SampledType@ of the
--     @OpTypeImage@ operand of that instruction /must/ have a @Width@ of
--     64.
--
-- -   If a 'Vulkan.Core10.Handles.BufferView' with a
--     'Vulkan.Core10.Enums.Format.Format' that has a channel width less
--     than 64-bit is accessed as a result of this command, the
--     @SampledType@ of the @OpTypeImage@ operand of that instruction
--     /must/ have a @Width@ of 32.
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-sparseImageInt64Atomics sparseImageInt64Atomics>
--     feature is not enabled, 'Vulkan.Core10.Handles.Image' objects
--     created with the
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SPARSE_RESIDENCY_BIT'
--     flag /must/ not be accessed by atomic instructions through an
--     @OpTypeImage@ with a @SampledType@ with a @Width@ of 64 by this
--     command.
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-sparseImageInt64Atomics sparseImageInt64Atomics>
--     feature is not enabled, 'Vulkan.Core10.Handles.Buffer' objects
--     created with the
--     'Vulkan.Core10.Enums.BufferCreateFlagBits.BUFFER_CREATE_SPARSE_RESIDENCY_BIT'
--     flag /must/ not be accessed by atomic instructions through an
--     @OpTypeImage@ with a @SampledType@ with a @Width@ of 64 by this
--     command.
--
-- -   The current render pass /must/ be
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#renderpass-compatibility compatible>
--     with the @renderPass@ member of the
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo' structure
--     specified when creating the 'Vulkan.Core10.Handles.Pipeline' bound
--     to
--     'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS'
--
-- -   The subpass index of the current render pass /must/ be equal to the
--     @subpass@ member of the
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo' structure
--     specified when creating the 'Vulkan.Core10.Handles.Pipeline' bound
--     to
--     'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS'
--
-- -   Every input attachment used by the current subpass /must/ be bound
--     to the pipeline via a descriptor set
--
-- -   Image subresources used as attachments in the current render pass
--     /must/ not be accessed in any way other than as an attachment by
--     this command
--
-- -   If the draw is recorded in a render pass instance with multiview
--     enabled, the maximum instance index /must/ be less than or equal to
--     'Vulkan.Core11.Promoted_From_VK_KHR_multiview.PhysicalDeviceMultiviewProperties'::@maxMultiviewInstanceIndex@
--
-- -   If the bound graphics pipeline was created with
--     'Vulkan.Extensions.VK_EXT_sample_locations.PipelineSampleLocationsStateCreateInfoEXT'::@sampleLocationsEnable@
--     set to 'Vulkan.Core10.FundamentalTypes.TRUE' and the current subpass
--     has a depth\/stencil attachment, then that attachment /must/ have
--     been created with the
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT'
--     bit set
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled, but not the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT'
--     dynamic state enabled, then
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--     /must/ have been called in the current command buffer prior to this
--     draw command, and the @viewportCount@ parameter of
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--     /must/ match the
--     'Vulkan.Core10.Pipeline.PipelineViewportStateCreateInfo'::@scissorCount@
--     of the pipeline
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT'
--     dynamic state enabled, but not the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled, then
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetScissorWithCountEXT'
--     /must/ have been called in the current command buffer prior to this
--     draw command, and the @scissorCount@ parameter of
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetScissorWithCountEXT'
--     /must/ match the
--     'Vulkan.Core10.Pipeline.PipelineViewportStateCreateInfo'::@viewportCount@
--     of the pipeline
--
-- -   If the bound graphics pipeline state was created with both the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT'
--     and
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic states enabled then both
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--     and
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetScissorWithCountEXT'
--     /must/ have been called in the current command buffer prior to this
--     draw command, and the @viewportCount@ parameter of
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--     /must/ match the @scissorCount@ parameter of
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetScissorWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled, but not the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_W_SCALING_NV'
--     dynamic state enabled, then the bound graphics pipeline /must/ have
--     been created with
--     'Vulkan.Extensions.VK_NV_clip_space_w_scaling.PipelineViewportWScalingStateCreateInfoNV'::@viewportCount@
--     greater or equal to the @viewportCount@ parameter in the last call
--     to
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     and
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_W_SCALING_NV'
--     dynamic states enabled then the @viewportCount@ parameter in the
--     last call to
--     'Vulkan.Extensions.VK_NV_clip_space_w_scaling.cmdSetViewportWScalingNV'
--     /must/ be greater than or equal to the @viewportCount@ parameter in
--     the last call to
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled, but not the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV'
--     dynamic state enabled, then the bound graphics pipeline /must/ have
--     been created with
--     'Vulkan.Extensions.VK_NV_shading_rate_image.PipelineViewportShadingRateImageStateCreateInfoNV'::@viewportCount@
--     greater or equal to the @viewportCount@ parameter in the last call
--     to
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     and
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV'
--     dynamic states enabled then the @viewportCount@ parameter in the
--     last call to
--     'Vulkan.Extensions.VK_NV_shading_rate_image.cmdSetViewportShadingRatePaletteNV'
--     /must/ be greater than or equal to the @viewportCount@ parameter in
--     the last call to
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled and an instance of
--     'Vulkan.Extensions.VK_NV_viewport_swizzle.PipelineViewportSwizzleStateCreateInfoNV'
--     chained from @VkPipelineVieportCreateInfo@, then the bound graphics
--     pipeline /must/ have been created with
--     'Vulkan.Extensions.VK_NV_viewport_swizzle.PipelineViewportSwizzleStateCreateInfoNV'::@viewportCount@
--     greater or equal to the @viewportCount@ parameter in the last call
--     to
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled and an instance of
--     'Vulkan.Extensions.VK_NV_scissor_exclusive.PipelineViewportExclusiveScissorStateCreateInfoNV'
--     chained from @VkPipelineVieportCreateInfo@, then the bound graphics
--     pipeline /must/ have been created with
--     'Vulkan.Extensions.VK_NV_scissor_exclusive.PipelineViewportExclusiveScissorStateCreateInfoNV'::@exclusiveScissorCount@
--     greater or equal to the @viewportCount@ parameter in the last call
--     to
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--
-- -   If the bound graphics pipeline state was created with the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT'
--     dynamic state enabled then
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetPrimitiveTopologyEXT'
--     /must/ have been called in the current command buffer prior to this
--     draw command, and the @primitiveTopology@ parameter of
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetPrimitiveTopologyEXT'
--     /must/ be of the same
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-primitive-topology-class topology class>
--     as the pipeline
--     'Vulkan.Core10.Pipeline.PipelineInputAssemblyStateCreateInfo'::@topology@
--     state
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-primitiveFragmentShadingRateWithMultipleViewports primitiveFragmentShadingRateWithMultipleViewports>
--     limit is not supported, the bound graphics pipeline was created with
--     the
--     'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT'
--     dynamic state enabled, and any of the shader stages of the bound
--     graphics pipeline write to the @PrimitiveShadingRateKHR@ built-in,
--     then
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--     /must/ have been called in the current command buffer prior to this
--     draw command, and the @viewportCount@ parameter of
--     'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetViewportWithCountEXT'
--     /must/ be @1@
--
-- -   All vertex input bindings accessed via vertex input variables
--     declared in the vertex shader entry point’s interface /must/ have
--     either valid or 'Vulkan.Core10.APIConstants.NULL_HANDLE' buffers
--     bound
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-nullDescriptor nullDescriptor>
--     feature is not enabled, all vertex input bindings accessed via
--     vertex input variables declared in the vertex shader entry point’s
--     interface /must/ not be 'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   For a given vertex buffer binding, any attribute data fetched /must/
--     be entirely contained within the corresponding vertex buffer
--     binding, as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fxvertex-input ???>
--
-- -   @commandBuffer@ /must/ not be a protected command buffer
--
-- -   If @isPreprocessed@ is 'Vulkan.Core10.FundamentalTypes.TRUE' then
--     'cmdPreprocessGeneratedCommandsNV' /must/ have already been executed
--     on the device, using the same @pGeneratedCommandsInfo@ content as
--     well as the content of the input buffers it references (all except
--     'GeneratedCommandsInfoNV'::@preprocessBuffer@). Furthermore
--     @pGeneratedCommandsInfo@\`s @indirectCommandsLayout@ /must/ have
--     been created with the
--     'INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV' bit set
--
-- -   'GeneratedCommandsInfoNV'::@pipeline@ /must/ match the current bound
--     pipeline at 'GeneratedCommandsInfoNV'::@pipelineBindPoint@
--
-- -   Transform feedback /must/ not be active
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   @pGeneratedCommandsInfo@ /must/ be a valid pointer to a valid
--     'GeneratedCommandsInfoNV' structure
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   This command /must/ only be called inside of a render pass instance
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Inside                                                                                                                 | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Handles.CommandBuffer', 'GeneratedCommandsInfoNV'
cmdExecuteGeneratedCommandsNV :: forall io
                               . (MonadIO io)
                              => -- | @commandBuffer@ is the command buffer into which the command is
                                 -- recorded.
                                 CommandBuffer
                              -> -- | @isPreprocessed@ represents whether the input data has already been
                                 -- preprocessed on the device. If it is
                                 -- 'Vulkan.Core10.FundamentalTypes.FALSE' this command will implicitly
                                 -- trigger the preprocessing step, otherwise not.
                                 ("isPreprocessed" ::: Bool)
                              -> -- | @pGeneratedCommandsInfo@ is a pointer to an instance of the
                                 -- 'GeneratedCommandsInfoNV' structure containing parameters affecting the
                                 -- generation of commands.
                                 GeneratedCommandsInfoNV
                              -> io ()
cmdExecuteGeneratedCommandsNV :: CommandBuffer
-> ("isPreprocessed" ::: Bool) -> GeneratedCommandsInfoNV -> io ()
cmdExecuteGeneratedCommandsNV commandBuffer :: CommandBuffer
commandBuffer isPreprocessed :: "isPreprocessed" ::: Bool
isPreprocessed generatedCommandsInfo :: GeneratedCommandsInfoNV
generatedCommandsInfo = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdExecuteGeneratedCommandsNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("isPreprocessed" ::: Bool32)
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
vkCmdExecuteGeneratedCommandsNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("isPreprocessed" ::: Bool32)
      -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
      -> IO ())
pVkCmdExecuteGeneratedCommandsNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("isPreprocessed" ::: Bool32)
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
vkCmdExecuteGeneratedCommandsNVPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("isPreprocessed" ::: Bool32)
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("isPreprocessed" ::: Bool32)
      -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
      -> IO ())
-> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("isPreprocessed" ::: Bool32)
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdExecuteGeneratedCommandsNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdExecuteGeneratedCommandsNV' :: Ptr CommandBuffer_T
-> ("isPreprocessed" ::: Bool32)
-> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
-> IO ()
vkCmdExecuteGeneratedCommandsNV' = FunPtr
  (Ptr CommandBuffer_T
   -> ("isPreprocessed" ::: Bool32)
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("isPreprocessed" ::: Bool32)
-> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
-> IO ()
mkVkCmdExecuteGeneratedCommandsNV FunPtr
  (Ptr CommandBuffer_T
   -> ("isPreprocessed" ::: Bool32)
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
vkCmdExecuteGeneratedCommandsNVPtr
  "pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV
pGeneratedCommandsInfo <- ((("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV))
-> ((("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
forall a b. (a -> b) -> a -> b
$ GeneratedCommandsInfoNV
-> (("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (GeneratedCommandsInfoNV
generatedCommandsInfo)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("isPreprocessed" ::: Bool32)
-> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
-> IO ()
vkCmdExecuteGeneratedCommandsNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (("isPreprocessed" ::: Bool) -> "isPreprocessed" ::: Bool32
boolToBool32 ("isPreprocessed" ::: Bool
isPreprocessed)) "pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV
pGeneratedCommandsInfo
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdPreprocessGeneratedCommandsNV
  :: FunPtr (Ptr CommandBuffer_T -> Ptr GeneratedCommandsInfoNV -> IO ()) -> Ptr CommandBuffer_T -> Ptr GeneratedCommandsInfoNV -> IO ()

-- | vkCmdPreprocessGeneratedCommandsNV - Performs preprocessing for
-- generated commands
--
-- == Valid Usage
--
-- -   @commandBuffer@ /must/ not be a protected command buffer
--
-- -   @pGeneratedCommandsInfo@\`s @indirectCommandsLayout@ /must/ have
--     been created with the
--     'INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV' bit set
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   @pGeneratedCommandsInfo@ /must/ be a valid pointer to a valid
--     'GeneratedCommandsInfoNV' structure
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   This command /must/ only be called outside of a render pass instance
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'GeneratedCommandsInfoNV'
cmdPreprocessGeneratedCommandsNV :: forall io
                                  . (MonadIO io)
                                 => -- | @commandBuffer@ is the command buffer which does the preprocessing.
                                    CommandBuffer
                                 -> -- | @pGeneratedCommandsInfo@ is a pointer to an instance of the
                                    -- 'GeneratedCommandsInfoNV' structure containing parameters affecting the
                                    -- preprocessing step.
                                    GeneratedCommandsInfoNV
                                 -> io ()
cmdPreprocessGeneratedCommandsNV :: CommandBuffer -> GeneratedCommandsInfoNV -> io ()
cmdPreprocessGeneratedCommandsNV commandBuffer :: CommandBuffer
commandBuffer generatedCommandsInfo :: GeneratedCommandsInfoNV
generatedCommandsInfo = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdPreprocessGeneratedCommandsNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
vkCmdPreprocessGeneratedCommandsNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
      -> IO ())
pVkCmdPreprocessGeneratedCommandsNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
vkCmdPreprocessGeneratedCommandsNVPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
      -> IO ())
-> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdPreprocessGeneratedCommandsNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPreprocessGeneratedCommandsNV' :: Ptr CommandBuffer_T
-> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
-> IO ()
vkCmdPreprocessGeneratedCommandsNV' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
-> IO ()
mkVkCmdPreprocessGeneratedCommandsNV FunPtr
  (Ptr CommandBuffer_T
   -> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
vkCmdPreprocessGeneratedCommandsNVPtr
  "pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV
pGeneratedCommandsInfo <- ((("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV))
-> ((("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
forall a b. (a -> b) -> a -> b
$ GeneratedCommandsInfoNV
-> (("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (GeneratedCommandsInfoNV
generatedCommandsInfo)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV)
-> IO ()
vkCmdPreprocessGeneratedCommandsNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pGeneratedCommandsInfo" ::: Ptr GeneratedCommandsInfoNV
pGeneratedCommandsInfo
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBindPipelineShaderGroupNV
  :: FunPtr (Ptr CommandBuffer_T -> PipelineBindPoint -> Pipeline -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> PipelineBindPoint -> Pipeline -> Word32 -> IO ()

-- | vkCmdBindPipelineShaderGroupNV - Bind a pipeline object
--
-- == Valid Usage
--
-- -   @groupIndex@ /must/ be @0@ or less than the effective
--     'GraphicsPipelineShaderGroupsCreateInfoNV'::@groupCount@ including
--     the referenced pipelines
--
-- -   The @pipelineBindPoint@ /must/ be
--     'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS'
--
-- -   The same restrictions as
--     'Vulkan.Core10.CommandBufferBuilding.cmdBindPipeline' apply as if
--     the bound pipeline was created only with the Shader Group from the
--     @groupIndex@ information
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   @pipelineBindPoint@ /must/ be a valid
--     'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' value
--
-- -   @pipeline@ /must/ be a valid 'Vulkan.Core10.Handles.Pipeline' handle
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   Both of @commandBuffer@, and @pipeline@ /must/ have been created,
--     allocated, or retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'Vulkan.Core10.Handles.Pipeline',
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint'
cmdBindPipelineShaderGroupNV :: forall io
                              . (MonadIO io)
                             => -- | @commandBuffer@ is the command buffer that the pipeline will be bound
                                -- to.
                                CommandBuffer
                             -> -- | @pipelineBindPoint@ is a
                                -- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' value
                                -- specifying the bind point to which the pipeline will be bound.
                                PipelineBindPoint
                             -> -- | @pipeline@ is the pipeline to be bound.
                                Pipeline
                             -> -- | @groupIndex@ is the shader group to be bound.
                                ("groupIndex" ::: Word32)
                             -> io ()
cmdBindPipelineShaderGroupNV :: CommandBuffer
-> PipelineBindPoint
-> Pipeline
-> ("groupIndex" ::: Word32)
-> io ()
cmdBindPipelineShaderGroupNV commandBuffer :: CommandBuffer
commandBuffer pipelineBindPoint :: PipelineBindPoint
pipelineBindPoint pipeline :: Pipeline
pipeline groupIndex :: "groupIndex" ::: Word32
groupIndex = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBindPipelineShaderGroupNVPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> PipelineBindPoint
   -> Pipeline
   -> ("groupIndex" ::: Word32)
   -> IO ())
vkCmdBindPipelineShaderGroupNVPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> PipelineBindPoint
      -> Pipeline
      -> ("groupIndex" ::: Word32)
      -> IO ())
pVkCmdBindPipelineShaderGroupNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> PipelineBindPoint
   -> Pipeline
   -> ("groupIndex" ::: Word32)
   -> IO ())
vkCmdBindPipelineShaderGroupNVPtr FunPtr
  (Ptr CommandBuffer_T
   -> PipelineBindPoint
   -> Pipeline
   -> ("groupIndex" ::: Word32)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> PipelineBindPoint
      -> Pipeline
      -> ("groupIndex" ::: Word32)
      -> IO ())
-> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> PipelineBindPoint
   -> Pipeline
   -> ("groupIndex" ::: Word32)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdBindPipelineShaderGroupNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindPipelineShaderGroupNV' :: Ptr CommandBuffer_T
-> PipelineBindPoint
-> Pipeline
-> ("groupIndex" ::: Word32)
-> IO ()
vkCmdBindPipelineShaderGroupNV' = FunPtr
  (Ptr CommandBuffer_T
   -> PipelineBindPoint
   -> Pipeline
   -> ("groupIndex" ::: Word32)
   -> IO ())
-> Ptr CommandBuffer_T
-> PipelineBindPoint
-> Pipeline
-> ("groupIndex" ::: Word32)
-> IO ()
mkVkCmdBindPipelineShaderGroupNV FunPtr
  (Ptr CommandBuffer_T
   -> PipelineBindPoint
   -> Pipeline
   -> ("groupIndex" ::: Word32)
   -> IO ())
vkCmdBindPipelineShaderGroupNVPtr
  Ptr CommandBuffer_T
-> PipelineBindPoint
-> Pipeline
-> ("groupIndex" ::: Word32)
-> IO ()
vkCmdBindPipelineShaderGroupNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (PipelineBindPoint
pipelineBindPoint) (Pipeline
pipeline) ("groupIndex" ::: Word32
groupIndex)
  () -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetGeneratedCommandsMemoryRequirementsNV
  :: FunPtr (Ptr Device_T -> Ptr GeneratedCommandsMemoryRequirementsInfoNV -> Ptr (SomeStruct MemoryRequirements2) -> IO ()) -> Ptr Device_T -> Ptr GeneratedCommandsMemoryRequirementsInfoNV -> Ptr (SomeStruct MemoryRequirements2) -> IO ()

-- | vkGetGeneratedCommandsMemoryRequirementsNV - Retrieve the buffer
-- allocation requirements for generated commands
--
-- == Valid Usage
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   @pInfo@ /must/ be a valid pointer to a valid
--     'GeneratedCommandsMemoryRequirementsInfoNV' structure
--
-- -   @pMemoryRequirements@ /must/ be a valid pointer to a
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2'
--     structure
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Device',
-- 'GeneratedCommandsMemoryRequirementsInfoNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2'
getGeneratedCommandsMemoryRequirementsNV :: forall a io
                                          . (Extendss MemoryRequirements2 a, PokeChain a, PeekChain a, MonadIO io)
                                         => -- | @device@ is the logical device that owns the buffer.
                                            Device
                                         -> -- | @pInfo@ is a pointer to an instance of the
                                            -- 'GeneratedCommandsMemoryRequirementsInfoNV' structure containing
                                            -- parameters required for the memory requirements query.
                                            GeneratedCommandsMemoryRequirementsInfoNV
                                         -> io (MemoryRequirements2 a)
getGeneratedCommandsMemoryRequirementsNV :: Device
-> GeneratedCommandsMemoryRequirementsInfoNV
-> io (MemoryRequirements2 a)
getGeneratedCommandsMemoryRequirementsNV device :: Device
device info :: GeneratedCommandsMemoryRequirementsInfoNV
info = IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a))
-> (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
    -> IO (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
 -> io (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetGeneratedCommandsMemoryRequirementsNVPtr :: FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetGeneratedCommandsMemoryRequirementsNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
      -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
      -> IO ())
pVkGetGeneratedCommandsMemoryRequirementsNV (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT (MemoryRequirements2 a) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (MemoryRequirements2 a) IO ())
-> IO () -> ContT (MemoryRequirements2 a) IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetGeneratedCommandsMemoryRequirementsNVPtr FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
      -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
      -> IO ())
-> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
/= FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetGeneratedCommandsMemoryRequirementsNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetGeneratedCommandsMemoryRequirementsNV' :: Ptr Device_T
-> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetGeneratedCommandsMemoryRequirementsNV' = FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
-> Ptr Device_T
-> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
mkVkGetGeneratedCommandsMemoryRequirementsNV FunPtr
  (Ptr Device_T
   -> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
   -> IO ())
vkGetGeneratedCommandsMemoryRequirementsNVPtr
  "pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV
pInfo <- ((("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
  -> IO (MemoryRequirements2 a))
 -> IO (MemoryRequirements2 a))
-> ContT
     (MemoryRequirements2 a)
     IO
     ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
   -> IO (MemoryRequirements2 a))
  -> IO (MemoryRequirements2 a))
 -> ContT
      (MemoryRequirements2 a)
      IO
      ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV))
-> ((("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
     -> IO (MemoryRequirements2 a))
    -> IO (MemoryRequirements2 a))
-> ContT
     (MemoryRequirements2 a)
     IO
     ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
forall a b. (a -> b) -> a -> b
$ GeneratedCommandsMemoryRequirementsInfoNV
-> (("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
    -> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (GeneratedCommandsMemoryRequirementsInfoNV
info)
  Ptr (MemoryRequirements2 a)
pPMemoryRequirements <- ((Ptr (MemoryRequirements2 a) -> IO (MemoryRequirements2 a))
 -> IO (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (Ptr (MemoryRequirements2 a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct (MemoryRequirements2 a) =>
(Ptr (MemoryRequirements2 a) -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @(MemoryRequirements2 _))
  IO () -> ContT (MemoryRequirements2 a) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (MemoryRequirements2 a) IO ())
-> IO () -> ContT (MemoryRequirements2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV)
-> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2))
-> IO ()
vkGetGeneratedCommandsMemoryRequirementsNV' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pInfo" ::: Ptr GeneratedCommandsMemoryRequirementsInfoNV
pInfo (Ptr (MemoryRequirements2 a)
-> "pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (MemoryRequirements2 a)
pPMemoryRequirements))
  MemoryRequirements2 a
pMemoryRequirements <- IO (MemoryRequirements2 a)
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO (MemoryRequirements2 a)
 -> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a)
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ Ptr (MemoryRequirements2 a) -> IO (MemoryRequirements2 a)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @(MemoryRequirements2 _) Ptr (MemoryRequirements2 a)
pPMemoryRequirements
  MemoryRequirements2 a
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MemoryRequirements2 a
 -> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a))
-> MemoryRequirements2 a
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ (MemoryRequirements2 a
pMemoryRequirements)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateIndirectCommandsLayoutNV
  :: FunPtr (Ptr Device_T -> Ptr IndirectCommandsLayoutCreateInfoNV -> Ptr AllocationCallbacks -> Ptr IndirectCommandsLayoutNV -> IO Result) -> Ptr Device_T -> Ptr IndirectCommandsLayoutCreateInfoNV -> Ptr AllocationCallbacks -> Ptr IndirectCommandsLayoutNV -> IO Result

-- | vkCreateIndirectCommandsLayoutNV - Create an indirect command layout
-- object
--
-- == Valid Usage
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   @pCreateInfo@ /must/ be a valid pointer to a valid
--     'IndirectCommandsLayoutCreateInfoNV' structure
--
-- -   If @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid
--     pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   @pIndirectCommandsLayout@ /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'IndirectCommandsLayoutCreateInfoNV',
-- 'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV'
createIndirectCommandsLayoutNV :: forall io
                                . (MonadIO io)
                               => -- | @device@ is the logical device that creates the indirect command layout.
                                  Device
                               -> -- | @pCreateInfo@ is a pointer to an instance of the
                                  -- 'IndirectCommandsLayoutCreateInfoNV' structure containing parameters
                                  -- affecting creation of the indirect command layout.
                                  IndirectCommandsLayoutCreateInfoNV
                               -> -- | @pAllocator@ controls host memory allocation as described in the
                                  -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                  -- chapter.
                                  ("allocator" ::: Maybe AllocationCallbacks)
                               -> io (IndirectCommandsLayoutNV)
createIndirectCommandsLayoutNV :: Device
-> IndirectCommandsLayoutCreateInfoNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io IndirectCommandsLayoutNV
createIndirectCommandsLayoutNV device :: Device
device createInfo :: IndirectCommandsLayoutCreateInfoNV
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO IndirectCommandsLayoutNV -> io IndirectCommandsLayoutNV
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IndirectCommandsLayoutNV -> io IndirectCommandsLayoutNV)
-> (ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
    -> IO IndirectCommandsLayoutNV)
-> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
-> io IndirectCommandsLayoutNV
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
-> IO IndirectCommandsLayoutNV
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
 -> io IndirectCommandsLayoutNV)
-> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
-> io IndirectCommandsLayoutNV
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateIndirectCommandsLayoutNVPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO Result)
vkCreateIndirectCommandsLayoutNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
      -> IO Result)
pVkCreateIndirectCommandsLayoutNV (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT IndirectCommandsLayoutNV IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT IndirectCommandsLayoutNV IO ())
-> IO () -> ContT IndirectCommandsLayoutNV IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO Result)
vkCreateIndirectCommandsLayoutNVPtr FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
      -> IO Result)
-> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
/= FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateIndirectCommandsLayoutNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateIndirectCommandsLayoutNV' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
-> IO Result
vkCreateIndirectCommandsLayoutNV' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
-> IO Result
mkVkCreateIndirectCommandsLayoutNV FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO Result)
vkCreateIndirectCommandsLayoutNVPtr
  "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
pCreateInfo <- ((("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
  -> IO IndirectCommandsLayoutNV)
 -> IO IndirectCommandsLayoutNV)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
   -> IO IndirectCommandsLayoutNV)
  -> IO IndirectCommandsLayoutNV)
 -> ContT
      IndirectCommandsLayoutNV
      IO
      ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV))
-> ((("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
     -> IO IndirectCommandsLayoutNV)
    -> IO IndirectCommandsLayoutNV)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
forall a b. (a -> b) -> a -> b
$ IndirectCommandsLayoutCreateInfoNV
-> (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
    -> IO IndirectCommandsLayoutNV)
-> IO IndirectCommandsLayoutNV
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (IndirectCommandsLayoutCreateInfoNV
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
  -> IO IndirectCommandsLayoutNV)
 -> IO IndirectCommandsLayoutNV)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO IndirectCommandsLayoutNV)
  -> IO IndirectCommandsLayoutNV)
 -> ContT
      IndirectCommandsLayoutNV
      IO
      ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
     -> IO IndirectCommandsLayoutNV)
    -> IO IndirectCommandsLayoutNV)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
    -> IO IndirectCommandsLayoutNV)
-> IO IndirectCommandsLayoutNV
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV
pPIndirectCommandsLayout <- ((("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
  -> IO IndirectCommandsLayoutNV)
 -> IO IndirectCommandsLayoutNV)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
   -> IO IndirectCommandsLayoutNV)
  -> IO IndirectCommandsLayoutNV)
 -> ContT
      IndirectCommandsLayoutNV
      IO
      ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV))
-> ((("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
     -> IO IndirectCommandsLayoutNV)
    -> IO IndirectCommandsLayoutNV)
-> ContT
     IndirectCommandsLayoutNV
     IO
     ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
forall a b. (a -> b) -> a -> b
$ IO ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
-> (("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
    -> IO ())
-> (("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
    -> IO IndirectCommandsLayoutNV)
-> IO IndirectCommandsLayoutNV
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
forall a. Int -> IO (Ptr a)
callocBytes @IndirectCommandsLayoutNV 8) ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
-> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT IndirectCommandsLayoutNV IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT IndirectCommandsLayoutNV IO Result)
-> IO Result -> ContT IndirectCommandsLayoutNV IO Result
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
-> IO Result
vkCreateIndirectCommandsLayoutNV' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV
pPIndirectCommandsLayout)
  IO () -> ContT IndirectCommandsLayoutNV IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT IndirectCommandsLayoutNV IO ())
-> IO () -> ContT IndirectCommandsLayoutNV IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
when (Result
r Result -> Result -> "isPreprocessed" ::: Bool
forall a. Ord a => a -> a -> "isPreprocessed" ::: Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  IndirectCommandsLayoutNV
pIndirectCommandsLayout <- IO IndirectCommandsLayoutNV
-> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO IndirectCommandsLayoutNV
 -> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV)
-> IO IndirectCommandsLayoutNV
-> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
forall a b. (a -> b) -> a -> b
$ ("pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV)
-> IO IndirectCommandsLayoutNV
forall a. Storable a => Ptr a -> IO a
peek @IndirectCommandsLayoutNV "pIndirectCommandsLayout" ::: Ptr IndirectCommandsLayoutNV
pPIndirectCommandsLayout
  IndirectCommandsLayoutNV
-> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IndirectCommandsLayoutNV
 -> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV)
-> IndirectCommandsLayoutNV
-> ContT IndirectCommandsLayoutNV IO IndirectCommandsLayoutNV
forall a b. (a -> b) -> a -> b
$ (IndirectCommandsLayoutNV
pIndirectCommandsLayout)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createIndirectCommandsLayoutNV' and 'destroyIndirectCommandsLayoutNV'
--
-- To ensure that 'destroyIndirectCommandsLayoutNV' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the first argument.
-- To just extract the pair pass '(,)' as the first argument.
--
withIndirectCommandsLayoutNV :: forall io r . MonadIO io => Device -> IndirectCommandsLayoutCreateInfoNV -> Maybe AllocationCallbacks -> (io (IndirectCommandsLayoutNV) -> ((IndirectCommandsLayoutNV) -> io ()) -> r) -> r
withIndirectCommandsLayoutNV :: Device
-> IndirectCommandsLayoutCreateInfoNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io IndirectCommandsLayoutNV
    -> (IndirectCommandsLayoutNV -> io ()) -> r)
-> r
withIndirectCommandsLayoutNV device :: Device
device pCreateInfo :: IndirectCommandsLayoutCreateInfoNV
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io IndirectCommandsLayoutNV
-> (IndirectCommandsLayoutNV -> io ()) -> r
b =
  io IndirectCommandsLayoutNV
-> (IndirectCommandsLayoutNV -> io ()) -> r
b (Device
-> IndirectCommandsLayoutCreateInfoNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io IndirectCommandsLayoutNV
forall (io :: * -> *).
MonadIO io =>
Device
-> IndirectCommandsLayoutCreateInfoNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io IndirectCommandsLayoutNV
createIndirectCommandsLayoutNV Device
device IndirectCommandsLayoutCreateInfoNV
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(IndirectCommandsLayoutNV
o0) -> Device
-> IndirectCommandsLayoutNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> IndirectCommandsLayoutNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyIndirectCommandsLayoutNV Device
device IndirectCommandsLayoutNV
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyIndirectCommandsLayoutNV
  :: FunPtr (Ptr Device_T -> IndirectCommandsLayoutNV -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> IndirectCommandsLayoutNV -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyIndirectCommandsLayoutNV - Destroy an indirect commands layout
--
-- == Valid Usage
--
-- -   All submitted commands that refer to @indirectCommandsLayout@ /must/
--     have completed execution
--
-- -   If 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @indirectCommandsLayout@ was created, a compatible set
--     of callbacks /must/ be provided here
--
-- -   If no 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @indirectCommandsLayout@ was created, @pAllocator@
--     /must/ be @NULL@
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   If @indirectCommandsLayout@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @indirectCommandsLayout@
--     /must/ be a valid
--     'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV' handle
--
-- -   If @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid
--     pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   If @indirectCommandsLayout@ is a valid handle, it /must/ have been
--     created, allocated, or retrieved from @device@
--
-- == Host Synchronization
--
-- -   Host access to @indirectCommandsLayout@ /must/ be externally
--     synchronized
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV'
destroyIndirectCommandsLayoutNV :: forall io
                                 . (MonadIO io)
                                => -- | @device@ is the logical device that destroys the layout.
                                   Device
                                -> -- | @indirectCommandsLayout@ is the layout to destroy.
                                   IndirectCommandsLayoutNV
                                -> -- | @pAllocator@ controls host memory allocation as described in the
                                   -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                   -- chapter.
                                   ("allocator" ::: Maybe AllocationCallbacks)
                                -> io ()
destroyIndirectCommandsLayoutNV :: Device
-> IndirectCommandsLayoutNV
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyIndirectCommandsLayoutNV device :: Device
device indirectCommandsLayout :: IndirectCommandsLayoutNV
indirectCommandsLayout allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyIndirectCommandsLayoutNVPtr :: FunPtr
  (Ptr Device_T
   -> IndirectCommandsLayoutNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyIndirectCommandsLayoutNVPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> IndirectCommandsLayoutNV
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroyIndirectCommandsLayoutNV (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> IndirectCommandsLayoutNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyIndirectCommandsLayoutNVPtr FunPtr
  (Ptr Device_T
   -> IndirectCommandsLayoutNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> IndirectCommandsLayoutNV
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
-> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
/= FunPtr
  (Ptr Device_T
   -> IndirectCommandsLayoutNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkDestroyIndirectCommandsLayoutNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyIndirectCommandsLayoutNV' :: Ptr Device_T
-> IndirectCommandsLayoutNV
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyIndirectCommandsLayoutNV' = FunPtr
  (Ptr Device_T
   -> IndirectCommandsLayoutNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> IndirectCommandsLayoutNV
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyIndirectCommandsLayoutNV FunPtr
  (Ptr Device_T
   -> IndirectCommandsLayoutNV
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyIndirectCommandsLayoutNVPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
 -> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> IndirectCommandsLayoutNV
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyIndirectCommandsLayoutNV' (Device -> Ptr Device_T
deviceHandle (Device
device)) (IndirectCommandsLayoutNV
indirectCommandsLayout) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


-- | VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV - Structure describing
-- the device-generated commands features that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceDeviceGeneratedCommandsFeaturesNV'
-- structure describe the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceDeviceGeneratedCommandsFeaturesNV' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- it is filled with values indicating whether the feature is supported.
-- 'PhysicalDeviceDeviceGeneratedCommandsFeaturesNV' /can/ also be used in
-- the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable
-- the features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceDeviceGeneratedCommandsFeaturesNV = PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
  { -- | @deviceGeneratedCommands@ indicates whether the implementation supports
    -- functionality to generate commands on the device. See
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#device-generated-commands Device-Generated Commands>.
    PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> "isPreprocessed" ::: Bool
deviceGeneratedCommands :: Bool }
  deriving (Typeable, PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> "isPreprocessed" ::: Bool
(PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
 -> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
 -> "isPreprocessed" ::: Bool)
-> (PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
    -> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
    -> "isPreprocessed" ::: Bool)
-> Eq PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> "isPreprocessed" ::: Bool
$c/= :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> "isPreprocessed" ::: Bool
== :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> "isPreprocessed" ::: Bool
$c== :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDeviceGeneratedCommandsFeaturesNV)
#endif
deriving instance Show PhysicalDeviceDeviceGeneratedCommandsFeaturesNV

instance ToCStruct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV where
  withCStruct :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> (Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
x f :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p -> Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
x (Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b
f Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p)
  pokeCStruct :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p PhysicalDeviceDeviceGeneratedCommandsFeaturesNV{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("isPreprocessed" ::: Bool32)
-> ("isPreprocessed" ::: Bool32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr ("isPreprocessed" ::: Bool32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (("isPreprocessed" ::: Bool) -> "isPreprocessed" ::: Bool32
boolToBool32 ("isPreprocessed" ::: Bool
deviceGeneratedCommands))
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("isPreprocessed" ::: Bool32)
-> ("isPreprocessed" ::: Bool32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr ("isPreprocessed" ::: Bool32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (("isPreprocessed" ::: Bool) -> "isPreprocessed" ::: Bool32
boolToBool32 ("isPreprocessed" ::: Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV where
  peekCStruct :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
peekCStruct p :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p = do
    "isPreprocessed" ::: Bool32
deviceGeneratedCommands <- Ptr ("isPreprocessed" ::: Bool32)
-> IO ("isPreprocessed" ::: Bool32)
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> Int -> Ptr ("isPreprocessed" ::: Bool32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
 -> IO PhysicalDeviceDeviceGeneratedCommandsFeaturesNV)
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool)
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
             (("isPreprocessed" ::: Bool32) -> "isPreprocessed" ::: Bool
bool32ToBool "isPreprocessed" ::: Bool32
deviceGeneratedCommands)

instance Storable PhysicalDeviceDeviceGeneratedCommandsFeaturesNV where
  sizeOf :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> Int
sizeOf ~PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
_ = 24
  alignment :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> Int
alignment ~PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
_ = 8
  peek :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
peek = Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV -> IO ()
poke ptr :: Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
ptr poked :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
poked = Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
ptr PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceDeviceGeneratedCommandsFeaturesNV where
  zero :: PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
zero = ("isPreprocessed" ::: Bool)
-> PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
PhysicalDeviceDeviceGeneratedCommandsFeaturesNV
           "isPreprocessed" ::: Bool
forall a. Zero a => a
zero


-- | VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV - Structure
-- describing push descriptor limits that can be supported by an
-- implementation
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceDeviceGeneratedCommandsPropertiesNV = PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
  { -- | @maxGraphicsShaderGroupCount@ is the maximum number of shader groups in
    -- 'GraphicsPipelineShaderGroupsCreateInfoNV'.
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
maxGraphicsShaderGroupCount :: Word32
  , -- | @maxIndirectSequenceCount@ is the maximum number of sequences in
    -- 'GeneratedCommandsInfoNV' and in
    -- 'GeneratedCommandsMemoryRequirementsInfoNV'.
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
maxIndirectSequenceCount :: Word32
  , -- No documentation found for Nested "VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV" "maxIndirectCommandsTokenCount"
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
maxIndirectCommandsTokenCount :: Word32
  , -- | @maxIndirectCommandsStreamCount@ is the maximum number of streams in
    -- 'IndirectCommandsLayoutCreateInfoNV'.
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
maxIndirectCommandsStreamCount :: Word32
  , -- | @maxIndirectCommandsTokenOffset@ is the maximum offset in
    -- 'IndirectCommandsLayoutTokenNV'.
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
maxIndirectCommandsTokenOffset :: Word32
  , -- | @maxIndirectCommandsStreamStride@ is the maximum stream stride in
    -- 'IndirectCommandsLayoutCreateInfoNV'.
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
maxIndirectCommandsStreamStride :: Word32
  , -- No documentation found for Nested "VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV" "minSequencesCountBufferOffsetAlignment"
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
minSequencesCountBufferOffsetAlignment :: Word32
  , -- No documentation found for Nested "VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV" "minSequencesIndexBufferOffsetAlignment"
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
minSequencesIndexBufferOffsetAlignment :: Word32
  , -- | @minIndirectCommandsBufferOffsetAlignment@ is the minimum alignment for
    -- memory addresses used in 'IndirectCommandsStreamNV' and as preprocess
    -- buffer in 'GeneratedCommandsInfoNV'.
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "groupIndex" ::: Word32
minIndirectCommandsBufferOffsetAlignment :: Word32
  }
  deriving (Typeable, PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "isPreprocessed" ::: Bool
(PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
 -> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
 -> "isPreprocessed" ::: Bool)
-> (PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
    -> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
    -> "isPreprocessed" ::: Bool)
-> Eq PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "isPreprocessed" ::: Bool
$c/= :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "isPreprocessed" ::: Bool
== :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "isPreprocessed" ::: Bool
$c== :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDeviceGeneratedCommandsPropertiesNV)
#endif
deriving instance Show PhysicalDeviceDeviceGeneratedCommandsPropertiesNV

instance ToCStruct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV where
  withCStruct :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> (Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
x f :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 56 8 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p -> Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
x (Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO b
f Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p)
  pokeCStruct :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO b
-> IO b
pokeCStruct p :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p PhysicalDeviceDeviceGeneratedCommandsPropertiesNV{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("groupIndex" ::: Word32
maxGraphicsShaderGroupCount)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("groupIndex" ::: Word32
maxIndirectSequenceCount)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ("groupIndex" ::: Word32
maxIndirectCommandsTokenCount)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("groupIndex" ::: Word32
maxIndirectCommandsStreamCount)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ("groupIndex" ::: Word32
maxIndirectCommandsTokenOffset)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32)) ("groupIndex" ::: Word32
maxIndirectCommandsStreamStride)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("groupIndex" ::: Word32
minSequencesCountBufferOffsetAlignment)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ("groupIndex" ::: Word32
minSequencesIndexBufferOffsetAlignment)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) ("groupIndex" ::: Word32
minIndirectCommandsBufferOffsetAlignment)
    IO b
f
  cStructSize :: Int
cStructSize = 56
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV where
  peekCStruct :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
peekCStruct p :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p = do
    "groupIndex" ::: Word32
maxGraphicsShaderGroupCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
    "groupIndex" ::: Word32
maxIndirectSequenceCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
    "groupIndex" ::: Word32
maxIndirectCommandsTokenCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    "groupIndex" ::: Word32
maxIndirectCommandsStreamCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
    "groupIndex" ::: Word32
maxIndirectCommandsTokenOffset <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
    "groupIndex" ::: Word32
maxIndirectCommandsStreamStride <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32))
    "groupIndex" ::: Word32
minSequencesCountBufferOffsetAlignment <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32))
    "groupIndex" ::: Word32
minSequencesIndexBufferOffsetAlignment <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    "groupIndex" ::: Word32
minIndirectCommandsBufferOffsetAlignment <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
p Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32))
    PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
 -> IO PhysicalDeviceDeviceGeneratedCommandsPropertiesNV)
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
forall a b. (a -> b) -> a -> b
$ ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
             "groupIndex" ::: Word32
maxGraphicsShaderGroupCount "groupIndex" ::: Word32
maxIndirectSequenceCount "groupIndex" ::: Word32
maxIndirectCommandsTokenCount "groupIndex" ::: Word32
maxIndirectCommandsStreamCount "groupIndex" ::: Word32
maxIndirectCommandsTokenOffset "groupIndex" ::: Word32
maxIndirectCommandsStreamStride "groupIndex" ::: Word32
minSequencesCountBufferOffsetAlignment "groupIndex" ::: Word32
minSequencesIndexBufferOffsetAlignment "groupIndex" ::: Word32
minIndirectCommandsBufferOffsetAlignment

instance Storable PhysicalDeviceDeviceGeneratedCommandsPropertiesNV where
  sizeOf :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> Int
sizeOf ~PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
_ = 56
  alignment :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> Int
alignment ~PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
_ = 8
  peek :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
peek = Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV -> IO ()
poke ptr :: Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
ptr poked :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
poked = Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
ptr PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceDeviceGeneratedCommandsPropertiesNV where
  zero :: PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
zero = ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
PhysicalDeviceDeviceGeneratedCommandsPropertiesNV
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero


-- | VkGraphicsShaderGroupCreateInfoNV - Structure specifying override
-- parameters for each shader group
--
-- == Valid Usage
--
-- -   For @stageCount@, the same restrictions as in
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo'::@stageCount@
--     apply
--
-- -   For @pStages@, the same restrictions as in
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo'::@pStages@ apply
--
-- -   For @pVertexInputState@, the same restrictions as in
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo'::@pVertexInputState@
--     apply
--
-- -   For @pTessellationState@, the same restrictions as in
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo'::@pTessellationState@
--     apply
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV'
--
-- -   @pNext@ /must/ be @NULL@
--
-- -   @pStages@ /must/ be a valid pointer to an array of @stageCount@
--     valid 'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo'
--     structures
--
-- -   @stageCount@ /must/ be greater than @0@
--
-- = See Also
--
-- 'GraphicsPipelineShaderGroupsCreateInfoNV',
-- 'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo',
-- 'Vulkan.Core10.Pipeline.PipelineTessellationStateCreateInfo',
-- 'Vulkan.Core10.Pipeline.PipelineVertexInputStateCreateInfo',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data GraphicsShaderGroupCreateInfoNV = GraphicsShaderGroupCreateInfoNV
  { -- | @pStages@ is an array of size @stageCount@ structures of type
    -- 'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo' describing the
    -- set of the shader stages to be included in this shader group.
    GraphicsShaderGroupCreateInfoNV
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
stages :: Vector (SomeStruct PipelineShaderStageCreateInfo)
  , -- | @pVertexInputState@ is a pointer to an instance of the
    -- 'Vulkan.Core10.Pipeline.PipelineVertexInputStateCreateInfo' structure.
    GraphicsShaderGroupCreateInfoNV
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
vertexInputState :: Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
  , -- | @pTessellationState@ is a pointer to an instance of the
    -- 'Vulkan.Core10.Pipeline.PipelineTessellationStateCreateInfo' structure,
    -- and is ignored if the shader group does not include a tessellation
    -- control shader stage and tessellation evaluation shader stage.
    GraphicsShaderGroupCreateInfoNV
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
tessellationState :: Maybe (SomeStruct PipelineTessellationStateCreateInfo)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsShaderGroupCreateInfoNV)
#endif
deriving instance Show GraphicsShaderGroupCreateInfoNV

instance ToCStruct GraphicsShaderGroupCreateInfoNV where
  withCStruct :: GraphicsShaderGroupCreateInfoNV
-> (Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b
withCStruct x :: GraphicsShaderGroupCreateInfoNV
x f :: Ptr GraphicsShaderGroupCreateInfoNV -> IO b
f = Int -> Int -> (Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
-> (Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsShaderGroupCreateInfoNV
p -> Ptr GraphicsShaderGroupCreateInfoNV
-> GraphicsShaderGroupCreateInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsShaderGroupCreateInfoNV
p GraphicsShaderGroupCreateInfoNV
x (Ptr GraphicsShaderGroupCreateInfoNV -> IO b
f Ptr GraphicsShaderGroupCreateInfoNV
p)
  pokeCStruct :: Ptr GraphicsShaderGroupCreateInfoNV
-> GraphicsShaderGroupCreateInfoNV -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsShaderGroupCreateInfoNV
p GraphicsShaderGroupCreateInfoNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ((Int -> "groupIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int)
-> Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)) :: Word32))
    Ptr (PipelineShaderStageCreateInfo Any)
pPStages' <- ((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any)))
-> ((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any))
forall a b. (a -> b) -> a -> b
$ Int
-> Int -> (Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(PipelineShaderStageCreateInfo _) ((Vector (SomeStruct PipelineShaderStageCreateInfo) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 48) 8
    (Int -> SomeStruct PipelineShaderStageCreateInfo -> ContT b IO ())
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct PipelineShaderStageCreateInfo
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> SomeStruct PipelineShaderStageCreateInfo -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineShaderStageCreateInfo Any)
pPStages' Ptr (PipelineShaderStageCreateInfo Any)
-> Int -> Ptr (PipelineShaderStageCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _))) (SomeStruct PipelineShaderStageCreateInfo
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct PipelineShaderStageCreateInfo)
stages)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineShaderStageCreateInfo Any))
-> Ptr (PipelineShaderStageCreateInfo Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineShaderStageCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _)))) (Ptr (PipelineShaderStageCreateInfo Any)
pPStages')
    Ptr (PipelineVertexInputStateCreateInfo '[])
pVertexInputState'' <- case (Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
vertexInputState) of
      Nothing -> Ptr (PipelineVertexInputStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineVertexInputStateCreateInfo '[])
forall a. Ptr a
nullPtr
      Just j :: SomeStruct PipelineVertexInputStateCreateInfo
j -> ((Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineVertexInputStateCreateInfo '[])) (((Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b) -> IO b)
 -> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[])))
-> ((Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineVertexInputStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \cont :: Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineVertexInputStateCreateInfo
-> (forall (es :: [*]).
    (Extendss PipelineVertexInputStateCreateInfo es, PokeChain es) =>
    Ptr (PipelineVertexInputStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineVertexInputStateCreateInfo (SomeStruct PipelineVertexInputStateCreateInfo
j) (Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineVertexInputStateCreateInfo es)
    -> Ptr (PipelineVertexInputStateCreateInfo '[]))
-> Ptr (PipelineVertexInputStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineVertexInputStateCreateInfo es)
-> Ptr (PipelineVertexInputStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineVertexInputStateCreateInfo '[]))
-> Ptr (PipelineVertexInputStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineVertexInputStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr (PipelineVertexInputStateCreateInfo _)))) Ptr (PipelineVertexInputStateCreateInfo '[])
pVertexInputState''
    Ptr (PipelineTessellationStateCreateInfo '[])
pTessellationState'' <- case (Maybe (SomeStruct PipelineTessellationStateCreateInfo)
tessellationState) of
      Nothing -> Ptr (PipelineTessellationStateCreateInfo '[])
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[]))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (PipelineTessellationStateCreateInfo '[])
forall a. Ptr a
nullPtr
      Just j :: SomeStruct PipelineTessellationStateCreateInfo
j -> ((Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (PipelineTessellationStateCreateInfo '[])) (((Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b) -> IO b)
 -> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[])))
-> ((Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b)
    -> IO b)
-> ContT b IO (Ptr (PipelineTessellationStateCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \cont :: Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b
cont -> SomeStruct PipelineTessellationStateCreateInfo
-> (forall (es :: [*]).
    (Extendss PipelineTessellationStateCreateInfo es, PokeChain es) =>
    Ptr (PipelineTessellationStateCreateInfo es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @PipelineTessellationStateCreateInfo (SomeStruct PipelineTessellationStateCreateInfo
j) (Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b
cont (Ptr (PipelineTessellationStateCreateInfo '[]) -> IO b)
-> (Ptr (PipelineTessellationStateCreateInfo es)
    -> Ptr (PipelineTessellationStateCreateInfo '[]))
-> Ptr (PipelineTessellationStateCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (PipelineTessellationStateCreateInfo es)
-> Ptr (PipelineTessellationStateCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineTessellationStateCreateInfo '[]))
-> Ptr (PipelineTessellationStateCreateInfo '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineTessellationStateCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr (PipelineTessellationStateCreateInfo _)))) Ptr (PipelineTessellationStateCreateInfo '[])
pTessellationState''
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsShaderGroupCreateInfoNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsShaderGroupCreateInfoNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (PipelineShaderStageCreateInfo Any)
pPStages' <- ((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any)))
-> ((Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (PipelineShaderStageCreateInfo Any))
forall a b. (a -> b) -> a -> b
$ Int
-> Int -> (Ptr (PipelineShaderStageCreateInfo Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(PipelineShaderStageCreateInfo _) ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 48) 8
    (Int -> SomeStruct PipelineShaderStageCreateInfo -> ContT b IO ())
-> Vector (SomeStruct PipelineShaderStageCreateInfo)
-> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct PipelineShaderStageCreateInfo
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> SomeStruct PipelineShaderStageCreateInfo -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineShaderStageCreateInfo Any)
pPStages' Ptr (PipelineShaderStageCreateInfo Any)
-> Int -> Ptr (PipelineShaderStageCreateInfo _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _))) (SomeStruct PipelineShaderStageCreateInfo
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct PipelineShaderStageCreateInfo)
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (PipelineShaderStageCreateInfo Any))
-> Ptr (PipelineShaderStageCreateInfo Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineShaderStageCreateInfo _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr (PipelineShaderStageCreateInfo _)))) (Ptr (PipelineShaderStageCreateInfo Any)
pPStages')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct GraphicsShaderGroupCreateInfoNV where
  peekCStruct :: Ptr GraphicsShaderGroupCreateInfoNV
-> IO GraphicsShaderGroupCreateInfoNV
peekCStruct p :: Ptr GraphicsShaderGroupCreateInfoNV
p = do
    "groupIndex" ::: Word32
stageCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
    Ptr (PipelineShaderStageCreateInfo Any)
pStages <- Ptr (Ptr (PipelineShaderStageCreateInfo Any))
-> IO (Ptr (PipelineShaderStageCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineShaderStageCreateInfo _)) ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineShaderStageCreateInfo a))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr (PipelineShaderStageCreateInfo a))))
    Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages' <- Int
-> (Int -> IO (SomeStruct PipelineShaderStageCreateInfo))
-> IO (Vector (SomeStruct PipelineShaderStageCreateInfo))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
stageCount) (\i :: Int
i -> Ptr (SomeStruct PipelineShaderStageCreateInfo)
-> IO (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineShaderStageCreateInfo Any)
-> Ptr (SomeStruct PipelineShaderStageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (PipelineShaderStageCreateInfo Any)
pStages Ptr (PipelineShaderStageCreateInfo Any)
-> Int -> Ptr (PipelineShaderStageCreateInfo Any)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (PipelineShaderStageCreateInfo _)))))
    Ptr (PipelineVertexInputStateCreateInfo Any)
pVertexInputState <- Ptr (Ptr (PipelineVertexInputStateCreateInfo Any))
-> IO (Ptr (PipelineVertexInputStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineVertexInputStateCreateInfo _)) ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineVertexInputStateCreateInfo a))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr (PipelineVertexInputStateCreateInfo a))))
    Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
pVertexInputState' <- (Ptr (PipelineVertexInputStateCreateInfo Any)
 -> IO (SomeStruct PipelineVertexInputStateCreateInfo))
-> Ptr (PipelineVertexInputStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineVertexInputStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\j :: Ptr (PipelineVertexInputStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineVertexInputStateCreateInfo)
-> IO (SomeStruct PipelineVertexInputStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineVertexInputStateCreateInfo Any)
-> Ptr (SomeStruct PipelineVertexInputStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineVertexInputStateCreateInfo Any)
j))) Ptr (PipelineVertexInputStateCreateInfo Any)
pVertexInputState
    Ptr (PipelineTessellationStateCreateInfo Any)
pTessellationState <- Ptr (Ptr (PipelineTessellationStateCreateInfo Any))
-> IO (Ptr (PipelineTessellationStateCreateInfo Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (PipelineTessellationStateCreateInfo _)) ((Ptr GraphicsShaderGroupCreateInfoNV
p Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr (Ptr (PipelineTessellationStateCreateInfo a))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr (PipelineTessellationStateCreateInfo a))))
    Maybe (SomeStruct PipelineTessellationStateCreateInfo)
pTessellationState' <- (Ptr (PipelineTessellationStateCreateInfo Any)
 -> IO (SomeStruct PipelineTessellationStateCreateInfo))
-> Ptr (PipelineTessellationStateCreateInfo Any)
-> IO (Maybe (SomeStruct PipelineTessellationStateCreateInfo))
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\j :: Ptr (PipelineTessellationStateCreateInfo Any)
j -> Ptr (SomeStruct PipelineTessellationStateCreateInfo)
-> IO (SomeStruct PipelineTessellationStateCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (PipelineTessellationStateCreateInfo Any)
-> Ptr (SomeStruct PipelineTessellationStateCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (PipelineTessellationStateCreateInfo Any)
j))) Ptr (PipelineTessellationStateCreateInfo Any)
pTessellationState
    GraphicsShaderGroupCreateInfoNV
-> IO GraphicsShaderGroupCreateInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsShaderGroupCreateInfoNV
 -> IO GraphicsShaderGroupCreateInfoNV)
-> GraphicsShaderGroupCreateInfoNV
-> IO GraphicsShaderGroupCreateInfoNV
forall a b. (a -> b) -> a -> b
$ Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> GraphicsShaderGroupCreateInfoNV
GraphicsShaderGroupCreateInfoNV
             Vector (SomeStruct PipelineShaderStageCreateInfo)
pStages' Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
pVertexInputState' Maybe (SomeStruct PipelineTessellationStateCreateInfo)
pTessellationState'

instance Zero GraphicsShaderGroupCreateInfoNV where
  zero :: GraphicsShaderGroupCreateInfoNV
zero = Vector (SomeStruct PipelineShaderStageCreateInfo)
-> Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
-> Maybe (SomeStruct PipelineTessellationStateCreateInfo)
-> GraphicsShaderGroupCreateInfoNV
GraphicsShaderGroupCreateInfoNV
           Vector (SomeStruct PipelineShaderStageCreateInfo)
forall a. Monoid a => a
mempty
           Maybe (SomeStruct PipelineVertexInputStateCreateInfo)
forall a. Maybe a
Nothing
           Maybe (SomeStruct PipelineTessellationStateCreateInfo)
forall a. Maybe a
Nothing


-- | VkGraphicsPipelineShaderGroupsCreateInfoNV - Structure specifying
-- parameters of a newly created multi shader group pipeline
--
-- = Description
--
-- When referencing shader groups by index, groups defined in the
-- referenced pipelines are treated as if they were defined as additional
-- entries in @pGroups@. They are appended in the order they appear in the
-- @pPipelines@ array and in the @pGroups@ array when those pipelines were
-- defined.
--
-- The application /must/ maintain the lifetime of all such referenced
-- pipelines based on the pipelines that make use of them.
--
-- == Valid Usage
--
-- -   @groupCount@ /must/ be at least @1@ and as maximum
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxGraphicsShaderGroupCount@
--
-- -   The sum of @groupCount@ including those groups added from referenced
--     @pPipelines@ /must/ also be as maximum
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxGraphicsShaderGroupCount@
--
-- -   The state of the first element of @pGroups@ /must/ match its
--     equivalent within the parent’s
--     'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo'
--
-- -   Each element of @pGroups@ /must/ in combination with the rest of the
--     pipeline state yield a valid state configuration
--
-- -   All elements of @pGroups@ /must/ use the same shader stage
--     combinations unless any mesh shader stage is used, then either
--     combination of task and mesh or just mesh shader is valid
--
-- -   Mesh and regular primitive shading stages cannot be mixed across
--     @pGroups@
--
-- -   Each element of the @pPipelines@ member of @libraries@ /must/ have
--     been created with identical state to the pipeline currently created
--     except the state that can be overriden by
--     'GraphicsShaderGroupCreateInfoNV'
--
-- -   The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-deviceGeneratedCommands ::deviceGeneratedCommands>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV'
--
-- -   @pGroups@ /must/ be a valid pointer to an array of @groupCount@
--     valid 'GraphicsShaderGroupCreateInfoNV' structures
--
-- -   If @pipelineCount@ is not @0@, @pPipelines@ /must/ be a valid
--     pointer to an array of @pipelineCount@ valid
--     'Vulkan.Core10.Handles.Pipeline' handles
--
-- -   @groupCount@ /must/ be greater than @0@
--
-- = See Also
--
-- 'GraphicsShaderGroupCreateInfoNV', 'Vulkan.Core10.Handles.Pipeline',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data GraphicsPipelineShaderGroupsCreateInfoNV = GraphicsPipelineShaderGroupsCreateInfoNV
  { -- | @pGroups@ is an array of 'GraphicsShaderGroupCreateInfoNV' values
    -- specifying which state of the original
    -- 'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo' each shader group
    -- overrides.
    GraphicsPipelineShaderGroupsCreateInfoNV
-> Vector GraphicsShaderGroupCreateInfoNV
groups :: Vector GraphicsShaderGroupCreateInfoNV
  , -- | @pPipelines@ is an array of graphics 'Vulkan.Core10.Handles.Pipeline',
    -- which are referenced within the created pipeline, including all their
    -- shader groups.
    GraphicsPipelineShaderGroupsCreateInfoNV -> Vector Pipeline
pipelines :: Vector Pipeline
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsPipelineShaderGroupsCreateInfoNV)
#endif
deriving instance Show GraphicsPipelineShaderGroupsCreateInfoNV

instance ToCStruct GraphicsPipelineShaderGroupsCreateInfoNV where
  withCStruct :: GraphicsPipelineShaderGroupsCreateInfoNV
-> (Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b) -> IO b
withCStruct x :: GraphicsPipelineShaderGroupsCreateInfoNV
x f :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b
f = Int
-> Int
-> (Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b) -> IO b)
-> (Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p -> Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> GraphicsPipelineShaderGroupsCreateInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p GraphicsPipelineShaderGroupsCreateInfoNV
x (Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b
f Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p)
  pokeCStruct :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> GraphicsPipelineShaderGroupsCreateInfoNV -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p GraphicsPipelineShaderGroupsCreateInfoNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ((Int -> "groupIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector GraphicsShaderGroupCreateInfoNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector GraphicsShaderGroupCreateInfoNV -> Int)
-> Vector GraphicsShaderGroupCreateInfoNV -> Int
forall a b. (a -> b) -> a -> b
$ (Vector GraphicsShaderGroupCreateInfoNV
groups)) :: Word32))
    Ptr GraphicsShaderGroupCreateInfoNV
pPGroups' <- ((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
-> ContT b IO (Ptr GraphicsShaderGroupCreateInfoNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
 -> ContT b IO (Ptr GraphicsShaderGroupCreateInfoNV))
-> ((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
-> ContT b IO (Ptr GraphicsShaderGroupCreateInfoNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @GraphicsShaderGroupCreateInfoNV ((Vector GraphicsShaderGroupCreateInfoNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector GraphicsShaderGroupCreateInfoNV
groups)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 48) 8
    (Int -> GraphicsShaderGroupCreateInfoNV -> ContT b IO ())
-> Vector GraphicsShaderGroupCreateInfoNV -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: GraphicsShaderGroupCreateInfoNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr GraphicsShaderGroupCreateInfoNV
-> GraphicsShaderGroupCreateInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr GraphicsShaderGroupCreateInfoNV
pPGroups' Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr GraphicsShaderGroupCreateInfoNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr GraphicsShaderGroupCreateInfoNV) (GraphicsShaderGroupCreateInfoNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector GraphicsShaderGroupCreateInfoNV
groups)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr GraphicsShaderGroupCreateInfoNV)
-> Ptr GraphicsShaderGroupCreateInfoNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr (Ptr GraphicsShaderGroupCreateInfoNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr GraphicsShaderGroupCreateInfoNV))) (Ptr GraphicsShaderGroupCreateInfoNV
pPGroups')
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ((Int -> "groupIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Pipeline -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Pipeline -> Int) -> Vector Pipeline -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Pipeline
pipelines)) :: Word32))
    Ptr Pipeline
pPPipelines' <- ((Ptr Pipeline -> IO b) -> IO b) -> ContT b IO (Ptr Pipeline)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Pipeline -> IO b) -> IO b) -> ContT b IO (Ptr Pipeline))
-> ((Ptr Pipeline -> IO b) -> IO b) -> ContT b IO (Ptr Pipeline)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr Pipeline -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Pipeline ((Vector Pipeline -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Pipeline
pipelines)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Pipeline -> IO ()) -> Vector Pipeline -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: Pipeline
e -> Ptr Pipeline -> Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Pipeline
pPPipelines' Ptr Pipeline -> Int -> Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline) (Pipeline
e)) (Vector Pipeline
pipelines)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Pipeline) -> Ptr Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr (Ptr Pipeline)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Pipeline))) (Ptr Pipeline
pPPipelines')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr GraphicsShaderGroupCreateInfoNV
pPGroups' <- ((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
-> ContT b IO (Ptr GraphicsShaderGroupCreateInfoNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
 -> ContT b IO (Ptr GraphicsShaderGroupCreateInfoNV))
-> ((Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b)
-> ContT b IO (Ptr GraphicsShaderGroupCreateInfoNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr GraphicsShaderGroupCreateInfoNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @GraphicsShaderGroupCreateInfoNV ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 48) 8
    (Int -> GraphicsShaderGroupCreateInfoNV -> ContT b IO ())
-> Vector GraphicsShaderGroupCreateInfoNV -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: GraphicsShaderGroupCreateInfoNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr GraphicsShaderGroupCreateInfoNV
-> GraphicsShaderGroupCreateInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr GraphicsShaderGroupCreateInfoNV
pPGroups' Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr GraphicsShaderGroupCreateInfoNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr GraphicsShaderGroupCreateInfoNV) (GraphicsShaderGroupCreateInfoNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector GraphicsShaderGroupCreateInfoNV
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr GraphicsShaderGroupCreateInfoNV)
-> Ptr GraphicsShaderGroupCreateInfoNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr (Ptr GraphicsShaderGroupCreateInfoNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr GraphicsShaderGroupCreateInfoNV))) (Ptr GraphicsShaderGroupCreateInfoNV
pPGroups')
    Ptr Pipeline
pPPipelines' <- ((Ptr Pipeline -> IO b) -> IO b) -> ContT b IO (Ptr Pipeline)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Pipeline -> IO b) -> IO b) -> ContT b IO (Ptr Pipeline))
-> ((Ptr Pipeline -> IO b) -> IO b) -> ContT b IO (Ptr Pipeline)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr Pipeline -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Pipeline ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 8) 8
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Pipeline -> IO ()) -> Vector Pipeline -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: Pipeline
e -> Ptr Pipeline -> Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Pipeline
pPPipelines' Ptr Pipeline -> Int -> Ptr Pipeline
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline) (Pipeline
e)) (Vector Pipeline
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Pipeline) -> Ptr Pipeline -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr (Ptr Pipeline)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Pipeline))) (Ptr Pipeline
pPPipelines')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct GraphicsPipelineShaderGroupsCreateInfoNV where
  peekCStruct :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> IO GraphicsPipelineShaderGroupsCreateInfoNV
peekCStruct p :: Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p = do
    "groupIndex" ::: Word32
groupCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
    Ptr GraphicsShaderGroupCreateInfoNV
pGroups <- Ptr (Ptr GraphicsShaderGroupCreateInfoNV)
-> IO (Ptr GraphicsShaderGroupCreateInfoNV)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr GraphicsShaderGroupCreateInfoNV) ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr (Ptr GraphicsShaderGroupCreateInfoNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr GraphicsShaderGroupCreateInfoNV)))
    Vector GraphicsShaderGroupCreateInfoNV
pGroups' <- Int
-> (Int -> IO GraphicsShaderGroupCreateInfoNV)
-> IO (Vector GraphicsShaderGroupCreateInfoNV)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
groupCount) (\i :: Int
i -> Ptr GraphicsShaderGroupCreateInfoNV
-> IO GraphicsShaderGroupCreateInfoNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GraphicsShaderGroupCreateInfoNV ((Ptr GraphicsShaderGroupCreateInfoNV
pGroups Ptr GraphicsShaderGroupCreateInfoNV
-> Int -> Ptr GraphicsShaderGroupCreateInfoNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr GraphicsShaderGroupCreateInfoNV)))
    "groupIndex" ::: Word32
pipelineCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
    Ptr Pipeline
pPipelines <- Ptr (Ptr Pipeline) -> IO (Ptr Pipeline)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Pipeline) ((Ptr GraphicsPipelineShaderGroupsCreateInfoNV
p Ptr GraphicsPipelineShaderGroupsCreateInfoNV
-> Int -> Ptr (Ptr Pipeline)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Pipeline)))
    Vector Pipeline
pPipelines' <- Int -> (Int -> IO Pipeline) -> IO (Vector Pipeline)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
pipelineCount) (\i :: Int
i -> Ptr Pipeline -> IO Pipeline
forall a. Storable a => Ptr a -> IO a
peek @Pipeline ((Ptr Pipeline
pPipelines Ptr Pipeline -> Int -> Ptr Pipeline
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Pipeline)))
    GraphicsPipelineShaderGroupsCreateInfoNV
-> IO GraphicsPipelineShaderGroupsCreateInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsPipelineShaderGroupsCreateInfoNV
 -> IO GraphicsPipelineShaderGroupsCreateInfoNV)
-> GraphicsPipelineShaderGroupsCreateInfoNV
-> IO GraphicsPipelineShaderGroupsCreateInfoNV
forall a b. (a -> b) -> a -> b
$ Vector GraphicsShaderGroupCreateInfoNV
-> Vector Pipeline -> GraphicsPipelineShaderGroupsCreateInfoNV
GraphicsPipelineShaderGroupsCreateInfoNV
             Vector GraphicsShaderGroupCreateInfoNV
pGroups' Vector Pipeline
pPipelines'

instance Zero GraphicsPipelineShaderGroupsCreateInfoNV where
  zero :: GraphicsPipelineShaderGroupsCreateInfoNV
zero = Vector GraphicsShaderGroupCreateInfoNV
-> Vector Pipeline -> GraphicsPipelineShaderGroupsCreateInfoNV
GraphicsPipelineShaderGroupsCreateInfoNV
           Vector GraphicsShaderGroupCreateInfoNV
forall a. Monoid a => a
mempty
           Vector Pipeline
forall a. Monoid a => a
mempty


-- | VkBindShaderGroupIndirectCommandNV - Structure specifying input data for
-- a single shader group command token
--
-- == Valid Usage
--
-- -   The current bound graphics pipeline, as well as the pipelines it may
--     reference, /must/ have been created with
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV'
--
-- -   The @index@ /must/ be within range of the accessible shader groups
--     of the current bound graphics pipeline. See
--     'cmdBindPipelineShaderGroupNV' for further details
--
-- = See Also
--
-- No cross-references are available
data BindShaderGroupIndirectCommandNV = BindShaderGroupIndirectCommandNV
  { -- No documentation found for Nested "VkBindShaderGroupIndirectCommandNV" "groupIndex"
    BindShaderGroupIndirectCommandNV -> "groupIndex" ::: Word32
groupIndex :: Word32 }
  deriving (Typeable, BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool
(BindShaderGroupIndirectCommandNV
 -> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> (BindShaderGroupIndirectCommandNV
    -> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> Eq BindShaderGroupIndirectCommandNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool
$c/= :: BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool
== :: BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool
$c== :: BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindShaderGroupIndirectCommandNV)
#endif
deriving instance Show BindShaderGroupIndirectCommandNV

instance ToCStruct BindShaderGroupIndirectCommandNV where
  withCStruct :: BindShaderGroupIndirectCommandNV
-> (Ptr BindShaderGroupIndirectCommandNV -> IO b) -> IO b
withCStruct x :: BindShaderGroupIndirectCommandNV
x f :: Ptr BindShaderGroupIndirectCommandNV -> IO b
f = Int
-> Int -> (Ptr BindShaderGroupIndirectCommandNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 4 4 ((Ptr BindShaderGroupIndirectCommandNV -> IO b) -> IO b)
-> (Ptr BindShaderGroupIndirectCommandNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr BindShaderGroupIndirectCommandNV
p -> Ptr BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindShaderGroupIndirectCommandNV
p BindShaderGroupIndirectCommandNV
x (Ptr BindShaderGroupIndirectCommandNV -> IO b
f Ptr BindShaderGroupIndirectCommandNV
p)
  pokeCStruct :: Ptr BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> IO b -> IO b
pokeCStruct p :: Ptr BindShaderGroupIndirectCommandNV
p BindShaderGroupIndirectCommandNV{..} f :: IO b
f = do
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindShaderGroupIndirectCommandNV
p Ptr BindShaderGroupIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("groupIndex" ::: Word32
groupIndex)
    IO b
f
  cStructSize :: Int
cStructSize = 4
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr BindShaderGroupIndirectCommandNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr BindShaderGroupIndirectCommandNV
p f :: IO b
f = do
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindShaderGroupIndirectCommandNV
p Ptr BindShaderGroupIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BindShaderGroupIndirectCommandNV where
  peekCStruct :: Ptr BindShaderGroupIndirectCommandNV
-> IO BindShaderGroupIndirectCommandNV
peekCStruct p :: Ptr BindShaderGroupIndirectCommandNV
p = do
    "groupIndex" ::: Word32
groupIndex <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BindShaderGroupIndirectCommandNV
p Ptr BindShaderGroupIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
    BindShaderGroupIndirectCommandNV
-> IO BindShaderGroupIndirectCommandNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindShaderGroupIndirectCommandNV
 -> IO BindShaderGroupIndirectCommandNV)
-> BindShaderGroupIndirectCommandNV
-> IO BindShaderGroupIndirectCommandNV
forall a b. (a -> b) -> a -> b
$ ("groupIndex" ::: Word32) -> BindShaderGroupIndirectCommandNV
BindShaderGroupIndirectCommandNV
             "groupIndex" ::: Word32
groupIndex

instance Storable BindShaderGroupIndirectCommandNV where
  sizeOf :: BindShaderGroupIndirectCommandNV -> Int
sizeOf ~BindShaderGroupIndirectCommandNV
_ = 4
  alignment :: BindShaderGroupIndirectCommandNV -> Int
alignment ~BindShaderGroupIndirectCommandNV
_ = 4
  peek :: Ptr BindShaderGroupIndirectCommandNV
-> IO BindShaderGroupIndirectCommandNV
peek = Ptr BindShaderGroupIndirectCommandNV
-> IO BindShaderGroupIndirectCommandNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> IO ()
poke ptr :: Ptr BindShaderGroupIndirectCommandNV
ptr poked :: BindShaderGroupIndirectCommandNV
poked = Ptr BindShaderGroupIndirectCommandNV
-> BindShaderGroupIndirectCommandNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindShaderGroupIndirectCommandNV
ptr BindShaderGroupIndirectCommandNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero BindShaderGroupIndirectCommandNV where
  zero :: BindShaderGroupIndirectCommandNV
zero = ("groupIndex" ::: Word32) -> BindShaderGroupIndirectCommandNV
BindShaderGroupIndirectCommandNV
           "groupIndex" ::: Word32
forall a. Zero a => a
zero


-- | VkBindIndexBufferIndirectCommandNV - Structure specifying input data for
-- a single index buffer command token
--
-- == Valid Usage
--
-- -   The buffer’s usage flag from which the address was acquired /must/
--     have the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDEX_BUFFER_BIT'
--     bit set
--
-- -   The @bufferAddress@ /must/ be aligned to the @indexType@ used
--
-- -   Each element of the buffer from which the address was acquired and
--     that is non-sparse /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   @indexType@ /must/ be a valid
--     'Vulkan.Core10.Enums.IndexType.IndexType' value
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress',
-- 'Vulkan.Core10.Enums.IndexType.IndexType'
data BindIndexBufferIndirectCommandNV = BindIndexBufferIndirectCommandNV
  { -- | @bufferAddress@ specifies a physical address of the
    -- 'Vulkan.Core10.Handles.Buffer' used as index buffer.
    BindIndexBufferIndirectCommandNV -> DeviceAddress
bufferAddress :: DeviceAddress
  , -- | @size@ is the byte size range which is available for this operation from
    -- the provided address.
    BindIndexBufferIndirectCommandNV -> "groupIndex" ::: Word32
size :: Word32
  , -- | @indexType@ is a 'Vulkan.Core10.Enums.IndexType.IndexType' value
    -- specifying how indices are treated. Instead of the Vulkan enum values, a
    -- custom @uint32_t@ value /can/ be mapped to an
    -- 'Vulkan.Core10.Enums.IndexType.IndexType' by specifying the
    -- 'IndirectCommandsLayoutTokenNV'::@pIndexTypes@ and
    -- 'IndirectCommandsLayoutTokenNV'::@pIndexTypeValues@ arrays.
    BindIndexBufferIndirectCommandNV -> IndexType
indexType :: IndexType
  }
  deriving (Typeable, BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
(BindIndexBufferIndirectCommandNV
 -> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> (BindIndexBufferIndirectCommandNV
    -> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> Eq BindIndexBufferIndirectCommandNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
$c/= :: BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
== :: BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
$c== :: BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindIndexBufferIndirectCommandNV)
#endif
deriving instance Show BindIndexBufferIndirectCommandNV

instance ToCStruct BindIndexBufferIndirectCommandNV where
  withCStruct :: BindIndexBufferIndirectCommandNV
-> (Ptr BindIndexBufferIndirectCommandNV -> IO b) -> IO b
withCStruct x :: BindIndexBufferIndirectCommandNV
x f :: Ptr BindIndexBufferIndirectCommandNV -> IO b
f = Int
-> Int -> (Ptr BindIndexBufferIndirectCommandNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 16 8 ((Ptr BindIndexBufferIndirectCommandNV -> IO b) -> IO b)
-> (Ptr BindIndexBufferIndirectCommandNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr BindIndexBufferIndirectCommandNV
p -> Ptr BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindIndexBufferIndirectCommandNV
p BindIndexBufferIndirectCommandNV
x (Ptr BindIndexBufferIndirectCommandNV -> IO b
f Ptr BindIndexBufferIndirectCommandNV
p)
  pokeCStruct :: Ptr BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> IO b -> IO b
pokeCStruct p :: Ptr BindIndexBufferIndirectCommandNV
p BindIndexBufferIndirectCommandNV{..} f :: IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr DeviceAddress)) (DeviceAddress
bufferAddress)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("groupIndex" ::: Word32
size)
    Ptr IndexType -> IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV -> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr IndexType)) (IndexType
indexType)
    IO b
f
  cStructSize :: Int
cStructSize = 16
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr BindIndexBufferIndirectCommandNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr BindIndexBufferIndirectCommandNV
p f :: IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr DeviceAddress)) (DeviceAddress
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr IndexType -> IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV -> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr IndexType)) (IndexType
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BindIndexBufferIndirectCommandNV where
  peekCStruct :: Ptr BindIndexBufferIndirectCommandNV
-> IO BindIndexBufferIndirectCommandNV
peekCStruct p :: Ptr BindIndexBufferIndirectCommandNV
p = do
    DeviceAddress
bufferAddress <- Ptr DeviceAddress -> IO DeviceAddress
forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr DeviceAddress))
    "groupIndex" ::: Word32
size <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
    IndexType
indexType <- Ptr IndexType -> IO IndexType
forall a. Storable a => Ptr a -> IO a
peek @IndexType ((Ptr BindIndexBufferIndirectCommandNV
p Ptr BindIndexBufferIndirectCommandNV -> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr IndexType))
    BindIndexBufferIndirectCommandNV
-> IO BindIndexBufferIndirectCommandNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindIndexBufferIndirectCommandNV
 -> IO BindIndexBufferIndirectCommandNV)
-> BindIndexBufferIndirectCommandNV
-> IO BindIndexBufferIndirectCommandNV
forall a b. (a -> b) -> a -> b
$ DeviceAddress
-> ("groupIndex" ::: Word32)
-> IndexType
-> BindIndexBufferIndirectCommandNV
BindIndexBufferIndirectCommandNV
             DeviceAddress
bufferAddress "groupIndex" ::: Word32
size IndexType
indexType

instance Storable BindIndexBufferIndirectCommandNV where
  sizeOf :: BindIndexBufferIndirectCommandNV -> Int
sizeOf ~BindIndexBufferIndirectCommandNV
_ = 16
  alignment :: BindIndexBufferIndirectCommandNV -> Int
alignment ~BindIndexBufferIndirectCommandNV
_ = 8
  peek :: Ptr BindIndexBufferIndirectCommandNV
-> IO BindIndexBufferIndirectCommandNV
peek = Ptr BindIndexBufferIndirectCommandNV
-> IO BindIndexBufferIndirectCommandNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> IO ()
poke ptr :: Ptr BindIndexBufferIndirectCommandNV
ptr poked :: BindIndexBufferIndirectCommandNV
poked = Ptr BindIndexBufferIndirectCommandNV
-> BindIndexBufferIndirectCommandNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindIndexBufferIndirectCommandNV
ptr BindIndexBufferIndirectCommandNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero BindIndexBufferIndirectCommandNV where
  zero :: BindIndexBufferIndirectCommandNV
zero = DeviceAddress
-> ("groupIndex" ::: Word32)
-> IndexType
-> BindIndexBufferIndirectCommandNV
BindIndexBufferIndirectCommandNV
           DeviceAddress
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           IndexType
forall a. Zero a => a
zero


-- | VkBindVertexBufferIndirectCommandNV - Structure specifying input data
-- for a single vertex buffer command token
--
-- == Valid Usage
--
-- -   The buffer’s usage flag from which the address was acquired /must/
--     have the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_VERTEX_BUFFER_BIT'
--     bit set
--
-- -   Each element of the buffer from which the address was acquired and
--     that is non-sparse /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress'
data BindVertexBufferIndirectCommandNV = BindVertexBufferIndirectCommandNV
  { -- | @bufferAddress@ specifies a physical address of the
    -- 'Vulkan.Core10.Handles.Buffer' used as vertex input binding.
    BindVertexBufferIndirectCommandNV -> DeviceAddress
bufferAddress :: DeviceAddress
  , -- | @size@ is the byte size range which is available for this operation from
    -- the provided address.
    BindVertexBufferIndirectCommandNV -> "groupIndex" ::: Word32
size :: Word32
  , -- | @stride@ is the byte size stride for this vertex input binding as in
    -- 'Vulkan.Core10.Pipeline.VertexInputBindingDescription'::@stride@. It is
    -- only used if 'IndirectCommandsLayoutTokenNV'::@vertexDynamicStride@ was
    -- set, otherwise the stride is inherited from the current bound graphics
    -- pipeline.
    BindVertexBufferIndirectCommandNV -> "groupIndex" ::: Word32
stride :: Word32
  }
  deriving (Typeable, BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
(BindVertexBufferIndirectCommandNV
 -> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> (BindVertexBufferIndirectCommandNV
    -> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> Eq BindVertexBufferIndirectCommandNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
$c/= :: BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
== :: BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
$c== :: BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindVertexBufferIndirectCommandNV)
#endif
deriving instance Show BindVertexBufferIndirectCommandNV

instance ToCStruct BindVertexBufferIndirectCommandNV where
  withCStruct :: BindVertexBufferIndirectCommandNV
-> (Ptr BindVertexBufferIndirectCommandNV -> IO b) -> IO b
withCStruct x :: BindVertexBufferIndirectCommandNV
x f :: Ptr BindVertexBufferIndirectCommandNV -> IO b
f = Int
-> Int -> (Ptr BindVertexBufferIndirectCommandNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 16 8 ((Ptr BindVertexBufferIndirectCommandNV -> IO b) -> IO b)
-> (Ptr BindVertexBufferIndirectCommandNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr BindVertexBufferIndirectCommandNV
p -> Ptr BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindVertexBufferIndirectCommandNV
p BindVertexBufferIndirectCommandNV
x (Ptr BindVertexBufferIndirectCommandNV -> IO b
f Ptr BindVertexBufferIndirectCommandNV
p)
  pokeCStruct :: Ptr BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> IO b -> IO b
pokeCStruct p :: Ptr BindVertexBufferIndirectCommandNV
p BindVertexBufferIndirectCommandNV{..} f :: IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr DeviceAddress)) (DeviceAddress
bufferAddress)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("groupIndex" ::: Word32
size)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32)) ("groupIndex" ::: Word32
stride)
    IO b
f
  cStructSize :: Int
cStructSize = 16
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr BindVertexBufferIndirectCommandNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr BindVertexBufferIndirectCommandNV
p f :: IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr DeviceAddress)) (DeviceAddress
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BindVertexBufferIndirectCommandNV where
  peekCStruct :: Ptr BindVertexBufferIndirectCommandNV
-> IO BindVertexBufferIndirectCommandNV
peekCStruct p :: Ptr BindVertexBufferIndirectCommandNV
p = do
    DeviceAddress
bufferAddress <- Ptr DeviceAddress -> IO DeviceAddress
forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr DeviceAddress))
    "groupIndex" ::: Word32
size <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
    "groupIndex" ::: Word32
stride <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BindVertexBufferIndirectCommandNV
p Ptr BindVertexBufferIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32))
    BindVertexBufferIndirectCommandNV
-> IO BindVertexBufferIndirectCommandNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindVertexBufferIndirectCommandNV
 -> IO BindVertexBufferIndirectCommandNV)
-> BindVertexBufferIndirectCommandNV
-> IO BindVertexBufferIndirectCommandNV
forall a b. (a -> b) -> a -> b
$ DeviceAddress
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> BindVertexBufferIndirectCommandNV
BindVertexBufferIndirectCommandNV
             DeviceAddress
bufferAddress "groupIndex" ::: Word32
size "groupIndex" ::: Word32
stride

instance Storable BindVertexBufferIndirectCommandNV where
  sizeOf :: BindVertexBufferIndirectCommandNV -> Int
sizeOf ~BindVertexBufferIndirectCommandNV
_ = 16
  alignment :: BindVertexBufferIndirectCommandNV -> Int
alignment ~BindVertexBufferIndirectCommandNV
_ = 8
  peek :: Ptr BindVertexBufferIndirectCommandNV
-> IO BindVertexBufferIndirectCommandNV
peek = Ptr BindVertexBufferIndirectCommandNV
-> IO BindVertexBufferIndirectCommandNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> IO ()
poke ptr :: Ptr BindVertexBufferIndirectCommandNV
ptr poked :: BindVertexBufferIndirectCommandNV
poked = Ptr BindVertexBufferIndirectCommandNV
-> BindVertexBufferIndirectCommandNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindVertexBufferIndirectCommandNV
ptr BindVertexBufferIndirectCommandNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero BindVertexBufferIndirectCommandNV where
  zero :: BindVertexBufferIndirectCommandNV
zero = DeviceAddress
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> BindVertexBufferIndirectCommandNV
BindVertexBufferIndirectCommandNV
           DeviceAddress
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero


-- | VkSetStateFlagsIndirectCommandNV - Structure specifying input data for a
-- single state flag command token
--
-- = See Also
--
-- No cross-references are available
data SetStateFlagsIndirectCommandNV = SetStateFlagsIndirectCommandNV
  { -- | @data@ encodes packed state that this command alters.
    --
    -- -   Bit @0@: If set represents
    --     'Vulkan.Core10.Enums.FrontFace.FRONT_FACE_CLOCKWISE', otherwise
    --     'Vulkan.Core10.Enums.FrontFace.FRONT_FACE_COUNTER_CLOCKWISE'
    SetStateFlagsIndirectCommandNV -> "groupIndex" ::: Word32
data' :: Word32 }
  deriving (Typeable, SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool
(SetStateFlagsIndirectCommandNV
 -> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> (SetStateFlagsIndirectCommandNV
    -> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool)
-> Eq SetStateFlagsIndirectCommandNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool
$c/= :: SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool
== :: SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool
$c== :: SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SetStateFlagsIndirectCommandNV)
#endif
deriving instance Show SetStateFlagsIndirectCommandNV

instance ToCStruct SetStateFlagsIndirectCommandNV where
  withCStruct :: SetStateFlagsIndirectCommandNV
-> (Ptr SetStateFlagsIndirectCommandNV -> IO b) -> IO b
withCStruct x :: SetStateFlagsIndirectCommandNV
x f :: Ptr SetStateFlagsIndirectCommandNV -> IO b
f = Int -> Int -> (Ptr SetStateFlagsIndirectCommandNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 4 4 ((Ptr SetStateFlagsIndirectCommandNV -> IO b) -> IO b)
-> (Ptr SetStateFlagsIndirectCommandNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SetStateFlagsIndirectCommandNV
p -> Ptr SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SetStateFlagsIndirectCommandNV
p SetStateFlagsIndirectCommandNV
x (Ptr SetStateFlagsIndirectCommandNV -> IO b
f Ptr SetStateFlagsIndirectCommandNV
p)
  pokeCStruct :: Ptr SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> IO b -> IO b
pokeCStruct p :: Ptr SetStateFlagsIndirectCommandNV
p SetStateFlagsIndirectCommandNV{..} f :: IO b
f = do
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SetStateFlagsIndirectCommandNV
p Ptr SetStateFlagsIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("groupIndex" ::: Word32
data')
    IO b
f
  cStructSize :: Int
cStructSize = 4
  cStructAlignment :: Int
cStructAlignment = 4
  pokeZeroCStruct :: Ptr SetStateFlagsIndirectCommandNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr SetStateFlagsIndirectCommandNV
p f :: IO b
f = do
    Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SetStateFlagsIndirectCommandNV
p Ptr SetStateFlagsIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SetStateFlagsIndirectCommandNV where
  peekCStruct :: Ptr SetStateFlagsIndirectCommandNV
-> IO SetStateFlagsIndirectCommandNV
peekCStruct p :: Ptr SetStateFlagsIndirectCommandNV
p = do
    "groupIndex" ::: Word32
data' <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SetStateFlagsIndirectCommandNV
p Ptr SetStateFlagsIndirectCommandNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
    SetStateFlagsIndirectCommandNV -> IO SetStateFlagsIndirectCommandNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SetStateFlagsIndirectCommandNV
 -> IO SetStateFlagsIndirectCommandNV)
-> SetStateFlagsIndirectCommandNV
-> IO SetStateFlagsIndirectCommandNV
forall a b. (a -> b) -> a -> b
$ ("groupIndex" ::: Word32) -> SetStateFlagsIndirectCommandNV
SetStateFlagsIndirectCommandNV
             "groupIndex" ::: Word32
data'

instance Storable SetStateFlagsIndirectCommandNV where
  sizeOf :: SetStateFlagsIndirectCommandNV -> Int
sizeOf ~SetStateFlagsIndirectCommandNV
_ = 4
  alignment :: SetStateFlagsIndirectCommandNV -> Int
alignment ~SetStateFlagsIndirectCommandNV
_ = 4
  peek :: Ptr SetStateFlagsIndirectCommandNV
-> IO SetStateFlagsIndirectCommandNV
peek = Ptr SetStateFlagsIndirectCommandNV
-> IO SetStateFlagsIndirectCommandNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> IO ()
poke ptr :: Ptr SetStateFlagsIndirectCommandNV
ptr poked :: SetStateFlagsIndirectCommandNV
poked = Ptr SetStateFlagsIndirectCommandNV
-> SetStateFlagsIndirectCommandNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SetStateFlagsIndirectCommandNV
ptr SetStateFlagsIndirectCommandNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SetStateFlagsIndirectCommandNV where
  zero :: SetStateFlagsIndirectCommandNV
zero = ("groupIndex" ::: Word32) -> SetStateFlagsIndirectCommandNV
SetStateFlagsIndirectCommandNV
           "groupIndex" ::: Word32
forall a. Zero a => a
zero


-- | VkIndirectCommandsStreamNV - Structure specifying input streams for
-- generated command tokens
--
-- == Valid Usage
--
-- -   The @buffer@’s usage flag /must/ have the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     bit set
--
-- -   The @offset@ /must/ be aligned to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@minIndirectCommandsBufferOffsetAlignment@
--
-- -   If @buffer@ is non-sparse then it /must/ be bound completely and
--     contiguously to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   @buffer@ /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize', 'GeneratedCommandsInfoNV'
data IndirectCommandsStreamNV = IndirectCommandsStreamNV
  { -- | @buffer@ specifies the 'Vulkan.Core10.Handles.Buffer' storing the
    -- functional arguments for each sequence. These arguments /can/ be written
    -- by the device.
    IndirectCommandsStreamNV -> Buffer
buffer :: Buffer
  , -- | @offset@ specified an offset into @buffer@ where the arguments start.
    IndirectCommandsStreamNV -> DeviceAddress
offset :: DeviceSize
  }
  deriving (Typeable, IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool
(IndirectCommandsStreamNV
 -> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool)
-> (IndirectCommandsStreamNV
    -> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool)
-> Eq IndirectCommandsStreamNV
forall a.
(a -> a -> "isPreprocessed" ::: Bool)
-> (a -> a -> "isPreprocessed" ::: Bool) -> Eq a
/= :: IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool
$c/= :: IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool
== :: IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool
$c== :: IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> "isPreprocessed" ::: Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (IndirectCommandsStreamNV)
#endif
deriving instance Show IndirectCommandsStreamNV

instance ToCStruct IndirectCommandsStreamNV where
  withCStruct :: IndirectCommandsStreamNV
-> (Ptr IndirectCommandsStreamNV -> IO b) -> IO b
withCStruct x :: IndirectCommandsStreamNV
x f :: Ptr IndirectCommandsStreamNV -> IO b
f = Int -> Int -> (Ptr IndirectCommandsStreamNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 16 8 ((Ptr IndirectCommandsStreamNV -> IO b) -> IO b)
-> (Ptr IndirectCommandsStreamNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr IndirectCommandsStreamNV
p -> Ptr IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr IndirectCommandsStreamNV
p IndirectCommandsStreamNV
x (Ptr IndirectCommandsStreamNV -> IO b
f Ptr IndirectCommandsStreamNV
p)
  pokeCStruct :: Ptr IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> IO b -> IO b
pokeCStruct p :: Ptr IndirectCommandsStreamNV
p IndirectCommandsStreamNV{..} f :: IO b
f = do
    Ptr Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsStreamNV
p Ptr IndirectCommandsStreamNV -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Buffer)) (Buffer
buffer)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsStreamNV
p Ptr IndirectCommandsStreamNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr DeviceSize)) (DeviceAddress
offset)
    IO b
f
  cStructSize :: Int
cStructSize = 16
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr IndirectCommandsStreamNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr IndirectCommandsStreamNV
p f :: IO b
f = do
    Ptr Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsStreamNV
p Ptr IndirectCommandsStreamNV -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Buffer)) (Buffer
forall a. Zero a => a
zero)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsStreamNV
p Ptr IndirectCommandsStreamNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr DeviceSize)) (DeviceAddress
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct IndirectCommandsStreamNV where
  peekCStruct :: Ptr IndirectCommandsStreamNV -> IO IndirectCommandsStreamNV
peekCStruct p :: Ptr IndirectCommandsStreamNV
p = do
    Buffer
buffer <- Ptr Buffer -> IO Buffer
forall a. Storable a => Ptr a -> IO a
peek @Buffer ((Ptr IndirectCommandsStreamNV
p Ptr IndirectCommandsStreamNV -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Buffer))
    DeviceAddress
offset <- Ptr DeviceAddress -> IO DeviceAddress
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr IndirectCommandsStreamNV
p Ptr IndirectCommandsStreamNV -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr DeviceSize))
    IndirectCommandsStreamNV -> IO IndirectCommandsStreamNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IndirectCommandsStreamNV -> IO IndirectCommandsStreamNV)
-> IndirectCommandsStreamNV -> IO IndirectCommandsStreamNV
forall a b. (a -> b) -> a -> b
$ Buffer -> DeviceAddress -> IndirectCommandsStreamNV
IndirectCommandsStreamNV
             Buffer
buffer DeviceAddress
offset

instance Storable IndirectCommandsStreamNV where
  sizeOf :: IndirectCommandsStreamNV -> Int
sizeOf ~IndirectCommandsStreamNV
_ = 16
  alignment :: IndirectCommandsStreamNV -> Int
alignment ~IndirectCommandsStreamNV
_ = 8
  peek :: Ptr IndirectCommandsStreamNV -> IO IndirectCommandsStreamNV
peek = Ptr IndirectCommandsStreamNV -> IO IndirectCommandsStreamNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr IndirectCommandsStreamNV -> IndirectCommandsStreamNV -> IO ()
poke ptr :: Ptr IndirectCommandsStreamNV
ptr poked :: IndirectCommandsStreamNV
poked = Ptr IndirectCommandsStreamNV
-> IndirectCommandsStreamNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr IndirectCommandsStreamNV
ptr IndirectCommandsStreamNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero IndirectCommandsStreamNV where
  zero :: IndirectCommandsStreamNV
zero = Buffer -> DeviceAddress -> IndirectCommandsStreamNV
IndirectCommandsStreamNV
           Buffer
forall a. Zero a => a
zero
           DeviceAddress
forall a. Zero a => a
zero


-- | VkIndirectCommandsLayoutTokenNV - Struct specifying the details of an
-- indirect command layout token
--
-- == Valid Usage
--
-- -   @stream@ /must/ be smaller than
--     'IndirectCommandsLayoutCreateInfoNV'::@streamCount@
--
-- -   @offset@ /must/ be less than or equal to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxIndirectCommandsTokenOffset@
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV',
--     @vertexBindingUnit@ /must/ stay within device supported limits for
--     the appropriate commands
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     @pushconstantPipelineLayout@ /must/ be valid
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     @pushconstantOffset@ /must/ be a multiple of @4@
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     @pushconstantSize@ /must/ be a multiple of @4@
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     @pushconstantOffset@ /must/ be less than
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPushConstantsSize@
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     @pushconstantSize@ /must/ be less than or equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPushConstantsSize@
--     minus @pushconstantOffset@
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     for each byte in the range specified by @pushconstantOffset@ and
--     @pushconstantSize@ and for each shader stage in
--     @pushconstantShaderStageFlags@, there /must/ be a push constant
--     range in @pushconstantPipelineLayout@ that includes that byte and
--     that stage
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV',
--     for each byte in the range specified by @pushconstantOffset@ and
--     @pushconstantSize@ and for each push constant range that overlaps
--     that byte, @pushconstantShaderStageFlags@ /must/ include all stages
--     in that push constant range’s
--     'Vulkan.Core10.PipelineLayout.PushConstantRange'::@pushconstantShaderStageFlags@
--
-- -   If @tokenType@ is 'INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV',
--     @indirectStateFlags@ /must/ not be ´0´
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV'
--
-- -   @pNext@ /must/ be @NULL@
--
-- -   @tokenType@ /must/ be a valid 'IndirectCommandsTokenTypeNV' value
--
-- -   If @pushconstantPipelineLayout@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @pushconstantPipelineLayout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   @pushconstantShaderStageFlags@ /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   @indirectStateFlags@ /must/ be a valid combination of
--     'IndirectStateFlagBitsNV' values
--
-- -   If @indexTypeCount@ is not @0@, @pIndexTypes@ /must/ be a valid
--     pointer to an array of @indexTypeCount@ valid
--     'Vulkan.Core10.Enums.IndexType.IndexType' values
--
-- -   If @indexTypeCount@ is not @0@, @pIndexTypeValues@ /must/ be a valid
--     pointer to an array of @indexTypeCount@ @uint32_t@ values
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.IndexType.IndexType',
-- 'IndirectCommandsLayoutCreateInfoNV', 'IndirectCommandsTokenTypeNV',
-- 'IndirectStateFlagsNV', 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data IndirectCommandsLayoutTokenNV = IndirectCommandsLayoutTokenNV
  { -- | @tokenType@ specifies the token command type.
    IndirectCommandsLayoutTokenNV -> IndirectCommandsTokenTypeNV
tokenType :: IndirectCommandsTokenTypeNV
  , -- | @stream@ is the index of the input stream that contains the token
    -- argument data.
    IndirectCommandsLayoutTokenNV -> "groupIndex" ::: Word32
stream :: Word32
  , -- | @offset@ is a relative starting offset within the input stream memory
    -- for the token argument data.
    IndirectCommandsLayoutTokenNV -> "groupIndex" ::: Word32
offset :: Word32
  , -- | @vertexBindingUnit@ is used for the vertex buffer binding command.
    IndirectCommandsLayoutTokenNV -> "groupIndex" ::: Word32
vertexBindingUnit :: Word32
  , -- | @vertexDynamicStride@ sets if the vertex buffer stride is provided by
    -- the binding command rather than the current bound graphics pipeline
    -- state.
    IndirectCommandsLayoutTokenNV -> "isPreprocessed" ::: Bool
vertexDynamicStride :: Bool
  , -- | @pushconstantPipelineLayout@ is the
    -- 'Vulkan.Core10.Handles.PipelineLayout' used for the push constant
    -- command.
    IndirectCommandsLayoutTokenNV -> PipelineLayout
pushconstantPipelineLayout :: PipelineLayout
  , -- | @pushconstantShaderStageFlags@ are the shader stage flags used for the
    -- push constant command.
    IndirectCommandsLayoutTokenNV -> ShaderStageFlags
pushconstantShaderStageFlags :: ShaderStageFlags
  , -- | @pushconstantOffset@ is the offset used for the push constant command.
    IndirectCommandsLayoutTokenNV -> "groupIndex" ::: Word32
pushconstantOffset :: Word32
  , -- | @pushconstantSize@ is the size used for the push constant command.
    IndirectCommandsLayoutTokenNV -> "groupIndex" ::: Word32
pushconstantSize :: Word32
  , -- | @indirectStateFlags@ are the active states for the state flag command.
    IndirectCommandsLayoutTokenNV -> IndirectStateFlagsNV
indirectStateFlags :: IndirectStateFlagsNV
  , -- | @pIndexTypes@ is the used 'Vulkan.Core10.Enums.IndexType.IndexType' for
    -- the corresponding @uint32_t@ value entry in @pIndexTypeValues@.
    IndirectCommandsLayoutTokenNV -> Vector IndexType
indexTypes :: Vector IndexType
  , -- No documentation found for Nested "VkIndirectCommandsLayoutTokenNV" "pIndexTypeValues"
    IndirectCommandsLayoutTokenNV -> Vector ("groupIndex" ::: Word32)
indexTypeValues :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (IndirectCommandsLayoutTokenNV)
#endif
deriving instance Show IndirectCommandsLayoutTokenNV

instance ToCStruct IndirectCommandsLayoutTokenNV where
  withCStruct :: IndirectCommandsLayoutTokenNV
-> (Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b
withCStruct x :: IndirectCommandsLayoutTokenNV
x f :: Ptr IndirectCommandsLayoutTokenNV -> IO b
f = Int -> Int -> (Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 88 8 ((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
-> (Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr IndirectCommandsLayoutTokenNV
p -> Ptr IndirectCommandsLayoutTokenNV
-> IndirectCommandsLayoutTokenNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr IndirectCommandsLayoutTokenNV
p IndirectCommandsLayoutTokenNV
x (Ptr IndirectCommandsLayoutTokenNV -> IO b
f Ptr IndirectCommandsLayoutTokenNV
p)
  pokeCStruct :: Ptr IndirectCommandsLayoutTokenNV
-> IndirectCommandsLayoutTokenNV -> IO b -> IO b
pokeCStruct p :: Ptr IndirectCommandsLayoutTokenNV
p IndirectCommandsLayoutTokenNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectCommandsTokenTypeNV
-> IndirectCommandsTokenTypeNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectCommandsTokenTypeNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr IndirectCommandsTokenTypeNV)) (IndirectCommandsTokenTypeNV
tokenType)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("groupIndex" ::: Word32
stream)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ("groupIndex" ::: Word32
offset)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("groupIndex" ::: Word32
vertexBindingUnit)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("isPreprocessed" ::: Bool32)
-> ("isPreprocessed" ::: Bool32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("isPreprocessed" ::: Bool32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (("isPreprocessed" ::: Bool) -> "isPreprocessed" ::: Bool32
boolToBool32 ("isPreprocessed" ::: Bool
vertexDynamicStride))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr PipelineLayout)) (PipelineLayout
pushconstantPipelineLayout)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr ShaderStageFlags)) (ShaderStageFlags
pushconstantShaderStageFlags)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) ("groupIndex" ::: Word32
pushconstantOffset)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) ("groupIndex" ::: Word32
pushconstantSize)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectStateFlagsNV -> IndirectStateFlagsNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectStateFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr IndirectStateFlagsNV)) (IndirectStateFlagsNV
indirectStateFlags)
    let pIndexTypesLength :: Int
pIndexTypesLength = Vector IndexType -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector IndexType -> Int) -> Vector IndexType -> Int
forall a b. (a -> b) -> a -> b
$ (Vector IndexType
indexTypes)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("isPreprocessed" ::: Bool) -> IO () -> IO ()
forall (f :: * -> *).
Applicative f =>
("isPreprocessed" ::: Bool) -> f () -> f ()
unless ((Vector ("groupIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("groupIndex" ::: Word32) -> Int)
-> Vector ("groupIndex" ::: Word32) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ("groupIndex" ::: Word32)
indexTypeValues)) Int -> Int -> "isPreprocessed" ::: Bool
forall a. Eq a => a -> a -> "isPreprocessed" ::: Bool
== Int
pIndexTypesLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
      IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "pIndexTypeValues and pIndexTypes must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr Word32)) ((Int -> "groupIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pIndexTypesLength :: Word32))
    Ptr IndexType
pPIndexTypes' <- ((Ptr IndexType -> IO b) -> IO b) -> ContT b IO (Ptr IndexType)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr IndexType -> IO b) -> IO b) -> ContT b IO (Ptr IndexType))
-> ((Ptr IndexType -> IO b) -> IO b) -> ContT b IO (Ptr IndexType)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr IndexType -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @IndexType ((Vector IndexType -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector IndexType
indexTypes)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> IndexType -> IO ()) -> Vector IndexType -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: IndexType
e -> Ptr IndexType -> IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IndexType
pPIndexTypes' Ptr IndexType -> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr IndexType) (IndexType
e)) (Vector IndexType
indexTypes)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr IndexType) -> Ptr IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr (Ptr IndexType)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (Ptr IndexType))) (Ptr IndexType
pPIndexTypes')
    Ptr ("groupIndex" ::: Word32)
pPIndexTypeValues' <- ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
 -> ContT b IO (Ptr ("groupIndex" ::: Word32)))
-> ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector ("groupIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("groupIndex" ::: Word32)
indexTypeValues)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("groupIndex" ::: Word32) -> IO ())
-> Vector ("groupIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "groupIndex" ::: Word32
e -> Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("groupIndex" ::: Word32)
pPIndexTypeValues' Ptr ("groupIndex" ::: Word32)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("groupIndex" ::: Word32
e)) (Vector ("groupIndex" ::: Word32)
indexTypeValues)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("groupIndex" ::: Word32))
-> Ptr ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr (Ptr ("groupIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr (Ptr Word32))) (Ptr ("groupIndex" ::: Word32)
pPIndexTypeValues')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 88
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr IndirectCommandsLayoutTokenNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr IndirectCommandsLayoutTokenNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectCommandsTokenTypeNV
-> IndirectCommandsTokenTypeNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectCommandsTokenTypeNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr IndirectCommandsTokenTypeNV)) (IndirectCommandsTokenTypeNV
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("isPreprocessed" ::: Bool32)
-> ("isPreprocessed" ::: Bool32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("isPreprocessed" ::: Bool32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (("isPreprocessed" ::: Bool) -> "isPreprocessed" ::: Bool32
boolToBool32 ("isPreprocessed" ::: Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) ("groupIndex" ::: Word32
forall a. Zero a => a
zero)
    Ptr IndexType
pPIndexTypes' <- ((Ptr IndexType -> IO b) -> IO b) -> ContT b IO (Ptr IndexType)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr IndexType -> IO b) -> IO b) -> ContT b IO (Ptr IndexType))
-> ((Ptr IndexType -> IO b) -> IO b) -> ContT b IO (Ptr IndexType)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr IndexType -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @IndexType ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> IndexType -> IO ()) -> Vector IndexType -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: IndexType
e -> Ptr IndexType -> IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr IndexType
pPIndexTypes' Ptr IndexType -> Int -> Ptr IndexType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr IndexType) (IndexType
e)) (Vector IndexType
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr IndexType) -> Ptr IndexType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr (Ptr IndexType)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (Ptr IndexType))) (Ptr IndexType
pPIndexTypes')
    Ptr ("groupIndex" ::: Word32)
pPIndexTypeValues' <- ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
 -> ContT b IO (Ptr ("groupIndex" ::: Word32)))
-> ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("groupIndex" ::: Word32) -> IO ())
-> Vector ("groupIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "groupIndex" ::: Word32
e -> Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("groupIndex" ::: Word32)
pPIndexTypeValues' Ptr ("groupIndex" ::: Word32)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("groupIndex" ::: Word32
e)) (Vector ("groupIndex" ::: Word32)
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("groupIndex" ::: Word32))
-> Ptr ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr (Ptr ("groupIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr (Ptr Word32))) (Ptr ("groupIndex" ::: Word32)
pPIndexTypeValues')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct IndirectCommandsLayoutTokenNV where
  peekCStruct :: Ptr IndirectCommandsLayoutTokenNV
-> IO IndirectCommandsLayoutTokenNV
peekCStruct p :: Ptr IndirectCommandsLayoutTokenNV
p = do
    IndirectCommandsTokenTypeNV
tokenType <- Ptr IndirectCommandsTokenTypeNV -> IO IndirectCommandsTokenTypeNV
forall a. Storable a => Ptr a -> IO a
peek @IndirectCommandsTokenTypeNV ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectCommandsTokenTypeNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr IndirectCommandsTokenTypeNV))
    "groupIndex" ::: Word32
stream <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
    "groupIndex" ::: Word32
offset <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    "groupIndex" ::: Word32
vertexBindingUnit <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
    "isPreprocessed" ::: Bool32
vertexDynamicStride <- Ptr ("isPreprocessed" ::: Bool32)
-> IO ("isPreprocessed" ::: Bool32)
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("isPreprocessed" ::: Bool32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32))
    PipelineLayout
pushconstantPipelineLayout <- Ptr PipelineLayout -> IO PipelineLayout
forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr PipelineLayout))
    ShaderStageFlags
pushconstantShaderStageFlags <- Ptr ShaderStageFlags -> IO ShaderStageFlags
forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlags ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr ShaderStageFlags))
    "groupIndex" ::: Word32
pushconstantOffset <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 52 :: Ptr Word32))
    "groupIndex" ::: Word32
pushconstantSize <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32))
    IndirectStateFlagsNV
indirectStateFlags <- Ptr IndirectStateFlagsNV -> IO IndirectStateFlagsNV
forall a. Storable a => Ptr a -> IO a
peek @IndirectStateFlagsNV ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectStateFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr IndirectStateFlagsNV))
    "groupIndex" ::: Word32
indexTypeCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr Word32))
    Ptr IndexType
pIndexTypes <- Ptr (Ptr IndexType) -> IO (Ptr IndexType)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr IndexType) ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV -> Int -> Ptr (Ptr IndexType)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (Ptr IndexType)))
    Vector IndexType
pIndexTypes' <- Int -> (Int -> IO IndexType) -> IO (Vector IndexType)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
indexTypeCount) (\i :: Int
i -> Ptr IndexType -> IO IndexType
forall a. Storable a => Ptr a -> IO a
peek @IndexType ((Ptr IndexType
pIndexTypes Ptr IndexType -> Int -> Ptr IndexType
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr IndexType)))
    Ptr ("groupIndex" ::: Word32)
pIndexTypeValues <- Ptr (Ptr ("groupIndex" ::: Word32))
-> IO (Ptr ("groupIndex" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr IndirectCommandsLayoutTokenNV
p Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr (Ptr ("groupIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr (Ptr Word32)))
    Vector ("groupIndex" ::: Word32)
pIndexTypeValues' <- Int
-> (Int -> IO ("groupIndex" ::: Word32))
-> IO (Vector ("groupIndex" ::: Word32))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
indexTypeCount) (\i :: Int
i -> Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("groupIndex" ::: Word32)
pIndexTypeValues Ptr ("groupIndex" ::: Word32)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    IndirectCommandsLayoutTokenNV -> IO IndirectCommandsLayoutTokenNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IndirectCommandsLayoutTokenNV -> IO IndirectCommandsLayoutTokenNV)
-> IndirectCommandsLayoutTokenNV
-> IO IndirectCommandsLayoutTokenNV
forall a b. (a -> b) -> a -> b
$ IndirectCommandsTokenTypeNV
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("isPreprocessed" ::: Bool)
-> PipelineLayout
-> ShaderStageFlags
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> IndirectStateFlagsNV
-> Vector IndexType
-> Vector ("groupIndex" ::: Word32)
-> IndirectCommandsLayoutTokenNV
IndirectCommandsLayoutTokenNV
             IndirectCommandsTokenTypeNV
tokenType "groupIndex" ::: Word32
stream "groupIndex" ::: Word32
offset "groupIndex" ::: Word32
vertexBindingUnit (("isPreprocessed" ::: Bool32) -> "isPreprocessed" ::: Bool
bool32ToBool "isPreprocessed" ::: Bool32
vertexDynamicStride) PipelineLayout
pushconstantPipelineLayout ShaderStageFlags
pushconstantShaderStageFlags "groupIndex" ::: Word32
pushconstantOffset "groupIndex" ::: Word32
pushconstantSize IndirectStateFlagsNV
indirectStateFlags Vector IndexType
pIndexTypes' Vector ("groupIndex" ::: Word32)
pIndexTypeValues'

instance Zero IndirectCommandsLayoutTokenNV where
  zero :: IndirectCommandsLayoutTokenNV
zero = IndirectCommandsTokenTypeNV
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> ("isPreprocessed" ::: Bool)
-> PipelineLayout
-> ShaderStageFlags
-> ("groupIndex" ::: Word32)
-> ("groupIndex" ::: Word32)
-> IndirectStateFlagsNV
-> Vector IndexType
-> Vector ("groupIndex" ::: Word32)
-> IndirectCommandsLayoutTokenNV
IndirectCommandsLayoutTokenNV
           IndirectCommandsTokenTypeNV
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "isPreprocessed" ::: Bool
forall a. Zero a => a
zero
           PipelineLayout
forall a. Zero a => a
zero
           ShaderStageFlags
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           "groupIndex" ::: Word32
forall a. Zero a => a
zero
           IndirectStateFlagsNV
forall a. Zero a => a
zero
           Vector IndexType
forall a. Monoid a => a
mempty
           Vector ("groupIndex" ::: Word32)
forall a. Monoid a => a
mempty


-- | VkIndirectCommandsLayoutCreateInfoNV - Structure specifying the
-- parameters of a newly created indirect commands layout object
--
-- = Description
--
-- The following code illustrates some of the flags:
--
-- > void cmdProcessAllSequences(cmd, pipeline, indirectCommandsLayout, pIndirectCommandsTokens, sequencesCount, indexbuffer, indexbufferOffset)
-- > {
-- >   for (s = 0; s < sequencesCount; s++)
-- >   {
-- >     sUsed = s;
-- >
-- >     if (indirectCommandsLayout.flags & VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV) {
-- >       sUsed = indexbuffer.load_uint32( sUsed * sizeof(uint32_t) + indexbufferOffset);
-- >     }
-- >
-- >     if (indirectCommandsLayout.flags & VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV) {
-- >       sUsed = incoherent_implementation_dependent_permutation[ sUsed ];
-- >     }
-- >
-- >     cmdProcessSequence( cmd, pipeline, indirectCommandsLayout, pIndirectCommandsTokens, sUsed );
-- >   }
-- > }
--
-- == Valid Usage
--
-- -   The @pipelineBindPoint@ /must/ be
--     'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS'
--
-- -   @tokenCount@ /must/ be greater than @0@ and less than or equal to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxIndirectCommandsTokenCount@
--
-- -   If @pTokens@ contains an entry of
--     'INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV' it /must/ be the
--     first element of the array and there /must/ be only a single element
--     of such token type
--
-- -   If @pTokens@ contains an entry of
--     'INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV' there /must/ be only a
--     single element of such token type
--
-- -   All state tokens in @pTokens@ /must/ occur prior work provoking
--     tokens ('INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV',
--     'INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV',
--     'INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV')
--
-- -   The content of @pTokens@ /must/ include one single work provoking
--     token that is compatible with the @pipelineBindPoint@
--
-- -   @streamCount@ /must/ be greater than @0@ and less or equal to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxIndirectCommandsStreamCount@
--
-- -   each element of @pStreamStrides@ /must/ be greater than \`0\`and
--     less than or equal to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxIndirectCommandsStreamStride@.
--     Furthermore the alignment of each token input /must/ be ensured
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV'
--
-- -   @pNext@ /must/ be @NULL@
--
-- -   @flags@ /must/ be a valid combination of
--     'IndirectCommandsLayoutUsageFlagBitsNV' values
--
-- -   @flags@ /must/ not be @0@
--
-- -   @pipelineBindPoint@ /must/ be a valid
--     'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' value
--
-- -   @pTokens@ /must/ be a valid pointer to an array of @tokenCount@
--     valid 'IndirectCommandsLayoutTokenNV' structures
--
-- -   @pStreamStrides@ /must/ be a valid pointer to an array of
--     @streamCount@ @uint32_t@ values
--
-- -   @tokenCount@ /must/ be greater than @0@
--
-- -   @streamCount@ /must/ be greater than @0@
--
-- = See Also
--
-- 'IndirectCommandsLayoutTokenNV', 'IndirectCommandsLayoutUsageFlagsNV',
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createIndirectCommandsLayoutNV'
data IndirectCommandsLayoutCreateInfoNV = IndirectCommandsLayoutCreateInfoNV
  { -- | @flags@ is a bitmask of 'IndirectCommandsLayoutUsageFlagBitsNV'
    -- specifying usage hints of this layout.
    IndirectCommandsLayoutCreateInfoNV
-> IndirectCommandsLayoutUsageFlagsNV
flags :: IndirectCommandsLayoutUsageFlagsNV
  , -- | @pipelineBindPoint@ is the
    -- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' that this
    -- layout targets.
    IndirectCommandsLayoutCreateInfoNV -> PipelineBindPoint
pipelineBindPoint :: PipelineBindPoint
  , -- | @pTokens@ is an array describing each command token in detail. See
    -- 'IndirectCommandsTokenTypeNV' and 'IndirectCommandsLayoutTokenNV' below
    -- for details.
    IndirectCommandsLayoutCreateInfoNV
-> Vector IndirectCommandsLayoutTokenNV
tokens :: Vector IndirectCommandsLayoutTokenNV
  , -- | @pStreamStrides@ is an array defining the byte stride for each input
    -- stream.
    IndirectCommandsLayoutCreateInfoNV
-> Vector ("groupIndex" ::: Word32)
streamStrides :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (IndirectCommandsLayoutCreateInfoNV)
#endif
deriving instance Show IndirectCommandsLayoutCreateInfoNV

instance ToCStruct IndirectCommandsLayoutCreateInfoNV where
  withCStruct :: IndirectCommandsLayoutCreateInfoNV
-> (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
    -> IO b)
-> IO b
withCStruct x :: IndirectCommandsLayoutCreateInfoNV
x f :: ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 56 8 ((("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
  -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p -> ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> IndirectCommandsLayoutCreateInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p IndirectCommandsLayoutCreateInfoNV
x (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV) -> IO b
f "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> IndirectCommandsLayoutCreateInfoNV -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p IndirectCommandsLayoutCreateInfoNV{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectCommandsLayoutUsageFlagsNV
-> IndirectCommandsLayoutUsageFlagsNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr IndirectCommandsLayoutUsageFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr IndirectCommandsLayoutUsageFlagsNV)) (IndirectCommandsLayoutUsageFlagsNV
flags)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineBindPoint -> PipelineBindPoint -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr PipelineBindPoint
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr PipelineBindPoint)) (PipelineBindPoint
pipelineBindPoint)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) ((Int -> "groupIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector IndirectCommandsLayoutTokenNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector IndirectCommandsLayoutTokenNV -> Int)
-> Vector IndirectCommandsLayoutTokenNV -> Int
forall a b. (a -> b) -> a -> b
$ (Vector IndirectCommandsLayoutTokenNV
tokens)) :: Word32))
    Ptr IndirectCommandsLayoutTokenNV
pPTokens' <- ((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
-> ContT b IO (Ptr IndirectCommandsLayoutTokenNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
 -> ContT b IO (Ptr IndirectCommandsLayoutTokenNV))
-> ((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
-> ContT b IO (Ptr IndirectCommandsLayoutTokenNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @IndirectCommandsLayoutTokenNV ((Vector IndirectCommandsLayoutTokenNV -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector IndirectCommandsLayoutTokenNV
tokens)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 88) 8
    (Int -> IndirectCommandsLayoutTokenNV -> ContT b IO ())
-> Vector IndirectCommandsLayoutTokenNV -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: IndirectCommandsLayoutTokenNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectCommandsLayoutTokenNV
-> IndirectCommandsLayoutTokenNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr IndirectCommandsLayoutTokenNV
pPTokens' Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectCommandsLayoutTokenNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr IndirectCommandsLayoutTokenNV) (IndirectCommandsLayoutTokenNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector IndirectCommandsLayoutTokenNV
tokens)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr IndirectCommandsLayoutTokenNV)
-> Ptr IndirectCommandsLayoutTokenNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr IndirectCommandsLayoutTokenNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr IndirectCommandsLayoutTokenNV))) (Ptr IndirectCommandsLayoutTokenNV
pPTokens')
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ((Int -> "groupIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ("groupIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("groupIndex" ::: Word32) -> Int)
-> Vector ("groupIndex" ::: Word32) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ("groupIndex" ::: Word32)
streamStrides)) :: Word32))
    Ptr ("groupIndex" ::: Word32)
pPStreamStrides' <- ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
 -> ContT b IO (Ptr ("groupIndex" ::: Word32)))
-> ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector ("groupIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("groupIndex" ::: Word32)
streamStrides)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("groupIndex" ::: Word32) -> IO ())
-> Vector ("groupIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "groupIndex" ::: Word32
e -> Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("groupIndex" ::: Word32)
pPStreamStrides' Ptr ("groupIndex" ::: Word32)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("groupIndex" ::: Word32
e)) (Vector ("groupIndex" ::: Word32)
streamStrides)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("groupIndex" ::: Word32))
-> Ptr ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr ("groupIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr Word32))) (Ptr ("groupIndex" ::: Word32)
pPStreamStrides')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 56
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectCommandsLayoutUsageFlagsNV
-> IndirectCommandsLayoutUsageFlagsNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr IndirectCommandsLayoutUsageFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr IndirectCommandsLayoutUsageFlagsNV)) (IndirectCommandsLayoutUsageFlagsNV
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineBindPoint -> PipelineBindPoint -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr PipelineBindPoint
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr PipelineBindPoint)) (PipelineBindPoint
forall a. Zero a => a
zero)
    Ptr IndirectCommandsLayoutTokenNV
pPTokens' <- ((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
-> ContT b IO (Ptr IndirectCommandsLayoutTokenNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
 -> ContT b IO (Ptr IndirectCommandsLayoutTokenNV))
-> ((Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b)
-> ContT b IO (Ptr IndirectCommandsLayoutTokenNV)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr IndirectCommandsLayoutTokenNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @IndirectCommandsLayoutTokenNV ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 88) 8
    (Int -> IndirectCommandsLayoutTokenNV -> ContT b IO ())
-> Vector IndirectCommandsLayoutTokenNV -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: IndirectCommandsLayoutTokenNV
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr IndirectCommandsLayoutTokenNV
-> IndirectCommandsLayoutTokenNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr IndirectCommandsLayoutTokenNV
pPTokens' Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectCommandsLayoutTokenNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr IndirectCommandsLayoutTokenNV) (IndirectCommandsLayoutTokenNV
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector IndirectCommandsLayoutTokenNV
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr IndirectCommandsLayoutTokenNV)
-> Ptr IndirectCommandsLayoutTokenNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr IndirectCommandsLayoutTokenNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr IndirectCommandsLayoutTokenNV))) (Ptr IndirectCommandsLayoutTokenNV
pPTokens')
    Ptr ("groupIndex" ::: Word32)
pPStreamStrides' <- ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
 -> ContT b IO (Ptr ("groupIndex" ::: Word32)))
-> ((Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("groupIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("groupIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("groupIndex" ::: Word32) -> IO ())
-> Vector ("groupIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "groupIndex" ::: Word32
e -> Ptr ("groupIndex" ::: Word32) -> ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("groupIndex" ::: Word32)
pPStreamStrides' Ptr ("groupIndex" ::: Word32)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("groupIndex" ::: Word32
e)) (Vector ("groupIndex" ::: Word32)
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("groupIndex" ::: Word32))
-> Ptr ("groupIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr ("groupIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr Word32))) (Ptr ("groupIndex" ::: Word32)
pPStreamStrides')
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct IndirectCommandsLayoutCreateInfoNV where
  peekCStruct :: ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> IO IndirectCommandsLayoutCreateInfoNV
peekCStruct p :: "pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p = do
    IndirectCommandsLayoutUsageFlagsNV
flags <- Ptr IndirectCommandsLayoutUsageFlagsNV
-> IO IndirectCommandsLayoutUsageFlagsNV
forall a. Storable a => Ptr a -> IO a
peek @IndirectCommandsLayoutUsageFlagsNV (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr IndirectCommandsLayoutUsageFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr IndirectCommandsLayoutUsageFlagsNV))
    PipelineBindPoint
pipelineBindPoint <- Ptr PipelineBindPoint -> IO PipelineBindPoint
forall a. Storable a => Ptr a -> IO a
peek @PipelineBindPoint (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr PipelineBindPoint
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr PipelineBindPoint))
    "groupIndex" ::: Word32
tokenCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    Ptr IndirectCommandsLayoutTokenNV
pTokens <- Ptr (Ptr IndirectCommandsLayoutTokenNV)
-> IO (Ptr IndirectCommandsLayoutTokenNV)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr IndirectCommandsLayoutTokenNV) (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr IndirectCommandsLayoutTokenNV)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr IndirectCommandsLayoutTokenNV)))
    Vector IndirectCommandsLayoutTokenNV
pTokens' <- Int
-> (Int -> IO IndirectCommandsLayoutTokenNV)
-> IO (Vector IndirectCommandsLayoutTokenNV)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
tokenCount) (\i :: Int
i -> Ptr IndirectCommandsLayoutTokenNV
-> IO IndirectCommandsLayoutTokenNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @IndirectCommandsLayoutTokenNV ((Ptr IndirectCommandsLayoutTokenNV
pTokens Ptr IndirectCommandsLayoutTokenNV
-> Int -> Ptr IndirectCommandsLayoutTokenNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr IndirectCommandsLayoutTokenNV)))
    "groupIndex" ::: Word32
streamCount <- Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32))
    Ptr ("groupIndex" ::: Word32)
pStreamStrides <- Ptr (Ptr ("groupIndex" ::: Word32))
-> IO (Ptr ("groupIndex" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) (("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV
p ("pCreateInfo" ::: Ptr IndirectCommandsLayoutCreateInfoNV)
-> Int -> Ptr (Ptr ("groupIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr Word32)))
    Vector ("groupIndex" ::: Word32)
pStreamStrides' <- Int
-> (Int -> IO ("groupIndex" ::: Word32))
-> IO (Vector ("groupIndex" ::: Word32))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("groupIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "groupIndex" ::: Word32
streamCount) (\i :: Int
i -> Ptr ("groupIndex" ::: Word32) -> IO ("groupIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("groupIndex" ::: Word32)
pStreamStrides Ptr ("groupIndex" ::: Word32)
-> Int -> Ptr ("groupIndex" ::: Word32)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    IndirectCommandsLayoutCreateInfoNV
-> IO IndirectCommandsLayoutCreateInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IndirectCommandsLayoutCreateInfoNV
 -> IO IndirectCommandsLayoutCreateInfoNV)
-> IndirectCommandsLayoutCreateInfoNV
-> IO IndirectCommandsLayoutCreateInfoNV
forall a b. (a -> b) -> a -> b
$ IndirectCommandsLayoutUsageFlagsNV
-> PipelineBindPoint
-> Vector IndirectCommandsLayoutTokenNV
-> Vector ("groupIndex" ::: Word32)
-> IndirectCommandsLayoutCreateInfoNV
IndirectCommandsLayoutCreateInfoNV
             IndirectCommandsLayoutUsageFlagsNV
flags PipelineBindPoint
pipelineBindPoint Vector IndirectCommandsLayoutTokenNV
pTokens' Vector ("groupIndex" ::: Word32)
pStreamStrides'

instance Zero IndirectCommandsLayoutCreateInfoNV where
  zero :: IndirectCommandsLayoutCreateInfoNV
zero = IndirectCommandsLayoutUsageFlagsNV
-> PipelineBindPoint
-> Vector IndirectCommandsLayoutTokenNV
-> Vector ("groupIndex" ::: Word32)
-> IndirectCommandsLayoutCreateInfoNV
IndirectCommandsLayoutCreateInfoNV
           IndirectCommandsLayoutUsageFlagsNV
forall a. Zero a => a
zero
           PipelineBindPoint
forall a. Zero a => a
zero
           Vector IndirectCommandsLayoutTokenNV
forall a. Monoid a => a
mempty
           Vector ("groupIndex" ::: Word32)
forall a. Monoid a => a
mempty


-- | VkGeneratedCommandsInfoNV - Structure specifying parameters for the
-- generation of commands
--
-- == Valid Usage
--
-- -   The provided @pipeline@ /must/ match the pipeline bound at execution
--     time
--
-- -   If the @indirectCommandsLayout@ uses a token of
--     'INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV', then the @pipeline@
--     /must/ have been created with multiple shader groups
--
-- -   If the @indirectCommandsLayout@ uses a token of
--     'INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV', then the @pipeline@
--     /must/ have been created with
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV'
--     set in 'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo'::@flags@
--
-- -   If the @indirectCommandsLayout@ uses a token of
--     'INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV', then the
--     @pipeline@\`s 'Vulkan.Core10.Handles.PipelineLayout' /must/ match
--     the 'IndirectCommandsLayoutTokenNV'::@pushconstantPipelineLayout@
--
-- -   @streamCount@ /must/ match the @indirectCommandsLayout@’s
--     @streamCount@
--
-- -   @sequencesCount@ /must/ be less or equal to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@maxIndirectSequenceCount@
--     and 'GeneratedCommandsMemoryRequirementsInfoNV'::@maxSequencesCount@
--     that was used to determine the @preprocessSize@
--
-- -   @preprocessBuffer@ /must/ have the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     bit set in its usage flag
--
-- -   @preprocessOffset@ /must/ be aligned to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@minIndirectCommandsBufferOffsetAlignment@
--
-- -   If @preprocessBuffer@ is non-sparse then it /must/ be bound
--     completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   @preprocessSize@ /must/ be at least equal to the memory
--     requirement\`s size returned by
--     'getGeneratedCommandsMemoryRequirementsNV' using the matching inputs
--     (@indirectCommandsLayout@, …​) as within this structure
--
-- -   @sequencesCountBuffer@ /can/ be set if the actual used count of
--     sequences is sourced from the provided buffer. In that case the
--     @sequencesCount@ serves as upper bound
--
-- -   If @sequencesCountBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', its usage flag /must/ have
--     the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     bit set
--
-- -   If @sequencesCountBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @sequencesCountOffset@
--     /must/ be aligned to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@minSequencesCountBufferOffsetAlignment@
--
-- -   If @sequencesCountBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' and is non-sparse then it
--     /must/ be bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   If @indirectCommandsLayout@’s
--     'INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV' is set,
--     @sequencesIndexBuffer@ /must/ be set otherwise it /must/ be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   If @sequencesIndexBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', its usage flag /must/ have
--     the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     bit set
--
-- -   If @sequencesIndexBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @sequencesIndexOffset@
--     /must/ be aligned to
--     'PhysicalDeviceDeviceGeneratedCommandsPropertiesNV'::@minSequencesIndexBufferOffsetAlignment@
--
-- -   If @sequencesIndexBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' and is non-sparse then it
--     /must/ be bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV'
--
-- -   @pNext@ /must/ be @NULL@
--
-- -   @pipelineBindPoint@ /must/ be a valid
--     'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' value
--
-- -   @pipeline@ /must/ be a valid 'Vulkan.Core10.Handles.Pipeline' handle
--
-- -   @indirectCommandsLayout@ /must/ be a valid
--     'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV' handle
--
-- -   @pStreams@ /must/ be a valid pointer to an array of @streamCount@
--     valid 'IndirectCommandsStreamNV' structures
--
-- -   @preprocessBuffer@ /must/ be a valid 'Vulkan.Core10.Handles.Buffer'
--     handle
--
-- -   If @sequencesCountBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @sequencesCountBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   If @sequencesIndexBuffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @sequencesIndexBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   @streamCount@ /must/ be greater than @0@
--
-- -   Each of @indirectCommandsLayout@, @pipeline@, @preprocessBuffer@,
--     @sequencesCountBuffer@, and @sequencesIndexBuffer@ that are valid
--     handles of non-ignored parameters /must/ have been created,
--     allocated, or retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Buffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV',
-- 'IndirectCommandsStreamNV', 'Vulkan.Core10.Handles.Pipeline',
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdExecuteGeneratedCommandsNV', 'cmdPreprocessGeneratedCommandsNV'
data GeneratedCommandsInfoNV = GeneratedCommandsInfoNV
  { -- | @pipelineBindPoint@ is the
    -- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' used for the
    -- @pipeline@.
    GeneratedCommandsInfoNV -> PipelineBindPoint
pipelineBindPoint :: PipelineBindPoint
  , -- | @pipeline@ is the 'Vulkan.Core10.Handles.Pipeline' used in the
    -- generation and execution process.
    GeneratedCommandsInfoNV -> Pipeline
pipeline :: Pipeline
  , -- | @indirectCommandsLayout@ is the
    -- 'Vulkan.Extensions.Handles.IndirectCommandsLayoutNV' that provides the
    -- command sequence to generate.
    GeneratedCommandsInfoNV -> IndirectCommandsLayoutNV
indirectCommandsLayout :: IndirectCommandsLayoutNV
  , -- | @pStreams@ provides an array of 'IndirectCommandsStreamNV' that provide
    -- the input data for the tokens used in @indirectCommandsLayout@.
    GeneratedCommandsInfoNV -> Vector IndirectCommandsStreamNV
streams :: Vector IndirectCommandsStreamNV
  , -- | @sequencesCount@ is the maximum number of sequences to reserve. If
    -- @sequencesCountBuffer@ is 'Vulkan.Core10.APIConstants.NULL_HANDLE', this
    -- is also the actual number of sequences generated.
    GeneratedCommandsInfoNV -> "groupIndex" ::: Word32
sequencesCount :: Word32
  , -- | @preprocessBuffer@ is the 'Vulkan.Core10.Handles.Buffer' that is used
    -- for preprocessing the input data for execution. If this structure is
    -- used with 'cmdExecuteGeneratedCommandsNV' with its @isPreprocessed@ set
    -- to 'Vulkan.Core10.FundamentalTypes.TRUE', then the preprocessing step is
    -- skipped and data is only read from this buffer.
    GeneratedCommandsInfoNV -> Buffer
preprocessBuffer :: Buffer
  , -- | @preprocessOffset@ is the byte offset into @preprocessBuffer@ where the
    -- preprocessed data is stored.
    GeneratedCommandsInfoNV -> DeviceAddress
preprocessOffset :: DeviceSize
  , -- | @preprocessSize@ is the maximum byte size within the @preprocessBuffer@
    -- after the @preprocessOffset@ that is available for preprocessing.
    GeneratedCommandsInfoNV -> DeviceAddress
preprocessSize :: DeviceSize
  , -- | @sequencesCountBuffer@ is a 'Vulkan.Core10.Handles.Buffer' in which the
    -- actual number of sequences is provided as single @uint32_t@ value.
    GeneratedCommandsInfoNV -> Buffer
sequencesCountBuffer :: Buffer
  , -- | @sequencesCountOffset@ is the byte offset into @sequencesCountBuffer@
    -- where the count value is stored.
    GeneratedCommandsInfoNV -> DeviceAddress
sequencesCountOffset :: DeviceSize
  , -- | @sequencesIndexBuffer@ is a 'Vulkan.Core10.Handles.Buffer' that encodes
    -- the used sequence indices as @uint32_t@ array.
    GeneratedCommandsInfoNV -> Buffer
sequencesIndexBuffer :: Buffer
  , -- | @sequencesIndexOffset@ is the byte offset into @sequencesIndexBuffer@
    -- where the index values start.
    GeneratedCommandsInfoNV -> DeviceAddress
sequencesIndexOffset :: DeviceSize
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GeneratedCommandsInfoNV)
#endif
deriving instance Show GeneratedCommandsInfoNV

instance