| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Vulkan.Core10.CommandBufferBuilding
Synopsis
- cmdBindPipeline :: forall io. MonadIO io => CommandBuffer -> PipelineBindPoint -> Pipeline -> io ()
- cmdSetViewport :: forall io. MonadIO io => CommandBuffer -> ("firstViewport" ::: Word32) -> ("viewports" ::: Vector Viewport) -> io ()
- cmdSetScissor :: forall io. MonadIO io => CommandBuffer -> ("firstScissor" ::: Word32) -> ("scissors" ::: Vector Rect2D) -> io ()
- cmdSetLineWidth :: forall io. MonadIO io => CommandBuffer -> ("lineWidth" ::: Float) -> io ()
- cmdSetDepthBias :: forall io. MonadIO io => CommandBuffer -> ("depthBiasConstantFactor" ::: Float) -> ("depthBiasClamp" ::: Float) -> ("depthBiasSlopeFactor" ::: Float) -> io ()
- cmdSetBlendConstants :: forall io. MonadIO io => CommandBuffer -> ("blendConstants" ::: (Float, Float, Float, Float)) -> io ()
- cmdSetDepthBounds :: forall io. MonadIO io => CommandBuffer -> ("minDepthBounds" ::: Float) -> ("maxDepthBounds" ::: Float) -> io ()
- cmdSetStencilCompareMask :: forall io. MonadIO io => CommandBuffer -> ("faceMask" ::: StencilFaceFlags) -> ("compareMask" ::: Word32) -> io ()
- cmdSetStencilWriteMask :: forall io. MonadIO io => CommandBuffer -> ("faceMask" ::: StencilFaceFlags) -> ("writeMask" ::: Word32) -> io ()
- cmdSetStencilReference :: forall io. MonadIO io => CommandBuffer -> ("faceMask" ::: StencilFaceFlags) -> ("reference" ::: Word32) -> io ()
- cmdBindDescriptorSets :: forall io. MonadIO io => CommandBuffer -> PipelineBindPoint -> PipelineLayout -> ("firstSet" ::: Word32) -> ("descriptorSets" ::: Vector DescriptorSet) -> ("dynamicOffsets" ::: Vector Word32) -> io ()
- cmdBindIndexBuffer :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> IndexType -> io ()
- cmdBindVertexBuffers :: forall io. MonadIO io => CommandBuffer -> ("firstBinding" ::: Word32) -> ("buffers" ::: Vector Buffer) -> ("offsets" ::: Vector DeviceSize) -> io ()
- cmdDraw :: forall io. MonadIO io => CommandBuffer -> ("vertexCount" ::: Word32) -> ("instanceCount" ::: Word32) -> ("firstVertex" ::: Word32) -> ("firstInstance" ::: Word32) -> io ()
- cmdDrawIndexed :: forall io. MonadIO io => CommandBuffer -> ("indexCount" ::: Word32) -> ("instanceCount" ::: Word32) -> ("firstIndex" ::: Word32) -> ("vertexOffset" ::: Int32) -> ("firstInstance" ::: Word32) -> io ()
- cmdDrawIndirect :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> ("drawCount" ::: Word32) -> ("stride" ::: Word32) -> io ()
- cmdDrawIndexedIndirect :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> ("drawCount" ::: Word32) -> ("stride" ::: Word32) -> io ()
- cmdDispatch :: forall io. MonadIO io => CommandBuffer -> ("groupCountX" ::: Word32) -> ("groupCountY" ::: Word32) -> ("groupCountZ" ::: Word32) -> io ()
- cmdDispatchIndirect :: forall io. MonadIO io => CommandBuffer -> Buffer -> ("offset" ::: DeviceSize) -> io ()
- cmdCopyBuffer :: forall io. MonadIO io => CommandBuffer -> ("srcBuffer" ::: Buffer) -> ("dstBuffer" ::: Buffer) -> ("regions" ::: Vector BufferCopy) -> io ()
- cmdCopyImage :: forall io. MonadIO io => CommandBuffer -> ("srcImage" ::: Image) -> ("srcImageLayout" ::: ImageLayout) -> ("dstImage" ::: Image) -> ("dstImageLayout" ::: ImageLayout) -> ("regions" ::: Vector ImageCopy) -> io ()
- cmdBlitImage :: forall io. MonadIO io => CommandBuffer -> ("srcImage" ::: Image) -> ("srcImageLayout" ::: ImageLayout) -> ("dstImage" ::: Image) -> ("dstImageLayout" ::: ImageLayout) -> ("regions" ::: Vector ImageBlit) -> Filter -> io ()
- cmdCopyBufferToImage :: forall io. MonadIO io => CommandBuffer -> ("srcBuffer" ::: Buffer) -> ("dstImage" ::: Image) -> ("dstImageLayout" ::: ImageLayout) -> ("regions" ::: Vector BufferImageCopy) -> io ()
- cmdCopyImageToBuffer :: forall io. MonadIO io => CommandBuffer -> ("srcImage" ::: Image) -> ("srcImageLayout" ::: ImageLayout) -> ("dstBuffer" ::: Buffer) -> ("regions" ::: Vector BufferImageCopy) -> io ()
- cmdUpdateBuffer :: forall io. MonadIO io => CommandBuffer -> ("dstBuffer" ::: Buffer) -> ("dstOffset" ::: DeviceSize) -> ("dataSize" ::: DeviceSize) -> ("data" ::: Ptr ()) -> io ()
- cmdFillBuffer :: forall io. MonadIO io => CommandBuffer -> ("dstBuffer" ::: Buffer) -> ("dstOffset" ::: DeviceSize) -> DeviceSize -> ("data" ::: Word32) -> io ()
- cmdClearColorImage :: forall io. MonadIO io => CommandBuffer -> Image -> ImageLayout -> ClearColorValue -> ("ranges" ::: Vector ImageSubresourceRange) -> io ()
- cmdClearDepthStencilImage :: forall io. MonadIO io => CommandBuffer -> Image -> ImageLayout -> ClearDepthStencilValue -> ("ranges" ::: Vector ImageSubresourceRange) -> io ()
- cmdClearAttachments :: forall io. MonadIO io => CommandBuffer -> ("attachments" ::: Vector ClearAttachment) -> ("rects" ::: Vector ClearRect) -> io ()
- cmdResolveImage :: forall io. MonadIO io => CommandBuffer -> ("srcImage" ::: Image) -> ("srcImageLayout" ::: ImageLayout) -> ("dstImage" ::: Image) -> ("dstImageLayout" ::: ImageLayout) -> ("regions" ::: Vector ImageResolve) -> io ()
- cmdSetEvent :: forall io. MonadIO io => CommandBuffer -> Event -> ("stageMask" ::: PipelineStageFlags) -> io ()
- cmdResetEvent :: forall io. MonadIO io => CommandBuffer -> Event -> ("stageMask" ::: PipelineStageFlags) -> io ()
- cmdWaitEvents :: forall io. MonadIO io => CommandBuffer -> ("events" ::: Vector Event) -> ("srcStageMask" ::: PipelineStageFlags) -> ("dstStageMask" ::: PipelineStageFlags) -> ("memoryBarriers" ::: Vector MemoryBarrier) -> ("bufferMemoryBarriers" ::: Vector BufferMemoryBarrier) -> ("imageMemoryBarriers" ::: Vector (SomeStruct ImageMemoryBarrier)) -> io ()
- cmdWaitEventsSafe :: forall io. MonadIO io => CommandBuffer -> ("events" ::: Vector Event) -> ("srcStageMask" ::: PipelineStageFlags) -> ("dstStageMask" ::: PipelineStageFlags) -> ("memoryBarriers" ::: Vector MemoryBarrier) -> ("bufferMemoryBarriers" ::: Vector BufferMemoryBarrier) -> ("imageMemoryBarriers" ::: Vector (SomeStruct ImageMemoryBarrier)) -> io ()
- cmdPipelineBarrier :: forall io. MonadIO io => CommandBuffer -> ("srcStageMask" ::: PipelineStageFlags) -> ("dstStageMask" ::: PipelineStageFlags) -> DependencyFlags -> ("memoryBarriers" ::: Vector MemoryBarrier) -> ("bufferMemoryBarriers" ::: Vector BufferMemoryBarrier) -> ("imageMemoryBarriers" ::: Vector (SomeStruct ImageMemoryBarrier)) -> io ()
- cmdBeginQuery :: forall io. MonadIO io => CommandBuffer -> QueryPool -> ("query" ::: Word32) -> QueryControlFlags -> io ()
- cmdUseQuery :: forall io r. MonadIO io => CommandBuffer -> QueryPool -> Word32 -> QueryControlFlags -> io r -> io r
- cmdEndQuery :: forall io. MonadIO io => CommandBuffer -> QueryPool -> ("query" ::: Word32) -> io ()
- cmdResetQueryPool :: forall io. MonadIO io => CommandBuffer -> QueryPool -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> io ()
- cmdWriteTimestamp :: forall io. MonadIO io => CommandBuffer -> PipelineStageFlagBits -> QueryPool -> ("query" ::: Word32) -> io ()
- cmdCopyQueryPoolResults :: forall io. MonadIO io => CommandBuffer -> QueryPool -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> ("dstBuffer" ::: Buffer) -> ("dstOffset" ::: DeviceSize) -> ("stride" ::: DeviceSize) -> QueryResultFlags -> io ()
- cmdPushConstants :: forall io. MonadIO io => CommandBuffer -> PipelineLayout -> ShaderStageFlags -> ("offset" ::: Word32) -> ("size" ::: Word32) -> ("values" ::: Ptr ()) -> io ()
- cmdBeginRenderPass :: forall a io. (Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) => CommandBuffer -> RenderPassBeginInfo a -> SubpassContents -> io ()
- cmdUseRenderPass :: forall a io r. (Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) => CommandBuffer -> RenderPassBeginInfo a -> SubpassContents -> io r -> io r
- cmdNextSubpass :: forall io. MonadIO io => CommandBuffer -> SubpassContents -> io ()
- cmdEndRenderPass :: forall io. MonadIO io => CommandBuffer -> io ()
- cmdExecuteCommands :: forall io. MonadIO io => CommandBuffer -> ("commandBuffers" ::: Vector CommandBuffer) -> io ()
- data ClearRect = ClearRect {- rect :: Rect2D
- baseArrayLayer :: Word32
- layerCount :: Word32
 
- data ImageSubresourceLayers = ImageSubresourceLayers {}
- data BufferCopy = BufferCopy {}
- data ImageCopy = ImageCopy {}
- data ImageBlit = ImageBlit {}
- data BufferImageCopy = BufferImageCopy {}
- data ImageResolve = ImageResolve {}
- data RenderPassBeginInfo (es :: [Type]) = RenderPassBeginInfo {- next :: Chain es
- renderPass :: RenderPass
- framebuffer :: Framebuffer
- renderArea :: Rect2D
- clearValues :: Vector ClearValue
 
- data ClearDepthStencilValue = ClearDepthStencilValue {}
- data ClearAttachment = ClearAttachment {}
- data ClearColorValue
- data ClearValue
- newtype IndexType where- IndexType Int32
- pattern INDEX_TYPE_UINT16 :: IndexType
- pattern INDEX_TYPE_UINT32 :: IndexType
- pattern INDEX_TYPE_UINT8_EXT :: IndexType
- pattern INDEX_TYPE_NONE_KHR :: IndexType
 
- newtype SubpassContents where
- newtype StencilFaceFlagBits where
- type StencilFaceFlags = StencilFaceFlagBits
Documentation
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> PipelineBindPoint | 
 | 
| -> Pipeline | 
 | 
| -> io () | 
vkCmdBindPipeline - Bind a pipeline object to a command buffer
Description
Once bound, a pipeline binding affects subsequent graphics or compute
 commands in the command buffer until a different pipeline is bound to
 the bind point. The pipeline bound to
 PIPELINE_BIND_POINT_COMPUTE
 controls the behavior of cmdDispatch and cmdDispatchIndirect. The
 pipeline bound to
 PIPELINE_BIND_POINT_GRAPHICS
 controls the behavior of all
 drawing commands.
 The pipeline bound to
 PIPELINE_BIND_POINT_RAY_TRACING_KHR
 controls the behavior of
 cmdTraceRaysKHR. No other
 commands are affected by the pipeline state.
Valid Usage
- If pipelineBindPointisPIPELINE_BIND_POINT_COMPUTE, theCommandPoolthatcommandBufferwas allocated from must support compute operations
- If pipelineBindPointisPIPELINE_BIND_POINT_GRAPHICS, theCommandPoolthatcommandBufferwas allocated from must support graphics operations
- If pipelineBindPointisPIPELINE_BIND_POINT_COMPUTE,pipelinemust be a compute pipeline
- If pipelineBindPointisPIPELINE_BIND_POINT_GRAPHICS,pipelinemust be a graphics pipeline
- If the
     variable multisample rate
     feature is not supported, pipelineis a graphics pipeline, the current subpass uses no attachments, and this is not the first call to this function with a graphics pipeline after transitioning to the current subpass, then the sample count specified by this pipeline must match that set in the previous pipeline
- If
     PhysicalDeviceSampleLocationsPropertiesEXT::variableSampleLocationsisFALSE, andpipelineis a graphics pipeline created with aPipelineSampleLocationsStateCreateInfoEXTstructure having itssampleLocationsEnablemember set toTRUEbut withoutDYNAMIC_STATE_SAMPLE_LOCATIONS_EXTenabled then the current render pass instance must have been begun by specifying aRenderPassSampleLocationsBeginInfoEXTstructure whosepPostSubpassSampleLocationsmember contains an element with asubpassIndexmatching the current subpass index and thesampleLocationsInfomember of that element must match thesampleLocationsInfospecified inPipelineSampleLocationsStateCreateInfoEXTwhen the pipeline was created
- This command must not be recorded when transform feedback is active
- If pipelineBindPointisPIPELINE_BIND_POINT_RAY_TRACING_KHR, theCommandPoolthatcommandBufferwas allocated from must support compute operations
- If pipelineBindPointisPIPELINE_BIND_POINT_RAY_TRACING_KHR, thepipelinemust be a ray tracing pipeline
- The pipelinemust not have been created withPIPELINE_CREATE_LIBRARY_BIT_KHRset
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pipelineBindPointmust be a valid- PipelineBindPointvalue
- pipelinemust be a valid- Pipelinehandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- Both of commandBuffer, andpipelinemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("firstViewport" ::: Word32) | 
 | 
| -> ("viewports" ::: Vector Viewport) | 
 | 
| -> io () | 
vkCmdSetViewport - Set the viewport on a command buffer
Description
The viewport parameters taken from element i of pViewports replace the
 current state for the viewport index firstViewport + i, for i in [0,
 viewportCount).
Valid Usage
- firstViewportmust be less than- PhysicalDeviceLimits::- maxViewports
- The sum of firstViewportandviewportCountmust be between1andPhysicalDeviceLimits::maxViewports, inclusive
- If the
     multiple viewports
     feature is not enabled, firstViewportmust be0
- If the
     multiple viewports
     feature is not enabled, viewportCountmust be1
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pViewportsmust be a valid pointer to an array of- viewportCountvalid- Viewportstructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- viewportCountmust be greater than- 0
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("firstScissor" ::: Word32) | 
 | 
| -> ("scissors" ::: Vector Rect2D) | 
 | 
| -> io () | 
vkCmdSetScissor - Set the dynamic scissor rectangles on a command buffer
Description
The scissor rectangles taken from element i of pScissors replace the
 current state for the scissor index firstScissor + i, for i in [0,
 scissorCount).
This command sets the state for a given draw when the graphics pipeline
 is created with DYNAMIC_STATE_SCISSOR
 set in
 PipelineDynamicStateCreateInfo::pDynamicStates.
Valid Usage
- firstScissormust be less than- PhysicalDeviceLimits::- maxViewports
- The sum of firstScissorandscissorCountmust be between1andPhysicalDeviceLimits::maxViewports, inclusive
- If the
     multiple viewports
     feature is not enabled, firstScissormust be0
- If the
     multiple viewports
     feature is not enabled, scissorCountmust be1
- The xandymembers ofoffsetmember of any element ofpScissorsmust be greater than or equal to0
- Evaluation of (offset.x+extent.width) must not cause a signed integer addition overflow for any element ofpScissors
- Evaluation of (offset.y+extent.height) must not cause a signed integer addition overflow for any element ofpScissors
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pScissorsmust be a valid pointer to an array of- scissorCount- Rect2Dstructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- scissorCountmust be greater than- 0
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("lineWidth" ::: Float) | 
 | 
| -> io () | 
vkCmdSetLineWidth - Set the dynamic line width state
Valid Usage
- If the
     wide lines
     feature is not enabled, lineWidthmust be1.0
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("depthBiasConstantFactor" ::: Float) | 
 | 
| -> ("depthBiasClamp" ::: Float) | 
 | 
| -> ("depthBiasSlopeFactor" ::: Float) | 
 | 
| -> io () | 
vkCmdSetDepthBias - Set the depth bias dynamic state
Description
If depthBiasEnable is FALSE, no depth
 bias is applied and the fragment’s depth values are unchanged.
depthBiasSlopeFactor scales the maximum depth slope of the polygon,
 and depthBiasConstantFactor scales an implementation-dependent
 constant that relates to the usable resolution of the depth buffer. The
 resulting values are summed to produce the depth bias value which is
 then clamped to a minimum or maximum value specified by
 depthBiasClamp. depthBiasSlopeFactor, depthBiasConstantFactor, and
 depthBiasClamp can each be positive, negative, or zero.
The maximum depth slope m of a triangle is
\[m = \sqrt{ \left({{\partial z_f} \over {\partial x_f}}\right)^2 + \left({{\partial z_f} \over {\partial y_f}}\right)^2}\]
where (xf, yf, zf) is a point on the triangle. m may be approximated as
\[m = \max\left( \left| { {\partial z_f} \over {\partial x_f} } \right|, \left| { {\partial z_f} \over {\partial y_f} } \right| \right).\]
The minimum resolvable difference r is an implementation-dependent
 parameter that depends on the depth buffer representation. It is the
 smallest difference in framebuffer coordinate z values that is
 guaranteed to remain distinct throughout polygon rasterization and in
 the depth buffer. All pairs of fragments generated by the rasterization
 of two polygons with otherwise identical vertices, but zf values that
 differ by r, will have distinct depth values.
For fixed-point depth buffer representations, r is constant throughout the range of the entire depth buffer. For floating-point depth buffers, there is no single minimum resolvable difference. In this case, the minimum resolvable difference for a given polygon is dependent on the maximum exponent, e, in the range of z values spanned by the primitive. If n is the number of bits in the floating-point mantissa, the minimum resolvable difference, r, for the given primitive is defined as
- r = 2e-n
If a triangle is rasterized using the
 POLYGON_MODE_FILL_RECTANGLE_NV polygon
 mode, then this minimum resolvable difference may not be resolvable
 for samples outside of the triangle, where the depth is extrapolated.
If no depth buffer is present, r is undefined.
The bias value o for a polygon is
[begin{aligned} o &= mathrm{dbclamp}( m times mathtt{depthBiasSlopeFactor} + r times mathtt{depthBiasConstantFactor} ) -- text{where} &quad mathrm{dbclamp}(x) =
Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+ | Primary | Both | Graphics | | | Secondary | | | | +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("blendConstants" ::: (Float, Float, Float, Float)) | 
 | 
| -> io () | 
vkCmdSetBlendConstants - Set the values of blend constants
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("minDepthBounds" ::: Float) | 
 | 
| -> ("maxDepthBounds" ::: Float) | 
 | 
| -> io () | 
vkCmdSetDepthBounds - Set the depth bounds test values for a command buffer
Description
This command sets the state for a given draw when the graphics pipeline
 is created with
 DYNAMIC_STATE_DEPTH_BOUNDS set in
 PipelineDynamicStateCreateInfo::pDynamicStates.
Valid Usage
- Unless the VK_EXT_depth_range_unrestrictedextension is enabledminDepthBoundsmust be between0.0and1.0, inclusive
- Unless the VK_EXT_depth_range_unrestrictedextension is enabledmaxDepthBoundsmust be between0.0and1.0, inclusive
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
cmdSetStencilCompareMask Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("faceMask" ::: StencilFaceFlags) | 
 | 
| -> ("compareMask" ::: Word32) | 
 | 
| -> io () | 
vkCmdSetStencilCompareMask - Set the stencil compare mask dynamic state
Description
This command sets the state for a given draw when the graphics pipeline
 is created with
 DYNAMIC_STATE_STENCIL_COMPARE_MASK
 set in
 PipelineDynamicStateCreateInfo::pDynamicStates.
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- faceMaskmust be a valid combination of- StencilFaceFlagBitsvalues
- faceMaskmust not be- 0
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
cmdSetStencilWriteMask Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("faceMask" ::: StencilFaceFlags) | 
 | 
| -> ("writeMask" ::: Word32) | 
 | 
| -> io () | 
vkCmdSetStencilWriteMask - Set the stencil write mask dynamic state
Description
This command sets the state for a given draw when the graphics pipeline
 is created with
 DYNAMIC_STATE_STENCIL_WRITE_MASK set
 in
 PipelineDynamicStateCreateInfo::pDynamicStates.
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- faceMaskmust be a valid combination of- StencilFaceFlagBitsvalues
- faceMaskmust not be- 0
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
cmdSetStencilReference Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("faceMask" ::: StencilFaceFlags) | 
 | 
| -> ("reference" ::: Word32) | 
 | 
| -> io () | 
vkCmdSetStencilReference - Set the stencil reference dynamic state
Description
This command sets the state for a given draw when the graphics pipeline
 is created with
 DYNAMIC_STATE_STENCIL_REFERENCE set
 in
 PipelineDynamicStateCreateInfo::pDynamicStates.
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- faceMaskmust be a valid combination of- StencilFaceFlagBitsvalues
- faceMaskmust not be- 0
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
cmdBindDescriptorSets Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> PipelineBindPoint | 
 | 
| -> PipelineLayout | 
 | 
| -> ("firstSet" ::: Word32) | 
 | 
| -> ("descriptorSets" ::: Vector DescriptorSet) | 
 | 
| -> ("dynamicOffsets" ::: Vector Word32) | 
 | 
| -> io () | 
vkCmdBindDescriptorSets - Binds descriptor sets to a command buffer
Description
cmdBindDescriptorSets causes the sets numbered [firstSet..
 firstSet+descriptorSetCount-1] to use the bindings stored in
 pDescriptorSets[0..descriptorSetCount-1] for subsequent rendering
 commands (either compute or graphics, according to the
 pipelineBindPoint). Any bindings that were previously applied via
 these sets are no longer valid.
Once bound, a descriptor set affects rendering of subsequent graphics or compute commands in the command buffer until a different set is bound to the same set number, or else until the set is disturbed as described in Pipeline Layout Compatibility.
A compatible descriptor set must be bound for all set numbers that any shaders in a pipeline access, at the time that a draw or dispatch command is recorded to execute using that pipeline. However, if none of the shaders in a pipeline statically use any bindings with a particular set number, then no descriptor set need be bound for that set number, even if the pipeline layout includes a non-trivial descriptor set layout for that set number.
If any of the sets being bound include dynamic uniform or storage
 buffers, then pDynamicOffsets includes one element for each array
 element in each dynamic descriptor type binding in each set. Values are
 taken from pDynamicOffsets in an order such that all entries for set N
 come before set N+1; within a set, entries are ordered by the binding
 numbers in the descriptor set layouts; and within a binding array,
 elements are in order. dynamicOffsetCount must equal the total
 number of dynamic descriptors in the sets being bound.
The effective offset used for dynamic uniform and storage buffer
 bindings is the sum of the relative offset taken from pDynamicOffsets,
 and the base address of the buffer plus base offset in the descriptor
 set. The range of the dynamic uniform and storage buffer bindings is the
 buffer range as specified in the descriptor set.
Each of the pDescriptorSets must be compatible with the pipeline
 layout specified by layout. The layout used to program the bindings
 must also be compatible with the pipeline used in subsequent graphics
 or compute commands, as defined in the
 Pipeline Layout Compatibility
 section.
The descriptor set contents bound by a call to cmdBindDescriptorSets
 may be consumed at the following times:
- For descriptor bindings created with the
     DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BITbit set, the contents may be consumed when the command buffer is submitted to a queue, or during shader execution of the resulting draws and dispatches, or any time in between. Otherwise,
- during host execution of the command, or during shader execution of the resulting draws and dispatches, or any time in between.
Thus, the contents of a descriptor set binding must not be altered (overwritten by an update command, or freed) between the first point in time that it may be consumed, and when the command completes executing on the queue.
The contents of pDynamicOffsets are consumed immediately during
 execution of cmdBindDescriptorSets. Once all pending uses have
 completed, it is legal to update and reuse a descriptor set.
Valid Usage
- Each element of pDescriptorSetsmust have been allocated with aDescriptorSetLayoutthat matches (is the same as, or identically defined as) theDescriptorSetLayoutat set n inlayout, where n is the sum offirstSetand the index intopDescriptorSets
- dynamicOffsetCountmust be equal to the total number of dynamic descriptors in- pDescriptorSets
- The sum of firstSetanddescriptorSetCountmust be less than or equal toPipelineLayoutCreateInfo::setLayoutCountprovided whenlayoutwas created
- pipelineBindPointmust be supported by the- commandBuffer’s parent- CommandPool’s queue family
- Each element of pDynamicOffsetswhich corresponds to a descriptor binding with typeDESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMICmust be a multiple ofPhysicalDeviceLimits::minUniformBufferOffsetAlignment
- Each element of pDynamicOffsetswhich corresponds to a descriptor binding with typeDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMICmust be a multiple ofPhysicalDeviceLimits::minStorageBufferOffsetAlignment
- For each dynamic uniform or storage buffer binding in
     pDescriptorSets, the sum of the effective offset, as defined above, and the range of the binding must be less than or equal to the size of the buffer
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pipelineBindPointmust be a valid- PipelineBindPointvalue
- layoutmust be a valid- PipelineLayouthandle
- pDescriptorSetsmust be a valid pointer to an array of- descriptorSetCountvalid- DescriptorSethandles
- If dynamicOffsetCountis not0,pDynamicOffsetsmust be a valid pointer to an array ofdynamicOffsetCountuint32_tvalues
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- descriptorSetCountmust be greater than- 0
- Each of commandBuffer,layout, and the elements ofpDescriptorSetsmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics Compute | 
See Also
CommandBuffer,
 DescriptorSet,
 PipelineBindPoint,
 PipelineLayout
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Buffer | 
 | 
| -> ("offset" ::: DeviceSize) | 
 | 
| -> IndexType | 
 | 
| -> io () | 
vkCmdBindIndexBuffer - Bind an index buffer to a command buffer
Valid Usage
- offsetmust be less than the size of- buffer
- The sum of offsetand the address of the range ofDeviceMemoryobject that is backingbuffer, must be a multiple of the type indicated byindexType
- buffermust have been created with the- BUFFER_USAGE_INDEX_BUFFER_BITflag
- If bufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- indexTypemust not be- INDEX_TYPE_NONE_KHR
- If indexTypeisINDEX_TYPE_UINT8_EXT, the indexTypeUint8 feature must be enabled
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- buffermust be a valid- Bufferhandle
- indexTypemust be a valid- IndexTypevalue
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- Both of buffer, andcommandBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("firstBinding" ::: Word32) | 
 | 
| -> ("buffers" ::: Vector Buffer) | 
 | 
| -> ("offsets" ::: Vector DeviceSize) | 
 | 
| -> io () | 
vkCmdBindVertexBuffers - Bind vertex buffers to a command buffer
Description
The values taken from elements i of pBuffers and pOffsets replace
 the current state for the vertex input binding firstBinding + i, for i
 in [0, bindingCount). The vertex input binding is updated to start at
 the offset indicated by pOffsets[i] from the start of the buffer
 pBuffers[i]. All vertex input attributes that use each of these
 bindings will use these updated addresses in their address calculations
 for subsequent draw commands. If the
 nullDescriptor
 feature is enabled, elements of pBuffers can be
 NULL_HANDLE, and can be used by the
 vertex shader. If a vertex input attribute is bound to a vertex input
 binding that is NULL_HANDLE, the values
 taken from memory are considered to be zero, and missing G, B, or A
 components are
 filled with (0,0,1).
Valid Usage
- firstBindingmust be less than- PhysicalDeviceLimits::- maxVertexInputBindings
- The sum of firstBindingandbindingCountmust be less than or equal toPhysicalDeviceLimits::maxVertexInputBindings
- All elements of pOffsetsmust be less than the size of the corresponding element inpBuffers
- All elements of pBuffersmust have been created with theBUFFER_USAGE_VERTEX_BUFFER_BITflag
- Each element of pBuffersthat is non-sparse must be bound completely and contiguously to a singleDeviceMemoryobject
- If the
     nullDescriptor
     feature is not enabled, all elements of pBuffersmust not beNULL_HANDLE
- If an element of pBuffersisNULL_HANDLE, then the corresponding element ofpOffsetsmust be zero
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pBuffersmust be a valid pointer to an array of- bindingCountvalid or- NULL_HANDLE- Bufferhandles
- pOffsetsmust be a valid pointer to an array of- bindingCount- DeviceSizevalues
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- bindingCountmust be greater than- 0
- Both of commandBuffer, and the elements ofpBuffersthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("vertexCount" ::: Word32) | 
 | 
| -> ("instanceCount" ::: Word32) | 
 | 
| -> ("firstVertex" ::: Word32) | 
 | 
| -> ("firstInstance" ::: Word32) | 
 | 
| -> io () | 
vkCmdDraw - Draw primitives
Description
When the command is executed, primitives are assembled using the current
 primitive topology and vertexCount consecutive vertex indices with the
 first vertexIndex value equal to firstVertex. The primitives are
 drawn instanceCount times with instanceIndex starting with
 firstInstance and increasing sequentially for each instance. The
 assembled primitives execute the bound graphics pipeline.
Valid Usage
- If a ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2
- Any Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For each set n that is statically used by the
     Pipelinebound 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 aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ???
- For each push constant that is statically used by the
     Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ???
- Descriptors in each bound descriptor set, specified via
     cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound 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 Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, 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
     Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage
- If the
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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 commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource
- If a ImageViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format.
- The current render pass must be
     compatible
     with the renderPassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS
- The subpass index of the current render pass must be equal to the
     subpassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_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
     PhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
- If the bound graphics pipeline was created with
     PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, then thencmdSetViewportWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thePipelineViewportStateCreateInfo::scissorCountof the pipeline
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, then thencmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and thescissorCountparameter ofcmdSetScissorWithCountEXTmust match thePipelineViewportStateCreateInfo::viewportCountof the pipeline
- If the bound graphics pipeline state was created with both the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTandDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic states enabled then bothcmdSetViewportWithCountEXTandcmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thescissorCountparameter ofcmdSetScissorWithCountEXT
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXTdynamic state enabled thencmdSetPrimitiveTopologyEXTmust have been called in the current command buffer prior to this draw command, and theprimitiveTopologyparameter ofcmdSetPrimitiveTopologyEXTmust be of the same topology class as the pipelinePipelineInputAssemblyStateCreateInfo::topologystate
- If commandBufferis a protected command buffer, any resource written to by thePipelineobject bound to the pipeline bind point used by this command must not be an unprotected resource
- If commandBufferis a protected command buffer, pipeline stages other than the framebuffer-space and compute stages in thePipelineobject bound to the pipeline bind point must not write to any resource
- All vertex input bindings accessed via vertex input variables
     declared in the vertex shader entry point’s interface must have
     either valid or NULL_HANDLEbuffers bound
- If the
     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 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 ???
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("indexCount" ::: Word32) | 
 | 
| -> ("instanceCount" ::: Word32) | 
 | 
| -> ("firstIndex" ::: Word32) | 
 | 
| -> ("vertexOffset" ::: Int32) | 
 | 
| -> ("firstInstance" ::: Word32) | 
 | 
| -> io () | 
vkCmdDrawIndexed - Issue an indexed draw into a command buffer
Description
When the command is executed, primitives are assembled using the current
 primitive topology and indexCount vertices whose indices are retrieved
 from the index buffer. The index buffer is treated as an array of
 tightly packed unsigned integers of size defined by the
 cmdBindIndexBuffer::indexType parameter with which the buffer was
 bound.
The first vertex index is at an offset of firstIndex × indexSize +
 offset within the bound index buffer, where offset is the offset
 specified by cmdBindIndexBuffer and indexSize is the byte size of
 the type specified by indexType. Subsequent index values are retrieved
 from consecutive locations in the index buffer. Indices are first
 compared to the primitive restart value, then zero extended to 32 bits
 (if the indexType is
 INDEX_TYPE_UINT8_EXT or
 INDEX_TYPE_UINT16) and have
 vertexOffset added to them, before being supplied as the vertexIndex
 value.
The primitives are drawn instanceCount times with instanceIndex
 starting with firstInstance and increasing sequentially for each
 instance. The assembled primitives execute the bound graphics pipeline.
Valid Usage
- If a ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2
- Any Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For each set n that is statically used by the
     Pipelinebound 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 aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ???
- For each push constant that is statically used by the
     Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ???
- Descriptors in each bound descriptor set, specified via
     cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound 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 Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, 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
     Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage
- If the
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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 commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource
- If a ImageViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format.
- The current render pass must be
     compatible
     with the renderPassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS
- The subpass index of the current render pass must be equal to the
     subpassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_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
     PhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
- If the bound graphics pipeline was created with
     PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, then thencmdSetViewportWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thePipelineViewportStateCreateInfo::scissorCountof the pipeline
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, then thencmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and thescissorCountparameter ofcmdSetScissorWithCountEXTmust match thePipelineViewportStateCreateInfo::viewportCountof the pipeline
- If the bound graphics pipeline state was created with both the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTandDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic states enabled then bothcmdSetViewportWithCountEXTandcmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thescissorCountparameter ofcmdSetScissorWithCountEXT
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXTdynamic state enabled thencmdSetPrimitiveTopologyEXTmust have been called in the current command buffer prior to this draw command, and theprimitiveTopologyparameter ofcmdSetPrimitiveTopologyEXTmust be of the same topology class as the pipelinePipelineInputAssemblyStateCreateInfo::topologystate
- If commandBufferis a protected command buffer, any resource written to by thePipelineobject bound to the pipeline bind point used by this command must not be an unprotected resource
- If commandBufferis a protected command buffer, pipeline stages other than the framebuffer-space and compute stages in thePipelineobject bound to the pipeline bind point must not write to any resource
- All vertex input bindings accessed via vertex input variables
     declared in the vertex shader entry point’s interface must have
     either valid or NULL_HANDLEbuffers bound
- If the
     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 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 ???
- (indexSize× (firstIndex+indexCount) +offset) must be less than or equal to the size of the bound index buffer, withindexSizebeing based on the type specified byindexType, where the index buffer,indexType, andoffsetare specified viacmdBindIndexBuffer
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Buffer | 
 | 
| -> ("offset" ::: DeviceSize) | 
 | 
| -> ("drawCount" ::: Word32) | 
 | 
| -> ("stride" ::: Word32) | 
 | 
| -> io () | 
vkCmdDrawIndirect - Issue an indirect draw into a command buffer
Description
cmdDrawIndirect behaves similarly to cmdDraw except that the
 parameters are read by the device from a buffer during execution.
 drawCount draws are executed by the command, with parameters taken
 from buffer starting at offset and increasing by stride bytes for
 each successive draw. The parameters of each draw are encoded in an
 array of DrawIndirectCommand structures. If
 drawCount is less than or equal to one, stride is ignored.
Valid Usage
- If a ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2
- Any Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For each set n that is statically used by the
     Pipelinebound 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 aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ???
- For each push constant that is statically used by the
     Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ???
- Descriptors in each bound descriptor set, specified via
     cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound 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 Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, 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
     Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage
- If the
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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 commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource
- If a ImageViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format.
- The current render pass must be
     compatible
     with the renderPassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS
- The subpass index of the current render pass must be equal to the
     subpassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_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
     PhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
- If the bound graphics pipeline was created with
     PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, then thencmdSetViewportWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thePipelineViewportStateCreateInfo::scissorCountof the pipeline
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, then thencmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and thescissorCountparameter ofcmdSetScissorWithCountEXTmust match thePipelineViewportStateCreateInfo::viewportCountof the pipeline
- If the bound graphics pipeline state was created with both the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTandDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic states enabled then bothcmdSetViewportWithCountEXTandcmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thescissorCountparameter ofcmdSetScissorWithCountEXT
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXTdynamic state enabled thencmdSetPrimitiveTopologyEXTmust have been called in the current command buffer prior to this draw command, and theprimitiveTopologyparameter ofcmdSetPrimitiveTopologyEXTmust be of the same topology class as the pipelinePipelineInputAssemblyStateCreateInfo::topologystate
- All vertex input bindings accessed via vertex input variables
     declared in the vertex shader entry point’s interface must have
     either valid or NULL_HANDLEbuffers bound
- If the
     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 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 ???
- If bufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- buffermust have been created with the- BUFFER_USAGE_INDIRECT_BUFFER_BITbit set
- offsetmust be a multiple of- 4
- commandBuffermust not be a protected command buffer
- If the
     multi-draw indirect
     feature is not enabled, drawCountmust be0or1
- drawCountmust be less than or equal to- PhysicalDeviceLimits::- maxDrawIndirectCount
- If the
     drawIndirectFirstInstance
     feature is not enabled, all the firstInstancemembers of theDrawIndirectCommandstructures accessed by this command must be0
- If drawCountis greater than1,stridemust be a multiple of4and must be greater than or equal tosizeof(DrawIndirectCommand)
- If drawCountis equal to1, (offset+sizeof(DrawIndirectCommand)) must be less than or equal to the size ofbuffer
- If drawCountis greater than1, (stride× (drawCount- 1) +offset+sizeof(DrawIndirectCommand)) must be less than or equal to the size ofbuffer
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- buffermust be a valid- Bufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
- Both of buffer, andcommandBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics | 
See Also
cmdDrawIndexedIndirect Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Buffer | 
 | 
| -> ("offset" ::: DeviceSize) | 
 | 
| -> ("drawCount" ::: Word32) | 
 | 
| -> ("stride" ::: Word32) | 
 | 
| -> io () | 
vkCmdDrawIndexedIndirect - Perform an indexed indirect draw
Description
cmdDrawIndexedIndirect behaves similarly to cmdDrawIndexed except
 that the parameters are read by the device from a buffer during
 execution. drawCount draws are executed by the command, with
 parameters taken from buffer starting at offset and increasing by
 stride bytes for each successive draw. The parameters of each draw are
 encoded in an array of
 DrawIndexedIndirectCommand structures. If
 drawCount is less than or equal to one, stride is ignored.
Valid Usage
- If a ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2
- Any Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For each set n that is statically used by the
     Pipelinebound 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 aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ???
- For each push constant that is statically used by the
     Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ???
- Descriptors in each bound descriptor set, specified via
     cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound 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 Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, 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
     Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage
- If the
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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 commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource
- If a ImageViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format.
- The current render pass must be
     compatible
     with the renderPassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_BIND_POINT_GRAPHICS
- The subpass index of the current render pass must be equal to the
     subpassmember of theGraphicsPipelineCreateInfostructure specified when creating thePipelinebound toPIPELINE_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
     PhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex
- If the bound graphics pipeline was created with
     PipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnableset toTRUEand the current subpass has a depth/stencil attachment, then that attachment must have been created with theIMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXTbit set
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, then thencmdSetViewportWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thePipelineViewportStateCreateInfo::scissorCountof the pipeline
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTdynamic state enabled, but not theDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic state enabled, then thencmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and thescissorCountparameter ofcmdSetScissorWithCountEXTmust match thePipelineViewportStateCreateInfo::viewportCountof the pipeline
- If the bound graphics pipeline state was created with both the
     DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXTandDYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXTdynamic states enabled then bothcmdSetViewportWithCountEXTandcmdSetScissorWithCountEXTmust have been called in the current command buffer prior to this draw command, and theviewportCountparameter ofcmdSetViewportWithCountEXTmust match thescissorCountparameter ofcmdSetScissorWithCountEXT
- If the bound graphics pipeline state was created with the
     DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXTdynamic state enabled thencmdSetPrimitiveTopologyEXTmust have been called in the current command buffer prior to this draw command, and theprimitiveTopologyparameter ofcmdSetPrimitiveTopologyEXTmust be of the same topology class as the pipelinePipelineInputAssemblyStateCreateInfo::topologystate
- All vertex input bindings accessed via vertex input variables
     declared in the vertex shader entry point’s interface must have
     either valid or NULL_HANDLEbuffers bound
- If the
     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 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 ???
- If bufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- buffermust have been created with the- BUFFER_USAGE_INDIRECT_BUFFER_BITbit set
- offsetmust be a multiple of- 4
- commandBuffermust not be a protected command buffer
- If the
     multi-draw indirect
     feature is not enabled, drawCountmust be0or1
- drawCountmust be less than or equal to- PhysicalDeviceLimits::- maxDrawIndirectCount
- If drawCountis greater than1,stridemust be a multiple of4and must be greater than or equal tosizeof(DrawIndexedIndirectCommand)
- If the
     drawIndirectFirstInstance
     feature is not enabled, all the firstInstancemembers of theDrawIndexedIndirectCommandstructures accessed by this command must be0
- If drawCountis equal to1, (offset+sizeof(DrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer
- If drawCountis greater than1, (stride× (drawCount- 1) +offset+sizeof(DrawIndexedIndirectCommand)) must be less than or equal to the size ofbuffer
- If drawIndirectCount is not enabled this function must not be used
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- buffermust be a valid- Bufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
- Both of buffer, andcommandBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("groupCountX" ::: Word32) | 
 | 
| -> ("groupCountY" ::: Word32) | 
 | 
| -> ("groupCountZ" ::: Word32) | 
 | 
| -> io () | 
vkCmdDispatch - Dispatch compute work items
Description
When the command is executed, a global workgroup consisting of
 groupCountX × groupCountY × groupCountZ local workgroups is
 assembled.
Valid Usage
- If a ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2
- Any Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For each set n that is statically used by the
     Pipelinebound 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 aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ???
- For each push constant that is statically used by the
     Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ???
- Descriptors in each bound descriptor set, specified via
     cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound 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 Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, 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
     Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage
- If the
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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 commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource
- If a ImageViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format.
- If commandBufferis a protected command buffer, any resource written to by thePipelineobject bound to the pipeline bind point used by this command must not be an unprotected resource
- If commandBufferis a protected command buffer, pipeline stages other than the framebuffer-space and compute stages in thePipelineobject bound to the pipeline bind point must not write to any resource
- groupCountXmust be less than or equal to- PhysicalDeviceLimits::- maxComputeWorkGroupCount[0]
- groupCountYmust be less than or equal to- PhysicalDeviceLimits::- maxComputeWorkGroupCount[1]
- groupCountZmust be less than or equal to- PhysicalDeviceLimits::- maxComputeWorkGroupCount[2]
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support compute operations
- This command must only be called outside of a render pass instance
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Compute | Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Buffer | 
 | 
| -> ("offset" ::: DeviceSize) | 
 | 
| -> io () | 
vkCmdDispatchIndirect - Dispatch compute work items using indirect parameters
Description
cmdDispatchIndirect behaves similarly to cmdDispatch except that the
 parameters are read by the device from a buffer during execution. The
 parameters of the dispatch are encoded in a
 DispatchIndirectCommand structure taken from
 buffer starting at offset.
Valid Usage
- If a ImageViewis sampled withFILTER_LINEARas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If a ImageViewis accessed using atomic operations as a result of this command, then the image view’s format features must containFORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT
- If a ImageViewis sampled withFILTER_CUBIC_EXTas a result of this command, then the image view’s format features must containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTas a result of this command must have aImageViewTypeand format that supports cubic filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicreturned bygetPhysicalDeviceImageFormatProperties2
- Any ImageViewbeing sampled withFILTER_CUBIC_EXTwith a reduction mode of eitherSAMPLER_REDUCTION_MODE_MINorSAMPLER_REDUCTION_MODE_MAXas a result of this command must have aImageViewTypeand format that supports cubic filtering together with minmax filtering, as specified byFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmaxreturned bygetPhysicalDeviceImageFormatProperties2
- Any Imagecreated with aImageCreateInfo::flagscontainingIMAGE_CREATE_CORNER_SAMPLED_BIT_NVsampled as a result of this command must only be sampled using aSamplerAddressModeofSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
- For each set n that is statically used by the
     Pipelinebound 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 aPipelineLayoutthat is compatible for set n, with thePipelineLayoutused to create the currentPipeline, as described in ???
- For each push constant that is statically used by the
     Pipelinebound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with aPipelineLayoutthat is compatible for push constants, with thePipelineLayoutused to create the currentPipeline, as described in ???
- Descriptors in each bound descriptor set, specified via
     cmdBindDescriptorSets, must be valid if they are statically used by thePipelinebound 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 Pipelineobject bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set forcommandBuffer, 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
     Pipelineobject bound to the pipeline bind point used by this command, since that pipeline was bound
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used to sample from anyImagewith aImageViewof the typeIMAGE_VIEW_TYPE_3D,IMAGE_VIEW_TYPE_CUBE,IMAGE_VIEW_TYPE_1D_ARRAY,IMAGE_VIEW_TYPE_2D_ARRAYorIMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions withImplicitLod,DreforProjin their name, in any shader stage
- If the Pipelineobject bound to the pipeline bind point used by this command accesses aSamplerobject that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-VOpImageSample*orOpImageSparseSample*instructions that includes a LOD bias or any offset values, in any shader stage
- If the
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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
     robust buffer access
     feature is not enabled, and if the Pipelineobject 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 commandBufferis an unprotected command buffer, any resource accessed by thePipelineobject bound to the pipeline bind point used by this command must not be a protected resource
- If a ImageViewis accessed usingOpImageWriteas a result of this command, then theTypeof theTexeloperand of that instruction must have at least as many components as the image view’s format.
- If bufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- buffermust have been created with the- BUFFER_USAGE_INDIRECT_BUFFER_BITbit set
- offsetmust be a multiple of- 4
- commandBuffermust not be a protected command buffer
- The sum of offsetand the size ofDispatchIndirectCommandmust be less than or equal to the size ofbuffer
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- buffermust be a valid- Bufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support compute operations
- This command must only be called outside of a render pass instance
- Both of buffer, andcommandBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Compute | Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcBuffer" ::: Buffer) | 
 | 
| -> ("dstBuffer" ::: Buffer) | 
 | 
| -> ("regions" ::: Vector BufferCopy) | 
 | 
| -> io () | 
vkCmdCopyBuffer - Copy data between buffer regions
Description
Each region in pRegions is copied from the source buffer to the same
 region of the destination buffer. srcBuffer and dstBuffer can be
 the same buffer or alias the same memory, but the resulting values are
 undefined if the copy regions overlap in memory.
Valid Usage
- If commandBufferis an unprotected command buffer, thensrcBuffermust not be a protected buffer
- If commandBufferis an unprotected command buffer, thendstBuffermust not be a protected buffer
- If commandBufferis a protected command buffer, thendstBuffermust not be an unprotected buffer
- The srcOffsetmember of each element ofpRegionsmust be less than the size ofsrcBuffer
- The dstOffsetmember of each element ofpRegionsmust be less than the size ofdstBuffer
- The sizemember of each element ofpRegionsmust be less than or equal to the size ofsrcBufferminussrcOffset
- The sizemember of each element ofpRegionsmust be less than or equal to the size ofdstBufferminusdstOffset
- The union of the source regions, and the union of the destination
     regions, specified by the elements of pRegions, must not overlap in memory
- srcBuffermust have been created with- BUFFER_USAGE_TRANSFER_SRC_BITusage flag
- If srcBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- dstBuffermust have been created with- BUFFER_USAGE_TRANSFER_DST_BITusage flag
- If dstBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcBuffermust be a valid- Bufferhandle
- dstBuffermust be a valid- Bufferhandle
- pRegionsmust be a valid pointer to an array of- regionCountvalid- BufferCopystructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- This command must only be called outside of a render pass instance
- regionCountmust be greater than- 0
- Each of commandBuffer,dstBuffer, andsrcBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Transfer Graphics Compute | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcImage" ::: Image) | 
 | 
| -> ("srcImageLayout" ::: ImageLayout) | 
 | 
| -> ("dstImage" ::: Image) | 
 | 
| -> ("dstImageLayout" ::: ImageLayout) | 
 | 
| -> ("regions" ::: Vector ImageCopy) | 
 | 
| -> io () | 
vkCmdCopyImage - Copy data between images
Description
Each region in pRegions is copied from the source image to the same
 region of the destination image. srcImage and dstImage can be the
 same image or alias the same memory.
The formats of srcImage and dstImage must be compatible. Formats
 are compatible if they share the same class, as shown in the
 Compatible Formats
 table. Depth/stencil formats must match exactly.
If the format of srcImage or dstImage is a
 multi-planar image format,
 regions of each plane to be copied must be specified separately using
 the srcSubresource and dstSubresource members of the ImageCopy
 structure. In this case, the aspectMask of the srcSubresource or
 dstSubresource that refers to the multi-planar image must be
 IMAGE_ASPECT_PLANE_0_BIT,
 IMAGE_ASPECT_PLANE_1_BIT, or
 IMAGE_ASPECT_PLANE_2_BIT. For
 the purposes of cmdCopyImage, each plane of a multi-planar image is
 treated as having the format listed in
 https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes
 for the plane identified by the aspectMask of the corresponding
 subresource. This applies both to Format
 and to coordinates used in the copy, which correspond to texels in the
 plane rather than how these texels map to coordinates in the image as
 a whole.
Note
For example, the
 IMAGE_ASPECT_PLANE_1_BIT plane
 of a FORMAT_G8_B8R8_2PLANE_420_UNORM image
 is compatible with an image of format
 FORMAT_R8G8_UNORM and (less usefully) with
 the IMAGE_ASPECT_PLANE_0_BIT
 plane of an image of format
 FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16,
 as each texel is 2 bytes in size.
cmdCopyImage allows copying between size-compatible compressed and
 uncompressed internal formats. Formats are size-compatible if the texel
 block size of the uncompressed format is equal to the texel block size
 of the compressed format. Such a copy does not perform on-the-fly
 compression or decompression. When copying from an uncompressed format
 to a compressed format, each texel of uncompressed data of the source
 image is copied as a raw value to the corresponding compressed texel
 block of the destination image. When copying from a compressed format to
 an uncompressed format, each compressed texel block of the source image
 is copied as a raw value to the corresponding texel of uncompressed data
 in the destination image. Thus, for example, it is legal to copy between
 a 128-bit uncompressed format and a compressed format which has a
 128-bit sized compressed texel block representing 4×4 texels (using 8
 bits per texel), or between a 64-bit uncompressed format and a
 compressed format which has a 64-bit sized compressed texel block
 representing 4×4 texels (using 4 bits per texel).
When copying between compressed and uncompressed formats the extent
 members represent the texel dimensions of the source image and not the
 destination. When copying from a compressed image to an uncompressed
 image the image texel dimensions written to the uncompressed image will
 be source extent divided by the compressed texel block dimensions. When
 copying from an uncompressed image to a compressed image the image texel
 dimensions written to the compressed image will be the source extent
 multiplied by the compressed texel block dimensions. In both cases the
 number of bytes read and the number of bytes written will be identical.
Copying to or from block-compressed images is typically done in
 multiples of the compressed texel block size. For this reason the
 extent must be a multiple of the compressed texel block dimension.
 There is one exception to this rule which is required to handle
 compressed images created with dimensions that are not a multiple of the
 compressed texel block dimensions: if the srcImage is compressed,
 then:
- If extent.widthis not a multiple of the compressed texel block width, then (extent.width+srcOffset.x) must equal the image subresource width.
- If extent.heightis not a multiple of the compressed texel block height, then (extent.height+srcOffset.y) must equal the image subresource height.
- If extent.depthis not a multiple of the compressed texel block depth, then (extent.depth+srcOffset.z) must equal the image subresource depth.
Similarly, if the dstImage is compressed, then:
- If extent.widthis not a multiple of the compressed texel block width, then (extent.width+dstOffset.x) must equal the image subresource width.
- If extent.heightis not a multiple of the compressed texel block height, then (extent.height+dstOffset.y) must equal the image subresource height.
- If extent.depthis not a multiple of the compressed texel block depth, then (extent.depth+dstOffset.z) must equal the image subresource depth.
This allows the last compressed texel block of the image in each non-multiple dimension to be included as a source or destination of the copy.
“_422” image formats that are not
 multi-planar
 are treated as having a 2×1 compressed texel block for the purposes of
 these rules.
cmdCopyImage can be used to copy image data between multisample
 images, but both images must have the same number of samples.
Valid Usage
- If commandBufferis an unprotected command buffer, thensrcImagemust not be a protected image
- If commandBufferis an unprotected command buffer, thendstImagemust not be a protected image
- If commandBufferis a protected command buffer, thendstImagemust not be an unprotected image
- The union of all source regions, and the union of all destination
     regions, specified by the elements of pRegions, must not overlap in memory
- The
     format features
     of srcImagemust containFORMAT_FEATURE_TRANSFER_SRC_BIT
- srcImagemust have been created with- IMAGE_USAGE_TRANSFER_SRC_BITusage flag
- If srcImageis non-sparse then the image or disjoint plane to be copied must be bound completely and contiguously to a singleDeviceMemoryobject
- srcImageLayoutmust specify the layout of the image subresources of- srcImagespecified in- pRegionsat the time this command is executed on a- Device
- srcImageLayoutmust be- IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,- IMAGE_LAYOUT_GENERAL, or- IMAGE_LAYOUT_SHARED_PRESENT_KHR
- The
     format features
     of dstImagemust containFORMAT_FEATURE_TRANSFER_DST_BIT
- dstImagemust have been created with- IMAGE_USAGE_TRANSFER_DST_BITusage flag
- If dstImageis non-sparse then the image or disjoint plane that is the destination of the copy must be bound completely and contiguously to a singleDeviceMemoryobject
- dstImageLayoutmust specify the layout of the image subresources of- dstImagespecified in- pRegionsat the time this command is executed on a- Device
- dstImageLayoutmust be- IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,- IMAGE_LAYOUT_GENERAL, or- IMAGE_LAYOUT_SHARED_PRESENT_KHR
- If the Formatof each ofsrcImageanddstImageis not a multi-planar format, theFormatof each ofsrcImageanddstImagemust be compatible, as defined above
- In a copy to or from a plane of a
     multi-planar image,
     the Formatof the image and plane must be compatible according to the description of compatible planes for the plane being copied
- The sample count of srcImageanddstImagemust match
- The srcSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhensrcImagewas created
- The dstSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhendstImagewas created
- The srcSubresource.baseArrayLayer+srcSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhensrcImagewas created
- The dstSubresource.baseArrayLayer+dstSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhendstImagewas created
- The srcOffsetandextentmembers of each element ofpRegionsmust respect the image transfer granularity requirements ofcommandBuffer’s command pool’s queue family, as described inQueueFamilyProperties
- The dstOffsetandextentmembers of each element ofpRegionsmust respect the image transfer granularity requirements ofcommandBuffer’s command pool’s queue family, as described inQueueFamilyProperties
- dstImageand- srcImagemust not have been created with- flagscontaining- IMAGE_CREATE_SUBSAMPLED_BIT_EXT
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcImagemust be a valid- Imagehandle
- srcImageLayoutmust be a valid- ImageLayoutvalue
- dstImagemust be a valid- Imagehandle
- dstImageLayoutmust be a valid- ImageLayoutvalue
- pRegionsmust be a valid pointer to an array of- regionCountvalid- ImageCopystructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- This command must only be called outside of a render pass instance
- regionCountmust be greater than- 0
- Each of commandBuffer,dstImage, andsrcImagemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Transfer Graphics Compute | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcImage" ::: Image) | 
 | 
| -> ("srcImageLayout" ::: ImageLayout) | 
 | 
| -> ("dstImage" ::: Image) | 
 | 
| -> ("dstImageLayout" ::: ImageLayout) | 
 | 
| -> ("regions" ::: Vector ImageBlit) | 
 | 
| -> Filter | 
 | 
| -> io () | 
vkCmdBlitImage - Copy regions of an image, potentially performing format conversion,
Description
cmdBlitImage must not be used for multisampled source or destination
 images. Use cmdResolveImage for this purpose.
As the sizes of the source and destination extents can differ in any dimension, texels in the source extent are scaled and filtered to the destination extent. Scaling occurs via the following operations:
- For each destination texel, the integer coordinate of that texel is converted to an unnormalized texture coordinate, using the effective inverse of the equations described in unnormalized to integer conversion: - ubase = i + ½
- vbase = j + ½
- wbase = k + ½
 
- These base coordinates are then offset by the first destination offset: - uoffset = ubase - xdst0
- voffset = vbase - ydst0
- woffset = wbase - zdst0
- aoffset = a - baseArrayCountdst
 
- The scale is determined from the source and destination regions, and applied to the offset coordinates: - scaleu = (xsrc1 - xsrc0) / (xdst1 - xdst0)
- scalev = (ysrc1 - ysrc0) / (ydst1 - ydst0)
- scalew = (zsrc1 - zsrc0) / (zdst1 - zdst0)
- uscaled = uoffset × scaleu
- vscaled = voffset × scalev
- wscaled = woffset × scalew
 
- Finally the source offset is added to the scaled coordinates, to determine the final unnormalized coordinates used to sample from - srcImage:- u = uscaled + xsrc0
- v = vscaled + ysrc0
- w = wscaled + zsrc0
- q = mipLevel
- a = aoffset + baseArrayCountsrc
 
These coordinates are used to sample from the source image, as described
 in
 Image Operations chapter,
 with the filter mode equal to that of filter, a mipmap mode of
 SAMPLER_MIPMAP_MODE_NEAREST and
 an address mode of
 SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.
 Implementations must clamp at the edge of the source image, and may
 additionally clamp to the edge of the source region.
Note
Due to allowable rounding errors in the generation of the source texture coordinates, it is not always possible to guarantee exactly which source texels will be sampled for a given blit. As rounding errors are implementation dependent, the exact results of a blitting operation are also implementation dependent.
Blits are done layer by layer starting with the baseArrayLayer member
 of srcSubresource for the source and dstSubresource for the
 destination. layerCount layers are blitted to the destination image.
3D textures are blitted slice by slice. Slices in the source region
 bounded by srcOffsets[0].z and srcOffsets[1].z are copied to slices
 in the destination region bounded by dstOffsets[0].z and
 dstOffsets[1].z. For each destination slice, a source z coordinate
 is linearly interpolated between srcOffsets[0].z and
 srcOffsets[1].z. If the filter parameter is
 FILTER_LINEAR then the value sampled from
 the source image is taken by doing linear filtering using the
 interpolated z coordinate. If filter parameter is
 FILTER_NEAREST then the value sampled from
 the source image is taken from the single nearest slice, with an
 implementation-dependent arithmetic rounding mode.
The following filtering and conversion rules apply:
- Integer formats can only be converted to other integer formats with the same signedness.
- No format conversion is supported between depth/stencil images. The formats must match.
- Format conversions on unorm, snorm, unscaled and packed float formats of the copied aspect of the image are performed by first converting the pixels to float values.
- For sRGB source formats, nonlinear RGB values are converted to linear representation prior to filtering.
- After filtering, the float values are first clamped and then cast to the destination image format. In case of sRGB destination format, linear RGB values are converted to nonlinear representation before writing the pixel to the image.
Signed and unsigned integers are converted by first clamping to the representable range of the destination format, then casting the value.
Valid Usage
- If commandBufferis an unprotected command buffer, thensrcImagemust not be a protected image
- If commandBufferis an unprotected command buffer, thendstImagemust not be a protected image
- If commandBufferis a protected command buffer, thendstImagemust not be an unprotected image
- The source region specified by each element of pRegionsmust be a region that is contained withinsrcImage
- The destination region specified by each element of pRegionsmust be a region that is contained withindstImage
- The union of all destination regions, specified by the elements of
     pRegions, must not overlap in memory with any texel that may be sampled during the blit operation
- The
     format features
     of srcImagemust containFORMAT_FEATURE_BLIT_SRC_BIT
- srcImagemust not use a format listed in ???
- srcImagemust have been created with- IMAGE_USAGE_TRANSFER_SRC_BITusage flag
- If srcImageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- srcImageLayoutmust specify the layout of the image subresources of- srcImagespecified in- pRegionsat the time this command is executed on a- Device
- srcImageLayoutmust be- IMAGE_LAYOUT_SHARED_PRESENT_KHR,- IMAGE_LAYOUT_TRANSFER_SRC_OPTIMALor- IMAGE_LAYOUT_GENERAL
- The
     format features
     of dstImagemust containFORMAT_FEATURE_BLIT_DST_BIT
- dstImagemust not use a format listed in ???
- dstImagemust have been created with- IMAGE_USAGE_TRANSFER_DST_BITusage flag
- If dstImageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- dstImageLayoutmust specify the layout of the image subresources of- dstImagespecified in- pRegionsat the time this command is executed on a- Device
- dstImageLayoutmust be- IMAGE_LAYOUT_SHARED_PRESENT_KHR,- IMAGE_LAYOUT_TRANSFER_DST_OPTIMALor- IMAGE_LAYOUT_GENERAL
- If either of srcImageordstImagewas created with a signed integerFormat, the other must also have been created with a signed integerFormat
- If either of srcImageordstImagewas created with an unsigned integerFormat, the other must also have been created with an unsigned integerFormat
- If either of srcImageordstImagewas created with a depth/stencil format, the other must have exactly the same format
- If srcImagewas created with a depth/stencil format,filtermust beFILTER_NEAREST
- srcImagemust have been created with a- samplesvalue of- SAMPLE_COUNT_1_BIT
- dstImagemust have been created with a- samplesvalue of- SAMPLE_COUNT_1_BIT
- If filterisFILTER_LINEAR, then the format features ofsrcImagemust containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
- If filterisFILTER_CUBIC_EXT, then the format features ofsrcImagemust containFORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT
- If filterisFILTER_CUBIC_EXT,srcImagemust have aImageTypeofIMAGE_TYPE_2D
- The srcSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhensrcImagewas created
- The dstSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhendstImagewas created
- The srcSubresource.baseArrayLayer+srcSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhensrcImagewas created
- The dstSubresource.baseArrayLayer+dstSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhendstImagewas created
- dstImageand- srcImagemust not have been created with- flagscontaining- IMAGE_CREATE_SUBSAMPLED_BIT_EXT
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcImagemust be a valid- Imagehandle
- srcImageLayoutmust be a valid- ImageLayoutvalue
- dstImagemust be a valid- Imagehandle
- dstImageLayoutmust be a valid- ImageLayoutvalue
- pRegionsmust be a valid pointer to an array of- regionCountvalid- ImageBlitstructures
- filtermust be a valid- Filtervalue
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called outside of a render pass instance
- regionCountmust be greater than- 0
- Each of commandBuffer,dstImage, andsrcImagemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcBuffer" ::: Buffer) | 
 | 
| -> ("dstImage" ::: Image) | 
 | 
| -> ("dstImageLayout" ::: ImageLayout) | 
 | 
| -> ("regions" ::: Vector BufferImageCopy) | 
 | 
| -> io () | 
vkCmdCopyBufferToImage - Copy data from a buffer into an image
Description
Each region in pRegions is copied from the specified region of the
 source buffer to the specified region of the destination image.
If the format of dstImage is a
 multi-planar image format,
 regions of each plane to be a target of a copy must be specified
 separately using the pRegions member of the BufferImageCopy
 structure. In this case, the aspectMask of imageSubresource must
 be IMAGE_ASPECT_PLANE_0_BIT,
 IMAGE_ASPECT_PLANE_1_BIT, or
 IMAGE_ASPECT_PLANE_2_BIT. For
 the purposes of cmdCopyBufferToImage, each plane of a multi-planar
 image is treated as having the format listed in
 https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes
 for the plane identified by the aspectMask of the corresponding
 subresource. This applies both to Format
 and to coordinates used in the copy, which correspond to texels in the
 plane rather than how these texels map to coordinates in the image as
 a whole.
Valid Usage
- If commandBufferis an unprotected command buffer, thensrcBuffermust not be a protected buffer
- If commandBufferis an unprotected command buffer, thendstImagemust not be a protected image
- If commandBufferis a protected command buffer, thendstImagemust not be an unprotected image
- srcBuffermust be large enough to contain all buffer locations that are accessed according to Buffer and Image Addressing, for each element of- pRegions
- The image region specified by each element of pRegionsmust be a region that is contained withindstImageif thedstImage’sFormatis not a multi-planar format, and must be a region that is contained within the plane being copied to if thedstImage’sFormatis a multi-planar format
- The union of all source regions, and the union of all destination
     regions, specified by the elements of pRegions, must not overlap in memory
- srcBuffermust have been created with- BUFFER_USAGE_TRANSFER_SRC_BITusage flag
- The
     format features
     of dstImagemust containFORMAT_FEATURE_TRANSFER_DST_BIT
- If srcBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- dstImagemust have been created with- IMAGE_USAGE_TRANSFER_DST_BITusage flag
- If dstImageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- dstImagemust have a sample count equal to- SAMPLE_COUNT_1_BIT
- dstImageLayoutmust specify the layout of the image subresources of- dstImagespecified in- pRegionsat the time this command is executed on a- Device
- dstImageLayoutmust be- IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,- IMAGE_LAYOUT_GENERAL, or- IMAGE_LAYOUT_SHARED_PRESENT_KHR
- The imageSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhendstImagewas created
- The imageSubresource.baseArrayLayer+imageSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhendstImagewas created
- The imageOffsetandimageExtentmembers of each element ofpRegionsmust respect the image transfer granularity requirements ofcommandBuffer’s command pool’s queue family, as described inQueueFamilyProperties
- dstImagemust not have been created with- flagscontaining- IMAGE_CREATE_SUBSAMPLED_BIT_EXT
- If the queue family used to create the
     CommandPoolwhichcommandBufferwas allocated from does not supportQUEUE_GRAPHICS_BITorQUEUE_COMPUTE_BIT, thebufferOffsetmember of any element ofpRegionsmust be a multiple of4
- If dstImagehas a depth/stencil format, thebufferOffsetmember of any element ofpRegionsmust be a multiple of4
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcBuffermust be a valid- Bufferhandle
- dstImagemust be a valid- Imagehandle
- dstImageLayoutmust be a valid- ImageLayoutvalue
- pRegionsmust be a valid pointer to an array of- regionCountvalid- BufferImageCopystructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- This command must only be called outside of a render pass instance
- regionCountmust be greater than- 0
- Each of commandBuffer,dstImage, andsrcBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Transfer Graphics Compute | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcImage" ::: Image) | 
 | 
| -> ("srcImageLayout" ::: ImageLayout) | 
 | 
| -> ("dstBuffer" ::: Buffer) | 
 | 
| -> ("regions" ::: Vector BufferImageCopy) | 
 | 
| -> io () | 
vkCmdCopyImageToBuffer - Copy image data into a buffer
Description
Each region in pRegions is copied from the specified region of the
 source image to the specified region of the destination buffer.
If the Format of srcImage is a
 multi-planar image format,
 regions of each plane to be a source of a copy must be specified
 separately using the pRegions member of the BufferImageCopy
 structure. In this case, the aspectMask of imageSubresource must
 be IMAGE_ASPECT_PLANE_0_BIT,
 IMAGE_ASPECT_PLANE_1_BIT, or
 IMAGE_ASPECT_PLANE_2_BIT. For
 the purposes of cmdCopyBufferToImage, each plane of a multi-planar
 image is treated as having the format listed in
 https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes
 for the plane identified by the aspectMask of the corresponding
 subresource. This applies both to Format
 and to coordinates used in the copy, which correspond to texels in the
 plane rather than how these texels map to coordinates in the image as
 a whole.
Valid Usage
- If commandBufferis an unprotected command buffer, thensrcImagemust not be a protected image
- If commandBufferis an unprotected command buffer, thendstBuffermust not be a protected buffer
- If commandBufferis a protected command buffer, thendstBuffermust not be an unprotected buffer
- The image region specified by each element of pRegionsmust be a region that is contained withinsrcImageif thesrcImage’sFormatis not a multi-planar format, and must be a region that is contained within the plane being copied if thesrcImage’sFormatis a multi-planar format
- dstBuffermust be large enough to contain all buffer locations that are accessed according to Buffer and Image Addressing, for each element of- pRegions
- The union of all source regions, and the union of all destination
     regions, specified by the elements of pRegions, must not overlap in memory
- The
     format features
     of srcImagemust containFORMAT_FEATURE_TRANSFER_SRC_BIT
- srcImagemust have been created with- IMAGE_USAGE_TRANSFER_SRC_BITusage flag
- If srcImageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- srcImagemust have a sample count equal to- SAMPLE_COUNT_1_BIT
- srcImageLayoutmust specify the layout of the image subresources of- srcImagespecified in- pRegionsat the time this command is executed on a- Device
- srcImageLayoutmust be- IMAGE_LAYOUT_SHARED_PRESENT_KHR,- IMAGE_LAYOUT_TRANSFER_SRC_OPTIMALor- IMAGE_LAYOUT_GENERAL
- dstBuffermust have been created with- BUFFER_USAGE_TRANSFER_DST_BITusage flag
- If dstBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- The imageSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhensrcImagewas created
- The imageSubresource.baseArrayLayer+imageSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhensrcImagewas created
- The imageOffsetandimageExtentmembers of each element ofpRegionsmust respect the image transfer granularity requirements ofcommandBuffer’s command pool’s queue family, as described inQueueFamilyProperties
- srcImagemust not have been created with- flagscontaining- IMAGE_CREATE_SUBSAMPLED_BIT_EXT
- If the queue family used to create the
     CommandPoolwhichcommandBufferwas allocated from does not supportQUEUE_GRAPHICS_BITorQUEUE_COMPUTE_BIT, thebufferOffsetmember of any element ofpRegionsmust be a multiple of4
- If srcImagehas a depth/stencil format, thebufferOffsetmember of any element ofpRegionsmust be a multiple of4
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcImagemust be a valid- Imagehandle
- srcImageLayoutmust be a valid- ImageLayoutvalue
- dstBuffermust be a valid- Bufferhandle
- pRegionsmust be a valid pointer to an array of- regionCountvalid- BufferImageCopystructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- This command must only be called outside of a render pass instance
- regionCountmust be greater than- 0
- Each of commandBuffer,dstBuffer, andsrcImagemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Transfer Graphics Compute | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("dstBuffer" ::: Buffer) | 
 | 
| -> ("dstOffset" ::: DeviceSize) | 
 | 
| -> ("dataSize" ::: DeviceSize) | 
 | 
| -> ("data" ::: Ptr ()) | 
 | 
| -> io () | 
vkCmdUpdateBuffer - Update a buffer’s contents from host memory
Description
dataSize must be less than or equal to 65536 bytes. For larger
 updates, applications can use buffer to buffer
 copies.
Note
Buffer updates performed with cmdUpdateBuffer first copy the data into
 command buffer memory when the command is recorded (which requires
 additional storage and may incur an additional allocation), and then
 copy the data from the command buffer into dstBuffer when the command
 is executed on a device.
The additional cost of this functionality compared to buffer to buffer copies means it is only recommended for very small amounts of data, and is why it is limited to only 65536 bytes.
Applications can work around this by issuing multiple
 cmdUpdateBuffer commands to different ranges of the same buffer, but
 it is strongly recommended that they should not.
The source data is copied from the user pointer to the command buffer when the command is called.
cmdUpdateBuffer is only allowed outside of a render pass. This command
 is treated as “transfer” operation, for the purposes of synchronization
 barriers. The
 BUFFER_USAGE_TRANSFER_DST_BIT
 must be specified in usage of
 BufferCreateInfo in order for the buffer to be
 compatible with cmdUpdateBuffer.
Valid Usage
- dstOffsetmust be less than the size of- dstBuffer
- dataSizemust be less than or equal to the size of- dstBufferminus- dstOffset
- dstBuffermust have been created with- BUFFER_USAGE_TRANSFER_DST_BITusage flag
- If dstBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- dstOffsetmust be a multiple of- 4
- dataSizemust be less than or equal to- 65536
- dataSizemust be a multiple of- 4
- If commandBufferis an unprotected command buffer, thendstBuffermust not be a protected buffer
- If commandBufferis a protected command buffer, thendstBuffermust not be an unprotected buffer
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- dstBuffermust be a valid- Bufferhandle
- pDatamust be a valid pointer to an array of- dataSizebytes
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- This command must only be called outside of a render pass instance
- dataSizemust be greater than- 0
- Both of commandBuffer, anddstBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Transfer Graphics Compute | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("dstBuffer" ::: Buffer) | 
 | 
| -> ("dstOffset" ::: DeviceSize) | 
 | 
| -> DeviceSize | 
 | 
| -> ("data" ::: Word32) | 
 | 
| -> io () | 
vkCmdFillBuffer - Fill a region of a buffer with a fixed value
Description
cmdFillBuffer is treated as “transfer” operation for the purposes of
 synchronization barriers. The
 BUFFER_USAGE_TRANSFER_DST_BIT
 must be specified in usage of
 BufferCreateInfo in order for the buffer to be
 compatible with cmdFillBuffer.
Valid Usage
- dstOffsetmust be less than the size of- dstBuffer
- dstOffsetmust be a multiple of- 4
- If sizeis not equal toWHOLE_SIZE,sizemust be greater than0
- If sizeis not equal toWHOLE_SIZE,sizemust be less than or equal to the size ofdstBufferminusdstOffset
- If sizeis not equal toWHOLE_SIZE,sizemust be a multiple of4
- dstBuffermust have been created with- BUFFER_USAGE_TRANSFER_DST_BITusage flag
- If dstBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- If commandBufferis an unprotected command buffer, thendstBuffermust not be a protected buffer
- If commandBufferis a protected command buffer, thendstBuffermust not be an unprotected buffer
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- dstBuffermust be a valid- Bufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics or compute operations
- This command must only be called outside of a render pass instance
- Both of commandBuffer, anddstBuffermust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Transfer Graphics Compute | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Image | 
 | 
| -> ImageLayout | 
 | 
| -> ClearColorValue | 
 | 
| -> ("ranges" ::: Vector ImageSubresourceRange) | 
 | 
| -> io () | 
vkCmdClearColorImage - Clear regions of a color image
Description
Each specified range in pRanges is cleared to the value specified by
 pColor.
Valid Usage
- The
     format features
     of imagemust containFORMAT_FEATURE_TRANSFER_DST_BIT
- imagemust have been created with- IMAGE_USAGE_TRANSFER_DST_BITusage flag
- imagemust not use a format listed in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion
- If imageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- imageLayoutmust specify the layout of the image subresource ranges of- imagespecified in- pRangesat the time this command is executed on a- Device
- imageLayoutmust be- IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,- IMAGE_LAYOUT_GENERAL, or- IMAGE_LAYOUT_SHARED_PRESENT_KHR
- The ImageSubresourceRange::aspectMaskmembers of the elements of thepRangesarray must each only includeIMAGE_ASPECT_COLOR_BIT
- The ImageSubresourceRange::baseMipLevelmembers of the elements of thepRangesarray must each be less than themipLevelsspecified inImageCreateInfowhenimagewas created
- For each ImageSubresourceRangeelement ofpRanges, if thelevelCountmember is notREMAINING_MIP_LEVELS, thenbaseMipLevel+levelCountmust be less than themipLevelsspecified inImageCreateInfowhenimagewas created
- The
     ImageSubresourceRange::baseArrayLayermembers of the elements of thepRangesarray must each be less than thearrayLayersspecified inImageCreateInfowhenimagewas created
- For each ImageSubresourceRangeelement ofpRanges, if thelayerCountmember is notREMAINING_ARRAY_LAYERS, thenbaseArrayLayer+layerCountmust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created
- imagemust not have a compressed or depth/stencil format
- If commandBufferis an unprotected command buffer, thenimagemust not be a protected image
- If commandBufferis a protected command buffer, thenimagemust not be an unprotected image
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- imagemust be a valid- Imagehandle
- imageLayoutmust be a valid- ImageLayoutvalue
- pColormust be a valid pointer to a valid- ClearColorValueunion
- pRangesmust be a valid pointer to an array of- rangeCountvalid- ImageSubresourceRangestructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- This command must only be called outside of a render pass instance
- rangeCountmust be greater than- 0
- Both of commandBuffer, andimagemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics Compute | Transfer | 
See Also
ClearColorValue, CommandBuffer,
 Image,
 ImageLayout,
 ImageSubresourceRange
cmdClearDepthStencilImage Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Image | 
 | 
| -> ImageLayout | 
 | 
| -> ClearDepthStencilValue | 
 | 
| -> ("ranges" ::: Vector ImageSubresourceRange) | 
 | 
| -> io () | 
vkCmdClearDepthStencilImage - Fill regions of a combined depth/stencil image
Valid Usage
- The
     format features
     of imagemust containFORMAT_FEATURE_TRANSFER_DST_BIT
- If the aspectmember of any element ofpRangesincludesIMAGE_ASPECT_STENCIL_BIT, andimagewas created with separate stencil usage,IMAGE_USAGE_TRANSFER_DST_BITmust have been included in theImageStencilUsageCreateInfo::stencilUsageused to createimage
- If the aspectmember of any element ofpRangesincludesIMAGE_ASPECT_STENCIL_BIT, andimagewas not created with separate stencil usage,IMAGE_USAGE_TRANSFER_DST_BITmust have been included in theImageCreateInfo::usageused to createimage
- If the aspectmember of any element ofpRangesincludesIMAGE_ASPECT_DEPTH_BIT,IMAGE_USAGE_TRANSFER_DST_BITmust have been included in theImageCreateInfo::usageused to createimage
- If imageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- imageLayoutmust specify the layout of the image subresource ranges of- imagespecified in- pRangesat the time this command is executed on a- Device
- imageLayoutmust be either of- IMAGE_LAYOUT_TRANSFER_DST_OPTIMALor- IMAGE_LAYOUT_GENERAL
- The ImageSubresourceRange::aspectMaskmember of each element of thepRangesarray must not include bits other thanIMAGE_ASPECT_DEPTH_BITorIMAGE_ASPECT_STENCIL_BIT
- If the image’s format does not have a stencil component, then theImageSubresourceRange::aspectMaskmember of each element of thepRangesarray must not include theIMAGE_ASPECT_STENCIL_BITbit
- If the image’s format does not have a depth component, then theImageSubresourceRange::aspectMaskmember of each element of thepRangesarray must not include theIMAGE_ASPECT_DEPTH_BITbit
- The ImageSubresourceRange::baseMipLevelmembers of the elements of thepRangesarray must each be less than themipLevelsspecified inImageCreateInfowhenimagewas created
- For each ImageSubresourceRangeelement ofpRanges, if thelevelCountmember is notREMAINING_MIP_LEVELS, thenbaseMipLevel+levelCountmust be less than themipLevelsspecified inImageCreateInfowhenimagewas created
- The
     ImageSubresourceRange::baseArrayLayermembers of the elements of thepRangesarray must each be less than thearrayLayersspecified inImageCreateInfowhenimagewas created
- For each ImageSubresourceRangeelement ofpRanges, if thelayerCountmember is notREMAINING_ARRAY_LAYERS, thenbaseArrayLayer+layerCountmust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created
- imagemust have a depth/stencil format
- If commandBufferis an unprotected command buffer, thenimagemust not be a protected image
- If commandBufferis a protected command buffer, thenimagemust not be an unprotected image
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- imagemust be a valid- Imagehandle
- imageLayoutmust be a valid- ImageLayoutvalue
- pDepthStencilmust be a valid pointer to a valid- ClearDepthStencilValuestructure
- pRangesmust be a valid pointer to an array of- rangeCountvalid- ImageSubresourceRangestructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called outside of a render pass instance
- rangeCountmust be greater than- 0
- Both of commandBuffer, andimagemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics | Transfer | 
See Also
ClearDepthStencilValue, CommandBuffer,
 Image,
 ImageLayout,
 ImageSubresourceRange
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("attachments" ::: Vector ClearAttachment) | 
 | 
| -> ("rects" ::: Vector ClearRect) | 
 | 
| -> io () | 
vkCmdClearAttachments - Clear regions within bound framebuffer attachments
Description
cmdClearAttachments can clear multiple regions of each attachment
 used in the current subpass of a render pass instance. This command
 must be called only inside a render pass instance, and implicitly
 selects the images to clear based on the current framebuffer attachments
 and the command parameters.
If the render pass has a fragment density map attachment, clears follow the operations of fragment density maps as if each clear region was a primitive which generates fragments. The clear color is applied to all pixels inside each fragment’s area regardless if the pixels lie outside of the clear region. Clears may have a different set of supported fragment areas than draws.
Unlike other
 clear commands,
 cmdClearAttachments executes as a drawing command, rather than a
 transfer command, with writes performed by it executing in
 rasterization order.
 Clears to color attachments are executed as color attachment writes, by
 the
 PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
 stage. Clears to depth/stencil attachments are executed as
 depth writes
 and
 writes
 by the
 PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
 and
 PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT
 stages.
Valid Usage
- If the aspectMaskmember of any element ofpAttachmentscontainsIMAGE_ASPECT_COLOR_BIT, then thecolorAttachmentmember of that element must either refer to a color attachment which isATTACHMENT_UNUSED, or must be a valid color attachment
- If the aspectMaskmember of any element ofpAttachmentscontainsIMAGE_ASPECT_DEPTH_BIT, then the current subpass' depth/stencil attachment must either beATTACHMENT_UNUSED, or must have a depth component
- If the aspectMaskmember of any element ofpAttachmentscontainsIMAGE_ASPECT_STENCIL_BIT, then the current subpass' depth/stencil attachment must either beATTACHMENT_UNUSED, or must have a stencil component
- The rectmember of each element ofpRectsmust have anextent.widthgreater than0
- The rectmember of each element ofpRectsmust have anextent.heightgreater than0
- The rectangular region specified by each element of pRectsmust be contained within the render area of the current render pass instance
- The layers specified by each element of pRectsmust be contained within every attachment thatpAttachmentsrefers to
- The layerCountmember of each element ofpRectsmust not be0
- If commandBufferis an unprotected command buffer, then each attachment to be cleared must not be a protected image
- If commandBufferis a protected command buffer, then each attachment to be cleared must not be an unprotected image
- If the render pass instance this is recorded in uses multiview, then
     baseArrayLayermust be zero andlayerCountmust be one
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pAttachmentsmust be a valid pointer to an array of- attachmentCountvalid- ClearAttachmentstructures
- pRectsmust be a valid pointer to an array of- rectCount- ClearRectstructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
- attachmentCountmust be greater than- 0
- rectCountmust be greater than- 0
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcImage" ::: Image) | 
 | 
| -> ("srcImageLayout" ::: ImageLayout) | 
 | 
| -> ("dstImage" ::: Image) | 
 | 
| -> ("dstImageLayout" ::: ImageLayout) | 
 | 
| -> ("regions" ::: Vector ImageResolve) | 
 | 
| -> io () | 
vkCmdResolveImage - Resolve regions of an image
Description
During the resolve the samples corresponding to each pixel location in the source are converted to a single sample before being written to the destination. If the source formats are floating-point or normalized types, the sample values for each pixel are resolved in an implementation-dependent manner. If the source formats are integer types, a single sample’s value is selected for each pixel.
srcOffset and dstOffset select the initial x, y, and z offsets
 in texels of the sub-regions of the source and destination image data.
 extent is the size in texels of the source image to resolve in
 width, height and depth. Each element of pRegions must be a
 region that is contained within its corresponding image.
Resolves are done layer by layer starting with baseArrayLayer member
 of srcSubresource for the source and dstSubresource for the
 destination. layerCount layers are resolved to the destination image.
Valid Usage
- If commandBufferis an unprotected command buffer, thensrcImagemust not be a protected image
- If commandBufferis an unprotected command buffer, thendstImagemust not be a protected image
- If commandBufferis a protected command buffer, thendstImagemust not be an unprotected image
- The union of all source regions, and the union of all destination
     regions, specified by the elements of pRegions, must not overlap in memory
- If srcImageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- srcImagemust have a sample count equal to any valid sample count value other than- SAMPLE_COUNT_1_BIT
- If dstImageis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- dstImagemust have a sample count equal to- SAMPLE_COUNT_1_BIT
- srcImageLayoutmust specify the layout of the image subresources of- srcImagespecified in- pRegionsat the time this command is executed on a- Device
- srcImageLayoutmust be- IMAGE_LAYOUT_SHARED_PRESENT_KHR,- IMAGE_LAYOUT_TRANSFER_SRC_OPTIMALor- IMAGE_LAYOUT_GENERAL
- dstImageLayoutmust specify the layout of the image subresources of- dstImagespecified in- pRegionsat the time this command is executed on a- Device
- dstImageLayoutmust be- IMAGE_LAYOUT_SHARED_PRESENT_KHR,- IMAGE_LAYOUT_TRANSFER_DST_OPTIMALor- IMAGE_LAYOUT_GENERAL
- The
     format features
     of dstImagemust containFORMAT_FEATURE_COLOR_ATTACHMENT_BIT
- srcImageand- dstImagemust have been created with the same image format
- The srcSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhensrcImagewas created
- The dstSubresource.mipLevelmember of each element ofpRegionsmust be less than themipLevelsspecified inImageCreateInfowhendstImagewas created
- The srcSubresource.baseArrayLayer+srcSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhensrcImagewas created
- The dstSubresource.baseArrayLayer+dstSubresource.layerCountof each element ofpRegionsmust be less than or equal to thearrayLayersspecified inImageCreateInfowhendstImagewas created
- dstImageand- srcImagemust not have been created with- flagscontaining- IMAGE_CREATE_SUBSAMPLED_BIT_EXT
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcImagemust be a valid- Imagehandle
- srcImageLayoutmust be a valid- ImageLayoutvalue
- dstImagemust be a valid- Imagehandle
- dstImageLayoutmust be a valid- ImageLayoutvalue
- pRegionsmust be a valid pointer to an array of- regionCountvalid- ImageResolvestructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called outside of a render pass instance
- regionCountmust be greater than- 0
- Each of commandBuffer,dstImage, andsrcImagemust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics | Transfer | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Event | 
 | 
| -> ("stageMask" ::: PipelineStageFlags) | 
 | 
| -> io () | 
vkCmdSetEvent - Set an event object to signaled state
Description
When cmdSetEvent is submitted to a queue, it defines an execution
 dependency on commands that were submitted before it, and defines an
 event signal operation which sets the event to the signaled state.
The first
 synchronization scope
 includes all commands that occur earlier in
 submission order.
 The synchronization scope is limited to operations on the pipeline
 stages determined by the
 source stage mask
 specified by stageMask.
The second synchronization scope includes only the event signal operation.
If event is already in the signaled state when cmdSetEvent is
 executed on the device, then cmdSetEvent has no effect, no event
 signal operation occurs, and no execution dependency is generated.
Valid Usage
- If the
     geometry shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_MESH_SHADER_BIT_NV
- If the
     task shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- Any pipeline stage included in stageMaskmust be supported by the capabilities of the queue family specified by thequeueFamilyIndexmember of theCommandPoolCreateInfostructure that was used to create theCommandPoolthatcommandBufferwas allocated from, as specified in the table of supported pipeline stages
- stageMaskmust not include- PIPELINE_STAGE_HOST_BIT
- commandBuffer’s current device mask must include exactly one physical device
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- eventmust be a valid- Eventhandle
- stageMaskmust be a valid combination of- PipelineStageFlagBitsvalues
- stageMaskmust not be- 0
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- This command must only be called outside of a render pass instance
- Both of commandBuffer, andeventmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> Event | 
 | 
| -> ("stageMask" ::: PipelineStageFlags) | 
 | 
| -> io () | 
vkCmdResetEvent - Reset an event object to non-signaled state
Description
When cmdResetEvent is submitted to a queue, it defines an execution
 dependency on commands that were submitted before it, and defines an
 event unsignal operation which resets the event to the unsignaled state.
The first
 synchronization scope
 includes all commands that occur earlier in
 submission order.
 The synchronization scope is limited to operations on the pipeline
 stages determined by the
 source stage mask
 specified by stageMask.
The second synchronization scope includes only the event unsignal operation.
If event is already in the unsignaled state when cmdResetEvent is
 executed on the device, then cmdResetEvent has no effect, no event
 unsignal operation occurs, and no execution dependency is generated.
Valid Usage
- If the
     geometry shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_MESH_SHADER_BIT_NV
- If the
     task shaders
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, stageMaskmust not containPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- Any pipeline stage included in stageMaskmust be supported by the capabilities of the queue family specified by thequeueFamilyIndexmember of theCommandPoolCreateInfostructure that was used to create theCommandPoolthatcommandBufferwas allocated from, as specified in the table of supported pipeline stages
- stageMaskmust not include- PIPELINE_STAGE_HOST_BIT
- When this command executes, eventmust not be waited on by acmdWaitEventscommand that is currently executing
- commandBuffer’s current device mask must include exactly one physical device
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- eventmust be a valid- Eventhandle
- stageMaskmust be a valid combination of- PipelineStageFlagBitsvalues
- stageMaskmust not be- 0
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- This command must only be called outside of a render pass instance
- Both of commandBuffer, andeventmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("events" ::: Vector Event) | 
 | 
| -> ("srcStageMask" ::: PipelineStageFlags) | 
 | 
| -> ("dstStageMask" ::: PipelineStageFlags) | 
 | 
| -> ("memoryBarriers" ::: Vector MemoryBarrier) | 
 | 
| -> ("bufferMemoryBarriers" ::: Vector BufferMemoryBarrier) | 
 | 
| -> ("imageMemoryBarriers" ::: Vector (SomeStruct ImageMemoryBarrier)) | 
 | 
| -> io () | 
vkCmdWaitEvents - Wait for one or more events and insert a set of memory
Description
When cmdWaitEvents is submitted to a queue, it defines a memory
 dependency between prior event signal operations on the same queue or
 the host, and subsequent commands. cmdWaitEvents must not be used to
 wait on event signal operations occurring on other queues.
The first synchronization scope only includes event signal operations
 that operate on members of pEvents, and the operations that
 happened-before the event signal operations. Event signal operations
 performed by cmdSetEvent that occur earlier in
 submission order
 are included in the first synchronization scope, if the
 logically latest
 pipeline stage in their stageMask parameter is
 logically earlier
 than or equal to the
 logically latest
 pipeline stage in srcStageMask. Event signal operations performed by
 setEvent are only included in the first
 synchronization scope if
 PIPELINE_STAGE_HOST_BIT is
 included in srcStageMask.
The second
 synchronization scope
 includes all commands that occur later in
 submission order.
 The second synchronization scope is limited to operations on the
 pipeline stages determined by the
 destination stage mask
 specified by dstStageMask.
The first
 access scope
 is limited to access in the pipeline stages determined by the
 source stage mask
 specified by srcStageMask. Within that, the first access scope only
 includes the first access scopes defined by elements of the
 pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers
 arrays, which each define a set of
 memory barriers.
 If no memory barriers are specified, then the first access scope
 includes no accesses.
The second
 access scope
 is limited to access in the pipeline stages determined by the
 destination stage mask
 specified by dstStageMask. Within that, the second access scope only
 includes the second access scopes defined by elements of the
 pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers
 arrays, which each define a set of
 memory barriers.
 If no memory barriers are specified, then the second access scope
 includes no accesses.
Note
cmdWaitEvents is used with cmdSetEvent to define a memory dependency
 between two sets of action commands, roughly in the same way as pipeline
 barriers, but split into two commands such that work between the two
 may execute unhindered.
Unlike cmdPipelineBarrier, a
 queue family ownership transfer
 cannot be performed using cmdWaitEvents.
Note
Applications should be careful to avoid race conditions when using
 events. There is no direct ordering guarantee between a cmdResetEvent
 command and a cmdWaitEvents command submitted after it, so some other
 execution dependency must be included between these commands (e.g. a
 semaphore).
Valid Usage
- If the
     geometry shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_MESH_SHADER_BIT_NV
- If the
     task shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- Any pipeline stage included in srcStageMaskmust be supported by the capabilities of the queue family specified by thequeueFamilyIndexmember of theCommandPoolCreateInfostructure that was used to create theCommandPoolthatcommandBufferwas allocated from, as specified in the table of supported pipeline stages
- If the
     geometry shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_MESH_SHADER_BIT_NV
- If the
     task shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- Any pipeline stage included in dstStageMaskmust be supported by the capabilities of the queue family specified by thequeueFamilyIndexmember of theCommandPoolCreateInfostructure that was used to create theCommandPoolthatcommandBufferwas allocated from, as specified in the table of supported pipeline stages
- The srcAccessMaskmember of each element ofpMemoryBarriersmust only include access flags that are supported by one or more of the pipeline stages insrcStageMask, as specified in the table of supported access types
- The dstAccessMaskmember of each element ofpMemoryBarriersmust only include access flags that are supported by one or more of the pipeline stages indstStageMask, as specified in the table of supported access types
- For any element of pBufferMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itssrcQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itssrcAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages insrcStageMask, as specified in the table of supported access types
- For any element of pBufferMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itsdstQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itsdstAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages indstStageMask, as specified in the table of supported access types
- For any element of pImageMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itssrcQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itssrcAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages insrcStageMask, as specified in the table of supported access types
- For any element of pImageMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itsdstQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itsdstAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages indstStageMask, as specified in the table of supported access types
- srcStageMaskmust be the bitwise OR of the- stageMaskparameter used in previous calls to- cmdSetEventwith any of the members of- pEventsand- PIPELINE_STAGE_HOST_BITif any of the members of- pEventswas set using- setEvent
- If pEventsincludes one or more events that will be signaled bysetEventaftercommandBufferhas been submitted to a queue, thencmdWaitEventsmust not be called inside a render pass instance
- The srcQueueFamilyIndexanddstQueueFamilyIndexmembers of any element ofpBufferMemoryBarriersorpImageMemoryBarriersmust be equal
- commandBuffer’s current device mask must include exactly one physical device
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pEventsmust be a valid pointer to an array of- eventCountvalid- Eventhandles
- srcStageMaskmust be a valid combination of- PipelineStageFlagBitsvalues
- srcStageMaskmust not be- 0
- dstStageMaskmust be a valid combination of- PipelineStageFlagBitsvalues
- dstStageMaskmust not be- 0
- If memoryBarrierCountis not0,pMemoryBarriersmust be a valid pointer to an array ofmemoryBarrierCountvalidMemoryBarrierstructures
- If bufferMemoryBarrierCountis not0,pBufferMemoryBarriersmust be a valid pointer to an array ofbufferMemoryBarrierCountvalidBufferMemoryBarrierstructures
- If imageMemoryBarrierCountis not0,pImageMemoryBarriersmust be a valid pointer to an array ofimageMemoryBarrierCountvalidImageMemoryBarrierstructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- eventCountmust be greater than- 0
- Both of commandBuffer, and the elements ofpEventsmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics Compute | 
See Also
BufferMemoryBarrier,
 CommandBuffer, Event,
 ImageMemoryBarrier,
 MemoryBarrier,
 PipelineStageFlags
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("events" ::: Vector Event) | 
 | 
| -> ("srcStageMask" ::: PipelineStageFlags) | 
 | 
| -> ("dstStageMask" ::: PipelineStageFlags) | 
 | 
| -> ("memoryBarriers" ::: Vector MemoryBarrier) | 
 | 
| -> ("bufferMemoryBarriers" ::: Vector BufferMemoryBarrier) | 
 | 
| -> ("imageMemoryBarriers" ::: Vector (SomeStruct ImageMemoryBarrier)) | 
 | 
| -> io () | 
A variant of cmdWaitEvents which makes a *safe* FFI call
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("srcStageMask" ::: PipelineStageFlags) | 
 | 
| -> ("dstStageMask" ::: PipelineStageFlags) | 
 | 
| -> DependencyFlags | 
 | 
| -> ("memoryBarriers" ::: Vector MemoryBarrier) | 
 | 
| -> ("bufferMemoryBarriers" ::: Vector BufferMemoryBarrier) | 
 | 
| -> ("imageMemoryBarriers" ::: Vector (SomeStruct ImageMemoryBarrier)) | 
 | 
| -> io () | 
vkCmdPipelineBarrier - Insert a memory dependency
Description
When cmdPipelineBarrier is submitted to a queue, it defines a memory
 dependency between commands that were submitted before it, and those
 submitted after it.
If cmdPipelineBarrier was recorded outside a render pass instance, the
 first
 synchronization scope
 includes all commands that occur earlier in
 submission order.
 If cmdPipelineBarrier was recorded inside a render pass instance, the
 first synchronization scope includes only commands that occur earlier in
 submission order
 within the same subpass. In either case, the first synchronization scope
 is limited to operations on the pipeline stages determined by the
 source stage mask
 specified by srcStageMask.
If cmdPipelineBarrier was recorded outside a render pass instance, the
 second
 synchronization scope
 includes all commands that occur later in
 submission order.
 If cmdPipelineBarrier was recorded inside a render pass instance, the
 second synchronization scope includes only commands that occur later in
 submission order
 within the same subpass. In either case, the second synchronization
 scope is limited to operations on the pipeline stages determined by the
 destination stage mask
 specified by dstStageMask.
The first
 access scope
 is limited to access in the pipeline stages determined by the
 source stage mask
 specified by srcStageMask. Within that, the first access scope only
 includes the first access scopes defined by elements of the
 pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers
 arrays, which each define a set of
 memory barriers.
 If no memory barriers are specified, then the first access scope
 includes no accesses.
The second
 access scope
 is limited to access in the pipeline stages determined by the
 destination stage mask
 specified by dstStageMask. Within that, the second access scope only
 includes the second access scopes defined by elements of the
 pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers
 arrays, which each define a set of
 memory barriers.
 If no memory barriers are specified, then the second access scope
 includes no accesses.
If dependencyFlags includes
 DEPENDENCY_BY_REGION_BIT, then
 any dependency between
 framebuffer-space
 pipeline stages is
 framebuffer-local
 - otherwise it is
 framebuffer-global.
Valid Usage
- If the
     geometry shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_MESH_SHADER_BIT_NV
- If the
     task shaders
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, srcStageMaskmust not containPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- Any pipeline stage included in srcStageMaskmust be supported by the capabilities of the queue family specified by thequeueFamilyIndexmember of theCommandPoolCreateInfostructure that was used to create theCommandPoolthatcommandBufferwas allocated from, as specified in the table of supported pipeline stages
- If the
     geometry shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_MESH_SHADER_BIT_NV
- If the
     task shaders
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, dstStageMaskmust not containPIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- Any pipeline stage included in dstStageMaskmust be supported by the capabilities of the queue family specified by thequeueFamilyIndexmember of theCommandPoolCreateInfostructure that was used to create theCommandPoolthatcommandBufferwas allocated from, as specified in the table of supported pipeline stages
- The srcAccessMaskmember of each element ofpMemoryBarriersmust only include access flags that are supported by one or more of the pipeline stages insrcStageMask, as specified in the table of supported access types
- The dstAccessMaskmember of each element ofpMemoryBarriersmust only include access flags that are supported by one or more of the pipeline stages indstStageMask, as specified in the table of supported access types
- For any element of pBufferMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itssrcQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itssrcAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages insrcStageMask, as specified in the table of supported access types
- For any element of pBufferMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itsdstQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itsdstAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages indstStageMask, as specified in the table of supported access types
- For any element of pImageMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itssrcQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itssrcAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages insrcStageMask, as specified in the table of supported access types
- For any element of pImageMemoryBarriers, if itssrcQueueFamilyIndexanddstQueueFamilyIndexmembers are equal, or if itsdstQueueFamilyIndexis the queue family index that was used to create the command pool thatcommandBufferwas allocated from, then itsdstAccessMaskmember must only contain access flags that are supported by one or more of the pipeline stages indstStageMask, as specified in the table of supported access types
- If cmdPipelineBarrieris called within a render pass instance, the render pass must have been created with at least oneSubpassDependencyinstance inRenderPassCreateInfo::pDependenciesthat expresses a dependency from the current subpass to itself, with synchronization scopes and access scopes that are all supersets of the scopes defined in this command
- If cmdPipelineBarrieris called within a render pass instance, it must not include any buffer memory barriers
- If cmdPipelineBarrieris called within a render pass instance, theimagemember of any image memory barrier included in this command must be an attachment used in the current subpass both as an input attachment, and as either a color or depth/stencil attachment
- If cmdPipelineBarrieris called within a render pass instance, theoldLayoutandnewLayoutmembers of any image memory barrier included in this command must be equal
- If cmdPipelineBarrieris called within a render pass instance, thesrcQueueFamilyIndexanddstQueueFamilyIndexmembers of any image memory barrier included in this command must be equal
- If cmdPipelineBarrieris called outside of a render pass instance,DEPENDENCY_VIEW_LOCAL_BITmust not be included in the dependency flags
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- srcStageMaskmust be a valid combination of- PipelineStageFlagBitsvalues
- srcStageMaskmust not be- 0
- dstStageMaskmust be a valid combination of- PipelineStageFlagBitsvalues
- dstStageMaskmust not be- 0
- dependencyFlagsmust be a valid combination of- DependencyFlagBitsvalues
- If memoryBarrierCountis not0,pMemoryBarriersmust be a valid pointer to an array ofmemoryBarrierCountvalidMemoryBarrierstructures
- If bufferMemoryBarrierCountis not0,pBufferMemoryBarriersmust be a valid pointer to an array ofbufferMemoryBarrierCountvalidBufferMemoryBarrierstructures
- If imageMemoryBarrierCountis not0,pImageMemoryBarriersmust be a valid pointer to an array ofimageMemoryBarrierCountvalidImageMemoryBarrierstructures
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Transfer Graphics Compute | 
See Also
BufferMemoryBarrier,
 CommandBuffer,
 DependencyFlags,
 ImageMemoryBarrier,
 MemoryBarrier,
 PipelineStageFlags
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> QueryPool | 
 | 
| -> ("query" ::: Word32) | 
 | 
| -> QueryControlFlags | 
 | 
| -> io () | 
vkCmdBeginQuery - Begin a query
Description
If the queryType of the pool is
 QUERY_TYPE_OCCLUSION and flags
 contains
 QUERY_CONTROL_PRECISE_BIT, an
 implementation must return a result that matches the actual number of
 samples passed. This is described in more detail in
 Occlusion Queries.
Calling cmdBeginQuery is equivalent to calling
 cmdBeginQueryIndexedEXT
 with the index parameter set to zero.
After beginning a query, that query is considered active within the command buffer it was called in until that same query is ended. Queries active in a primary command buffer when secondary command buffers are executed are considered active for those secondary command buffers.
Valid Usage
- queryPoolmust have been created with a- queryTypethat differs from that of any queries that are active within- commandBuffer
- All queries used by the command must be unavailable
- The queryTypeused to createqueryPoolmust not beQUERY_TYPE_TIMESTAMP
- If the
     precise occlusion queries
     feature is not enabled, or the queryTypeused to createqueryPoolwas notQUERY_TYPE_OCCLUSION,flagsmust not containQUERY_CONTROL_PRECISE_BIT
- querymust be less than the number of queries in- queryPool
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_OCCLUSION, theCommandPoolthatcommandBufferwas allocated from must support graphics operations
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_PIPELINE_STATISTICSand any of thepipelineStatisticsindicate graphics operations, theCommandPoolthatcommandBufferwas allocated from must support graphics operations
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_PIPELINE_STATISTICSand any of thepipelineStatisticsindicate compute operations, theCommandPoolthatcommandBufferwas allocated from must support compute operations
- commandBuffermust not be a protected command buffer
- If called within a render pass instance, the sum of queryand the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries inqueryPool
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTtheCommandPoolthatcommandBufferwas allocated from must support graphics operations
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXTthenPhysicalDeviceTransformFeedbackPropertiesEXT::transformFeedbackQueriesmust be supported
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHR, the profiling lock must have been held beforebeginCommandBufferwas called oncommandBuffer
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHRand one of the counters used to createqueryPoolwasPERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR, the query begin must be the first recorded command incommandBuffer
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHRand one of the counters used to createqueryPoolwasPERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR, the begin command must not be recorded within a render pass instance
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHRand another query pool with aqueryTypeQUERY_TYPE_PERFORMANCE_QUERY_KHRhas been used withincommandBuffer, its parent primary command buffer or secondary command buffer recorded within the same parent primary command buffer ascommandBuffer, the performanceCounterMultipleQueryPools feature must be enabled
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHR, this command must not be recorded in a command buffer that, either directly or through secondary command buffers, also contains acmdResetQueryPoolcommand affecting the same query
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- queryPoolmust be a valid- QueryPoolhandle
- flagsmust be a valid combination of- QueryControlFlagBitsvalues
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- Both of commandBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics Compute | 
See Also
cmdUseQuery :: forall io r. MonadIO io => CommandBuffer -> QueryPool -> Word32 -> QueryControlFlags -> io r -> io r Source #
This function will call the supplied action between calls to
 cmdBeginQuery and cmdEndQuery
Note that cmdEndQuery is *not* called if an exception is thrown by the
 inner action.
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> QueryPool | 
 | 
| -> ("query" ::: Word32) | 
 | 
| -> io () | 
vkCmdEndQuery - Ends a query
Description
Calling cmdEndQuery is equivalent to calling
 cmdEndQueryIndexedEXT with
 the index parameter set to zero.
As queries operate asynchronously, ending a query does not immediately
 set the query’s status to available. A query is considered finished
 when the final results of the query are ready to be retrieved by
 getQueryPoolResults and cmdCopyQueryPoolResults,
 and this is when the query’s status is set to available.
Once a query is ended the query must finish in finite time, unless the state of the query is changed using other commands, e.g. by issuing a reset of the query.
Valid Usage
- All queries used by the command must be active
- querymust be less than the number of queries in- queryPool
- commandBuffermust not be a protected command buffer
- If cmdEndQueryis called within a render pass instance, the sum ofqueryand the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries inqueryPool
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHRand one or more of the counters used to createqueryPoolwasPERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR, thecmdEndQuerymust be the last recorded command incommandBuffer
- If queryPoolwas created with aqueryTypeofQUERY_TYPE_PERFORMANCE_QUERY_KHRand one or more of the counters used to createqueryPoolwasPERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR, thecmdEndQuerymust not be recorded within a render pass instance
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- queryPoolmust be a valid- QueryPoolhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- Both of commandBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> QueryPool | 
 | 
| -> ("firstQuery" ::: Word32) | 
 | 
| -> ("queryCount" ::: Word32) | 
 | 
| -> io () | 
vkCmdResetQueryPool - Reset queries in a query pool
Description
When executed on a queue, this command sets the status of query indices
 [firstQuery, firstQuery + queryCount - 1] to unavailable.
If the queryType used to create queryPool was
 QUERY_TYPE_PERFORMANCE_QUERY_KHR, this
 command sets the status of query indices [firstQuery, firstQuery +
 queryCount - 1] to unavailable for each pass of queryPool, as
 indicated by a call to
 getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR.
Note
Because cmdResetQueryPool resets all the passes of the indicated
 queries, applications must not record a cmdResetQueryPool command for
 a queryPool created with
 QUERY_TYPE_PERFORMANCE_QUERY_KHR in a
 command buffer that needs to be submitted multiple times as indicated by
 a call to
 getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR.
 Otherwise applications will never be able to complete the recorded
 queries.
Valid Usage
- firstQuerymust be less than the number of queries in- queryPool
- The sum of firstQueryandqueryCountmust be less than or equal to the number of queries inqueryPool
- All queries used by the command must not be active
- If queryPoolwas created withQUERY_TYPE_PERFORMANCE_QUERY_KHR, this command must not be recorded in a command buffer that, either directly or through secondary command buffers, also contains begin commands for a query from the set of queries [firstQuery,firstQuery+queryCount- 1]
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- queryPoolmust be a valid- QueryPoolhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- This command must only be called outside of a render pass instance
- Both of commandBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics Compute | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> PipelineStageFlagBits | 
 | 
| -> QueryPool | 
 | 
| -> ("query" ::: Word32) | 
 | 
| -> io () | 
vkCmdWriteTimestamp - Write a device timestamp into a query object
Description
cmdWriteTimestamp latches the value of the timer when all previous
 commands have completed executing as far as the specified pipeline
 stage, and writes the timestamp value to memory. When the timestamp
 value is written, the availability status of the query is set to
 available.
Note
If an implementation is unable to detect completion and latch the timer at any specific stage of the pipeline, it may instead do so at any logically later stage.
Timestamps may only be meaningfully compared if they are written by commands submitted to the same queue.
Note
An example of such a comparison is determining the execution time of a sequence of commands.
If cmdWriteTimestamp is called while executing a render pass instance
 that has multiview enabled, the timestamp uses N consecutive query
 indices in the query pool (starting at query) where N is the number of
 bits set in the view mask of the subpass the command is executed in. The
 resulting query values are determined by an implementation-dependent
 choice of one of the following behaviors:
- The first query is a timestamp value and (if more than one bit is set in the view mask) zero is written to the remaining queries. If two timestamps are written in the same subpass, the sum of the execution time of all views between those commands is the difference between the first query written by each command.
- All N queries are timestamp values. If two timestamps are written in the same subpass, the sum of the execution time of all views between those commands is the sum of the difference between corresponding queries written by each command. The difference between corresponding queries may be the execution time of a single view.
In either case, the application can sum the differences between all N queries to determine the total execution time.
Valid Usage
- pipelineStagemust be a valid stage for the queue family that was used to create the command pool that- commandBufferwas allocated from
- If the
     geometry shaders
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the
     tessellation shaders
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BITorPIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the
     conditional rendering
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT
- If the
     fragment density map
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT
- If the
     transform feedback
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
- If the
     mesh shaders
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_MESH_SHADER_BIT_NVorPIPELINE_STAGE_TASK_SHADER_BIT_NV
- If the
     shading rate image
     feature is not enabled, pipelineStagemust not bePIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV
- queryPoolmust have been created with a- queryTypeof- QUERY_TYPE_TIMESTAMP
- The query identified by queryPoolandquerymust be unavailable
- The command pool’s queue family must support a non-zero
     timestampValidBits
- All queries used by the command must be unavailable
- If cmdWriteTimestampis called within a render pass instance, the sum ofqueryand the number of bits set in the current subpass’s view mask must be less than or equal to the number of queries inqueryPool
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pipelineStagemust be a valid- PipelineStageFlagBitsvalue
- queryPoolmust be a valid- QueryPoolhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- Both of commandBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Transfer Graphics Compute | Transfer | 
See Also
cmdCopyQueryPoolResults Source #
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> QueryPool | 
 | 
| -> ("firstQuery" ::: Word32) | 
 | 
| -> ("queryCount" ::: Word32) | 
 | 
| -> ("dstBuffer" ::: Buffer) | 
 | 
| -> ("dstOffset" ::: DeviceSize) | 
 | 
| -> ("stride" ::: DeviceSize) | 
 | 
| -> QueryResultFlags | 
 | 
| -> io () | 
vkCmdCopyQueryPoolResults - Copy the results of queries in a query pool to a buffer object
Description
cmdCopyQueryPoolResults is guaranteed to see the effect of previous
 uses of cmdResetQueryPool in the same queue, without any additional
 synchronization. Thus, the results will always reflect the most recent
 use of the query.
flags has the same possible values described above for the flags
 parameter of getQueryPoolResults, but the
 different style of execution causes some subtle behavioral differences.
 Because cmdCopyQueryPoolResults executes in order with respect to
 other query commands, there is less ambiguity about which use of a query
 is being requested.
Results for all requested occlusion queries, pipeline statistics
 queries, transform feedback queries, and timestamp queries are written
 as 64-bit unsigned integer values if
 QUERY_RESULT_64_BIT is set or
 32-bit unsigned integer values otherwise. Performance queries store
 results in a tightly packed array whose type is determined by the unit
 member of the corresponding
 PerformanceCounterKHR.
If neither of
 QUERY_RESULT_WAIT_BIT and
 QUERY_RESULT_WITH_AVAILABILITY_BIT
 are set, results are only written out for queries in the available
 state.
If QUERY_RESULT_WAIT_BIT is
 set, the implementation will wait for each query’s status to be in the
 available state before retrieving the numerical results for that query.
 This is guaranteed to reflect the most recent use of the query on the
 same queue, assuming that the query is not being simultaneously used by
 other queues. If the query does not become available in a finite amount
 of time (e.g. due to not issuing a query since the last reset), a
 ERROR_DEVICE_LOST error may occur.
Similarly, if
 QUERY_RESULT_WITH_AVAILABILITY_BIT
 is set and
 QUERY_RESULT_WAIT_BIT is not
 set, the availability is guaranteed to reflect the most recent use of
 the query on the same queue, assuming that the query is not being
 simultaneously used by other queues. As with
 getQueryPoolResults, implementations must
 guarantee that if they return a non-zero availability value, then the
 numerical results are valid.
If QUERY_RESULT_PARTIAL_BIT is
 set, QUERY_RESULT_WAIT_BIT is
 not set, and the query’s status is unavailable, an intermediate result
 value between zero and the final result value is written for that query.
QUERY_RESULT_PARTIAL_BIT
 must not be used if the pool’s queryType is
 QUERY_TYPE_TIMESTAMP.
cmdCopyQueryPoolResults is considered to be a transfer operation, and
 its writes to buffer memory must be synchronized using
 PIPELINE_STAGE_TRANSFER_BIT
 and ACCESS_TRANSFER_WRITE_BIT
 before using the results.
Valid Usage
- dstOffsetmust be less than the size of- dstBuffer
- firstQuerymust be less than the number of queries in- queryPool
- The sum of firstQueryandqueryCountmust be less than or equal to the number of queries inqueryPool
- If QUERY_RESULT_64_BITis not set inflagsthendstOffsetandstridemust be multiples of4
- If QUERY_RESULT_64_BITis set inflagsthendstOffsetandstridemust be multiples of8
- dstBuffermust have enough storage, from- dstOffset, to contain the result of each query, as described here
- dstBuffermust have been created with- BUFFER_USAGE_TRANSFER_DST_BITusage flag
- If dstBufferis non-sparse then it must be bound completely and contiguously to a singleDeviceMemoryobject
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_TIMESTAMP,flagsmust not containQUERY_RESULT_PARTIAL_BIT
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_PERFORMANCE_QUERY_KHR,PhysicalDevicePerformanceQueryPropertiesKHR::allowCommandBufferQueryCopiesmust beTRUE
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_PERFORMANCE_QUERY_KHR,flagsmust not containQUERY_RESULT_WITH_AVAILABILITY_BIT,QUERY_RESULT_PARTIAL_BITorQUERY_RESULT_64_BIT
- If the queryTypeused to createqueryPoolwasQUERY_TYPE_PERFORMANCE_QUERY_KHR, thequeryPoolmust have been submitted once for each pass as retrieved via a call togetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR
- cmdCopyQueryPoolResultsmust not be called if the- queryTypeused to create- queryPoolwas- QUERY_TYPE_PERFORMANCE_QUERY_INTEL
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- queryPoolmust be a valid- QueryPoolhandle
- dstBuffermust be a valid- Bufferhandle
- flagsmust be a valid combination of- QueryResultFlagBitsvalues
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- This command must only be called outside of a render pass instance
- Each of commandBuffer,dstBuffer, andqueryPoolmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Outside | Graphics Compute | Transfer | 
See Also
Buffer, CommandBuffer,
 DeviceSize,
 QueryPool,
 QueryResultFlags
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> PipelineLayout | 
 | 
| -> ShaderStageFlags | 
 | 
| -> ("offset" ::: Word32) | 
 | 
| -> ("size" ::: Word32) | 
 | 
| -> ("values" ::: Ptr ()) | 
 | 
| -> io () | 
vkCmdPushConstants - Update the values of push constants
Description
Note
As stageFlags needs to include all flags the relevant push constant
 ranges were created with, any flags that are not supported by the queue
 family that the CommandPool used to allocate
 commandBuffer was created on are ignored.
Valid Usage
- For each byte in the range specified by offsetandsizeand for each shader stage instageFlags, there must be a push constant range inlayoutthat includes that byte and that stage
- For each byte in the range specified by offsetandsizeand for each push constant range that overlaps that byte,stageFlagsmust include all stages in that push constant range’sPushConstantRange::stageFlags
- offsetmust be a multiple of- 4
- sizemust be a multiple of- 4
- offsetmust be less than- PhysicalDeviceLimits::- maxPushConstantsSize
- sizemust be less than or equal to- PhysicalDeviceLimits::- maxPushConstantsSizeminus- offset
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- layoutmust be a valid- PipelineLayouthandle
- stageFlagsmust be a valid combination of- ShaderStageFlagBitsvalues
- stageFlagsmust not be- 0
- pValuesmust be a valid pointer to an array of- sizebytes
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations
- sizemust be greater than- 0
- Both of commandBuffer, andlayoutmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary Secondary | Both | Graphics Compute | 
See Also
Arguments
| :: forall a io. (Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) | |
| => CommandBuffer | 
 | 
| -> RenderPassBeginInfo a | 
 | 
| -> SubpassContents | 
 | 
| -> io () | 
vkCmdBeginRenderPass - Begin a new render pass
Description
After beginning a render pass instance, the command buffer is ready to record the commands for the first subpass of that render pass.
Valid Usage
- If any of the initialLayoutorfinalLayoutmember of theAttachmentDescriptionstructures or thelayoutmember of theAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_COLOR_ATTACHMENT_BIT
- If any of the initialLayoutorfinalLayoutmember of theAttachmentDescriptionstructures or thelayoutmember of theAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL,IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL,IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, orIMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If any of the initialLayoutorfinalLayoutmember of theAttachmentDescriptionstructures or thelayoutmember of theAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, orIMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, orIMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If any of the stencilInitialLayoutorstencilFinalLayoutmember of theAttachmentDescriptionStencilLayoutstructures or thestencilLayoutmember of theAttachmentReferenceStencilLayoutstructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, orIMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If any of the initialLayoutorfinalLayoutmember of theAttachmentDescriptionstructures or thelayoutmember of theAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_SAMPLED_BITorIMAGE_USAGE_INPUT_ATTACHMENT_BIT
- If any of the initialLayoutorfinalLayoutmember of theAttachmentDescriptionstructures or thelayoutmember of theAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_TRANSFER_SRC_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_TRANSFER_SRC_BIT
- If any of the initialLayoutorfinalLayoutmember of theAttachmentDescriptionstructures or thelayoutmember of theAttachmentReferencestructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginisIMAGE_LAYOUT_TRANSFER_DST_OPTIMALthen the corresponding attachment image view of the framebuffer specified in theframebuffermember ofpRenderPassBeginmust have been created with ausagevalue includingIMAGE_USAGE_TRANSFER_DST_BIT
- If any of the initialLayoutmembers of theAttachmentDescriptionstructures specified when creating the render pass specified in therenderPassmember ofpRenderPassBeginis notIMAGE_LAYOUT_UNDEFINED, then each suchinitialLayoutmust be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in theframebuffermember ofpRenderPassBegin
- The srcStageMaskanddstStageMaskmembers of any element of thepDependenciesmember ofRenderPassCreateInfoused to createrenderPassmust be supported by the capabilities of the queue family identified by thequeueFamilyIndexmember of theCommandPoolCreateInfoused to create the command pool whichcommandBufferwas allocated from
- For any attachment in framebufferthat is used byrenderPassand is bound to memory locations that are also bound to another attachment used byrenderPass, and if at least one of those uses causes either attachment to be written to, both attachments must have had theATTACHMENT_DESCRIPTION_MAY_ALIAS_BITset
- Each element of the pAttachmentsofframebufferthat is referenced by any element of thepInputAttachmentsof any element ofpSubpassesofrenderPassmust have image view format features containing at leastFORMAT_FEATURE_COLOR_ATTACHMENT_BITorFORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
- Each element of the pAttachmentsofframebufferthat is referenced by any element of thepColorAttachmentsof any element ofpSubpassesofrenderPassmust have image view format features containingFORMAT_FEATURE_COLOR_ATTACHMENT_BIT
- Each element of the pAttachmentsofframebufferthat is referenced by any element of thepResolveAttachmentsof any element ofpSubpassesofrenderPassmust have image view format features containingFORMAT_FEATURE_COLOR_ATTACHMENT_BIT
- Each element of the pAttachmentsofframebufferthat is referenced by any element of thepDepthStencilAttachmentof any element ofpSubpassesofrenderPassmust have image view format features containingFORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pRenderPassBeginmust be a valid pointer to a valid- RenderPassBeginInfostructure
- contentsmust be a valid- SubpassContentsvalue
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called outside of a render pass instance
- commandBuffermust be a primary- CommandBuffer
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary | Outside | Graphics | Graphics | 
See Also
cmdUseRenderPass :: forall a io r. (Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) => CommandBuffer -> RenderPassBeginInfo a -> SubpassContents -> io r -> io r Source #
This function will call the supplied action between calls to
 cmdBeginRenderPass and cmdEndRenderPass
Note that cmdEndRenderPass is *not* called if an exception is thrown
 by the inner action.
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> SubpassContents | 
 | 
| -> io () | 
vkCmdNextSubpass - Transition to the next subpass of a render pass
Description
The subpass index for a render pass begins at zero when
 cmdBeginRenderPass is recorded, and increments each time
 cmdNextSubpass is recorded.
Moving to the next subpass automatically performs any multisample
 resolve operations in the subpass being ended. End-of-subpass
 multisample resolves are treated as color attachment writes for the
 purposes of synchronization. This applies to resolve operations for both
 color and depth/stencil attachments. That is, they are considered to
 execute in the
 PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
 pipeline stage and their writes are synchronized with
 ACCESS_COLOR_ATTACHMENT_WRITE_BIT.
 Synchronization between rendering within a subpass and any resolve
 operations at the end of the subpass occurs automatically, without need
 for explicit dependencies or pipeline barriers. However, if the resolve
 attachment is also used in a different subpass, an explicit dependency
 is needed.
After transitioning to the next subpass, the application can record the commands for that subpass.
Valid Usage
- The current subpass index must be less than the number of subpasses in the render pass minus one
- This command must not be recorded when transform feedback is active
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- contentsmust be a valid- SubpassContentsvalue
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
- commandBuffermust be a primary- CommandBuffer
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary | Inside | Graphics | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> io () | 
vkCmdEndRenderPass - End the current render pass
Description
Ending a render pass instance performs any multisample resolve operations on the final subpass.
Valid Usage
- The current subpass index must be equal to the number of subpasses in the render pass minus one
- This command must not be recorded when transform feedback is active
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support graphics operations
- This command must only be called inside of a render pass instance
- commandBuffermust be a primary- CommandBuffer
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary | Inside | Graphics | Graphics | 
See Also
Arguments
| :: forall io. MonadIO io | |
| => CommandBuffer | 
 | 
| -> ("commandBuffers" ::: Vector CommandBuffer) | 
 | 
| -> io () | 
vkCmdExecuteCommands - Execute a secondary command buffer from a primary command buffer
Description
If any element of pCommandBuffers was not recorded with the
 COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
 flag, and it was recorded into any other primary command buffer which is
 currently in the
 executable or recording state,
 that primary command buffer becomes
 invalid.
Valid Usage
- Each element of pCommandBuffersmust have been allocated with alevelofCOMMAND_BUFFER_LEVEL_SECONDARY
- Each element of pCommandBuffersmust be in the pending or executable state
- If any element of pCommandBufferswas not recorded with theCOMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BITflag, it must not be in the pending state
- If any element of pCommandBufferswas not recorded with theCOMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BITflag, it must not have already been recorded tocommandBuffer
- If any element of pCommandBufferswas not recorded with theCOMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BITflag, it must not appear more than once inpCommandBuffers
- Each element of pCommandBuffersmust have been allocated from aCommandPoolthat was created for the same queue family as theCommandPoolfrom whichcommandBufferwas allocated
- If cmdExecuteCommandsis being called within a render pass instance, that render pass instance must have been begun with thecontentsparameter ofcmdBeginRenderPassset toSUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS
- If cmdExecuteCommandsis being called within a render pass instance, each element ofpCommandBuffersmust have been recorded with theCOMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
- If cmdExecuteCommandsis being called within a render pass instance, each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceInfo::subpassset to the index of the subpass which the given command buffer will be executed in
- If cmdExecuteCommandsis being called within a render pass instance, the render passes specified in thepBeginInfo->pInheritanceInfo->renderPassmembers of thebeginCommandBuffercommands used to begin recording each element ofpCommandBuffersmust be compatible with the current render pass
- If cmdExecuteCommandsis being called within a render pass instance, and any element ofpCommandBufferswas recorded withCommandBufferInheritanceInfo::framebuffernot equal toNULL_HANDLE, thatFramebuffermust match theFramebufferused in the current render pass instance
- If cmdExecuteCommandsis being called within a render pass instance that includedRenderPassTransformBeginInfoQCOMin thepNextchain ofRenderPassBeginInfo, then each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceRenderPassTransformInfoQCOMin thepNextchain ofCommandBufferBeginInfo
- If cmdExecuteCommandsis being called within a render pass instance that includedRenderPassTransformBeginInfoQCOMin thepNextchain ofRenderPassBeginInfo, then each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceRenderPassTransformInfoQCOM::transformidentical toRenderPassTransformBeginInfoQCOM::transform
- If cmdExecuteCommandsis being called within a render pass instance that includedRenderPassTransformBeginInfoQCOMin thepNextchain ofRenderPassBeginInfo, then each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceRenderPassTransformInfoQCOM::renderAreaidentical toRenderPassBeginInfo::renderArea
- If cmdExecuteCommandsis not being called within a render pass instance, each element ofpCommandBuffersmust not have been recorded with theCOMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
- If the
     inherited queries
     feature is not enabled, commandBuffermust not have any queries active
- If commandBufferhas aQUERY_TYPE_OCCLUSIONquery active, then each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceInfo::occlusionQueryEnableset toTRUE
- If commandBufferhas aQUERY_TYPE_OCCLUSIONquery active, then each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceInfo::queryFlagshaving all bits set that are set for the query
- If commandBufferhas aQUERY_TYPE_PIPELINE_STATISTICSquery active, then each element ofpCommandBuffersmust have been recorded withCommandBufferInheritanceInfo::pipelineStatisticshaving all bits set that are set in theQueryPoolthe query uses
- Each element of pCommandBuffersmust not begin any query types that are active incommandBuffer
- If commandBufferis a protected command buffer, then each element ofpCommandBuffersmust be a protected command buffer
- If commandBufferis an unprotected command buffer, then each element ofpCommandBuffersmust be an unprotected command buffer
- This command must not be recorded when transform feedback is active
Valid Usage (Implicit)
- commandBuffermust be a valid- CommandBufferhandle
- pCommandBuffersmust be a valid pointer to an array of- commandBufferCountvalid- CommandBufferhandles
- commandBuffermust be in the recording state
- The CommandPoolthatcommandBufferwas allocated from must support transfer, graphics, or compute operations
- commandBuffermust be a primary- CommandBuffer
- commandBufferCountmust be greater than- 0
- Both of commandBuffer, and the elements ofpCommandBuffersmust have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to commandBuffermust be externally synchronized
- Host access to the CommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type | 
|---|---|---|---|
| Primary | Both | Transfer Graphics Compute | 
See Also
VkClearRect - Structure specifying a clear rectangle
Description
The layers [baseArrayLayer, baseArrayLayer + layerCount) counting
 from the base layer of the attachment image view are cleared.
See Also
Constructors
| ClearRect | |
| Fields 
 | |
Instances
| Show ClearRect Source # | |
| Generic ClearRect Source # | |
| FromCStruct ClearRect Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding | |
| ToCStruct ClearRect Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding | |
| Zero ClearRect Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding | |
| type Rep ClearRect Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding type Rep ClearRect = D1 ('MetaData "ClearRect" "Vulkan.Core10.CommandBufferBuilding" "vulkan-3.6-inplace" 'False) (C1 ('MetaCons "ClearRect" 'PrefixI 'True) (S1 ('MetaSel ('Just "rect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Rect2D) :*: (S1 ('MetaSel ('Just "baseArrayLayer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "layerCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32)))) | |
data ImageSubresourceLayers Source #
VkImageSubresourceLayers - Structure specifying an image subresource layers
Valid Usage
- If aspectMaskcontainsIMAGE_ASPECT_COLOR_BIT, it must not contain either ofIMAGE_ASPECT_DEPTH_BITorIMAGE_ASPECT_STENCIL_BIT
- aspectMaskmust not contain- IMAGE_ASPECT_METADATA_BIT
- aspectMaskmust not include- VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXTfor any index- i
- layerCountmust be greater than 0
Valid Usage (Implicit)
- aspectMaskmust be a valid combination of- ImageAspectFlagBitsvalues
- aspectMaskmust not be- 0
See Also
BufferImageCopy,
 ImageAspectFlags, ImageBlit,
 ImageCopy, ImageResolve
Constructors
| ImageSubresourceLayers | |
| Fields 
 | |
Instances
data BufferCopy Source #
VkBufferCopy - Structure specifying a buffer copy operation
Valid Usage
- The sizemust be greater than0
See Also
Constructors
| BufferCopy | |
| Fields 
 | |
Instances
VkImageCopy - Structure specifying an image copy operation
Description
For IMAGE_TYPE_3D images, copies are
 performed slice by slice starting with the z member of the srcOffset
 or dstOffset, and copying depth slices. For images with multiple
 layers, copies are performed layer by layer starting with the
 baseArrayLayer member of the srcSubresource or dstSubresource and
 copying layerCount layers. Image data can be copied between images
 with different image types. If one image is
 IMAGE_TYPE_3D and the other image is
 IMAGE_TYPE_2D with multiple layers, then
 each slice is copied to or from a different layer.
Copies involving a
 multi-planar image format
 specify the region to be copied in terms of the plane to be copied,
 not the coordinates of the multi-planar image. This means that copies
 accessing the R/B planes of “_422” format images must fit the
 copied region within half the width of the parent image, and that
 copies accessing the R/B planes of “_420” format images must fit
 the copied region within half the width and height of the parent
 image.
Valid Usage
- If neither the calling command’s srcImagenor the calling command’sdstImagehas a multi-planar image format then theaspectMaskmember ofsrcSubresourceanddstSubresourcemust match
- If the calling command’s srcImagehas aFormatwith two planes then thesrcSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BITorIMAGE_ASPECT_PLANE_1_BIT
- If the calling command’s srcImagehas aFormatwith three planes then thesrcSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT
- If the calling command’s dstImagehas aFormatwith two planes then thedstSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BITorIMAGE_ASPECT_PLANE_1_BIT
- If the calling command’s dstImagehas aFormatwith three planes then thedstSubresourceaspectMaskmust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT
- If the calling command’s srcImagehas a multi-planar image format and thedstImagedoes not have a multi-planar image format, thedstSubresourceaspectMaskmust beIMAGE_ASPECT_COLOR_BIT
- If the calling command’s dstImagehas a multi-planar image format and thesrcImagedoes not have a multi-planar image format, thesrcSubresourceaspectMaskmust beIMAGE_ASPECT_COLOR_BIT
- The number of slices of the extent(for 3D) or layers of thesrcSubresource(for non-3D) must match the number of slices of theextent(for 3D) or layers of thedstSubresource(for non-3D)
- If either of the calling command’s srcImageordstImageparameters are ofImageTypeIMAGE_TYPE_3D, thebaseArrayLayerandlayerCountmembers of the corresponding subresource must be0and1, respectively
- The aspectMaskmember ofsrcSubresourcemust specify aspects present in the calling command’ssrcImage
- The aspectMaskmember ofdstSubresourcemust specify aspects present in the calling command’sdstImage
- srcOffset.xand (- extent.width+- srcOffset.x) must both be greater than or equal to- 0and less than or equal to the source image subresource width
- srcOffset.yand (- extent.height+- srcOffset.y) must both be greater than or equal to- 0and less than or equal to the source image subresource height
- If the calling command’s srcImageis of typeIMAGE_TYPE_1D, thensrcOffset.ymust be0andextent.heightmust be1
- srcOffset.zand (- extent.depth+- srcOffset.z) must both be greater than or equal to- 0and less than or equal to the source image subresource depth
- If the calling command’s srcImageis of typeIMAGE_TYPE_1D, thensrcOffset.zmust be0andextent.depthmust be1
- If the calling command’s dstImageis of typeIMAGE_TYPE_1D, thendstOffset.zmust be0andextent.depthmust be1
- If the calling command’s srcImageis of typeIMAGE_TYPE_2D, thensrcOffset.zmust be0
- If the calling command’s dstImageis of typeIMAGE_TYPE_2D, thendstOffset.zmust be0
- If both srcImageanddstImageare of typeIMAGE_TYPE_2Dthenextent.depthmust be1
- If the calling command’s srcImageis of typeIMAGE_TYPE_2D, and thedstImageis of typeIMAGE_TYPE_3D, thenextent.depthmust equal to thelayerCountmember ofsrcSubresource
- If the calling command’s dstImageis of typeIMAGE_TYPE_2D, and thesrcImageis of typeIMAGE_TYPE_3D, thenextent.depthmust equal to thelayerCountmember ofdstSubresource
- dstOffset.xand (- extent.width+- dstOffset.x) must both be greater than or equal to- 0and less than or equal to the destination image subresource width
- dstOffset.yand (- extent.height+- dstOffset.y) must both be greater than or equal to- 0and less than or equal to the destination image subresource height
- If the calling command’s dstImageis of typeIMAGE_TYPE_1D, thendstOffset.ymust be0andextent.heightmust be1
- dstOffset.zand (- extent.depth+- dstOffset.z) must both be greater than or equal to- 0and less than or equal to the destination image subresource depth
- If the calling command’s srcImageis a compressed image, or a single-plane, “_422” image format, all members ofsrcOffsetmust be a multiple of the corresponding dimensions of the compressed texel block
- If the calling command’s srcImageis a compressed image, or a single-plane, “_422” image format,extent.widthmust be a multiple of the compressed texel block width or (extent.width+srcOffset.x) must equal the source image subresource width
- If the calling command’s srcImageis a compressed image, or a single-plane, “_422” image format,extent.heightmust be a multiple of the compressed texel block height or (extent.height+srcOffset.y) must equal the source image subresource height
- If the calling command’s srcImageis a compressed image, or a single-plane, “_422” image format,extent.depthmust be a multiple of the compressed texel block depth or (extent.depth+srcOffset.z) must equal the source image subresource depth
- If the calling command’s dstImageis a compressed format image, or a single-plane, “_422” image format, all members ofdstOffsetmust be a multiple of the corresponding dimensions of the compressed texel block
- If the calling command’s dstImageis a compressed format image, or a single-plane, “_422” image format,extent.widthmust be a multiple of the compressed texel block width or (extent.width+dstOffset.x) must equal the destination image subresource width
- If the calling command’s dstImageis a compressed format image, or a single-plane, “_422” image format,extent.heightmust be a multiple of the compressed texel block height or (extent.height+dstOffset.y) must equal the destination image subresource height
- If the calling command’s dstImageis a compressed format image, or a single-plane, “_422” image format,extent.depthmust be a multiple of the compressed texel block depth or (extent.depth+dstOffset.z) must equal the destination image subresource depth
Valid Usage (Implicit)
- srcSubresourcemust be a valid- ImageSubresourceLayersstructure
- dstSubresourcemust be a valid- ImageSubresourceLayersstructure
See Also
Constructors
| ImageCopy | |
| Fields 
 | |
Instances
VkImageBlit - Structure specifying an image blit operation
Description
For each element of the pRegions array, a blit operation is performed
 the specified source and destination regions.
Valid Usage
- The aspectMaskmember ofsrcSubresourceanddstSubresourcemust match
- The layerCountmember ofsrcSubresourceanddstSubresourcemust match
- If either of the calling command’s srcImageordstImageparameters are ofImageTypeIMAGE_TYPE_3D, thebaseArrayLayerandlayerCountmembers of bothsrcSubresourceanddstSubresourcemust be0and1, respectively
- The aspectMaskmember ofsrcSubresourcemust specify aspects present in the calling command’ssrcImage
- The aspectMaskmember ofdstSubresourcemust specify aspects present in the calling command’sdstImage
- srcOffset[0].x and- srcOffset[1].x must both be greater than or equal to- 0and less than or equal to the source image subresource width
- srcOffset[0].y and- srcOffset[1].y must both be greater than or equal to- 0and less than or equal to the source image subresource height
- If the calling command’s srcImageis of typeIMAGE_TYPE_1D, thensrcOffset[0].y must be0andsrcOffset[1].y must be1
- srcOffset[0].z and- srcOffset[1].z must both be greater than or equal to- 0and less than or equal to the source image subresource depth
- If the calling command’s srcImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, thensrcOffset[0].z must be0andsrcOffset[1].z must be1
- dstOffset[0].x and- dstOffset[1].x must both be greater than or equal to- 0and less than or equal to the destination image subresource width
- dstOffset[0].y and- dstOffset[1].y must both be greater than or equal to- 0and less than or equal to the destination image subresource height
- If the calling command’s dstImageis of typeIMAGE_TYPE_1D, thendstOffset[0].y must be0anddstOffset[1].y must be1
- dstOffset[0].z and- dstOffset[1].z must both be greater than or equal to- 0and less than or equal to the destination image subresource depth
- If the calling command’s dstImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, thendstOffset[0].z must be0anddstOffset[1].z must be1
Valid Usage (Implicit)
- srcSubresourcemust be a valid- ImageSubresourceLayersstructure
- dstSubresourcemust be a valid- ImageSubresourceLayersstructure
See Also
Constructors
| ImageBlit | |
| Fields 
 | |
Instances
data BufferImageCopy Source #
VkBufferImageCopy - Structure specifying a buffer image copy operation
Description
When copying to or from a depth or stencil aspect, the data in buffer memory uses a layout that is a (mostly) tightly packed representation of the depth or stencil data. Specifically:
- data copied to or from the stencil aspect of any depth/stencil
     format is tightly packed with one
     FORMAT_S8_UINTvalue per texel.
- data copied to or from the depth aspect of a
     FORMAT_D16_UNORMorFORMAT_D16_UNORM_S8_UINTformat is tightly packed with oneFORMAT_D16_UNORMvalue per texel.
- data copied to or from the depth aspect of a
     FORMAT_D32_SFLOATorFORMAT_D32_SFLOAT_S8_UINTformat is tightly packed with oneFORMAT_D32_SFLOATvalue per texel.
- data copied to or from the depth aspect of a
     FORMAT_X8_D24_UNORM_PACK32orFORMAT_D24_UNORM_S8_UINTformat is packed with one 32-bit word per texel with the D24 value in the LSBs of the word, and undefined values in the eight MSBs.
Note
To copy both the depth and stencil aspects of a depth/stencil format,
 two entries in pRegions can be used, where one specifies the depth
 aspect in imageSubresource, and the other specifies the stencil
 aspect.
Because depth or stencil aspect buffer to image copies may require format conversions on some implementations, they are not supported on queues that do not support graphics.
When copying to a depth aspect, and the
 VK_EXT_depth_range_unrestricted extension is not enabled, the data in
 buffer memory must be in the range [0,1], or the resulting values are
 undefined.
Copies are done layer by layer starting with image layer
 baseArrayLayer member of imageSubresource. layerCount layers are
 copied from the source image or to the destination image.
Valid Usage
- If the calling command’s Imageparameter’s format is not a depth/stencil format or a multi-planar format, thenbufferOffsetmust be a multiple of the format’s texel block size
- If the calling command’s Imageparameter’s format is a multi-planar format, thenbufferOffsetmust be a multiple of the element size of the compatible format for the format and theaspectMaskof theimageSubresourceas defined in ???
- bufferRowLengthmust be- 0, or greater than or equal to the- widthmember of- imageExtent
- bufferImageHeightmust be- 0, or greater than or equal to the- heightmember of- imageExtent
- imageOffset.xand (- imageExtent.width+- imageOffset.x) must both be greater than or equal to- 0and less than or equal to the image subresource width where this refers to the width of the plane of the image involved in the copy in the case of a multi-planar format
- imageOffset.yand (imageExtent.height +- imageOffset.y) must both be greater than or equal to- 0and less than or equal to the image subresource height where this refers to the height of the plane of the image involved in the copy in the case of a multi-planar format
- If the calling command’s srcImage(cmdCopyImageToBuffer) ordstImage(cmdCopyBufferToImage) is of typeIMAGE_TYPE_1D, thenimageOffset.ymust be0andimageExtent.heightmust be1
- imageOffset.zand (imageExtent.depth +- imageOffset.z) must both be greater than or equal to- 0and less than or equal to the image subresource depth
- If the calling command’s srcImage(cmdCopyImageToBuffer) ordstImage(cmdCopyBufferToImage) is of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, thenimageOffset.zmust be0andimageExtent.depthmust be1
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format,bufferRowLengthmust be a multiple of the compressed texel block width
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format,bufferImageHeightmust be a multiple of the compressed texel block height
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format, all members ofimageOffsetmust be a multiple of the corresponding dimensions of the compressed texel block
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format,bufferOffsetmust be a multiple of the compressed texel block size in bytes
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format,imageExtent.widthmust be a multiple of the compressed texel block width or (imageExtent.width+imageOffset.x) must equal the image subresource width
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format,imageExtent.heightmust be a multiple of the compressed texel block height or (imageExtent.height+imageOffset.y) must equal the image subresource height
- If the calling command’s Imageparameter is a compressed image, or a single-plane, “_422” image format,imageExtent.depthmust be a multiple of the compressed texel block depth or (imageExtent.depth+imageOffset.z) must equal the image subresource depth
- The aspectMaskmember ofimageSubresourcemust specify aspects present in the calling command’sImageparameter
- If the calling command’s Imageparameter’s format is a multi-planar format, then theaspectMaskmember ofimageSubresourcemust beIMAGE_ASPECT_PLANE_0_BIT,IMAGE_ASPECT_PLANE_1_BIT, orIMAGE_ASPECT_PLANE_2_BIT(withIMAGE_ASPECT_PLANE_2_BITvalid only for image formats with three planes)
- The aspectMaskmember ofimageSubresourcemust only have a single bit set
- If the calling command’s Imageparameter is ofImageTypeIMAGE_TYPE_3D, thebaseArrayLayerandlayerCountmembers ofimageSubresourcemust be0and1, respectively
Valid Usage (Implicit)
- imageSubresourcemust be a valid- ImageSubresourceLayersstructure
See Also
DeviceSize,
 Extent3D, ImageSubresourceLayers,
 Offset3D, cmdCopyBufferToImage,
 cmdCopyImageToBuffer
Constructors
| BufferImageCopy | |
| Fields 
 | |
Instances
data ImageResolve Source #
VkImageResolve - Structure specifying an image resolve operation
Valid Usage
- The aspectMaskmember ofsrcSubresourceanddstSubresourcemust only containIMAGE_ASPECT_COLOR_BIT
- The layerCountmember ofsrcSubresourceanddstSubresourcemust match
- If either of the calling command’s srcImageordstImageparameters are ofImageTypeIMAGE_TYPE_3D, thebaseArrayLayerandlayerCountmembers of bothsrcSubresourceanddstSubresourcemust be0and1, respectively
- srcOffset.xand (- extent.width+- srcOffset.x) must both be greater than or equal to- 0and less than or equal to the source image subresource width
- srcOffset.yand (- extent.height+- srcOffset.y) must both be greater than or equal to- 0and less than or equal to the source image subresource height
- If the calling command’s srcImageis of typeIMAGE_TYPE_1D, thensrcOffset.ymust be0andextent.heightmust be1
- srcOffset.zand (- extent.depth+- srcOffset.z) must both be greater than or equal to- 0and less than or equal to the source image subresource depth
- If the calling command’s srcImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, thensrcOffset.zmust be0andextent.depthmust be1
- dstOffset.xand (- extent.width+- dstOffset.x) must both be greater than or equal to- 0and less than or equal to the destination image subresource width
- dstOffset.yand (- extent.height+- dstOffset.y) must both be greater than or equal to- 0and less than or equal to the destination image subresource height
- If the calling command’s dstImageis of typeIMAGE_TYPE_1D, thendstOffset.ymust be0andextent.heightmust be1
- dstOffset.zand (- extent.depth+- dstOffset.z) must both be greater than or equal to- 0and less than or equal to the destination image subresource depth
- If the calling command’s dstImageis of typeIMAGE_TYPE_1DorIMAGE_TYPE_2D, thendstOffset.zmust be0andextent.depthmust be1
Valid Usage (Implicit)
- srcSubresourcemust be a valid- ImageSubresourceLayersstructure
- dstSubresourcemust be a valid- ImageSubresourceLayersstructure
See Also
Constructors
| ImageResolve | |
| Fields 
 | |
Instances
data RenderPassBeginInfo (es :: [Type]) Source #
VkRenderPassBeginInfo - Structure specifying render pass begin info
Description
renderArea is the render area that is affected by the render pass
 instance. The effects of attachment load, store and multisample resolve
 operations are restricted to the pixels whose x and y coordinates fall
 within the render area on all attachments. The render area extends to
 all layers of framebuffer. The application must ensure (using
 scissor if necessary) that all rendering is contained within the render
 area. The render area, after any transform specified by
 RenderPassTransformBeginInfoQCOM::transform
 is applied, must be contained within the framebuffer dimensions.
If
 render pass transform
 is enabled, then renderArea must equal the framebuffer
 pre-transformed dimensions. After renderArea has been transformed by
 RenderPassTransformBeginInfoQCOM::transform,
 the resulting render area must be equal to the framebuffer dimensions.
When multiview is enabled, the resolve operation at the end of a subpass applies to all views in the view mask.
Note
There may be a performance cost for using a render area smaller than the framebuffer, unless it matches the render area granularity for the render pass.
Valid Usage
- clearValueCountmust be greater than the largest attachment index in- renderPassthat specifies a- loadOp(or- stencilLoadOp, if the attachment has a depth/stencil format) of- ATTACHMENT_LOAD_OP_CLEAR
- renderPassmust be compatible with the- renderPassmember of the- FramebufferCreateInfostructure specified when creating- framebuffer
- If the pNextchain does not containDeviceGroupRenderPassBeginInfoor itsdeviceRenderAreaCountmember is equal to 0,renderArea.offset.xmust be greater than or equal to 0
- If the pNextchain does not containDeviceGroupRenderPassBeginInfoor itsdeviceRenderAreaCountmember is equal to 0,renderArea.offset.ymust be greater than or equal to 0
- If the pNextchain does not containDeviceGroupRenderPassBeginInfoor itsdeviceRenderAreaCountmember is equal to 0,renderArea.offset.x+renderArea.offset.widthmust be less than or equal toFramebufferCreateInfo::widththeframebufferwas created with
- If the pNextchain does not containDeviceGroupRenderPassBeginInfoor itsdeviceRenderAreaCountmember is equal to 0,renderArea.offset.y+renderArea.offset.heightmust be less than or equal toFramebufferCreateInfo::heighttheframebufferwas created with
- If the pNextchain containsDeviceGroupRenderPassBeginInfo, theoffset.xmember of each element ofpDeviceRenderAreasmust be greater than or equal to 0
- If the pNextchain containsDeviceGroupRenderPassBeginInfo, theoffset.ymember of each element ofpDeviceRenderAreasmust be greater than or equal to 0
- If the pNextchain containsDeviceGroupRenderPassBeginInfo,offset.x+offset.widthof each element ofpDeviceRenderAreasmust be less than or equal toFramebufferCreateInfo::widththeframebufferwas created with
- If the pNextchain containsDeviceGroupRenderPassBeginInfo,offset.y+offset.heightof each element ofpDeviceRenderAreasmust be less than or equal toFramebufferCreateInfo::heighttheframebufferwas created with
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that did not includeFRAMEBUFFER_CREATE_IMAGELESS_BIT, and thepNextchain includes aRenderPassAttachmentBeginInfostructure, itsattachmentCountmust be zero
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, theattachmentCountof aRenderPassAttachmentBeginInfostructure included in thepNextchain must be equal to the value ofFramebufferAttachmentsCreateInfo::attachmentImageInfoCountused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must have been created on the sameDeviceasframebufferandrenderPass
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a value ofImageCreateInfo::flagsequal to theflagsmember of the corresponding element ofFramebufferAttachmentsCreateInfoKHR::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a value ofImageCreateInfo::usageequal to theusagemember of the corresponding element ofFramebufferAttachmentsCreateInfo::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewwith a width equal to thewidthmember of the corresponding element ofFramebufferAttachmentsCreateInfo::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewwith a height equal to theheightmember of the corresponding element ofFramebufferAttachmentsCreateInfo::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a value ofImageViewCreateInfo::subresourceRange.layerCountequal to thelayerCountmember of the corresponding element ofFramebufferAttachmentsCreateInfo::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a value ofImageFormatListCreateInfo::viewFormatCountequal to theviewFormatCountmember of the corresponding element ofFramebufferAttachmentsCreateInfo::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a set of elements inImageFormatListCreateInfo::pViewFormatsequal to the set of elements in thepViewFormatsmember of the corresponding element ofFramebufferAttachmentsCreateInfo::pAttachmentsused to createframebuffer
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a value ofImageViewCreateInfo::formatequal to the corresponding value ofAttachmentDescription::formatinrenderPass
- If framebufferwas created with aFramebufferCreateInfo::flagsvalue that includedFRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of thepAttachmentsmember of aRenderPassAttachmentBeginInfostructure included in thepNextchain must be aImageViewof an image created with a value ofImageCreateInfo::samplesequal to the corresponding value ofAttachmentDescription::samplesinrenderPass
- If the pNextchain includesRenderPassTransformBeginInfoQCOM,renderArea::offsetmust equal (0,0)
- If the pNextchain includesRenderPassTransformBeginInfoQCOM,renderArea::extenttransformed byRenderPassTransformBeginInfoQCOM::transformmust equal theframebufferdimensions
Valid Usage (Implicit)
- sTypemust be- STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
- Each pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofDeviceGroupRenderPassBeginInfo,RenderPassAttachmentBeginInfo,RenderPassSampleLocationsBeginInfoEXT, orRenderPassTransformBeginInfoQCOM
- The sTypevalue of each struct in thepNextchain must be unique
- renderPassmust be a valid- RenderPasshandle
- framebuffermust be a valid- Framebufferhandle
- If clearValueCountis not0,pClearValuesmust be a valid pointer to an array ofclearValueCountClearValueunions
- Both of framebuffer, andrenderPassmust have been created, allocated, or retrieved from the sameDevice
See Also
ClearValue, Framebuffer,
 Rect2D,
 RenderPass,
 StructureType, cmdBeginRenderPass,
 cmdBeginRenderPass2,
 cmdBeginRenderPass2KHR
Constructors
| RenderPassBeginInfo | |
| Fields 
 | |
Instances
data ClearDepthStencilValue Source #
VkClearDepthStencilValue - Structure specifying a clear depth stencil value
Valid Usage
- Unless the VK_EXT_depth_range_unrestrictedextension is enableddepthmust be between0.0and1.0, inclusive
See Also
Constructors
| ClearDepthStencilValue | |
| Fields 
 | |
Instances
data ClearAttachment Source #
VkClearAttachment - Structure specifying a clear attachment
Description
No memory barriers are needed between cmdClearAttachments and
 preceding or subsequent draw or attachment clear commands in the same
 subpass.
The cmdClearAttachments command is not affected by the bound pipeline
 state.
Attachments can also be cleared at the beginning of a render pass
 instance by setting loadOp (or stencilLoadOp) of
 AttachmentDescription to
 ATTACHMENT_LOAD_OP_CLEAR, as
 described for createRenderPass.
Valid Usage
- If aspectMaskincludesIMAGE_ASPECT_COLOR_BIT, it must not includeIMAGE_ASPECT_DEPTH_BITorIMAGE_ASPECT_STENCIL_BIT
- aspectMaskmust not include- IMAGE_ASPECT_METADATA_BIT
- aspectMaskmust not include- VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXTfor any index- i
- clearValuemust be a valid- ClearValueunion
Valid Usage (Implicit)
- aspectMaskmust be a valid combination of- ImageAspectFlagBitsvalues
- aspectMaskmust not be- 0
See Also
Constructors
| ClearAttachment | |
| Fields 
 | |
Instances
data ClearColorValue Source #
Constructors
| Float32 (Float, Float, Float, Float) | |
| Int32 (Int32, Int32, Int32, Int32) | |
| Uint32 (Word32, Word32, Word32, Word32) | 
Instances
| Show ClearColorValue Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding Methods showsPrec :: Int -> ClearColorValue -> ShowS # show :: ClearColorValue -> String # showList :: [ClearColorValue] -> ShowS # | |
| ToCStruct ClearColorValue Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding Methods withCStruct :: ClearColorValue -> (Ptr ClearColorValue -> IO b) -> IO b Source # pokeCStruct :: Ptr ClearColorValue -> ClearColorValue -> IO b -> IO b Source # withZeroCStruct :: (Ptr ClearColorValue -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr ClearColorValue -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero ClearColorValue Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding Methods | |
data ClearValue Source #
Constructors
| Color ClearColorValue | |
| DepthStencil ClearDepthStencilValue | 
Instances
| Show ClearValue Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding Methods showsPrec :: Int -> ClearValue -> ShowS # show :: ClearValue -> String # showList :: [ClearValue] -> ShowS # | |
| ToCStruct ClearValue Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding Methods withCStruct :: ClearValue -> (Ptr ClearValue -> IO b) -> IO b Source # pokeCStruct :: Ptr ClearValue -> ClearValue -> IO b -> IO b Source # withZeroCStruct :: (Ptr ClearValue -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr ClearValue -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero ClearValue Source # | |
| Defined in Vulkan.Core10.CommandBufferBuilding Methods zero :: ClearValue Source # | |
VkIndexType - Type of index buffer indices
See Also
AccelerationStructureCreateGeometryTypeInfoKHR,
 AccelerationStructureGeometryTrianglesDataKHR,
 BindIndexBufferIndirectCommandNV,
 GeometryTrianglesNV,
 IndirectCommandsLayoutTokenNV,
 cmdBindIndexBuffer
Bundled Patterns
| pattern INDEX_TYPE_UINT16 :: IndexType | 
 | 
| pattern INDEX_TYPE_UINT32 :: IndexType | 
 | 
| pattern INDEX_TYPE_UINT8_EXT :: IndexType | 
 | 
| pattern INDEX_TYPE_NONE_KHR :: IndexType | 
 | 
Instances
| Eq IndexType Source # | |
| Ord IndexType Source # | |
| Read IndexType Source # | |
| Show IndexType Source # | |
| Storable IndexType Source # | |
| Defined in Vulkan.Core10.Enums.IndexType | |
| Zero IndexType Source # | |
| Defined in Vulkan.Core10.Enums.IndexType | |
newtype SubpassContents Source #
VkSubpassContents - Specify how commands in the first subpass of a render pass are provided
See Also
Constructors
| SubpassContents Int32 | 
Bundled Patterns
| pattern SUBPASS_CONTENTS_INLINE :: SubpassContents | 
 | 
| pattern SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS :: SubpassContents | 
 | 
Instances
newtype StencilFaceFlagBits Source #
VkStencilFaceFlagBits - Bitmask specifying sets of stencil state for which to update the compare mask
See Also
Constructors
| StencilFaceFlagBits Flags | 
Bundled Patterns
| pattern STENCIL_FACE_FRONT_BIT :: StencilFaceFlagBits | 
 | 
| pattern STENCIL_FACE_BACK_BIT :: StencilFaceFlagBits | 
 | 
| pattern STENCIL_FACE_FRONT_AND_BACK :: StencilFaceFlagBits | 
 |