Vulkan API Reference
Vulkan Commands
vkAllocateCommandBuffers(3)
Name
vkAllocateCommandBuffers - Allocate command buffers from an existing command pool
C Specification
To allocate command buffers, call:
VkResult vkAllocateCommandBuffers( VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers);
Parameters
-
device
is the logical device that owns the command pool. -
pAllocateInfo
is a pointer to an instance of theVkCommandBufferAllocateInfo
structure describing parameters of the allocation. -
pCommandBuffers
is a pointer to an array ofVkCommandBuffer
handles in which the resulting command buffer objects are returned. The array must be at least the length specified by thecommandBufferCount
member ofpAllocateInfo
. Each allocated command buffer begins in the initial state.
Description
When command buffers are first allocated, they are in the initial state.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepAllocateInfo
must be a pointer to a validVkCommandBufferAllocateInfo
structurepCommandBuffers
must be a pointer to an array ofpAllocateInfo
::commandBufferCountVkCommandBuffer
handles
Host Synchronization
- Host access to
pAllocateInfo
::commandPool must be externally synchronized
Return Codes
See Also
VkCommandBuffer, VkCommandBufferAllocateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkAllocateCommandBuffers
vkAllocateDescriptorSets(3)
Name
vkAllocateDescriptorSets - Allocate one or more descriptor sets
C Specification
To allocate descriptor sets from a descriptor pool, call:
VkResult vkAllocateDescriptorSets( VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets);
Parameters
-
device
is the logical device that owns the descriptor pool. -
pAllocateInfo
is a pointer to an instance of the VkDescriptorSetAllocateInfo structure describing parameters of the allocation. -
pDescriptorSets
is a pointer to an array ofVkDescriptorSet
handles in which the resulting descriptor set objects are returned. The array must be at least the length specified by thedescriptorSetCount
member ofpAllocateInfo
.
Description
The allocated descriptor sets are returned in pDescriptorSets
.
When a descriptor set is allocated, the initial state is largely uninitialized and all descriptors are undefined. However, the descriptor set can be bound in a command buffer without causing errors or exceptions. All entries that are statically used by a pipeline in a drawing or dispatching command must have been populated before the descriptor set is bound for use by that command. Entries that are not statically used by a pipeline can have uninitialized descriptors or descriptors of resources that have been destroyed, and executing a draw or dispatch with such a descriptor set bound does not cause undefined behavior. This means applications need not populate unused entries with dummy descriptors.
If an allocation fails due to fragmentation, an indeterminate error is returned with an unspecified error code. Any returned error other than VK_ERROR_FRAGMENTED_POOL
does not imply its usual meaning: applications should assume that the allocation failed due to fragmentation, and create a new descriptor pool.
Note
Applications should check for a negative return value when allocating new descriptor sets, assume that any error effectively means
VK_ERROR_FRAGMENTED_POOL
, and try to create a new descriptor pool. IfVK_ERROR_FRAGMENTED_POOL
is the actual return value, it adds certainty to that decision.The reason for this is that
VK_ERROR_FRAGMENTED_POOL
was only added in a later revision of the 1.0 specification, and so drivers may return other errors if they were written against earlier revisions. To ensure full compatibility with earlier patch revisions, these other errors are allowed.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepAllocateInfo
must be a pointer to a validVkDescriptorSetAllocateInfo
structurepDescriptorSets
must be a pointer to an array ofpAllocateInfo
::descriptorSetCountVkDescriptorSet
handles
Host Synchronization
- Host access to
pAllocateInfo
::descriptorPool must be externally synchronized
Return Codes
See Also
VkDescriptorSet, VkDescriptorSetAllocateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkAllocateDescriptorSets
vkAllocateMemory(3)
Name
vkAllocateMemory - Allocate GPU memory
C Specification
To allocate memory objects, call:
VkResult vkAllocateMemory( VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory);
Parameters
-
device
is the logical device that owns the memory. -
pAllocateInfo
is a pointer to an instance of the VkMemoryAllocateInfo structure describing parameters of the allocation. A successful returned allocation must use the requested parameters — no substitution is permitted by the implementation. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pMemory
is a pointer to aVkDeviceMemory
handle in which information about the allocated memory is returned.
Description
Allocations returned by vkAllocateMemory
are guaranteed to meet any alignment requirement by the implementation. For example, if an implementation requires 128 byte alignment for images and 64 byte alignment for buffers, the device memory returned through this mechanism would be 128-byte aligned. This ensures that applications can correctly suballocate objects of different types (with potentially different alignment requirements) in the same memory object.
When memory is allocated, its contents are undefined.
There is an implementation-dependent maximum number of memory allocations which can be simultaneously created on a device. This is specified by the maxMemoryAllocationCount
member of the VkPhysicalDeviceLimits
structure. If maxMemoryAllocationCount
is exceeded, vkAllocateMemory
will return VK_ERROR_TOO_MANY_OBJECTS
.
Note
Some platforms may have a limit on the maximum size of a single allocation. For example, certain systems may fail to create allocations with a size greater than or equal to 4GB. Such a limit is implementation-dependent, and if such a failure occurs then the error
VK_ERROR_OUT_OF_DEVICE_MEMORY
should be returned.
Valid Usage
- The number of currently valid memory objects, allocated from
device
, must be less thanVkPhysicalDeviceLimits
::maxMemoryAllocationCount
Valid Usage (Implicit)
device
must be a validVkDevice
handlepAllocateInfo
must be a pointer to a validVkMemoryAllocateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepMemory
must be a pointer to aVkDeviceMemory
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkDeviceMemory, VkMemoryAllocateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkAllocateMemory
vkBeginCommandBuffer(3)
Name
vkBeginCommandBuffer - Start recording a command buffer
C Specification
To begin recording a command buffer, call:
VkResult vkBeginCommandBuffer( VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo);
Parameters
-
commandBuffer
is the handle of the command buffer which is to be put in the recording state. -
pBeginInfo
is an instance of theVkCommandBufferBeginInfo
structure, which defines additional information about how the command buffer begins recording.
Description
Valid Usage
commandBuffer
must not be in the recording or pending state.- If
commandBuffer
was allocated from a VkCommandPool which did not have theVK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
flag set,commandBuffer
must be in the initial state.- If
commandBuffer
is a secondary command buffer, thepInheritanceInfo
member ofpBeginInfo
must be a validVkCommandBufferInheritanceInfo
structure- If
commandBuffer
is a secondary command buffer and either theocclusionQueryEnable
member of thepInheritanceInfo
member ofpBeginInfo
isVK_FALSE
, or the precise occlusion queries feature is not enabled, thequeryFlags
member of thepInheritanceInfo
memberpBeginInfo
must not containVK_QUERY_CONTROL_PRECISE_BIT
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepBeginInfo
must be a pointer to a validVkCommandBufferBeginInfo
structure
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Return Codes
See Also
VkCommandBuffer, VkCommandBufferBeginInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkBeginCommandBuffer
vkBindBufferMemory(3)
Name
vkBindBufferMemory - Bind device memory to a buffer object
C Specification
To attach memory to a buffer object, call:
VkResult vkBindBufferMemory( VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset);
Parameters
-
device
is the logical device that owns the buffer and memory. -
buffer
is the buffer to be attached to memory. -
memory
is aVkDeviceMemory
object describing the device memory to attach. -
memoryOffset
is the start offset of the region ofmemory
which is to be bound to the buffer. The number of bytes returned in theVkMemoryRequirements
::size
member inmemory
, starting frommemoryOffset
bytes, will be bound to the specified buffer.
Description
Valid Usage
buffer
must not already be backed by a memory objectbuffer
must not have been created with any sparse memory binding flagsmemoryOffset
must be less than the size ofmemory
- If
buffer
was created with theVK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
orVK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
,memoryOffset
must be a multiple ofVkPhysicalDeviceLimits
::minTexelBufferOffsetAlignment
- If
buffer
was created with theVK_BUFFER_USAGE_UNIFORM_BUFFER_BIT
,memoryOffset
must be a multiple ofVkPhysicalDeviceLimits
::minUniformBufferOffsetAlignment
- If
buffer
was created with theVK_BUFFER_USAGE_STORAGE_BUFFER_BIT
,memoryOffset
must be a multiple ofVkPhysicalDeviceLimits
::minStorageBufferOffsetAlignment
memory
must have been allocated using one of the memory types allowed in thememoryTypeBits
member of theVkMemoryRequirements
structure returned from a call tovkGetBufferMemoryRequirements
withbuffer
memoryOffset
must be an integer multiple of thealignment
member of theVkMemoryRequirements
structure returned from a call tovkGetBufferMemoryRequirements
withbuffer
- The
size
member of theVkMemoryRequirements
structure returned from a call tovkGetBufferMemoryRequirements
withbuffer
must be less than or equal to the size ofmemory
minusmemoryOffset
Valid Usage (Implicit)
device
must be a validVkDevice
handlebuffer
must be a validVkBuffer
handlememory
must be a validVkDeviceMemory
handlebuffer
must have been created, allocated, or retrieved fromdevice
memory
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
buffer
must be externally synchronized
Return Codes
See Also
VkBuffer, VkDevice, VkDeviceMemory, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkBindBufferMemory
vkBindImageMemory(3)
Name
vkBindImageMemory - Bind device memory to an image object
C Specification
To attach memory to an image object, call:
VkResult vkBindImageMemory( VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset);
Parameters
-
device
is the logical device that owns the image and memory. -
image
is the image. -
memory
is theVkDeviceMemory
object describing the device memory to attach. -
memoryOffset
is the start offset of the region ofmemory
which is to be bound to the image. The number of bytes returned in theVkMemoryRequirements
::size
member inmemory
, starting frommemoryOffset
bytes, will be bound to the specified image.
Description
Valid Usage
image
must not already be backed by a memory objectimage
must not have been created with any sparse memory binding flagsmemoryOffset
must be less than the size ofmemory
memory
must have been allocated using one of the memory types allowed in thememoryTypeBits
member of theVkMemoryRequirements
structure returned from a call tovkGetImageMemoryRequirements
withimage
memoryOffset
must be an integer multiple of thealignment
member of theVkMemoryRequirements
structure returned from a call tovkGetImageMemoryRequirements
withimage
- The
size
member of theVkMemoryRequirements
structure returned from a call tovkGetImageMemoryRequirements
withimage
must be less than or equal to the size ofmemory
minusmemoryOffset
Valid Usage (Implicit)
device
must be a validVkDevice
handleimage
must be a validVkImage
handlememory
must be a validVkDeviceMemory
handleimage
must have been created, allocated, or retrieved fromdevice
memory
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
image
must be externally synchronized
Return Codes
See Also
VkDevice, VkDeviceMemory, VkDeviceSize
, VkImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkBindImageMemory
vkCmdBeginQuery(3)
Name
vkCmdBeginQuery - Begin a query
C Specification
To begin a query, call:
void vkCmdBeginQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags);
Parameters
-
commandBuffer
is the command buffer into which this command will be recorded. -
queryPool
is the query pool that will manage the results of the query. -
query
is the query index within the query pool that will contain the results. -
flags
is a bitmask of VkQueryControlFlagBits specifying constraints on the types of queries that can be performed.
Description
If the queryType
of the pool is VK_QUERY_TYPE_OCCLUSION
and flags
contains VK_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.
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
- The query identified by
queryPool
andquery
must currently not be active- The query identified by
queryPool
andquery
must be unavailable- If the precise occlusion queries feature is not enabled, or the
queryType
used to createqueryPool
was notVK_QUERY_TYPE_OCCLUSION
,flags
must not containVK_QUERY_CONTROL_PRECISE_BIT
queryPool
must have been created with aqueryType
that differs from that of any other queries that have been made active, and are currently still active withincommandBuffer
query
must be less than the number of queries inqueryPool
- If the
queryType
used to createqueryPool
wasVK_QUERY_TYPE_OCCLUSION
, theVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- If the
queryType
used to createqueryPool
wasVK_QUERY_TYPE_PIPELINE_STATISTICS
and any of thepipelineStatistics
indicate graphics operations, theVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- If the
queryType
used to createqueryPool
wasVK_QUERY_TYPE_PIPELINE_STATISTICS
and any of thepipelineStatistics
indicate compute operations, theVkCommandPool
thatcommandBuffer
was allocated from must support compute operations
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlequeryPool
must be a validVkQueryPool
handleflags
must be a valid combination of VkQueryControlFlagBits valuescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- Both of
commandBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
compute
See Also
VkCommandBuffer, VkQueryControlFlags, VkQueryPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBeginQuery
vkCmdBeginRenderPass(3)
Name
vkCmdBeginRenderPass - Begin a new render pass
C Specification
To begin a render pass instance, call:
void vkCmdBeginRenderPass( VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents);
Parameters
-
commandBuffer
is the command buffer in which to record the command. -
pRenderPassBegin
is a pointer to a VkRenderPassBeginInfo structure (defined below) which indicates the render pass to begin an instance of, and the framebuffer the instance uses. -
contents
is a VkSubpassContents value specifying how the commands in the first subpass will be provided.
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
initialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
then the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created withVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
set- If any of the
initialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
orVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
then the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created withVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
set- If any of the
initialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
then the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created withVK_IMAGE_USAGE_SAMPLED_BIT
orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
set- If any of the
initialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
then the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created withVK_IMAGE_USAGE_TRANSFER_SRC_BIT
set- If any of the
initialLayout
orfinalLayout
member of theVkAttachmentDescription
structures or thelayout
member of theVkAttachmentReference
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
isVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
then the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
set- If any of the
initialLayout
members of theVkAttachmentDescription
structures specified when creating the render pass specified in therenderPass
member ofpRenderPassBegin
is notVK_IMAGE_LAYOUT_UNDEFINED
, then each suchinitialLayout
must be equal to the current layout of the corresponding attachment image subresource of the framebuffer specified in theframebuffer
member ofpRenderPassBegin
- The
srcStageMask
anddstStageMask
members of any element of thepDependencies
member of VkRenderPassCreateInfo used to createrenderpass
must be supported by the capabilities of the queue family identified by thequeueFamilyIndex
member of the VkCommandPoolCreateInfo used to create the command pool whichcommandBuffer
was allocated from.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepRenderPassBegin
must be a pointer to a validVkRenderPassBeginInfo
structurecontents
must be a valid VkSubpassContents valuecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called outside of a render pass instance
commandBuffer
must be a primaryVkCommandBuffer
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was 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
VkCommandBuffer, VkRenderPassBeginInfo, VkSubpassContents
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBeginRenderPass
vkCmdBindDescriptorSets(3)
Name
vkCmdBindDescriptorSets - Binds descriptor sets to a command buffer
C Specification
To bind one or more descriptor sets to a command buffer, call:
void vkCmdBindDescriptorSets( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
Parameters
-
commandBuffer
is the command buffer that the descriptor sets will be bound to. -
pipelineBindPoint
is a VkPipelineBindPoint indicating whether the descriptors will be used by graphics pipelines or compute pipelines. There is a separate set of bind points for each of graphics and compute, so binding one does not disturb the other. -
layout
is aVkPipelineLayout
object used to program the bindings. -
firstSet
is the set number of the first descriptor set to be bound. -
descriptorSetCount
is the number of elements in thepDescriptorSets
array. -
pDescriptorSets
is an array of handles toVkDescriptorSet
objects describing the descriptor sets to write to. -
dynamicOffsetCount
is the number of dynamic offsets in thepDynamicOffsets
array. -
pDynamicOffsets
is a pointer to an array ofuint32_t
values specifying dynamic offsets.
Description
vkCmdBindDescriptorSets
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 length 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 vkCmdBindDescriptorSets
may be consumed during host execution of the command, or during shader execution of the resulting draws, or any time in between. Thus, the contents must not be altered (overwritten by an update command, or freed) between when the command is recorded and when the command completes executing on the queue. The contents of pDynamicOffsets
are consumed immediately during execution of vkCmdBindDescriptorSets
. Once all pending uses have completed, it is legal to update and reuse a descriptor set.
Valid Usage
- Any given element of
pDescriptorSets
must have been allocated with aVkDescriptorSetLayout
that matches (is the same as, or identically defined as) theVkDescriptorSetLayout
at set n inlayout
, where n is the sum offirstSet
and the index intopDescriptorSets
dynamicOffsetCount
must be equal to the total number of dynamic descriptors inpDescriptorSets
- The sum of
firstSet
anddescriptorSetCount
must be less than or equal toVkPipelineLayoutCreateInfo
::setLayoutCount
provided whenlayout
was createdpipelineBindPoint
must be supported by thecommandBuffer
’s parentVkCommandPool
’s queue family- Any given element of
pDynamicOffsets
must satisfy the required alignment for the corresponding descriptor binding’s descriptor type
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepipelineBindPoint
must be a valid VkPipelineBindPoint valuelayout
must be a validVkPipelineLayout
handlepDescriptorSets
must be a pointer to an array ofdescriptorSetCount
validVkDescriptorSet
handles- If
dynamicOffsetCount
is not0
,pDynamicOffsets
must be a pointer to an array ofdynamicOffsetCount
uint32_t
valuescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operationsdescriptorSetCount
must be greater than0
- Each of
commandBuffer
,layout
, and the elements ofpDescriptorSets
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
compute
See Also
VkCommandBuffer, VkDescriptorSet, VkPipelineBindPoint, VkPipelineLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBindDescriptorSets
vkCmdBindIndexBuffer(3)
Name
vkCmdBindIndexBuffer - Bind an index buffer to a command buffer
C Specification
To bind an index buffer to a command buffer, call:
void vkCmdBindIndexBuffer( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer being bound. -
offset
is the starting offset in bytes withinbuffer
used in index buffer address calculations. -
indexType
is a VkIndexType value specifying whether indices are treated as 16 bits or 32 bits.
Description
Valid Usage
offset
must be less than the size ofbuffer
- The sum of
offset
and the address of the range ofVkDeviceMemory
object that is backingbuffer
, must be a multiple of the type indicated byindexType
buffer
must have been created with theVK_BUFFER_USAGE_INDEX_BUFFER_BIT
flag- If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlebuffer
must be a validVkBuffer
handleindexType
must be a valid VkIndexType valuecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- Both of
buffer
, andcommandBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
, VkIndexType
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBindIndexBuffer
vkCmdBindPipeline(3)
Name
vkCmdBindPipeline - Bind a pipeline object to a command buffer
C Specification
Once a pipeline has been created, it can be bound to the command buffer using the command:
void vkCmdBindPipeline( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
Parameters
-
commandBuffer
is the command buffer that the pipeline will be bound to. -
pipelineBindPoint
is a VkPipelineBindPoint value specifying whether to bind to the compute or graphics bind point. Binding one does not disturb the other. -
pipeline
is the pipeline to be bound.
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 VK_PIPELINE_BIND_POINT_COMPUTE
controls the behavior of vkCmdDispatch and vkCmdDispatchIndirect. The pipeline bound to VK_PIPELINE_BIND_POINT_GRAPHICS
controls the behavior of vkCmdDraw, vkCmdDrawIndexed, vkCmdDrawIndirect, and vkCmdDrawIndexedIndirect. No other commands are affected by the pipeline state.
Valid Usage
- If
pipelineBindPoint
isVK_PIPELINE_BIND_POINT_COMPUTE
, theVkCommandPool
thatcommandBuffer
was allocated from must support compute operations- If
pipelineBindPoint
isVK_PIPELINE_BIND_POINT_GRAPHICS
, theVkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- If
pipelineBindPoint
isVK_PIPELINE_BIND_POINT_COMPUTE
,pipeline
must be a compute pipeline- If
pipelineBindPoint
isVK_PIPELINE_BIND_POINT_GRAPHICS
,pipeline
must be a graphics pipeline- If the variable multisample rate feature is not supported,
pipeline
is a graphics pipeline, the current subpass has 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
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepipelineBindPoint
must be a valid VkPipelineBindPoint valuepipeline
must be a validVkPipeline
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- Both of
commandBuffer
, andpipeline
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
compute
See Also
VkCommandBuffer, VkPipeline, VkPipelineBindPoint
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBindPipeline
vkCmdBindVertexBuffers(3)
Name
vkCmdBindVertexBuffers - Bind vertex buffers to a command buffer
C Specification
To bind vertex buffers to a command buffer for use in subsequent draw commands, call:
void vkCmdBindVertexBuffers( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
firstBinding
is the index of the first vertex input binding whose state is updated by the command. -
bindingCount
is the number of vertex input bindings whose state is updated by the command. -
pBuffers
is a pointer to an array of buffer handles. -
pOffsets
is a pointer to an array of buffer offsets.
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.
Valid Usage
firstBinding
must be less thanVkPhysicalDeviceLimits
::maxVertexInputBindings
- The sum of
firstBinding
andbindingCount
must be less than or equal toVkPhysicalDeviceLimits
::maxVertexInputBindings
- All elements of
pOffsets
must be less than the size of the corresponding element inpBuffers
- All elements of
pBuffers
must have been created with theVK_BUFFER_USAGE_VERTEX_BUFFER_BIT
flag- Each element of
pBuffers
that is non-sparse must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepBuffers
must be a pointer to an array ofbindingCount
validVkBuffer
handlespOffsets
must be a pointer to an array ofbindingCount
VkDeviceSize
valuescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operationsbindingCount
must be greater than0
- Both of
commandBuffer
, and the elements ofpBuffers
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBindVertexBuffers
vkCmdBlitImage(3)
Name
vkCmdBlitImage - Copy regions of an image, potentially performing format conversion,
C Specification
To copy regions of a source image into a destination image, potentially performing format conversion, arbitrary scaling, and filtering, call:
void vkCmdBlitImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
srcImage
is the source image. -
srcImageLayout
is the layout of the source image subresources for the blit. -
dstImage
is the destination image. -
dstImageLayout
is the layout of the destination image subresources for the blit. -
regionCount
is the number of regions to blit. -
pRegions
is a pointer to an array of VkImageBlit structures specifying the regions to blit. -
filter
is a VkFilter specifying the filter to apply if the blits require scaling.
Description
vkCmdBlitImage
must not be used for multisampled source or destination images. Use vkCmdResolveImage 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 -
baseArrayCount
dst
-
The scale is determined from the source and destination regions, and applied to the offset coordinates:
- scale_u = (xsrc1 - xsrc0) / (xdst1 - xdst0)
- scale_v = (ysrc1 - ysrc0) / (ydst1 - ydst0)
- scale_w = (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 +
baseArrayCount
src
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 VK_SAMPLER_MIPMAP_MODE_NEAREST
and an address mode of VK_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 VK_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 VK_FILTER_NEAREST
then value sampled from the source image is taken from the single nearest slice (with undefined 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
- The source region specified by a given element of
pRegions
must be a region that is contained withinsrcImage
- The destination region specified by a given element of
pRegions
must 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 operationsrcImage
must use a format that supportsVK_FORMAT_FEATURE_BLIT_SRC_BIT
, which is indicated byVkFormatProperties
::linearTilingFeatures
(for linearly tiled images) orVkFormatProperties
::optimalTilingFeatures
(for optimally tiled images) - as returned byvkGetPhysicalDeviceFormatProperties
srcImage
must have been created withVK_IMAGE_USAGE_TRANSFER_SRC_BIT
usage flag- If
srcImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectsrcImageLayout
must specify the layout of the image subresources ofsrcImage
specified inpRegions
at the time this command is executed on aVkDevice
srcImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
dstImage
must use a format that supportsVK_FORMAT_FEATURE_BLIT_DST_BIT
, which is indicated byVkFormatProperties
::linearTilingFeatures
(for linearly tiled images) orVkFormatProperties
::optimalTilingFeatures
(for optimally tiled images) - as returned byvkGetPhysicalDeviceFormatProperties
dstImage
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
usage flag- If
dstImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstImageLayout
must specify the layout of the image subresources ofdstImage
specified inpRegions
at the time this command is executed on aVkDevice
dstImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
- The sample count of
srcImage
anddstImage
must both be equal toVK_SAMPLE_COUNT_1_BIT
- If either of
srcImage
ordstImage
was created with a signed integer VkFormat, the other must also have been created with a signed integer VkFormat- If either of
srcImage
ordstImage
was created with an unsigned integer VkFormat, the other must also have been created with an unsigned integer VkFormat- If either of
srcImage
ordstImage
was created with a depth/stencil format, the other must have exactly the same format- If
srcImage
was created with a depth/stencil format,filter
must beVK_FILTER_NEAREST
srcImage
must have been created with asamples
value ofVK_SAMPLE_COUNT_1_BIT
dstImage
must have been created with asamples
value ofVK_SAMPLE_COUNT_1_BIT
- If
filter
isVK_FILTER_LINEAR
,srcImage
must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcImage
must be a validVkImage
handlesrcImageLayout
must be a valid VkImageLayout valuedstImage
must be a validVkImage
handledstImageLayout
must be a valid VkImageLayout valuepRegions
must be a pointer to an array ofregionCount
validVkImageBlit
structuresfilter
must be a valid VkFilter valuecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called outside of a render pass instance
regionCount
must be greater than0
- Each of
commandBuffer
,dstImage
, andsrcImage
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
Transfer
See Also
VkCommandBuffer, VkFilter, VkImage, VkImageBlit, VkImageLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdBlitImage
vkCmdClearAttachments(3)
Name
vkCmdClearAttachments - Clear regions within currently bound framebuffer attachments
C Specification
To clear one or more regions of color and depth/stencil attachments inside a render pass instance, call:
void vkCmdClearAttachments( VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
attachmentCount
is the number of entries in thepAttachments
array. -
pAttachments
is a pointer to an array of VkClearAttachment structures defining the attachments to clear and the clear values to use. -
rectCount
is the number of entries in thepRects
array. -
pRects
points to an array of VkClearRect structures defining regions within each selected attachment to clear.
Description
vkCmdClearAttachments
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.
Valid Usage
- If the
aspectMask
member of any given element ofpAttachments
containsVK_IMAGE_ASPECT_COLOR_BIT
, thecolorAttachment
member of those elements must refer to a valid color attachment in the current subpass- The rectangular region specified by a given element of
pRects
must be contained within the render area of the current render pass instance- The layers specified by a given element of
pRects
must be contained within every attachment thatpAttachments
refers to
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepAttachments
must be a pointer to an array ofattachmentCount
validVkClearAttachment
structurespRects
must be a pointer to an array ofrectCount
VkClearRect
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
attachmentCount
must be greater than0
rectCount
must be greater than0
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryInside
Graphics
Graphics
See Also
VkClearAttachment, VkClearRect, VkCommandBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdClearAttachments
vkCmdClearColorImage(3)
Name
vkCmdClearColorImage - Clear regions of a color image
C Specification
To clear one or more subranges of a color image, call:
void vkCmdClearColorImage( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
image
is the image to be cleared. -
imageLayout
specifies the current layout of the image subresource ranges to be cleared, and must beVK_IMAGE_LAYOUT_GENERAL
orVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
. -
pColor
is a pointer to a VkClearColorValue structure that contains the values the image subresource ranges will be cleared to (see html/vkspec.html#clears-values below). -
rangeCount
is the number of image subresource range structures inpRanges
. -
pRanges
points to an array of VkImageSubresourceRange structures that describe a range of mipmap levels, array layers, and aspects to be cleared, as described in Image Views. TheaspectMask
of all image subresource ranges must only includeVK_IMAGE_ASPECT_COLOR_BIT
.
Description
Each specified range in pRanges
is cleared to the value specified by pColor
.
Valid Usage
image
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
usage flag- If
image
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectimageLayout
must specify the layout of the image subresource ranges ofimage
specified inpRanges
at the time this command is executed on aVkDevice
imageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
- The VkImageSubresourceRange::
baseMipLevel
members of the elements of thepRanges
array must each be less than themipLevels
specified in VkImageCreateInfo whenimage
was created- If the VkImageSubresourceRange::
levelCount
member of any element of thepRanges
array is notVK_REMAINING_MIP_LEVELS
, it must be non-zero and VkImageSubresourceRange::baseMipLevel
+ VkImageSubresourceRange::levelCount
for that element of thepRanges
array must be less than or equal to themipLevels
specified in VkImageCreateInfo whenimage
was created- The VkImageSubresourceRange::
baseArrayLayer
members of the elements of thepRanges
array must each be less than thearrayLayers
specified in VkImageCreateInfo whenimage
was created- If the VkImageSubresourceRange::
layerCount
member of any element of thepRanges
array is notVK_REMAINING_ARRAY_LAYERS
, it must be non-zero and VkImageSubresourceRange::baseArrayLayer
+ VkImageSubresourceRange::layerCount
for that element of thepRanges
array must be less than or equal to thearrayLayers
specified in VkImageCreateInfo whenimage
was createdimage
must not have a compressed or depth/stencil format
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handleimage
must be a validVkImage
handleimageLayout
must be a valid VkImageLayout valuepColor
must be a pointer to a validVkClearColorValue
unionpRanges
must be a pointer to an array ofrangeCount
validVkImageSubresourceRange
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- This command must only be called outside of a render pass instance
rangeCount
must be greater than0
- Both of
commandBuffer
, andimage
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
computeTransfer
See Also
VkClearColorValue, VkCommandBuffer, VkImage, VkImageLayout, VkImageSubresourceRange
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdClearColorImage
vkCmdClearDepthStencilImage(3)
Name
vkCmdClearDepthStencilImage - Fill regions of a combined depth/stencil image
C Specification
To clear one or more subranges of a depth/stencil image, call:
void vkCmdClearDepthStencilImage( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
image
is the image to be cleared. -
imageLayout
specifies the current layout of the image subresource ranges to be cleared, and must beVK_IMAGE_LAYOUT_GENERAL
orVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
. -
pDepthStencil
is a pointer to a VkClearDepthStencilValue structure that contains the values the depth and stencil image subresource ranges will be cleared to (see html/vkspec.html#clears-values below). -
rangeCount
is the number of image subresource range structures inpRanges
. -
pRanges
points to an array of VkImageSubresourceRange structures that describe a range of mipmap levels, array layers, and aspects to be cleared, as described in Image Views. TheaspectMask
of each image subresource range inpRanges
can includeVK_IMAGE_ASPECT_DEPTH_BIT
if the image format has a depth component, andVK_IMAGE_ASPECT_STENCIL_BIT
if the image format has a stencil component.pDepthStencil
is a pointer to aVkClearDepthStencilValue
structure that contains the values the image subresource ranges will be cleared to (see html/vkspec.html#clears-values below).
Description
Valid Usage
image
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
usage flag- If
image
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectimageLayout
must specify the layout of the image subresource ranges ofimage
specified inpRanges
at the time this command is executed on aVkDevice
imageLayout
must be either ofVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
- The VkImageSubresourceRange::
baseMipLevel
members of the elements of thepRanges
array must each be less than themipLevels
specified in VkImageCreateInfo whenimage
was created- If the VkImageSubresourceRange::
levelCount
member of any element of thepRanges
array is notVK_REMAINING_MIP_LEVELS
, it must be non-zero and VkImageSubresourceRange::baseMipLevel
+ VkImageSubresourceRange::levelCount
for that element of thepRanges
array must be less than or equal to themipLevels
specified in VkImageCreateInfo whenimage
was created- The VkImageSubresourceRange::
baseArrayLayer
members of the elements of thepRanges
array must each be less than thearrayLayers
specified in VkImageCreateInfo whenimage
was created- If the VkImageSubresourceRange::
layerCount
member of any element of thepRanges
array is notVK_REMAINING_ARRAY_LAYERS
, it must be non-zero and VkImageSubresourceRange::baseArrayLayer
+ VkImageSubresourceRange::layerCount
for that element of thepRanges
array must be less than or equal to thearrayLayers
specified in VkImageCreateInfo whenimage
was createdimage
must have a depth/stencil format
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handleimage
must be a validVkImage
handleimageLayout
must be a valid VkImageLayout valuepDepthStencil
must be a pointer to a validVkClearDepthStencilValue
structurepRanges
must be a pointer to an array ofrangeCount
validVkImageSubresourceRange
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called outside of a render pass instance
rangeCount
must be greater than0
- Both of
commandBuffer
, andimage
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
Transfer
See Also
VkClearDepthStencilValue, VkCommandBuffer, VkImage, VkImageLayout, VkImageSubresourceRange
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdClearDepthStencilImage
vkCmdCopyBuffer(3)
Name
vkCmdCopyBuffer - Copy data between buffer regions
C Specification
To copy data between buffer objects, call:
void vkCmdCopyBuffer( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
srcBuffer
is the source buffer. -
dstBuffer
is the destination buffer. -
regionCount
is the number of regions to copy. -
pRegions
is a pointer to an array of VkBufferCopy structures specifying the regions to copy.
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 result is undefined if the copy regions overlap in memory.
Valid Usage
- The
size
member of a given element ofpRegions
must be greater than0
- The
srcOffset
member of a given element ofpRegions
must be less than the size ofsrcBuffer
- The
dstOffset
member of a given element ofpRegions
must be less than the size ofdstBuffer
- The
size
member of a given element ofpRegions
must be less than or equal to the size ofsrcBuffer
minussrcOffset
- The
size
member of a given element ofpRegions
must be less than or equal to the size ofdstBuffer
minusdstOffset
- The union of the source regions, and the union of the destination regions, specified by the elements of
pRegions
, must not overlap in memorysrcBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_SRC_BIT
usage flag- If
srcBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_DST_BIT
usage flag- If
dstBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcBuffer
must be a validVkBuffer
handledstBuffer
must be a validVkBuffer
handlepRegions
must be a pointer to an array ofregionCount
VkBufferCopy
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations- This command must only be called outside of a render pass instance
regionCount
must be greater than0
- Each of
commandBuffer
,dstBuffer
, andsrcBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Transfer
graphics
computeTransfer
See Also
VkBuffer, VkBufferCopy, VkCommandBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdCopyBuffer
vkCmdCopyBufferToImage(3)
Name
vkCmdCopyBufferToImage - Copy data from a buffer into an image
C Specification
To copy data from a buffer object to an image object, call:
void vkCmdCopyBufferToImage( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
srcBuffer
is the source buffer. -
dstImage
is the destination image. -
dstImageLayout
is the layout of the destination image subresources for the copy. -
regionCount
is the number of regions to copy. -
pRegions
is a pointer to an array of VkBufferImageCopy structures specifying the regions to copy.
Description
Each region in pRegions
is copied from the specified region of the source buffer to the specified region of the destination image.
Valid Usage
- The buffer region specified by a given element of
pRegions
must be a region that is contained withinsrcBuffer
- The image region specified by a given element of
pRegions
must be a region that is contained withindstImage
- The union of all source regions, and the union of all destination regions, specified by the elements of
pRegions
, must not overlap in memorysrcBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_SRC_BIT
usage flag- If
srcBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstImage
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
usage flag- If
dstImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstImage
must have a sample count equal toVK_SAMPLE_COUNT_1_BIT
dstImageLayout
must specify the layout of the image subresources ofdstImage
specified inpRegions
at the time this command is executed on aVkDevice
dstImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcBuffer
must be a validVkBuffer
handledstImage
must be a validVkImage
handledstImageLayout
must be a valid VkImageLayout valuepRegions
must be a pointer to an array ofregionCount
validVkBufferImageCopy
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations- This command must only be called outside of a render pass instance
regionCount
must be greater than0
- Each of
commandBuffer
,dstImage
, andsrcBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Transfer
graphics
computeTransfer
See Also
VkBuffer, VkBufferImageCopy, VkCommandBuffer, VkImage, VkImageLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdCopyBufferToImage
vkCmdCopyImage(3)
Name
vkCmdCopyImage - Copy data between images
C Specification
To copy data between image objects, call:
void vkCmdCopyImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
srcImage
is the source image. -
srcImageLayout
is the current layout of the source image subresource. -
dstImage
is the destination image. -
dstImageLayout
is the current layout of the destination image subresource. -
regionCount
is the number of regions to copy. -
pRegions
is a pointer to an array of VkImageCopy structures specifying the regions to copy.
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 considered compatible if their element size is the same between both formats. For example, VK_FORMAT_R8G8B8A8_UNORM
is compatible with VK_FORMAT_R32_UINT
because both texels are 4 bytes in size. Depth/stencil formats must match exactly.
vkCmdCopyImage
allows copying between size-compatible compressed and uncompressed internal formats. Formats are size-compatible if the element size of the uncompressed format is equal to the element size (compressed 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.width
is not a multiple of the compressed texel block width, then (extent.width
+srcOffset.x
) must equal the image subresource width. - If
extent.height
is not a multiple of the compressed texel block height, then (extent.height
+srcOffset.y
) must equal the image subresource height. - If
extent.depth
is 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.width
is not a multiple of the compressed texel block width, then (extent.width
+dstOffset.x
) must equal the image subresource width. - If
extent.height
is not a multiple of the compressed texel block height, then (extent.height
+dstOffset.y
) must equal the image subresource height. - If
extent.depth
is 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.
vkCmdCopyImage
can be used to copy image data between multisample images, but both images must have the same number of samples.
Valid Usage
- The source region specified by a given element of
pRegions
must be a region that is contained withinsrcImage
- The destination region specified by a given element of
pRegions
must be a region that is contained withindstImage
- The union of all source regions, and the union of all destination regions, specified by the elements of
pRegions
, must not overlap in memorysrcImage
must have been created withVK_IMAGE_USAGE_TRANSFER_SRC_BIT
usage flag- If
srcImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectsrcImageLayout
must specify the layout of the image subresources ofsrcImage
specified inpRegions
at the time this command is executed on aVkDevice
srcImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
dstImage
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
usage flag- If
dstImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstImageLayout
must specify the layout of the image subresources ofdstImage
specified inpRegions
at the time this command is executed on aVkDevice
dstImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
- The VkFormat of each of
srcImage
anddstImage
must be compatible, as defined below- The sample count of
srcImage
anddstImage
must match
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcImage
must be a validVkImage
handlesrcImageLayout
must be a valid VkImageLayout valuedstImage
must be a validVkImage
handledstImageLayout
must be a valid VkImageLayout valuepRegions
must be a pointer to an array ofregionCount
validVkImageCopy
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations- This command must only be called outside of a render pass instance
regionCount
must be greater than0
- Each of
commandBuffer
,dstImage
, andsrcImage
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Transfer
graphics
computeTransfer
See Also
VkCommandBuffer, VkImage, VkImageCopy, VkImageLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdCopyImage
vkCmdCopyImageToBuffer(3)
Name
vkCmdCopyImageToBuffer - Copy image data into a buffer
C Specification
To copy data from an image object to a buffer object, call:
void vkCmdCopyImageToBuffer( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
srcImage
is the source image. -
srcImageLayout
is the layout of the source image subresources for the copy. -
dstBuffer
is the destination buffer. -
regionCount
is the number of regions to copy. -
pRegions
is a pointer to an array of VkBufferImageCopy structures specifying the regions to copy.
Description
Each region in pRegions
is copied from the specified region of the source image to the specified region of the destination buffer.
Valid Usage
- The image region specified by a given element of
pRegions
must be a region that is contained withinsrcImage
- The buffer region specified by a given element of
pRegions
must be a region that is contained withindstBuffer
- The union of all source regions, and the union of all destination regions, specified by the elements of
pRegions
, must not overlap in memorysrcImage
must have been created withVK_IMAGE_USAGE_TRANSFER_SRC_BIT
usage flag- If
srcImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectsrcImage
must have a sample count equal toVK_SAMPLE_COUNT_1_BIT
srcImageLayout
must specify the layout of the image subresources ofsrcImage
specified inpRegions
at the time this command is executed on aVkDevice
srcImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
dstBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_DST_BIT
usage flag- If
dstBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcImage
must be a validVkImage
handlesrcImageLayout
must be a valid VkImageLayout valuedstBuffer
must be a validVkBuffer
handlepRegions
must be a pointer to an array ofregionCount
validVkBufferImageCopy
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations- This command must only be called outside of a render pass instance
regionCount
must be greater than0
- Each of
commandBuffer
,dstBuffer
, andsrcImage
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Transfer
graphics
computeTransfer
See Also
VkBuffer, VkBufferImageCopy, VkCommandBuffer, VkImage, VkImageLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdCopyImageToBuffer
vkCmdCopyQueryPoolResults(3)
Name
vkCmdCopyQueryPoolResults - Copy the results of queries in a query pool to a buffer object
C Specification
To copy query statuses and numerical results directly to buffer memory, call:
void vkCmdCopyQueryPoolResults( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags);
Parameters
-
commandBuffer
is the command buffer into which this command will be recorded. -
queryPool
is the query pool managing the queries containing the desired results. -
firstQuery
is the initial query index. -
queryCount
is the number of queries.firstQuery
andqueryCount
together define a range of queries. -
dstBuffer
is aVkBuffer
object that will receive the results of the copy command. -
dstOffset
is an offset intodstBuffer
. -
stride
is the stride in bytes between results for individual queries withindstBuffer
. The required size of the backing memory fordstBuffer
is determined as described above for vkGetQueryPoolResults. -
flags
is a bitmask of VkQueryResultFlagBits specifying how and when results are returned.
Description
vkCmdCopyQueryPoolResults
is guaranteed to see the effect of previous uses of vkCmdResetQueryPool
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 vkGetQueryPoolResults, but the different style of execution causes some subtle behavioral differences. Because vkCmdCopyQueryPoolResults
executes in order with respect to other query commands, there is less ambiguity about which use of a query is being requested.
If no bits are set in flags
, results for all requested queries in the available state are written as 32-bit unsigned integer values, and nothing is written for queries in the unavailable state.
If VK_QUERY_RESULT_64_BIT
is set, the results are written as an array of 64-bit unsigned integer values as described for vkGetQueryPoolResults.
If VK_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 VK_ERROR_DEVICE_LOST
error may occur.
Similarly, if VK_QUERY_RESULT_WITH_AVAILABILITY_BIT
is set and VK_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 vkGetQueryPoolResults
, implementations must guarantee that if they return a non-zero availability value, then the numerical results are valid.
If VK_QUERY_RESULT_PARTIAL_BIT
is set, VK_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.
VK_QUERY_RESULT_PARTIAL_BIT
must not be used if the pool’s queryType
is VK_QUERY_TYPE_TIMESTAMP
.
vkCmdCopyQueryPoolResults
is considered to be a transfer operation, and its writes to buffer memory must be synchronized using VK_PIPELINE_STAGE_TRANSFER_BIT
and VK_ACCESS_TRANSFER_WRITE_BIT
before using the results.
Valid Usage
dstOffset
must be less than the size ofdstBuffer
firstQuery
must be less than the number of queries inqueryPool
- The sum of
firstQuery
andqueryCount
must be less than or equal to the number of queries inqueryPool
- If
VK_QUERY_RESULT_64_BIT
is not set inflags
thendstOffset
andstride
must be multiples of4
- If
VK_QUERY_RESULT_64_BIT
is set inflags
thendstOffset
andstride
must be multiples of8
dstBuffer
must have enough storage, fromdstOffset
, to contain the result of each query, as described heredstBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_DST_BIT
usage flag- If
dstBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object- If the
queryType
used to createqueryPool
wasVK_QUERY_TYPE_TIMESTAMP
,flags
must not containVK_QUERY_RESULT_PARTIAL_BIT
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlequeryPool
must be a validVkQueryPool
handledstBuffer
must be a validVkBuffer
handleflags
must be a valid combination of VkQueryResultFlagBits valuescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- This command must only be called outside of a render pass instance
- Each of
commandBuffer
,dstBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
computeTransfer
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
, VkQueryPool, VkQueryResultFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdCopyQueryPoolResults
vkCmdDispatch(3)
Name
vkCmdDispatch - Dispatch compute work items
C Specification
To record a dispatch, call:
void vkCmdDispatch( VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
groupCountX
is the number of local workgroups to dispatch in the X dimension. -
groupCountY
is the number of local workgroups to dispatch in the Y dimension. -
groupCountZ
is the number of local workgroups to dispatch in the Z dimension.
Description
When the command is executed, a global workgroup consisting of groupCountX × groupCountY × groupCountZ local workgroups is assembled.
Valid Usage
groupCountX
must be less than or equal toVkPhysicalDeviceLimits
::maxComputeWorkGroupCount
[0]groupCountY
must be less than or equal toVkPhysicalDeviceLimits
::maxComputeWorkGroupCount
[1]groupCountZ
must be less than or equal toVkPhysicalDeviceLimits
::maxComputeWorkGroupCount
[2]- For each set n that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_COMPUTE
, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by the currently boundVkPipeline
object, specified viavkCmdBindPipeline
- A valid compute pipeline must be bound to the current command buffer with
VK_PIPELINE_BIND_POINT_COMPUTE
- For each push constant that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
, a push constant value must have been set forVK_PIPELINE_BIND_POINT_COMPUTE
, with aVkPipelineLayout
that is compatible for push constants with the one used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
uses unnormalized coordinates, it must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
uses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
uses unnormalized coordinates, it 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 any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- If the robust buffer access feature is not enabled, and any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- Any
VkImageView
being sampled withVK_FILTER_LINEAR
as a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support compute operations- This command must only be called outside of a render pass instance
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Compute
Compute
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDispatch
vkCmdDispatchIndirect(3)
Name
vkCmdDispatchIndirect - Dispatch compute work items using indirect parameters
C Specification
To record an indirect command dispatch, call:
void vkCmdDispatchIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
buffer
is the buffer containing dispatch parameters. -
offset
is the byte offset intobuffer
where parameters begin.
Description
vkCmdDispatchIndirect
behaves similarly to vkCmdDispatch except that the parameters are read by the device from a buffer during execution. The parameters of the dispatch are encoded in a VkDispatchIndirectCommand structure taken from buffer
starting at offset
.
Valid Usage
- If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object- For each set n that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_COMPUTE
, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by the currently boundVkPipeline
object, specified viavkCmdBindPipeline
- A valid compute pipeline must be bound to the current command buffer with
VK_PIPELINE_BIND_POINT_COMPUTE
buffer
must have been created with theVK_BUFFER_USAGE_INDIRECT_BUFFER_BIT
bit setoffset
must be a multiple of4
- The sum of
offset
and the size ofVkDispatchIndirectCommand
must be less than or equal to the size ofbuffer
- For each push constant that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
, a push constant value must have been set forVK_PIPELINE_BIND_POINT_COMPUTE
, with aVkPipelineLayout
that is compatible for push constants with the one used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
uses unnormalized coordinates, it must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
uses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
uses unnormalized coordinates, it 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 any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- If the robust buffer access feature is not enabled, and any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_COMPUTE
accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- Any
VkImageView
being sampled withVK_FILTER_LINEAR
as a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlebuffer
must be a validVkBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support compute operations- This command must only be called outside of a render pass instance
- Both of
buffer
, andcommandBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Compute
Compute
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDispatchIndirect
vkCmdDraw(3)
Name
vkCmdDraw - Draw primitives
C Specification
To record a non-indexed draw, call:
void vkCmdDraw( VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
vertexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstVertex
is the index of the first vertex to draw. -
firstInstance
is the instance ID of the first instance to draw.
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 currently bound graphics pipeline.
Valid Usage
- The current render pass must be compatible with the
renderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- For each set n that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- For each push constant that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a push constant value must have been set forVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for push constants, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by the currently boundVkPipeline
object, specified viavkCmdBindPipeline
- All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in html/vkspec.html#fxvertex-input
- A valid graphics pipeline must be bound to the current command buffer with
VK_PIPELINE_BIND_POINT_GRAPHICS
- If the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
requires any dynamic state, that state must have been set on the current command buffer- Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it 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 any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- If the robust buffer access feature is not enabled, and any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- Any
VkImageView
being sampled withVK_FILTER_LINEAR
as a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
- 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.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryInside
Graphics
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDraw
vkCmdDrawIndexed(3)
Name
vkCmdDrawIndexed - Issue an indexed draw into a command buffer
C Specification
To record an indexed draw, call:
void vkCmdDrawIndexed( VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
indexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstIndex
is the base index within the index buffer. -
vertexOffset
is the value added to the vertex index before indexing into the vertex buffer. -
firstInstance
is the instance ID of the first instance to draw.
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 vkCmdBindIndexBuffer::indexType
parameter with which the buffer was bound.
The first vertex index is at an offset of firstIndex
* indexSize
+ offset
within the currently bound index buffer, where offset
is the offset specified by vkCmdBindIndexBuffer
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 VK_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 currently bound graphics pipeline.
Valid Usage
- The current render pass must be compatible with the
renderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- For each set n that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- For each push constant that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a push constant value must have been set forVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for push constants, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by the currently boundVkPipeline
object, specified viavkCmdBindPipeline
- All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in html/vkspec.html#fxvertex-input
- A valid graphics pipeline must be bound to the current command buffer with
VK_PIPELINE_BIND_POINT_GRAPHICS
- If the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
requires any dynamic state, that state must have been set on the current command buffer- (
indexSize
* (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the currently bound index buffer, with indexSize being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
- Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it 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 any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- If the robust buffer access feature is not enabled, and any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- Any
VkImageView
being sampled withVK_FILTER_LINEAR
as a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
- 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.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryInside
Graphics
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDrawIndexed
vkCmdDrawIndexedIndirect(3)
Name
vkCmdDrawIndexedIndirect - Perform an indexed indirect draw
C Specification
To record an indexed indirect draw, call:
void vkCmdDrawIndexedIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer containing draw parameters. -
offset
is the byte offset intobuffer
where parameters begin. -
drawCount
is the number of draws to execute, and can be zero. -
stride
is the byte stride between successive sets of draw parameters.
Description
vkCmdDrawIndexedIndirect
behaves similarly to vkCmdDrawIndexed 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 VkDrawIndexedIndirectCommand structures. If drawCount
is less than or equal to one, stride
is ignored.
Valid Usage
- If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectoffset
must be a multiple of4
- If
drawCount
is greater than1
,stride
must be a multiple of4
and must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand
)- If the multi-draw indirect feature is not enabled,
drawCount
must be0
or1
- If the drawIndirectFirstInstance feature is not enabled, all the
firstInstance
members of theVkDrawIndexedIndirectCommand
structures accessed by this command must be0
- The current render pass must be compatible with the
renderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- For each set n that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- For each push constant that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a push constant value must have been set forVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for push constants, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by the currently boundVkPipeline
object, specified viavkCmdBindPipeline
- All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- A valid graphics pipeline must be bound to the current command buffer with
VK_PIPELINE_BIND_POINT_GRAPHICS
- If the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
requires any dynamic state, that state must have been set on the current command buffer- If
drawCount
is equal to1
, (offset
+ sizeof(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
- If
drawCount
is greater than1
, (stride
× (drawCount
- 1) +offset
+ sizeof(VkDrawIndexedIndirectCommand
)) must be less than or equal to the size ofbuffer
drawCount
must be less than or equal toVkPhysicalDeviceLimits
::maxDrawIndirectCount
- Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it 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 any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- If the robust buffer access feature is not enabled, and any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- Any
VkImageView
being sampled withVK_FILTER_LINEAR
as a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
- 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.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlebuffer
must be a validVkBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
- Both of
buffer
, andcommandBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryInside
Graphics
Graphics
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDrawIndexedIndirect
vkCmdDrawIndirect(3)
Name
vkCmdDrawIndirect - Issue an indirect draw into a command buffer
C Specification
To record a non-indexed indirect draw, call:
void vkCmdDrawIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
buffer
is the buffer containing draw parameters. -
offset
is the byte offset intobuffer
where parameters begin. -
drawCount
is the number of draws to execute, and can be zero. -
stride
is the byte stride between successive sets of draw parameters.
Description
vkCmdDrawIndirect
behaves similarly to vkCmdDraw 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 VkDrawIndirectCommand structures. If drawCount
is less than or equal to one, stride
is ignored.
Valid Usage
- If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectoffset
must be a multiple of4
- If
drawCount
is greater than1
,stride
must be a multiple of4
and must be greater than or equal to sizeof(VkDrawIndirectCommand
)- If the multi-draw indirect feature is not enabled,
drawCount
must be0
or1
- If the drawIndirectFirstInstance feature is not enabled, all the
firstInstance
members of theVkDrawIndirectCommand
structures accessed by this command must be0
- The current render pass must be compatible with the
renderPass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.- For each set n that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a descriptor set must have been bound to n atVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for set n, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- For each push constant that is statically used by the
VkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
, a push constant value must have been set forVK_PIPELINE_BIND_POINT_GRAPHICS
, with aVkPipelineLayout
that is compatible for push constants, with theVkPipelineLayout
used to create the currentVkPipeline
, as described in html/vkspec.html#descriptorsets-compatibility- Descriptors in each bound descriptor set, specified via
vkCmdBindDescriptorSets
, must be valid if they are statically used by the currently boundVkPipeline
object, specified viavkCmdBindPipeline
- All vertex input bindings accessed via vertex input variables declared in the vertex shader entry point’s interface must have valid buffers bound
- A valid graphics pipeline must be bound to the current command buffer with
VK_PIPELINE_BIND_POINT_GRAPHICS
- If the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
requires any dynamic state, that state must have been set on the current command buffer- If
drawCount
is equal to1
, (offset
+ sizeof(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer
- If
drawCount
is greater than1
, (stride
× (drawCount
- 1) +offset
+ sizeof(VkDrawIndirectCommand)) must be less than or equal to the size ofbuffer
drawCount
must be less than or equal toVkPhysicalDeviceLimits
::maxDrawIndirectCount
- Every input attachment used by the current subpass must be bound to the pipeline via a descriptor set
- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used to sample from anyVkImage
with aVkImageView
of the typeVK_IMAGE_VIEW_TYPE_3D
,VK_IMAGE_VIEW_TYPE_CUBE
,VK_IMAGE_VIEW_TYPE_1D_ARRAY
,VK_IMAGE_VIEW_TYPE_2D_ARRAY
orVK_IMAGE_VIEW_TYPE_CUBE_ARRAY
, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it must not be used with any of the SPIR-VOpImageSample*
orOpImageSparseSample*
instructions withImplicitLod
,Dref
orProj
in their name, in any shader stage- If any
VkSampler
object that is accessed from a shader by theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
uses unnormalized coordinates, it 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 any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a uniform buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- If the robust buffer access feature is not enabled, and any shader stage in the
VkPipeline
object currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
accesses a storage buffer, it must not access values outside of the range of that buffer specified in the currently bound descriptor set- Any
VkImageView
being sampled withVK_FILTER_LINEAR
as a result of this command must be of a format which supports linear filtering, as specified by theVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT
flag inVkFormatProperties
::linearTilingFeatures
(for a linear image) orVkFormatProperties
::optimalTilingFeatures
(for an optimally tiled image) returned byvkGetPhysicalDeviceFormatProperties
- 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.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlebuffer
must be a validVkBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
- Both of
buffer
, andcommandBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryInside
Graphics
Graphics
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDrawIndirect
vkCmdEndQuery(3)
Name
vkCmdEndQuery - Ends a query
C Specification
To end a query after the set of desired draw or dispatch commands is executed, call:
void vkCmdEndQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query);
Parameters
-
commandBuffer
is the command buffer into which this command will be recorded. -
queryPool
is the query pool that is managing the results of the query. -
query
is the query index within the query pool where the result is stored.
Description
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 vkGetQueryPoolResults and vkCmdCopyQueryPoolResults, 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
- The query identified by
queryPool
andquery
must currently be activequery
must be less than the number of queries inqueryPool
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlequeryPool
must be a validVkQueryPool
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- Both of
commandBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
compute
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdEndQuery
vkCmdEndRenderPass(3)
Name
vkCmdEndRenderPass - End the current render pass
C Specification
To record a command to end a render pass instance after recording the commands for the last subpass, call:
void vkCmdEndRenderPass( VkCommandBuffer commandBuffer);
Parameters
-
commandBuffer
is the command buffer in which to end the current render pass instance.
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
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
commandBuffer
must be a primaryVkCommandBuffer
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was 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
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdEndRenderPass
vkCmdExecuteCommands(3)
Name
vkCmdExecuteCommands - Execute a secondary command buffer from a primary command buffer
C Specification
A secondary command buffer must not be directly submitted to a queue. Instead, secondary command buffers are recorded to execute as part of a primary command buffer with the command:
void vkCmdExecuteCommands( VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers);
Parameters
-
commandBuffer
is a handle to a primary command buffer that the secondary command buffers are executed in. -
commandBufferCount
is the length of thepCommandBuffers
array. -
pCommandBuffers
is an array of secondary command buffer handles, which are recorded to execute in the primary command buffer in the order they are listed in the array.
Description
If any element of pCommandBuffers
was not recorded with the VK_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
commandBuffer
must have been allocated with alevel
ofVK_COMMAND_BUFFER_LEVEL_PRIMARY
- Any given element of
pCommandBuffers
must have been allocated with alevel
ofVK_COMMAND_BUFFER_LEVEL_SECONDARY
- Any given element of
pCommandBuffers
must be in the pending or executable state.- If any element of
pCommandBuffers
was not recorded with theVK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
flag, and it was recorded into any other primary command buffer, that primary command buffer must not be in the pending state- If any given element of
pCommandBuffers
was not recorded with theVK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
flag, it must not be in the pending state.- If any given element of
pCommandBuffers
was not recorded with theVK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
flag, it must not have already been recorded tocommandBuffer
.- If any given element of
pCommandBuffers
was not recorded with theVK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
flag, it must not appear more than once inpCommandBuffers
.- Any given element of
pCommandBuffers
must have been allocated from aVkCommandPool
that was created for the same queue family as theVkCommandPool
from whichcommandBuffer
was allocated- If
vkCmdExecuteCommands
is being called within a render pass instance, that render pass instance must have been begun with thecontents
parameter ofvkCmdBeginRenderPass
set toVK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS
- If
vkCmdExecuteCommands
is being called within a render pass instance, any given element ofpCommandBuffers
must have been recorded with theVK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
- If
vkCmdExecuteCommands
is being called within a render pass instance, any given element ofpCommandBuffers
must have been recorded withVkCommandBufferInheritanceInfo
::subpass
set to the index of the subpass which the given command buffer will be executed in- If
vkCmdExecuteCommands
is being called within a render pass instance, the render passes specified in the pname::pBeginInfo::pInheritanceInfo
::renderPass
members of the vkBeginCommandBuffer commands used to begin recording each element ofpCommandBuffers
must be compatible with the current render pass.- If
vkCmdExecuteCommands
is being called within a render pass instance, and any given element ofpCommandBuffers
was recorded withVkCommandBufferInheritanceInfo
::framebuffer
not equal to VK_NULL_HANDLE, thatVkFramebuffer
must match theVkFramebuffer
used in the current render pass instance- If
vkCmdExecuteCommands
is not being called within a render pass instance, any given element ofpCommandBuffers
must not have been recorded with theVK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
- If the inherited queries feature is not enabled,
commandBuffer
must not have any queries active- If
commandBuffer
has aVK_QUERY_TYPE_OCCLUSION
query active, then each element ofpCommandBuffers
must have been recorded withVkCommandBufferInheritanceInfo
::occlusionQueryEnable
set toVK_TRUE
- If
commandBuffer
has aVK_QUERY_TYPE_OCCLUSION
query active, then each element ofpCommandBuffers
must have been recorded withVkCommandBufferInheritanceInfo
::queryFlags
having all bits set that are set for the query- If
commandBuffer
has aVK_QUERY_TYPE_PIPELINE_STATISTICS
query active, then each element ofpCommandBuffers
must have been recorded withVkCommandBufferInheritanceInfo
::pipelineStatistics
having all bits set that are set in theVkQueryPool
the query uses- Any given element of
pCommandBuffers
must not begin any query types that are active incommandBuffer
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepCommandBuffers
must be a pointer to an array ofcommandBufferCount
validVkCommandBuffer
handlescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operationscommandBuffer
must be a primaryVkCommandBuffer
commandBufferCount
must be greater than0
- Both of
commandBuffer
, and the elements ofpCommandBuffers
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was 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
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdExecuteCommands
vkCmdFillBuffer(3)
Name
vkCmdFillBuffer - Fill a region of a buffer with a fixed value
C Specification
To clear buffer data, call:
void vkCmdFillBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
dstBuffer
is the buffer to be filled. -
dstOffset
is the byte offset into the buffer at which to start filling, and must be a multiple of 4. -
size
is the number of bytes to fill, and must be either a multiple of 4, orVK_WHOLE_SIZE
to fill the range fromoffset
to the end of the buffer. IfVK_WHOLE_SIZE
is used and the remaining size of the buffer is not a multiple of 4, then the nearest smaller multiple is used. -
data
is the 4-byte word written repeatedly to the buffer to fillsize
bytes of data. The data word is written to memory according to the host endianness.
Description
vkCmdFillBuffer
is treated as “transfer” operation for the purposes of synchronization barriers. The VK_BUFFER_USAGE_TRANSFER_DST_BIT
must be specified in usage
of VkBufferCreateInfo
in order for the buffer to be compatible with vkCmdFillBuffer
.
Valid Usage
dstOffset
must be less than the size ofdstBuffer
dstOffset
must be a multiple of4
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be greater than0
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be less than or equal to the size ofdstBuffer
minusdstOffset
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be a multiple of4
dstBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_DST_BIT
usage flag- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics or compute operations- If
dstBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handledstBuffer
must be a validVkBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics or compute operations- This command must only be called outside of a render pass instance
- Both of
commandBuffer
, anddstBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
ComputeTransfer
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdFillBuffer
vkCmdNextSubpass(3)
Name
vkCmdNextSubpass - Transition to the next subpass of a render pass
C Specification
To transition to the next subpass in the render pass instance after recording the commands for a subpass, call:
void vkCmdNextSubpass( VkCommandBuffer commandBuffer, VkSubpassContents contents);
Parameters
-
commandBuffer
is the command buffer in which to record the command. -
contents
specifies how the commands in the next subpass will be provided, in the same fashion as the corresponding parameter of vkCmdBeginRenderPass.
Description
The subpass index for a render pass begins at zero when vkCmdBeginRenderPass
is recorded, and increments each time vkCmdNextSubpass
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. That is, they are considered to execute in the VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
pipeline stage and their writes are synchronized with VK_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
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecontents
must be a valid VkSubpassContents valuecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called inside of a render pass instance
commandBuffer
must be a primaryVkCommandBuffer
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was 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
VkCommandBuffer, VkSubpassContents
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdNextSubpass
vkCmdPipelineBarrier(3)
Name
vkCmdPipelineBarrier - Insert a memory dependency
C Specification
To record a pipeline barrier, call:
void vkCmdPipelineBarrier( VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
srcStageMask
is a bitmask of VkPipelineStageFlagBits specifying the source stage mask. -
dstStageMask
is a bitmask of VkPipelineStageFlagBits specifying the destination stage mask. -
dependencyFlags
is a bitmask of VkDependencyFlagBits specifying how execution and memory dependencies are formed. -
memoryBarrierCount
is the length of thepMemoryBarriers
array. -
pMemoryBarriers
is a pointer to an array of VkMemoryBarrier structures. -
bufferMemoryBarrierCount
is the length of thepBufferMemoryBarriers
array. -
pBufferMemoryBarriers
is a pointer to an array of VkBufferMemoryBarrier structures. -
imageMemoryBarrierCount
is the length of thepImageMemoryBarriers
array. -
pImageMemoryBarriers
is a pointer to an array of VkImageMemoryBarrier structures.
Description
When vkCmdPipelineBarrier is submitted to a queue, it defines a memory dependency between commands that were submitted before it, and those submitted after it.
If vkCmdPipelineBarrier was recorded outside a render pass instance, the first synchronization scope includes every command submitted to the same queue before it, including those in the same command buffer and batch. If vkCmdPipelineBarrier was recorded inside a render pass instance, the first synchronization scope includes only commands submitted before it 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 vkCmdPipelineBarrier was recorded outside a render pass instance, the second synchronization scope includes every command submitted to the same queue after it, including those in the same command buffer and batch. If vkCmdPipelineBarrier was recorded inside a render pass instance, the second synchronization scope includes only commands submitted after it 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 VK_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,
srcStageMask
must not containVK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the geometry shaders feature is not enabled,
dstStageMask
must not containVK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the tessellation shaders feature is not enabled,
srcStageMask
must not containVK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
orVK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the tessellation shaders feature is not enabled,
dstStageMask
must not containVK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
orVK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If
vkCmdPipelineBarrier
is called within a render pass instance, the render pass must have been created with aVkSubpassDependency
instance inpDependencies
that expresses a dependency from the current subpass to itself.- If
vkCmdPipelineBarrier
is called within a render pass instance,srcStageMask
must contain a subset of the bit values in thesrcStageMask
member of that instance ofVkSubpassDependency
- If
vkCmdPipelineBarrier
is called within a render pass instance,dstStageMask
must contain a subset of the bit values in thedstStageMask
member of that instance ofVkSubpassDependency
- If
vkCmdPipelineBarrier
is called within a render pass instance, thesrcAccessMask
of any element ofpMemoryBarriers
orpImageMemoryBarriers
must contain a subset of the bit values thesrcAccessMask
member of that instance ofVkSubpassDependency
- If
vkCmdPipelineBarrier
is called within a render pass instance, thedstAccessMask
of any element ofpMemoryBarriers
orpImageMemoryBarriers
must contain a subset of the bit values thedstAccessMask
member of that instance ofVkSubpassDependency
- If
vkCmdPipelineBarrier
is called within a render pass instance,dependencyFlags
must be equal to thedependencyFlags
member of that instance ofVkSubpassDependency
- If
vkCmdPipelineBarrier
is called within a render pass instance,bufferMemoryBarrierCount
must be0
- If
vkCmdPipelineBarrier
is called within a render pass instance, theimage
member of any element ofpImageMemoryBarriers
must be equal to one of the elements ofpAttachments
that the currentframebuffer
was created with, that is also referred to by one of the elements of thepColorAttachments
,pResolveAttachments
orpDepthStencilAttachment
members of theVkSubpassDescription
instance that the current subpass was created with- If
vkCmdPipelineBarrier
is called within a render pass instance, theoldLayout
andnewLayout
members of any element ofpImageMemoryBarriers
must be equal to thelayout
member of an element of thepColorAttachments
,pResolveAttachments
orpDepthStencilAttachment
members of theVkSubpassDescription
instance that the current subpass was created with, that refers to the sameimage
- If
vkCmdPipelineBarrier
is called within a render pass instance, theoldLayout
andnewLayout
members of an element ofpImageMemoryBarriers
must be equal- If
vkCmdPipelineBarrier
is called within a render pass instance, thesrcQueueFamilyIndex
anddstQueueFamilyIndex
members of any element ofpImageMemoryBarriers
must beVK_QUEUE_FAMILY_IGNORED
- Any pipeline stage included in
srcStageMask
ordstStageMask
must be supported by the capabilities of the queue family specified by thequeueFamilyIndex
member of the VkCommandPoolCreateInfo structure that was used to create theVkCommandPool
thatcommandBuffer
was allocated from, as specified in the table of supported pipeline stages.- Any given element of
pMemoryBarriers
,pBufferMemoryBarriers
orpImageMemoryBarriers
must not have any access flag included in itssrcAccessMask
member if that bit is not supported by any of the pipeline stages insrcStageMask
, as specified in the table of supported access types.- Any given element of
pMemoryBarriers
,pBufferMemoryBarriers
orpImageMemoryBarriers
must not have any access flag included in itsdstAccessMask
member if that bit is not supported by any of the pipeline stages indstStageMask
, as specified in the table of supported access types.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcStageMask
must be a valid combination of VkPipelineStageFlagBits valuessrcStageMask
must not be0
dstStageMask
must be a valid combination of VkPipelineStageFlagBits valuesdstStageMask
must not be0
dependencyFlags
must be a valid combination of VkDependencyFlagBits values- If
memoryBarrierCount
is not0
,pMemoryBarriers
must be a pointer to an array ofmemoryBarrierCount
validVkMemoryBarrier
structures- If
bufferMemoryBarrierCount
is not0
,pBufferMemoryBarriers
must be a pointer to an array ofbufferMemoryBarrierCount
validVkBufferMemoryBarrier
structures- If
imageMemoryBarrierCount
is not0
,pImageMemoryBarriers
must be a pointer to an array ofimageMemoryBarrierCount
validVkImageMemoryBarrier
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Transfer
graphics
compute
See Also
VkBufferMemoryBarrier, VkCommandBuffer, VkDependencyFlags, VkImageMemoryBarrier, VkMemoryBarrier, VkPipelineStageFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdPipelineBarrier
vkCmdPushConstants(3)
Name
vkCmdPushConstants - Update the values of push constants
C Specification
To update push constants, call:
void vkCmdPushConstants( VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues);
Parameters
-
commandBuffer
is the command buffer in which the push constant update will be recorded. -
layout
is the pipeline layout used to program the push constant updates. -
stageFlags
is a bitmask of VkShaderStageFlagBits specifying the shader stages that will use the push constants in the updated range. -
offset
is the start offset of the push constant range to update, in units of bytes. -
size
is the size of the push constant range to update, in units of bytes. -
pValues
is an array ofsize
bytes containing the new push constant values.
Description
Valid Usage
stageFlags
must match exactly the shader stages used inlayout
for the range specified byoffset
andsize
offset
must be a multiple of4
size
must be a multiple of4
offset
must be less thanVkPhysicalDeviceLimits
::maxPushConstantsSize
size
must be less than or equal toVkPhysicalDeviceLimits
::maxPushConstantsSize
minusoffset
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlelayout
must be a validVkPipelineLayout
handlestageFlags
must be a valid combination of VkShaderStageFlagBits valuesstageFlags
must not be0
pValues
must be a pointer to an array ofsize
bytescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operationssize
must be greater than0
- Both of
commandBuffer
, andlayout
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
compute
See Also
VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdPushConstants
vkCmdResetEvent(3)
Name
vkCmdResetEvent - Reset an event object to non-signaled state
C Specification
To set the state of an event to unsignaled from a device, call:
void vkCmdResetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
event
is the event that will be unsignaled. -
stageMask
is a bitmask of VkPipelineStageFlagBits specifying the source stage mask used to determine when theevent
is unsignaled.
Description
When vkCmdResetEvent 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 every command previously submitted to the same queue, including those in the same command buffer and batch. 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 vkCmdResetEvent is executed on the device, then vkCmdResetEvent has no effect, no event unsignal operation occurs, and no execution dependency is generated.
Valid Usage
stageMask
must not includeVK_PIPELINE_STAGE_HOST_BIT
- If the geometry shaders feature is not enabled,
stageMask
must not containVK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the tessellation shaders feature is not enabled,
stageMask
must not containVK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
orVK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- When this command executes,
event
must not be waited on by avkCmdWaitEvents
command that is currently executing
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handleevent
must be a validVkEvent
handlestageMask
must be a valid combination of VkPipelineStageFlagBits valuesstageMask
must not be0
commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- This command must only be called outside of a render pass instance
- Both of
commandBuffer
, andevent
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
compute
See Also
VkCommandBuffer, VkEvent, VkPipelineStageFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdResetEvent
vkCmdResetQueryPool(3)
Name
vkCmdResetQueryPool - Reset queries in a query pool
C Specification
To reset a range of queries in a query pool, call:
void vkCmdResetQueryPool( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount);
Parameters
-
commandBuffer
is the command buffer into which this command will be recorded. -
queryPool
is the handle of the query pool managing the queries being reset. -
firstQuery
is the initial query index to reset. -
queryCount
is the number of queries to reset.
Description
When executed on a queue, this command sets the status of query indices [firstQuery
, firstQuery
+ queryCount
- 1] to unavailable.
Valid Usage
firstQuery
must be less than the number of queries inqueryPool
- The sum of
firstQuery
andqueryCount
must be less than or equal to the number of queries inqueryPool
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlequeryPool
must be a validVkQueryPool
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- This command must only be called outside of a render pass instance
- Both of
commandBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
compute
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdResetQueryPool
vkCmdResolveImage(3)
Name
vkCmdResolveImage - Resolve regions of an image
C Specification
To resolve a multisample image to a non-multisample image, call:
void vkCmdResolveImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
srcImage
is the source image. -
srcImageLayout
is the layout of the source image subresources for the resolve. -
dstImage
is the destination image. -
dstImageLayout
is the layout of the destination image subresources for the resolve. -
regionCount
is the number of regions to resolve. -
pRegions
is a pointer to an array of VkImageResolve structures specifying the regions to resolve.
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
.
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
- The source region specified by a given element of
pRegions
must be a region that is contained withinsrcImage
- The destination region specified by a given element of
pRegions
must be a region that is contained withindstImage
- 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
srcImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectsrcImage
must have a sample count equal to any valid sample count value other thanVK_SAMPLE_COUNT_1_BIT
- If
dstImage
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstImage
must have a sample count equal toVK_SAMPLE_COUNT_1_BIT
srcImageLayout
must specify the layout of the image subresources ofsrcImage
specified inpRegions
at the time this command is executed on aVkDevice
srcImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
dstImageLayout
must specify the layout of the image subresources ofdstImage
specified inpRegions
at the time this command is executed on aVkDevice
dstImageLayout
must beVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
orVK_IMAGE_LAYOUT_GENERAL
- If
dstImage
was created withtiling
equal toVK_IMAGE_TILING_LINEAR
,dstImage
must have been created with aformat
that supports being a color attachment, as specified by theVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
flag inVkFormatProperties
::linearTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
- If
dstImage
was created withtiling
equal toVK_IMAGE_TILING_OPTIMAL
,dstImage
must have been created with aformat
that supports being a color attachment, as specified by theVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
flag inVkFormatProperties
::optimalTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
srcImage
anddstImage
must have been created with the same image format
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlesrcImage
must be a validVkImage
handlesrcImageLayout
must be a valid VkImageLayout valuedstImage
must be a validVkImage
handledstImageLayout
must be a valid VkImageLayout valuepRegions
must be a pointer to an array ofregionCount
validVkImageResolve
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations- This command must only be called outside of a render pass instance
regionCount
must be greater than0
- Each of
commandBuffer
,dstImage
, andsrcImage
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
Transfer
See Also
VkCommandBuffer, VkImage, VkImageLayout, VkImageResolve
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdResolveImage
vkCmdSetBlendConstants(3)
Name
vkCmdSetBlendConstants - Set the values of blend constants
C Specification
Otherwise, to dynamically set and change the blend constant, call:
void vkCmdSetBlendConstants( VkCommandBuffer commandBuffer, const float blendConstants[4]);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
blendConstants
is an array of four values specifying the R, G, B, and A components of the blend constant color used in blending, depending on the blend factor.
Description
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_BLEND_CONSTANTS
dynamic state enabled
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetBlendConstants
vkCmdSetDepthBias(3)
Name
vkCmdSetDepthBias - Set the depth bias dynamic state
C Specification
The depth values of all fragments generated by the rasterization of a polygon can be offset by a single value that is computed for that polygon. This behavior is controlled by the depthBiasEnable
, depthBiasConstantFactor
, depthBiasClamp
, and depthBiasSlopeFactor
members of VkPipelineRasterizationStateCreateInfo, or by the corresponding parameters to the vkCmdSetDepthBias
command if depth bias state is dynamic.
void vkCmdSetDepthBias( VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
depthBiasConstantFactor
is a scalar factor controlling the constant depth value added to each fragment. -
depthBiasClamp
is the maximum (or minimum) depth bias of a fragment. -
depthBiasSlopeFactor
is a scalar factor applied to a fragment’s slope in depth bias calculations.
Description
If depthBiasEnable
is VK_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
where (xf, yf, zf) is a point on the triangle. m may be approximated as
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 z
f 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 no depth buffer is present, r is undefined.
The bias value o for a polygon is
m is computed as described above. If the depth buffer uses a fixed-point representation, m is a function of depth values in the range [0,1], and o is applied to depth values in the same range.
For fixed-point depth buffers, fragment depth values are always limited to the range [0,1] by clamping after depth bias addition is performed. Fragment depth values are clamped even when the depth buffer uses a floating-point representation.
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_DEPTH_BIAS
dynamic state enabled- If the depth bias clamping feature is not enabled,
depthBiasClamp
must be0
.0
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetDepthBias
vkCmdSetDepthBounds(3)
Name
vkCmdSetDepthBounds - Set the depth bounds test values for a command buffer
C Specification
The depth bounds test conditionally disables coverage of a sample based on the outcome of a comparison between the value za in the depth attachment at location (xf,yf) (for the appropriate sample) and a range of values. The test is enabled or disabled by the depthBoundsTestEnable
member of VkPipelineDepthStencilStateCreateInfo: If the pipeline state object is created without the VK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabled then the range of values used in the depth bounds test are defined by the minDepthBounds
and maxDepthBounds
members of the VkPipelineDepthStencilStateCreateInfo structure. Otherwise, to dynamically set the depth bounds range values call:
void vkCmdSetDepthBounds( VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
minDepthBounds
is the lower bound of the range of depth values used in the depth bounds test. -
maxDepthBounds
is the upper bound of the range.
Description
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_DEPTH_BOUNDS
dynamic state enabledminDepthBounds
must be between0.0
and1.0
, inclusivemaxDepthBounds
must be between0.0
and1.0
, inclusive
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetDepthBounds
vkCmdSetEvent(3)
Name
vkCmdSetEvent - Set an event object to signaled state
C Specification
To set the state of an event to signaled from a device, call:
void vkCmdSetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
event
is the event that will be signaled. -
stageMask
specifies the source stage mask used to determine when theevent
is signaled.
Description
When vkCmdSetEvent 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 every command previously submitted to the same queue, including those in the same command buffer and batch. 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 vkCmdSetEvent is executed on the device, then vkCmdSetEvent has no effect, no event signal operation occurs, and no execution dependency is generated.
Valid Usage
stageMask
must not includeVK_PIPELINE_STAGE_HOST_BIT
- If the geometry shaders feature is not enabled,
stageMask
must not containVK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the tessellation shaders feature is not enabled,
stageMask
must not containVK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
orVK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handleevent
must be a validVkEvent
handlestageMask
must be a valid combination of VkPipelineStageFlagBits valuesstageMask
must not be0
commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- This command must only be called outside of a render pass instance
- Both of
commandBuffer
, andevent
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Graphics
compute
See Also
VkCommandBuffer, VkEvent, VkPipelineStageFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetEvent
vkCmdSetLineWidth(3)
Name
vkCmdSetLineWidth - Set the dynamic line width state
C Specification
The line width is specified by the VkPipelineRasterizationStateCreateInfo::lineWidth
property of the currently active pipeline, if the pipeline was not created with VK_DYNAMIC_STATE_LINE_WIDTH
enabled.
Otherwise, the line width is set by calling vkCmdSetLineWidth
:
void vkCmdSetLineWidth( VkCommandBuffer commandBuffer, float lineWidth);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
lineWidth
is the width of rasterized line segments.
Description
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_LINE_WIDTH
dynamic state enabled- If the wide lines feature is not enabled,
lineWidth
must be1.0
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetLineWidth
vkCmdSetScissor(3)
Name
vkCmdSetScissor - Set the dynamic scissor rectangles on a command buffer
C Specification
The scissor test determines if a fragment’s framebuffer coordinates (xf,yf) lie within the scissor rectangle corresponding to the viewport index (see Controlling the Viewport) used by the primitive that generated the fragment. If the pipeline state object is created without VK_DYNAMIC_STATE_SCISSOR
enabled then the scissor rectangles are set by the VkPipelineViewportStateCreateInfo state of the pipeline state object. Otherwise, to dynamically set the scissor rectangles call:
void vkCmdSetScissor( VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
firstScissor
is the index of the first scissor whose state is updated by the command. -
scissorCount
is the number of scissors whose rectangles are updated by the command. -
pScissors
is a pointer to an array of VkRect2D structures defining scissor rectangles.
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
).
Each scissor rectangle is described by a VkRect2D structure, with the offset.x
and offset.y
values determining the upper left corner of the scissor rectangle, and the extent.width
and extent.height
values determining the size in pixels.
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_SCISSOR
dynamic state enabledfirstScissor
must be less thanVkPhysicalDeviceLimits
::maxViewports
- The sum of
firstScissor
andscissorCount
must be between1
andVkPhysicalDeviceLimits
::maxViewports
, inclusive- If the multiple viewports feature is not enabled,
firstScissor
must be0
- If the multiple viewports feature is not enabled,
scissorCount
must be1
- The
x
andy
members ofoffset
must be greater than or equal to0
- Evaluation of (
offset.x
+extent.width
) must not cause a signed integer addition overflow- Evaluation of (
offset.y
+extent.height
) must not cause a signed integer addition overflow
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepScissors
must be a pointer to an array ofscissorCount
VkRect2D
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operationsscissorCount
must be greater than0
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetScissor
vkCmdSetStencilCompareMask(3)
Name
vkCmdSetStencilCompareMask - Set the stencil compare mask dynamic state
C Specification
If the pipeline state object is created with the VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled, then to dynamically set the stencil compare mask call:
void vkCmdSetStencilCompareMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
faceMask
is a bitmask of VkStencilFaceFlagBits specifying the set of stencil state for which to update the compare mask. -
compareMask
is the new value to use as the stencil compare mask.
Description
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK
dynamic state enabled
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlefaceMask
must be a valid combination of VkStencilFaceFlagBits valuesfaceMask
must not be0
commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
VkCommandBuffer, VkStencilFaceFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetStencilCompareMask
vkCmdSetStencilReference(3)
Name
vkCmdSetStencilReference - Set the stencil reference dynamic state
C Specification
If the pipeline state object is created with the VK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled, then to dynamically set the stencil reference value call:
void vkCmdSetStencilReference( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
faceMask
is a bitmask of VkStencilFaceFlagBits specifying the set of stencil state for which to update the reference value, as described above for vkCmdSetStencilCompareMask. -
reference
is the new value to use as the stencil reference value.
Description
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_STENCIL_REFERENCE
dynamic state enabled
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlefaceMask
must be a valid combination of VkStencilFaceFlagBits valuesfaceMask
must not be0
commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
VkCommandBuffer, VkStencilFaceFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetStencilReference
vkCmdSetStencilWriteMask(3)
Name
vkCmdSetStencilWriteMask - Set the stencil write mask dynamic state
C Specification
If the pipeline state object is created with the VK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled, then to dynamically set the stencil write mask call:
void vkCmdSetStencilWriteMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
faceMask
is a bitmask of VkStencilFaceFlagBits specifying the set of stencil state for which to update the write mask, as described above for vkCmdSetStencilCompareMask. -
writeMask
is the new value to use as the stencil write mask.
Description
Valid Usage
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_STENCIL_WRITE_MASK
dynamic state enabled
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlefaceMask
must be a valid combination of VkStencilFaceFlagBits valuesfaceMask
must not be0
commandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operations
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
VkCommandBuffer, VkStencilFaceFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetStencilWriteMask
vkCmdSetViewport(3)
Name
vkCmdSetViewport - Set the viewport on a command buffer
C Specification
If the bound pipeline state object was not created with the VK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled, viewport transformation parameters are specified using the pViewports
member of VkPipelineViewportStateCreateInfo
in the pipeline state object. If the pipeline state object was created with the VK_DYNAMIC_STATE_VIEWPORT
dynamic state enabled, the viewport transformation parameters are dynamically set and changed with the command:
void vkCmdSetViewport( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
firstViewport
is the index of the first viewport whose parameters are updated by the command. -
viewportCount
is the number of viewports whose parameters are updated by the command. -
pViewports
is a pointer to an array of VkViewport structures specifying viewport parameters.
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
- The currently bound graphics pipeline must have been created with the
VK_DYNAMIC_STATE_VIEWPORT
dynamic state enabledfirstViewport
must be less thanVkPhysicalDeviceLimits
::maxViewports
- The sum of
firstViewport
andviewportCount
must be between1
andVkPhysicalDeviceLimits
::maxViewports
, inclusive- If the multiple viewports feature is not enabled,
firstViewport
must be0
- If the multiple viewports feature is not enabled,
viewportCount
must be1
pViewports
must be a pointer to an array ofviewportCount
validVkViewport
structures
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics operationsviewportCount
must be greater than0
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdSetViewport
vkCmdUpdateBuffer(3)
Name
vkCmdUpdateBuffer - Update a buffer’s contents from host memory
C Specification
To update buffer data inline in a command buffer, call:
void vkCmdUpdateBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
dstBuffer
is a handle to the buffer to be updated. -
dstOffset
is the byte offset into the buffer to start updating, and must be a multiple of 4. -
dataSize
is the number of bytes to update, and must be a multiple of 4. -
pData
is a pointer to the source data for the buffer update, and must be at leastdataSize
bytes in size.
Description
dataSize
must be less than or equal to 65536 bytes. For larger updates, applications can use buffer to buffer copies.
The source data is copied from the user pointer to the command buffer when the command is called.
vkCmdUpdateBuffer
is only allowed outside of a render pass. This command is treated as “transfer” operation, for the purposes of synchronization barriers. The VK_BUFFER_USAGE_TRANSFER_DST_BIT
must be specified in usage
of VkBufferCreateInfo in order for the buffer to be compatible with vkCmdUpdateBuffer
.
Valid Usage
dstOffset
must be less than the size ofdstBuffer
dataSize
must be less than or equal to the size ofdstBuffer
minusdstOffset
dstBuffer
must have been created withVK_BUFFER_USAGE_TRANSFER_DST_BIT
usage flag- If
dstBuffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
objectdstOffset
must be a multiple of4
dataSize
must be less than or equal to65536
dataSize
must be a multiple of4
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handledstBuffer
must be a validVkBuffer
handlepData
must be a pointer to an array ofdataSize
bytescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support transfer, graphics, or compute operations- This command must only be called outside of a render pass instance
dataSize
must be greater than0
- Both of
commandBuffer
, anddstBuffer
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryOutside
Transfer
graphics
computeTransfer
See Also
VkBuffer, VkCommandBuffer, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdUpdateBuffer
vkCmdWaitEvents(3)
Name
vkCmdWaitEvents - Wait for one or more events and insert a set of memory
C Specification
To wait for one or more events to enter the signaled state on a device, call:
void vkCmdWaitEvents( VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
Parameters
-
commandBuffer
is the command buffer into which the command is recorded. -
eventCount
is the length of thepEvents
array. -
pEvents
is an array of event object handles to wait on. -
srcStageMask
is a bitmask of VkPipelineStageFlagBits specifying the source stage mask. -
dstStageMask
is a bitmask of VkPipelineStageFlagBits specifying the destination stage mask. -
memoryBarrierCount
is the length of thepMemoryBarriers
array. -
pMemoryBarriers
is a pointer to an array of VkMemoryBarrier structures. -
bufferMemoryBarrierCount
is the length of thepBufferMemoryBarriers
array. -
pBufferMemoryBarriers
is a pointer to an array of VkBufferMemoryBarrier structures. -
imageMemoryBarrierCount
is the length of thepImageMemoryBarriers
array. -
pImageMemoryBarriers
is a pointer to an array of VkImageMemoryBarrier structures.
Description
When vkCmdWaitEvents
is submitted to a queue, it defines a memory dependency between prior event signal operations, and subsequent commands.
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 vkCmdSetEvent that were previously submitted to the same queue 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 vkSetEvent are only included in the first synchronization scope if VK_PIPELINE_STAGE_HOST_BIT
is included in srcStageMask
.
The second synchronization scope includes commands subsequently submitted to the same queue, including those in the same command buffer and batch. 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
vkCmdWaitEvents is used with vkCmdSetEvent 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.
Note
Applications should be careful to avoid race conditions when using events. There is no direct ordering guarantee between a vkCmdResetEvent command and a vkCmdWaitEvents command submitted after it, so some other execution dependency must be included between these commands (e.g. a semaphore).
Valid Usage
srcStageMask
must be the bitwise OR of thestageMask
parameter used in previous calls tovkCmdSetEvent
with any of the members ofpEvents
andVK_PIPELINE_STAGE_HOST_BIT
if any of the members ofpEvents
was set usingvkSetEvent
- If the geometry shaders feature is not enabled,
srcStageMask
must not containVK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the geometry shaders feature is not enabled,
dstStageMask
must not containVK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
- If the tessellation shaders feature is not enabled,
srcStageMask
must not containVK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
orVK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If the tessellation shaders feature is not enabled,
dstStageMask
must not containVK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
orVK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
- If
pEvents
includes one or more events that will be signaled byvkSetEvent
aftercommandBuffer
has been submitted to a queue, thenvkCmdWaitEvents
must not be called inside a render pass instance- Any pipeline stage included in
srcStageMask
ordstStageMask
must be supported by the capabilities of the queue family specified by thequeueFamilyIndex
member of the VkCommandPoolCreateInfo structure that was used to create theVkCommandPool
thatcommandBuffer
was allocated from, as specified in the table of supported pipeline stages.- Any given element of
pMemoryBarriers
,pBufferMemoryBarriers
orpImageMemoryBarriers
must not have any access flag included in itssrcAccessMask
member if that bit is not supported by any of the pipeline stages insrcStageMask
, as specified in the table of supported access types.- Any given element of
pMemoryBarriers
,pBufferMemoryBarriers
orpImageMemoryBarriers
must not have any access flag included in itsdstAccessMask
member if that bit is not supported by any of the pipeline stages indstStageMask
, as specified in the table of supported access types.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepEvents
must be a pointer to an array ofeventCount
validVkEvent
handlessrcStageMask
must be a valid combination of VkPipelineStageFlagBits valuessrcStageMask
must not be0
dstStageMask
must be a valid combination of VkPipelineStageFlagBits valuesdstStageMask
must not be0
- If
memoryBarrierCount
is not0
,pMemoryBarriers
must be a pointer to an array ofmemoryBarrierCount
validVkMemoryBarrier
structures- If
bufferMemoryBarrierCount
is not0
,pBufferMemoryBarriers
must be a pointer to an array ofbufferMemoryBarrierCount
validVkBufferMemoryBarrier
structures- If
imageMemoryBarrierCount
is not0
,pImageMemoryBarriers
must be a pointer to an array ofimageMemoryBarrierCount
validVkImageMemoryBarrier
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operationseventCount
must be greater than0
- Both of
commandBuffer
, and the elements ofpEvents
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
compute
See Also
VkBufferMemoryBarrier, VkCommandBuffer, VkEvent, VkImageMemoryBarrier, VkMemoryBarrier, VkPipelineStageFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdWaitEvents
vkCmdWriteTimestamp(3)
Name
vkCmdWriteTimestamp - Write a device timestamp into a query object
C Specification
To request a timestamp, call:
void vkCmdWriteTimestamp( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query);
Parameters
-
commandBuffer
is the command buffer into which the command will be recorded. -
pipelineStage
is one of the VkPipelineStageFlagBits, specifying a stage of the pipeline. -
queryPool
is the query pool that will manage the timestamp. -
query
is the query within the query pool that will contain the timestamp.
Description
vkCmdWriteTimestamp
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.
vkCmdCopyQueryPoolResults can then be called to copy the timestamp value from the query pool into buffer memory, with ordering and synchronization behavior equivalent to how other queries operate. Timestamp values can also be retrieved from the query pool using vkGetQueryPoolResults. As with other queries, the query must be reset using vkCmdResetQueryPool before requesting the timestamp value be written to it.
While vkCmdWriteTimestamp
can be called inside or outside of a render pass instance, vkCmdCopyQueryPoolResults must only be called outside of a render pass instance.
Valid Usage
queryPool
must have been created with aqueryType
ofVK_QUERY_TYPE_TIMESTAMP
- The query identified by
queryPool
andquery
must be unavailable- The command pool’s queue family must support a non-zero
timestampValidBits
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepipelineStage
must be a valid VkPipelineStageFlagBits valuequeryPool
must be a validVkQueryPool
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations- Both of
commandBuffer
, andqueryPool
must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary
SecondaryBoth
Graphics
computeTransfer
See Also
VkCommandBuffer, VkPipelineStageFlagBits, VkQueryPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdWriteTimestamp
vkCreateBuffer(3)
Name
vkCreateBuffer - Create a new buffer object
C Specification
To create buffers, call:
VkResult vkCreateBuffer( VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);
Parameters
-
device
is the logical device that creates the buffer object. -
pCreateInfo
is a pointer to an instance of theVkBufferCreateInfo
structure containing parameters affecting creation of the buffer. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pBuffer
points to aVkBuffer
handle in which the resulting buffer object is returned.
Description
Valid Usage
- If the
flags
member ofpCreateInfo
includesVK_BUFFER_CREATE_SPARSE_BINDING_BIT
, creating thisVkBuffer
must not cause the total required sparse memory for all currently valid sparse resources on the device to exceedVkPhysicalDeviceLimits
::sparseAddressSpaceSize
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkBufferCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepBuffer
must be a pointer to aVkBuffer
handle
Return Codes
See Also
VkAllocationCallbacks, VkBuffer, VkBufferCreateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateBuffer
vkCreateBufferView(3)
Name
vkCreateBufferView - Create a new buffer view object
C Specification
To create a buffer view, call:
VkResult vkCreateBufferView( VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView);
Parameters
-
device
is the logical device that creates the buffer view. -
pCreateInfo
is a pointer to an instance of theVkBufferViewCreateInfo
structure containing parameters to be used to create the buffer. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pView
points to aVkBufferView
handle in which the resulting buffer view object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkBufferViewCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepView
must be a pointer to aVkBufferView
handle
Return Codes
See Also
VkAllocationCallbacks, VkBufferView, VkBufferViewCreateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateBufferView
vkCreateCommandPool(3)
Name
vkCreateCommandPool - Create a new command pool object
C Specification
To create a command pool, call:
VkResult vkCreateCommandPool( VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool);
Parameters
-
device
is the logical device that creates the command pool. -
pCreateInfo
contains information used to create the command pool. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pCommandPool
points to aVkCommandPool
handle in which the created pool is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkCommandPoolCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepCommandPool
must be a pointer to aVkCommandPool
handle
Return Codes
See Also
VkAllocationCallbacks, VkCommandPool, VkCommandPoolCreateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateCommandPool
vkCreateComputePipelines(3)
Name
vkCreateComputePipelines - Creates a new compute pipeline object
C Specification
To create compute pipelines, call:
VkResult vkCreateComputePipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
Parameters
-
device
is the logical device that creates the compute pipelines. -
pipelineCache
is either VK_NULL_HANDLE, indicating that pipeline caching is disabled; or the handle of a valid pipeline cache object, in which case use of that cache is enabled for the duration of the command. -
createInfoCount
is the length of thepCreateInfos
andpPipelines
arrays. -
pCreateInfos
is an array ofVkComputePipelineCreateInfo
structures. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pPipelines
is a pointer to an array in which the resulting compute pipeline objects are returned.
Description
Valid Usage
- If the
flags
member of any given element ofpCreateInfos
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, and thebasePipelineIndex
member of that same element is not-1
,basePipelineIndex
must be less than the index intopCreateInfos
that corresponds to that element- If the
flags
member of any given element ofpCreateInfos
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, the base pipeline must have been created with theVK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
flag set
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
pipelineCache
is not VK_NULL_HANDLE,pipelineCache
must be a validVkPipelineCache
handlepCreateInfos
must be a pointer to an array ofcreateInfoCount
validVkComputePipelineCreateInfo
structures- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepPipelines
must be a pointer to an array ofcreateInfoCount
VkPipeline
handlescreateInfoCount
must be greater than0
- If
pipelineCache
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VkAllocationCallbacks, VkComputePipelineCreateInfo, VkDevice, VkPipeline, VkPipelineCache
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateComputePipelines
vkCreateDescriptorPool(3)
Name
vkCreateDescriptorPool - Creates a descriptor pool object
C Specification
To create a descriptor pool object, call:
VkResult vkCreateDescriptorPool( VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool);
Parameters
-
device
is the logical device that creates the descriptor pool. -
pCreateInfo
is a pointer to an instance of the VkDescriptorPoolCreateInfo structure specifying the state of the descriptor pool object. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pDescriptorPool
points to aVkDescriptorPool
handle in which the resulting descriptor pool object is returned.
Description
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
The created descriptor pool is returned in pDescriptorPool
.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkDescriptorPoolCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepDescriptorPool
must be a pointer to aVkDescriptorPool
handle
Return Codes
See Also
VkAllocationCallbacks, VkDescriptorPool, VkDescriptorPoolCreateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateDescriptorPool
vkCreateDescriptorSetLayout(3)
Name
vkCreateDescriptorSetLayout - Create a new descriptor set layout
C Specification
To create descriptor set layout objects, call:
VkResult vkCreateDescriptorSetLayout( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout);
Parameters
-
device
is the logical device that creates the descriptor set layout. -
pCreateInfo
is a pointer to an instance of the VkDescriptorSetLayoutCreateInfo structure specifying the state of the descriptor set layout object. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pSetLayout
points to aVkDescriptorSetLayout
handle in which the resulting descriptor set layout object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkDescriptorSetLayoutCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepSetLayout
must be a pointer to aVkDescriptorSetLayout
handle
Return Codes
See Also
VkAllocationCallbacks, VkDescriptorSetLayout, VkDescriptorSetLayoutCreateInfo, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateDescriptorSetLayout
vkCreateDevice(3)
Name
vkCreateDevice - Create a new device instance
C Specification
A logical device is created as a connection to a physical device. To create a logical device, call:
VkResult vkCreateDevice( VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
Parameters
-
physicalDevice
must be one of the device handles returned from a call tovkEnumeratePhysicalDevices
(see Physical Device Enumeration). -
pCreateInfo
is a pointer to a VkDeviceCreateInfo structure containing information about how to create the device. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pDevice
points to a handle in which the createdVkDevice
is returned.
Description
vkCreateDevice
verifies that extensions and features requested in the ppEnabledExtensionNames
and pEnabledFeatures
members of pCreateInfo
, respectively, are supported by the implementation. If any requested extension is not supported, vkCreateDevice
must return VK_ERROR_EXTENSION_NOT_PRESENT
. If any requested feature is not supported, vkCreateDevice
must return VK_ERROR_FEATURE_NOT_PRESENT
. Support for extensions can be checked before creating a device by querying vkEnumerateDeviceExtensionProperties. Support for features can similarly be checked by querying vkGetPhysicalDeviceFeatures.
After verifying and enabling the extensions the VkDevice
object is created and returned to the application. If a requested extension is only supported by a layer, both the layer and the extension need to be specified at vkCreateInstance
time for the creation to succeed.
Multiple logical devices can be created from the same physical device. Logical device creation may fail due to lack of device-specific resources (in addition to the other errors). If that occurs, vkCreateDevice
will return VK_ERROR_TOO_MANY_OBJECTS
.
Valid Usage
- All required extensions for each extension in the VkDeviceCreateInfo::
ppEnabledExtensionNames
list must also be present in that list.
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlepCreateInfo
must be a pointer to a validVkDeviceCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepDevice
must be a pointer to aVkDevice
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkDeviceCreateInfo, VkPhysicalDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateDevice
vkCreateEvent(3)
Name
vkCreateEvent - Create a new event object
C Specification
To create an event, call:
VkResult vkCreateEvent( VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent);
Parameters
-
device
is the logical device that creates the event. -
pCreateInfo
is a pointer to an instance of theVkEventCreateInfo
structure which contains information about how the event is to be created. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pEvent
points to a handle in which the resulting event object is returned.
Description
When created, the event object is in the unsignaled state.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkEventCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepEvent
must be a pointer to aVkEvent
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkEvent, VkEventCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateEvent
vkCreateFence(3)
Name
vkCreateFence - Create a new fence object
C Specification
To create a fence, call:
VkResult vkCreateFence( VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence);
Parameters
-
device
is the logical device that creates the fence. -
pCreateInfo
is a pointer to an instance of theVkFenceCreateInfo
structure which contains information about how the fence is to be created. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pFence
points to a handle in which the resulting fence object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkFenceCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepFence
must be a pointer to aVkFence
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkFence, VkFenceCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateFence
vkCreateFramebuffer(3)
Name
vkCreateFramebuffer - Create a new framebuffer object
C Specification
To create a framebuffer, call:
VkResult vkCreateFramebuffer( VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer);
Parameters
-
device
is the logical device that creates the framebuffer. -
pCreateInfo
points to a VkFramebufferCreateInfo structure which describes additional information about framebuffer creation. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pFramebuffer
points to aVkFramebuffer
handle in which the resulting framebuffer object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkFramebufferCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepFramebuffer
must be a pointer to aVkFramebuffer
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkFramebuffer, VkFramebufferCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateFramebuffer
vkCreateGraphicsPipelines(3)
Name
vkCreateGraphicsPipelines - Create graphics pipelines
C Specification
To create graphics pipelines, call:
VkResult vkCreateGraphicsPipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
Parameters
-
device
is the logical device that creates the graphics pipelines. -
pipelineCache
is either VK_NULL_HANDLE, indicating that pipeline caching is disabled; or the handle of a valid pipeline cache object, in which case use of that cache is enabled for the duration of the command. -
createInfoCount
is the length of thepCreateInfos
andpPipelines
arrays. -
pCreateInfos
is an array ofVkGraphicsPipelineCreateInfo
structures. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pPipelines
is a pointer to an array in which the resulting graphics pipeline objects are returned.
Description
The VkGraphicsPipelineCreateInfo structure includes an array of shader create info structures containing all the desired active shader stages, as well as creation info to define all relevant fixed-function stages, and a pipeline layout.
Valid Usage
- If the
flags
member of any given element ofpCreateInfos
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, and thebasePipelineIndex
member of that same element is not-1
,basePipelineIndex
must be less than the index intopCreateInfos
that corresponds to that element- If the
flags
member of any given element ofpCreateInfos
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, the base pipeline must have been created with theVK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT
flag set
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
pipelineCache
is not VK_NULL_HANDLE,pipelineCache
must be a validVkPipelineCache
handlepCreateInfos
must be a pointer to an array ofcreateInfoCount
validVkGraphicsPipelineCreateInfo
structures- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepPipelines
must be a pointer to an array ofcreateInfoCount
VkPipeline
handlescreateInfoCount
must be greater than0
- If
pipelineCache
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkGraphicsPipelineCreateInfo, VkPipeline, VkPipelineCache
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateGraphicsPipelines
vkCreateImage(3)
Name
vkCreateImage - Create a new image object
C Specification
To create images, call:
VkResult vkCreateImage( VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage);
Parameters
-
device
is the logical device that creates the image. -
pCreateInfo
is a pointer to an instance of theVkImageCreateInfo
structure containing parameters to be used to create the image. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pImage
points to aVkImage
handle in which the resulting image object is returned.
Description
Valid Usage
- If the
flags
member ofpCreateInfo
includesVK_IMAGE_CREATE_SPARSE_BINDING_BIT
, creating thisVkImage
must not cause the total required sparse memory for all currently valid sparse resources on the device to exceedVkPhysicalDeviceLimits
::sparseAddressSpaceSize
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkImageCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepImage
must be a pointer to aVkImage
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkImage, VkImageCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateImage
vkCreateImageView(3)
Name
vkCreateImageView - Create an image view from an existing image
C Specification
To create an image view, call:
VkResult vkCreateImageView( VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView);
Parameters
-
device
is the logical device that creates the image view. -
pCreateInfo
is a pointer to an instance of theVkImageViewCreateInfo
structure containing parameters to be used to create the image view. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pView
points to aVkImageView
handle in which the resulting image view object is returned.
Description
Some of the image creation parameters are inherited by the view. The remaining parameters are contained in the pCreateInfo
.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkImageViewCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepView
must be a pointer to aVkImageView
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkImageView, VkImageViewCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateImageView
vkCreateInstance(3)
Name
vkCreateInstance - Create a new Vulkan instance
C Specification
To create an instance object, call:
VkResult vkCreateInstance( const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
Parameters
-
pCreateInfo
points to an instance of VkInstanceCreateInfo controlling creation of the instance. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pInstance
points aVkInstance
handle in which the resulting instance is returned.
Description
vkCreateInstance
verifies that the requested layers exist. If not, vkCreateInstance
will return VK_ERROR_LAYER_NOT_PRESENT
. Next vkCreateInstance
verifies that the requested extensions are supported (e.g. in the implementation or in any enabled instance layer) and if any requested extension is not supported, vkCreateInstance
must return VK_ERROR_EXTENSION_NOT_PRESENT
. After verifying and enabling the instance layers and extensions the VkInstance
object is created and returned to the application. If a requested extension is only supported by a layer, both the layer and the extension need to be specified at vkCreateInstance
time for the creation to succeed.
Valid Usage
- All required extensions for each extension in the VkInstanceCreateInfo::
ppEnabledExtensionNames
list must also be present in that list.
Valid Usage (Implicit)
pCreateInfo
must be a pointer to a validVkInstanceCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepInstance
must be a pointer to aVkInstance
handle
Return Codes
See Also
VkAllocationCallbacks, VkInstance, VkInstanceCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateInstance
vkCreatePipelineCache(3)
Name
vkCreatePipelineCache - Creates a new pipeline cache
C Specification
To create pipeline cache objects, call:
VkResult vkCreatePipelineCache( VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache);
Parameters
-
device
is the logical device that creates the pipeline cache object. -
pCreateInfo
is a pointer to aVkPipelineCacheCreateInfo
structure that contains the initial parameters for the pipeline cache object. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pPipelineCache
is a pointer to aVkPipelineCache
handle in which the resulting pipeline cache object is returned.
Description
Note
Applications can track and manage the total host memory size of a pipeline cache object using the
pAllocator
. Applications can limit the amount of data retrieved from a pipeline cache object invkGetPipelineCacheData
. Implementations should not internally limit the total number of entries added to a pipeline cache object or the total host memory consumed.
Once created, a pipeline cache can be passed to the vkCreateGraphicsPipelines
and vkCreateComputePipelines
commands. If the pipeline cache passed into these commands is not VK_NULL_HANDLE, the implementation will query it for possible reuse opportunities and update it with new content. The use of the pipeline cache object in these commands is internally synchronized, and the same pipeline cache object can be used in multiple threads simultaneously.
Note
Implementations should make every effort to limit any critical sections to the actual accesses to the cache, which is expected to be significantly shorter than the duration of the
vkCreateGraphicsPipelines
andvkCreateComputePipelines
commands.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkPipelineCacheCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepPipelineCache
must be a pointer to aVkPipelineCache
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkPipelineCache, VkPipelineCacheCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreatePipelineCache
vkCreatePipelineLayout(3)
Name
vkCreatePipelineLayout - Creates a new pipeline layout object
C Specification
To create a pipeline layout, call:
VkResult vkCreatePipelineLayout( VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout);
Parameters
-
device
is the logical device that creates the pipeline layout. -
pCreateInfo
is a pointer to an instance of the VkPipelineLayoutCreateInfo structure specifying the state of the pipeline layout object. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pPipelineLayout
points to aVkPipelineLayout
handle in which the resulting pipeline layout object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkPipelineLayoutCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepPipelineLayout
must be a pointer to aVkPipelineLayout
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkPipelineLayout, VkPipelineLayoutCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreatePipelineLayout
vkCreateQueryPool(3)
Name
vkCreateQueryPool - Create a new query pool object
C Specification
To create a query pool, call:
VkResult vkCreateQueryPool( VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool);
Parameters
-
device
is the logical device that creates the query pool. -
pCreateInfo
is a pointer to an instance of theVkQueryPoolCreateInfo
structure containing the number and type of queries to be managed by the pool. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pQueryPool
is a pointer to aVkQueryPool
handle in which the resulting query pool object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkQueryPoolCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepQueryPool
must be a pointer to aVkQueryPool
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkQueryPool, VkQueryPoolCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateQueryPool
vkCreateRenderPass(3)
Name
vkCreateRenderPass - Create a new render pass object
C Specification
To create a render pass, call:
VkResult vkCreateRenderPass( VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass);
Parameters
-
device
is the logical device that creates the render pass. -
pCreateInfo
is a pointer to an instance of the VkRenderPassCreateInfo structure that describes the parameters of the render pass. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pRenderPass
points to aVkRenderPass
handle in which the resulting render pass object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkRenderPassCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepRenderPass
must be a pointer to aVkRenderPass
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkRenderPass, VkRenderPassCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateRenderPass
vkCreateSampler(3)
Name
vkCreateSampler - Create a new sampler object
C Specification
To create a sampler object, call:
VkResult vkCreateSampler( VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler);
Parameters
-
device
is the logical device that creates the sampler. -
pCreateInfo
is a pointer to an instance of the VkSamplerCreateInfo structure specifying the state of the sampler object. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pSampler
points to a VkSampler handle in which the resulting sampler object is returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkSamplerCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepSampler
must be a pointer to aVkSampler
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkSampler, VkSamplerCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateSampler
vkCreateSemaphore(3)
Name
vkCreateSemaphore - Create a new queue semaphore object
C Specification
To create a semaphore, call:
VkResult vkCreateSemaphore( VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore);
Parameters
-
device
is the logical device that creates the semaphore. -
pCreateInfo
is a pointer to an instance of theVkSemaphoreCreateInfo
structure which contains information about how the semaphore is to be created. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pSemaphore
points to a handle in which the resulting semaphore object is returned.
Description
When created, the semaphore is in the unsignaled state.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkSemaphoreCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepSemaphore
must be a pointer to aVkSemaphore
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkSemaphore, VkSemaphoreCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateSemaphore
vkCreateShaderModule(3)
Name
vkCreateShaderModule - Creates a new shader module object
C Specification
To create a shader module, call:
VkResult vkCreateShaderModule( VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule);
Parameters
-
device
is the logical device that creates the shader module. -
pCreateInfo
parameter is a pointer to an instance of theVkShaderModuleCreateInfo
structure. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter. -
pShaderModule
points to aVkShaderModule
handle in which the resulting shader module object is returned.
Description
Once a shader module has been created, any entry points it contains can be used in pipeline shader stages as described in Compute Pipelines and Graphics Pipelines.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepCreateInfo
must be a pointer to a validVkShaderModuleCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structurepShaderModule
must be a pointer to aVkShaderModule
handle
Return Codes
See Also
VkAllocationCallbacks, VkDevice, VkShaderModule, VkShaderModuleCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCreateShaderModule
vkDestroyBuffer(3)
Name
vkDestroyBuffer - Destroy a buffer object
C Specification
To destroy a buffer, call:
void vkDestroyBuffer( VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the buffer. -
buffer
is the buffer to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
buffer
, either directly or via aVkBufferView
, must have completed execution- If
VkAllocationCallbacks
were provided whenbuffer
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenbuffer
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
buffer
is not VK_NULL_HANDLE,buffer
must be a validVkBuffer
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
buffer
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
buffer
must be externally synchronized
See Also
VkAllocationCallbacks, VkBuffer, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyBuffer
vkDestroyBufferView(3)
Name
vkDestroyBufferView - Destroy a buffer view object
C Specification
To destroy a buffer view, call:
void vkDestroyBufferView( VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the buffer view. -
bufferView
is the buffer view to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
bufferView
must have completed execution- If
VkAllocationCallbacks
were provided whenbufferView
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenbufferView
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
bufferView
is not VK_NULL_HANDLE,bufferView
must be a validVkBufferView
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
bufferView
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
bufferView
must be externally synchronized
See Also
VkAllocationCallbacks, VkBufferView, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyBufferView
vkDestroyCommandPool(3)
Name
vkDestroyCommandPool - Destroy a command pool object
C Specification
To destroy a command pool, call:
void vkDestroyCommandPool( VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the command pool. -
commandPool
is the handle of the command pool to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
When a pool is destroyed, all command buffers allocated from the pool are freed.
Any primary command buffer allocated from another VkCommandPool that is in the recording or executable state and has a secondary command buffer allocated from commandPool
recorded into it, becomes invalid.
Valid Usage
- All
VkCommandBuffer
objects allocated fromcommandPool
must not be in the pending state.- If
VkAllocationCallbacks
were provided whencommandPool
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whencommandPool
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
commandPool
is not VK_NULL_HANDLE,commandPool
must be a validVkCommandPool
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
commandPool
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
commandPool
must be externally synchronized
See Also
VkAllocationCallbacks, VkCommandPool, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyCommandPool
vkDestroyDescriptorPool(3)
Name
vkDestroyDescriptorPool - Destroy a descriptor pool object
C Specification
To destroy a descriptor pool, call:
void vkDestroyDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the descriptor pool. -
descriptorPool
is the descriptor pool to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
When a pool is destroyed, all descriptor sets allocated from the pool are implicitly freed and become invalid. Descriptor sets allocated from a given pool do not need to be freed before destroying that descriptor pool.
Valid Usage
- All submitted commands that refer to
descriptorPool
(via any allocated descriptor sets) must have completed execution- If
VkAllocationCallbacks
were provided whendescriptorPool
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whendescriptorPool
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
descriptorPool
is not VK_NULL_HANDLE,descriptorPool
must be a validVkDescriptorPool
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
descriptorPool
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
descriptorPool
must be externally synchronized
See Also
VkAllocationCallbacks, VkDescriptorPool, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyDescriptorPool
vkDestroyDescriptorSetLayout(3)
Name
vkDestroyDescriptorSetLayout - Destroy a descriptor set layout object
C Specification
To destroy a descriptor set layout, call:
void vkDestroyDescriptorSetLayout( VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the descriptor set layout. -
descriptorSetLayout
is the descriptor set layout to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- If
VkAllocationCallbacks
were provided whendescriptorSetLayout
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whendescriptorSetLayout
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
descriptorSetLayout
is not VK_NULL_HANDLE,descriptorSetLayout
must be a validVkDescriptorSetLayout
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
descriptorSetLayout
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
descriptorSetLayout
must be externally synchronized
See Also
VkAllocationCallbacks, VkDescriptorSetLayout, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyDescriptorSetLayout
vkDestroyDevice(3)
Name
vkDestroyDevice - Destroy a logical device
C Specification
To destroy a device, call:
void vkDestroyDevice( VkDevice device, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
To ensure that no work is active on the device, vkDeviceWaitIdle can be used to gate the destruction of the device. Prior to destroying a device, an application is responsible for destroying/freeing any Vulkan objects that were created using that device as the first parameter of the corresponding vkCreate*
or vkAllocate*
command.
Note
The lifetime of each of these objects is bound by the lifetime of the
VkDevice
object. Therefore, to avoid resource leaks, it is critical that an application explicitly free all of these resources prior to callingvkDestroyDevice
.
Valid Usage
- All child objects created on
device
must have been destroyed prior to destroyingdevice
- If
VkAllocationCallbacks
were provided whendevice
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whendevice
was created,pAllocator
must beNULL
Valid Usage (Implicit)
- If
device
is notNULL
,device
must be a validVkDevice
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure
Host Synchronization
- Host access to
device
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyDevice
vkDestroyEvent(3)
Name
vkDestroyEvent - Destroy an event object
C Specification
To destroy an event, call:
void vkDestroyEvent( VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the event. -
event
is the handle of the event to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
event
must have completed execution- If
VkAllocationCallbacks
were provided whenevent
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenevent
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
event
is not VK_NULL_HANDLE,event
must be a validVkEvent
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
event
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
event
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkEvent
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyEvent
vkDestroyFence(3)
Name
vkDestroyFence - Destroy a fence object
C Specification
To destroy a fence, call:
void vkDestroyFence( VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the fence. -
fence
is the handle of the fence to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All queue submission commands that refer to
fence
must have completed execution- If
VkAllocationCallbacks
were provided whenfence
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenfence
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
fence
is not VK_NULL_HANDLE,fence
must be a validVkFence
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
fence
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
fence
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkFence
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyFence
vkDestroyFramebuffer(3)
Name
vkDestroyFramebuffer - Destroy a framebuffer object
C Specification
To destroy a framebuffer, call:
void vkDestroyFramebuffer( VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the framebuffer. -
framebuffer
is the handle of the framebuffer to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
framebuffer
must have completed execution- If
VkAllocationCallbacks
were provided whenframebuffer
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenframebuffer
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
framebuffer
is not VK_NULL_HANDLE,framebuffer
must be a validVkFramebuffer
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
framebuffer
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
framebuffer
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkFramebuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyFramebuffer
vkDestroyImage(3)
Name
vkDestroyImage - Destroy an image object
C Specification
To destroy an image, call:
void vkDestroyImage( VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the image. -
image
is the image to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
image
, either directly or via aVkImageView
, must have completed execution- If
VkAllocationCallbacks
were provided whenimage
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenimage
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
image
is not VK_NULL_HANDLE,image
must be a validVkImage
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
image
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
image
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyImage
vkDestroyImageView(3)
Name
vkDestroyImageView - Destroy an image view object
C Specification
To destroy an image view, call:
void vkDestroyImageView( VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the image view. -
imageView
is the image view to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
imageView
must have completed execution- If
VkAllocationCallbacks
were provided whenimageView
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenimageView
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
imageView
is not VK_NULL_HANDLE,imageView
must be a validVkImageView
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
imageView
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
imageView
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkImageView
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyImageView
vkDestroyInstance(3)
Name
vkDestroyInstance - Destroy an instance of Vulkan
C Specification
To destroy an instance, call:
void vkDestroyInstance( VkInstance instance, const VkAllocationCallbacks* pAllocator);
Parameters
-
instance
is the handle of the instance to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All child objects created using
instance
must have been destroyed prior to destroyinginstance
- If
VkAllocationCallbacks
were provided wheninstance
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided wheninstance
was created,pAllocator
must beNULL
Valid Usage (Implicit)
- If
instance
is notNULL
,instance
must be a validVkInstance
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure
Host Synchronization
- Host access to
instance
must be externally synchronized
See Also
VkAllocationCallbacks, VkInstance
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyInstance
vkDestroyPipeline(3)
Name
vkDestroyPipeline - Destroy a pipeline object
C Specification
To destroy a graphics or compute pipeline, call:
void vkDestroyPipeline( VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the pipeline. -
pipeline
is the handle of the pipeline to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
pipeline
must have completed execution- If
VkAllocationCallbacks
were provided whenpipeline
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenpipeline
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
pipeline
is not VK_NULL_HANDLE,pipeline
must be a validVkPipeline
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
pipeline
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
pipeline
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkPipeline
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyPipeline
vkDestroyPipelineCache(3)
Name
vkDestroyPipelineCache - Destroy a pipeline cache object
C Specification
To destroy a pipeline cache, call:
void vkDestroyPipelineCache( VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the pipeline cache object. -
pipelineCache
is the handle of the pipeline cache to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- If
VkAllocationCallbacks
were provided whenpipelineCache
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenpipelineCache
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
pipelineCache
is not VK_NULL_HANDLE,pipelineCache
must be a validVkPipelineCache
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
pipelineCache
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
pipelineCache
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkPipelineCache
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyPipelineCache
vkDestroyPipelineLayout(3)
Name
vkDestroyPipelineLayout - Destroy a pipeline layout object
C Specification
To destroy a pipeline layout, call:
void vkDestroyPipelineLayout( VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the pipeline layout. -
pipelineLayout
is the pipeline layout to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- If
VkAllocationCallbacks
were provided whenpipelineLayout
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenpipelineLayout
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
pipelineLayout
is not VK_NULL_HANDLE,pipelineLayout
must be a validVkPipelineLayout
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
pipelineLayout
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
pipelineLayout
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkPipelineLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyPipelineLayout
vkDestroyQueryPool(3)
Name
vkDestroyQueryPool - Destroy a query pool object
C Specification
To destroy a query pool, call:
void vkDestroyQueryPool( VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the query pool. -
queryPool
is the query pool to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
queryPool
must have completed execution- If
VkAllocationCallbacks
were provided whenqueryPool
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenqueryPool
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
queryPool
is not VK_NULL_HANDLE,queryPool
must be a validVkQueryPool
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
queryPool
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
queryPool
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkQueryPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyQueryPool
vkDestroyRenderPass(3)
Name
vkDestroyRenderPass - Destroy a render pass object
C Specification
To destroy a render pass, call:
void vkDestroyRenderPass( VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the render pass. -
renderPass
is the handle of the render pass to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
renderPass
must have completed execution- If
VkAllocationCallbacks
were provided whenrenderPass
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenrenderPass
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
renderPass
is not VK_NULL_HANDLE,renderPass
must be a validVkRenderPass
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
renderPass
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
renderPass
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkRenderPass
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyRenderPass
vkDestroySampler(3)
Name
vkDestroySampler - Destroy a sampler object
C Specification
To destroy a sampler, call:
void vkDestroySampler( VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the sampler. -
sampler
is the sampler to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
sampler
must have completed execution- If
VkAllocationCallbacks
were provided whensampler
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whensampler
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
sampler
is not VK_NULL_HANDLE,sampler
must be a validVkSampler
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
sampler
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
sampler
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkSampler
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroySampler
vkDestroySemaphore(3)
Name
vkDestroySemaphore - Destroy a semaphore object
C Specification
To destroy a semaphore, call:
void vkDestroySemaphore( VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the semaphore. -
semaphore
is the handle of the semaphore to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted batches that refer to
semaphore
must have completed execution- If
VkAllocationCallbacks
were provided whensemaphore
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whensemaphore
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
semaphore
is not VK_NULL_HANDLE,semaphore
must be a validVkSemaphore
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
semaphore
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
semaphore
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkSemaphore
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroySemaphore
vkDestroyShaderModule(3)
Name
vkDestroyShaderModule - Destroy a shader module module
C Specification
To destroy a shader module, call:
void vkDestroyShaderModule( VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that destroys the shader module. -
shaderModule
is the handle of the shader module to destroy. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
A shader module can be destroyed while pipelines created using its shaders are still in use.
Valid Usage
- If
VkAllocationCallbacks
were provided whenshaderModule
was created, a compatible set of callbacks must be provided here- If no
VkAllocationCallbacks
were provided whenshaderModule
was created,pAllocator
must beNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
shaderModule
is not VK_NULL_HANDLE,shaderModule
must be a validVkShaderModule
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
shaderModule
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
shaderModule
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkShaderModule
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDestroyShaderModule
vkDeviceWaitIdle(3)
Name
vkDeviceWaitIdle - Wait for a device to become idle
C Specification
To wait on the host for the completion of outstanding queue operations for all queues on a given logical device, call:
VkResult vkDeviceWaitIdle( VkDevice device);
Parameters
-
device
is the logical device to idle.
Description
vkDeviceWaitIdle
is equivalent to calling vkQueueWaitIdle
for all queues owned by device
.
Valid Usage (Implicit)
device
must be a validVkDevice
handle
Host Synchronization
- Host access to all
VkQueue
objects created fromdevice
must be externally synchronized
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkDeviceWaitIdle
vkEndCommandBuffer(3)
Name
vkEndCommandBuffer - Finish recording a command buffer
C Specification
To complete recording of a command buffer, call:
VkResult vkEndCommandBuffer( VkCommandBuffer commandBuffer);
Parameters
-
commandBuffer
is the command buffer to complete recording.
Description
If there was an error during recording, the application will be notified by an unsuccessful return code returned by vkEndCommandBuffer
. If the application wishes to further use the command buffer, the command buffer must be reset. The command buffer must have been in the recording state, and is moved to the executable state.
Valid Usage
commandBuffer
must be in the recording state.- If
commandBuffer
is a primary command buffer, there must not be an active render pass instance- All queries made active during the recording of
commandBuffer
must have been made inactive
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handle
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkEndCommandBuffer
vkEnumerateDeviceExtensionProperties(3)
Name
vkEnumerateDeviceExtensionProperties - Returns properties of available physical device extensions
C Specification
To query the extensions available to a given physical device, call:
VkResult vkEnumerateDeviceExtensionProperties( VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties);
Parameters
-
physicalDevice
is the physical device that will be queried. -
pLayerName
is eitherNULL
or a pointer to a null-terminated UTF-8 string naming the layer to retrieve extensions from. -
pPropertyCount
is a pointer to an integer related to the number of extension properties available or queried, and is treated in the same fashion as the vkEnumerateInstanceExtensionProperties::pPropertyCount
parameter. -
pProperties
is eitherNULL
or a pointer to an array of VkExtensionProperties structures.
Description
When pLayerName
parameter is NULL, only extensions provided by the Vulkan implementation or by implicitly enabled layers are returned. When pLayerName
is the name of a layer, the device extensions provided by that layer are returned.
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handle- If
pLayerName
is notNULL
,pLayerName
must be a null-terminated UTF-8 stringpPropertyCount
must be a pointer to auint32_t
value- If the value referenced by
pPropertyCount
is not0
, andpProperties
is notNULL
,pProperties
must be a pointer to an array ofpPropertyCount
VkExtensionProperties
structures
Return Codes
See Also
VkExtensionProperties, VkPhysicalDevice
Document Notes
For more information, see the Vulkan Specification at URL
vkEnumerateDeviceLayerProperties(3)
Name
vkEnumerateDeviceLayerProperties - Returns properties of available physical device layers
C Specification
To enumerate device layers, call:
VkResult vkEnumerateDeviceLayerProperties( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties);
Parameters
-
pPropertyCount
is a pointer to an integer related to the number of layer properties available or queried. -
pProperties
is eitherNULL
or a pointer to an array of VkLayerProperties structures.
Description
If pProperties
is NULL
, then the number of layer properties available is returned in pPropertyCount
. Otherwise, pPropertyCount
must point to a variable set by the user to the number of elements in the pProperties
array, and on return the variable is overwritten with the number of structures actually written to pProperties
. If pPropertyCount
is less than the number of layer properties available, at most pPropertyCount
structures will be written. If pPropertyCount
is smaller than the number of layers available, VK_INCOMPLETE
will be returned instead of VK_SUCCESS
, to indicate that not all the available layer properties were returned.
The list of layers enumerated by vkEnumerateDeviceLayerProperties
must be exactly the sequence of layers enabled for the instance. The members of VkLayerProperties
for each enumerated layer must be the same as the properties when the layer was enumerated by vkEnumerateInstanceLayerProperties
.
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlepPropertyCount
must be a pointer to auint32_t
value- If the value referenced by
pPropertyCount
is not0
, andpProperties
is notNULL
,pProperties
must be a pointer to an array ofpPropertyCount
VkLayerProperties
structures
Return Codes
See Also
VkLayerProperties, VkPhysicalDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkEnumerateDeviceLayerProperties
vkEnumerateInstanceExtensionProperties(3)
Name
vkEnumerateInstanceExtensionProperties - Returns up to requested number of global extension properties
C Specification
To query the available instance extensions, call:
VkResult vkEnumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties);
Parameters
-
pLayerName
is eitherNULL
or a pointer to a null-terminated UTF-8 string naming the layer to retrieve extensions from. -
pPropertyCount
is a pointer to an integer related to the number of extension properties available or queried, as described below. -
pProperties
is eitherNULL
or a pointer to an array of VkExtensionProperties structures.
Description
When pLayerName
parameter is NULL, only extensions provided by the Vulkan implementation or by implicitly enabled layers are returned. When pLayerName
is the name of a layer, the instance extensions provided by that layer are returned.
If pProperties
is NULL
, then the number of extensions properties available is returned in pPropertyCount
. Otherwise, pPropertyCount
must point to a variable set by the user to the number of elements in the pProperties
array, and on return the variable is overwritten with the number of structures actually written to pProperties
. If pPropertyCount
is less than the number of extension properties available, at most pPropertyCount
structures will be written. If pPropertyCount
is smaller than the number of extensions available, VK_INCOMPLETE
will be returned instead of VK_SUCCESS
, to indicate that not all the available properties were returned.
Because the list of available layers may change externally between calls to vkEnumerateInstanceExtensionProperties
, two calls may retrieve different results if a pLayerName
is available in one call but not in another. The extensions supported by a layer may also change between two calls, e.g. if the layer implementation is replaced by a different version between those calls.
Valid Usage (Implicit)
- If
pLayerName
is notNULL
,pLayerName
must be a null-terminated UTF-8 stringpPropertyCount
must be a pointer to auint32_t
value- If the value referenced by
pPropertyCount
is not0
, andpProperties
is notNULL
,pProperties
must be a pointer to an array ofpPropertyCount
VkExtensionProperties
structures
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
vkEnumerateInstanceLayerProperties(3)
Name
vkEnumerateInstanceLayerProperties - Returns up to requested number of global layer properties
C Specification
To query the available layers, call:
VkResult vkEnumerateInstanceLayerProperties( uint32_t* pPropertyCount, VkLayerProperties* pProperties);
Parameters
-
pPropertyCount
is a pointer to an integer related to the number of layer properties available or queried, as described below. -
pProperties
is eitherNULL
or a pointer to an array of VkLayerProperties structures.
Description
If pProperties
is NULL
, then the number of layer properties available is returned in pPropertyCount
. Otherwise, pPropertyCount
must point to a variable set by the user to the number of elements in the pProperties
array, and on return the variable is overwritten with the number of structures actually written to pProperties
. If pPropertyCount
is less than the number of layer properties available, at most pPropertyCount
structures will be written. If pPropertyCount
is smaller than the number of layers available, VK_INCOMPLETE
will be returned instead of VK_SUCCESS
, to indicate that not all the available layer properties were returned.
The list of available layers may change at any time due to actions outside of the Vulkan implementation, so two calls to vkEnumerateInstanceLayerProperties
with the same parameters may return different results, or retrieve different pPropertyCount
values or pProperties
contents. Once an instance has been created, the layers enabled for that instance will continue to be enabled and valid for the lifetime of that instance, even if some of them become unavailable for future instances.
Valid Usage (Implicit)
pPropertyCount
must be a pointer to auint32_t
value- If the value referenced by
pPropertyCount
is not0
, andpProperties
is notNULL
,pProperties
must be a pointer to an array ofpPropertyCount
VkLayerProperties
structures
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
vkEnumeratePhysicalDevices(3)
Name
vkEnumeratePhysicalDevices - Enumerates the physical devices accessible to a Vulkan instance
C Specification
To retrieve a list of physical device objects representing the physical devices installed in the system, call:
VkResult vkEnumeratePhysicalDevices( VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
Parameters
-
instance
is a handle to a Vulkan instance previously created with vkCreateInstance. -
pPhysicalDeviceCount
is a pointer to an integer related to the number of physical devices available or queried, as described below. -
pPhysicalDevices
is eitherNULL
or a pointer to an array ofVkPhysicalDevice
handles.
Description
If pPhysicalDevices
is NULL
, then the number of physical devices available is returned in pPhysicalDeviceCount
. Otherwise, pPhysicalDeviceCount
must point to a variable set by the user to the number of elements in the pPhysicalDevices
array, and on return the variable is overwritten with the number of handles actually written to pPhysicalDevices
. If pPhysicalDeviceCount
is less than the number of physical devices available, at most pPhysicalDeviceCount
structures will be written. If pPhysicalDeviceCount
is smaller than the number of physical devices available, VK_INCOMPLETE
will be returned instead of VK_SUCCESS
, to indicate that not all the available physical devices were returned.
Valid Usage (Implicit)
instance
must be a validVkInstance
handlepPhysicalDeviceCount
must be a pointer to auint32_t
value- If the value referenced by
pPhysicalDeviceCount
is not0
, andpPhysicalDevices
is notNULL
,pPhysicalDevices
must be a pointer to an array ofpPhysicalDeviceCount
VkPhysicalDevice
handles
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkEnumeratePhysicalDevices
vkFlushMappedMemoryRanges(3)
Name
vkFlushMappedMemoryRanges - Flush mapped memory ranges
C Specification
To flush ranges of non-coherent memory from the host caches, call:
VkResult vkFlushMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
Parameters
-
device
is the logical device that owns the memory ranges. -
memoryRangeCount
is the length of thepMemoryRanges
array. -
pMemoryRanges
is a pointer to an array of VkMappedMemoryRange structures describing the memory ranges to flush.
Description
vkFlushMappedMemoryRanges
guarantees that host writes to the memory ranges described by pMemoryRanges
can be made available to device access, via availability operations from the VK_ACCESS_HOST_WRITE_BIT
access type.
Unmapping non-coherent memory does not implicitly flush the mapped memory, and host writes that have not been flushed may not ever be visible to the device. However, implementations must ensure that writes that have not been flushed do not become visible to any other memory.
Note
The above guarantee avoids a potential memory corruption in scenarios where host writes to a mapped memory object have not been flushed before the memory is unmapped (or freed), and the virtual address range is subsequently reused for a different mapping (or memory allocation).
Valid Usage (Implicit)
device
must be a validVkDevice
handlepMemoryRanges
must be a pointer to an array ofmemoryRangeCount
validVkMappedMemoryRange
structuresmemoryRangeCount
must be greater than0
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkFlushMappedMemoryRanges
vkFreeCommandBuffers(3)
Name
vkFreeCommandBuffers - Free command buffers
C Specification
To free command buffers, call:
void vkFreeCommandBuffers( VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers);
Parameters
-
device
is the logical device that owns the command pool. -
commandPool
is the command pool from which the command buffers were allocated. -
commandBufferCount
is the length of thepCommandBuffers
array. -
pCommandBuffers
is an array of handles of command buffers to free.
Description
Any primary command buffer that is in the recording or executable state and has any element of pCommandBuffers
recorded into it, becomes invalid.
Valid Usage
- All elements of
pCommandBuffers
must not be in the pending statepCommandBuffers
must be a pointer to an array ofcommandBufferCount
VkCommandBuffer
handles, each element of which must either be a valid handle orNULL
Valid Usage (Implicit)
device
must be a validVkDevice
handlecommandPool
must be a validVkCommandPool
handlecommandBufferCount
must be greater than0
commandPool
must have been created, allocated, or retrieved fromdevice
- Each element of
pCommandBuffers
that is a valid handle must have been created, allocated, or retrieved fromcommandPool
Host Synchronization
- Host access to
commandPool
must be externally synchronized- Host access to each member of
pCommandBuffers
must be externally synchronized
See Also
VkCommandBuffer, VkCommandPool, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkFreeCommandBuffers
vkFreeDescriptorSets(3)
Name
vkFreeDescriptorSets - Free one or more descriptor sets
C Specification
To free allocated descriptor sets, call:
VkResult vkFreeDescriptorSets( VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets);
Parameters
-
device
is the logical device that owns the descriptor pool. -
descriptorPool
is the descriptor pool from which the descriptor sets were allocated. -
descriptorSetCount
is the number of elements in thepDescriptorSets
array. -
pDescriptorSets
is an array of handles toVkDescriptorSet
objects.
Description
After a successful call to vkFreeDescriptorSets
, all descriptor sets in pDescriptorSets
are invalid.
Valid Usage
- All submitted commands that refer to any element of
pDescriptorSets
must have completed executionpDescriptorSets
must be a pointer to an array ofdescriptorSetCount
VkDescriptorSet
handles, each element of which must either be a valid handle or VK_NULL_HANDLE- Each valid handle in
pDescriptorSets
must have been allocated fromdescriptorPool
descriptorPool
must have been created with theVK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT
flag
Valid Usage (Implicit)
device
must be a validVkDevice
handledescriptorPool
must be a validVkDescriptorPool
handledescriptorSetCount
must be greater than0
descriptorPool
must have been created, allocated, or retrieved fromdevice
- Each element of
pDescriptorSets
that is a valid handle must have been created, allocated, or retrieved fromdescriptorPool
Host Synchronization
- Host access to
descriptorPool
must be externally synchronized- Host access to each member of
pDescriptorSets
must be externally synchronized
Return Codes
See Also
VkDescriptorPool, VkDescriptorSet, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkFreeDescriptorSets
vkFreeMemory(3)
Name
vkFreeMemory - Free GPU memory
C Specification
To free a memory object, call:
void vkFreeMemory( VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator);
Parameters
-
device
is the logical device that owns the memory. -
memory
is theVkDeviceMemory
object to be freed. -
pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Before freeing a memory object, an application must ensure the memory object is no longer in use by the device—for example by command buffers queued for execution. The memory can remain bound to images or buffers at the time the memory object is freed, but any further use of them (on host or device) for anything other than destroying those objects will result in undefined behavior. If there are still any bound images or buffers, the memory may not be immediately released by the implementation, but must be released by the time all bound images and buffers have been destroyed. Once memory is released, it is returned to the heap from which it was allocated.
How memory objects are bound to Images and Buffers is described in detail in the Resource Memory Association section.
If a memory object is mapped at the time it is freed, it is implicitly unmapped.
Note
As described below, host writes are not implicitly flushed when the memory object is unmapped, but the implementation must guarantee that writes that have not been flushed do not affect any other memory.
Valid Usage
- All submitted commands that refer to
memory
(via images or buffers) must have completed execution
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
memory
is not VK_NULL_HANDLE,memory
must be a validVkDeviceMemory
handle- If
pAllocator
is notNULL
,pAllocator
must be a pointer to a validVkAllocationCallbacks
structure- If
memory
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
memory
must be externally synchronized
See Also
VkAllocationCallbacks, VkDevice, VkDeviceMemory
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkFreeMemory
vkGetBufferMemoryRequirements(3)
Name
vkGetBufferMemoryRequirements - Returns the memory requirements for specified Vulkan object
C Specification
To determine the memory requirements for a buffer resource, call:
void vkGetBufferMemoryRequirements( VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
Parameters
-
device
is the logical device that owns the buffer. -
buffer
is the buffer to query. -
pMemoryRequirements
points to an instance of the VkMemoryRequirements structure in which the memory requirements of the buffer object are returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handlebuffer
must be a validVkBuffer
handlepMemoryRequirements
must be a pointer to aVkMemoryRequirements
structurebuffer
must have been created, allocated, or retrieved fromdevice
See Also
VkBuffer, VkDevice, VkMemoryRequirements
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetBufferMemoryRequirements
vkGetDeviceMemoryCommitment(3)
Name
vkGetDeviceMemoryCommitment - Query the current commitment for a VkDeviceMemory
C Specification
To determine the amount of lazily-allocated memory that is currently committed for a memory object, call:
void vkGetDeviceMemoryCommitment( VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes);
Parameters
-
device
is the logical device that owns the memory. -
memory
is the memory object being queried. -
pCommittedMemoryInBytes
is a pointer to aVkDeviceSize
value in which the number of bytes currently committed is returned, on success.
Description
The implementation may update the commitment at any time, and the value returned by this query may be out of date.
The implementation guarantees to allocate any committed memory from the heapIndex indicated by the memory type that the memory object was created with.
Valid Usage
memory
must have been created with a memory type that reportsVK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
Valid Usage (Implicit)
device
must be a validVkDevice
handlememory
must be a validVkDeviceMemory
handlepCommittedMemoryInBytes
must be a pointer to aVkDeviceSize
valuememory
must have been created, allocated, or retrieved fromdevice
See Also
VkDevice, VkDeviceMemory, VkDeviceSize
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetDeviceMemoryCommitment
vkGetDeviceProcAddr(3)
Name
vkGetDeviceProcAddr - Return a function pointer for a command
C Specification
In order to support systems with multiple Vulkan implementations comprising heterogeneous collections of hardware and software, the function pointers returned by vkGetInstanceProcAddr
may point to dispatch code, which calls a different real implementation for different VkDevice
objects (and objects created from them). The overhead of this internal dispatch can be avoided by obtaining device-specific function pointers for any commands that use a device or device-child object as their dispatchable object. Such function pointers can be obtained with the command:
PFN_vkVoidFunction vkGetDeviceProcAddr( VkDevice device, const char* pName);
Parameters
The table below defines the various use cases for vkGetDeviceProcAddr
and expected return value for each case.
Description
The returned function pointer is of type PFN_vkVoidFunction, and must be cast to the type of the command being queried.
device | pName | return value |
---|---|---|
| * | undefined |
invalid device | * | undefined |
device |
| undefined |
device | core Vulkan command | fp1 |
device | enabled extension commands | fp1 |
device | * (any |
|
- 1
- The returned function pointer must only be called with a dispatchable object (the first parameter) that is
device
or a child ofdevice
. e.g.VkDevice
,VkQueue
, orVkCommandBuffer
.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepName
must be a null-terminated UTF-8 string
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetDeviceProcAddr
vkGetDeviceQueue(3)
Name
vkGetDeviceQueue - Get a queue handle from a device
C Specification
To retrieve a handle to a VkQueue object, call:
void vkGetDeviceQueue( VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue);
Parameters
-
device
is the logical device that owns the queue. -
queueFamilyIndex
is the index of the queue family to which the queue belongs. -
queueIndex
is the index within this queue family of the queue to retrieve. -
pQueue
is a pointer to aVkQueue
object that will be filled with the handle for the requested queue.
Description
Valid Usage
queueFamilyIndex
must be one of the queue family indices specified whendevice
was created, via theVkDeviceQueueCreateInfo
structurequeueIndex
must be less than the number of queues created for the specified queue family index whendevice
was created, via thequeueCount
member of theVkDeviceQueueCreateInfo
structure
Valid Usage (Implicit)
device
must be a validVkDevice
handlepQueue
must be a pointer to aVkQueue
handle
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetDeviceQueue
vkGetEventStatus(3)
Name
vkGetEventStatus - Retrieve the status of an event object
C Specification
To query the state of an event from the host, call:
VkResult vkGetEventStatus( VkDevice device, VkEvent event);
Parameters
-
device
is the logical device that owns the event. -
event
is the handle of the event to query.
Description
Upon success, vkGetEventStatus
returns the state of the event object with the following return codes:
Status | Meaning |
---|---|
| The event specified by |
| The event specified by |
If a vkCmdSetEvent
or vkCmdResetEvent
command is in a command buffer that is in the pending state, then the value returned by this command may immediately be out of date.
The state of an event can be updated by the host. The state of the event is immediately changed, and subsequent calls to vkGetEventStatus
will return the new state. If an event is already in the requested state, then updating it to the same state has no effect.
Valid Usage (Implicit)
device
must be a validVkDevice
handleevent
must be a validVkEvent
handleevent
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetEventStatus
vkGetFenceStatus(3)
Name
vkGetFenceStatus - Return the status of a fence
C Specification
To query the status of a fence from the host, call:
VkResult vkGetFenceStatus( VkDevice device, VkFence fence);
Parameters
-
device
is the logical device that owns the fence. -
fence
is the handle of the fence to query.
Description
Upon success, vkGetFenceStatus
returns the status of the fence object, with the following return codes:
Status | Meaning |
---|---|
| The fence specified by |
| The fence specified by |
| The device has been lost. See Lost Device. |
If a queue submission command is pending execution, then the value returned by this command may immediately be out of date.
If the device has been lost (see Lost Device), vkGetFenceStatus
may return any of the above status codes. If the device has been lost and vkGetFenceStatus
is called repeatedly, it will eventually return either VK_SUCCESS
or VK_DEVICE_LOST
.
Valid Usage (Implicit)
device
must be a validVkDevice
handlefence
must be a validVkFence
handlefence
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetFenceStatus
vkGetImageMemoryRequirements(3)
Name
vkGetImageMemoryRequirements - Returns the memory requirements for specified Vulkan object
C Specification
To determine the memory requirements for an image resource, call:
void vkGetImageMemoryRequirements( VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
Parameters
-
device
is the logical device that owns the image. -
image
is the image to query. -
pMemoryRequirements
points to an instance of the VkMemoryRequirements structure in which the memory requirements of the image object are returned.
Description
Valid Usage (Implicit)
device
must be a validVkDevice
handleimage
must be a validVkImage
handlepMemoryRequirements
must be a pointer to aVkMemoryRequirements
structureimage
must have been created, allocated, or retrieved fromdevice
See Also
VkDevice, VkImage, VkMemoryRequirements
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetImageMemoryRequirements
vkGetImageSparseMemoryRequirements(3)
Name
vkGetImageSparseMemoryRequirements - Query the memory requirements for a sparse image
C Specification
To query sparse memory requirements for an image, call:
void vkGetImageSparseMemoryRequirements( VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
Parameters
-
device
is the logical device that owns the image. -
image
is theVkImage
object to get the memory requirements for. -
pSparseMemoryRequirementCount
is a pointer to an integer related to the number of sparse memory requirements available or queried, as described below. -
pSparseMemoryRequirements
is eitherNULL
or a pointer to an array ofVkSparseImageMemoryRequirements
structures.
Description
If pSparseMemoryRequirements
is NULL
, then the number of sparse memory requirements available is returned in pSparseMemoryRequirementCount
. Otherwise, pSparseMemoryRequirementCount
must point to a variable set by the user to the number of elements in the pSparseMemoryRequirements
array, and on return the variable is overwritten with the number of structures actually written to pSparseMemoryRequirements
. If pSparseMemoryRequirementCount
is less than the number of sparse memory requirements available, at most pSparseMemoryRequirementCount
structures will be written.
If the image was not created with VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
then pSparseMemoryRequirementCount
will be set to zero and pSparseMemoryRequirements
will not be written to.
Note
It is legal for an implementation to report a larger value in
VkMemoryRequirements
::size
than would be obtained by adding together memory sizes for allVkSparseImageMemoryRequirements
returned byvkGetImageSparseMemoryRequirements
. This may occur when the hardware requires unused padding in the address range describing the resource.
Valid Usage (Implicit)
device
must be a validVkDevice
handleimage
must be a validVkImage
handlepSparseMemoryRequirementCount
must be a pointer to auint32_t
value- If the value referenced by
pSparseMemoryRequirementCount
is not0
, andpSparseMemoryRequirements
is notNULL
,pSparseMemoryRequirements
must be a pointer to an array ofpSparseMemoryRequirementCount
VkSparseImageMemoryRequirements
structuresimage
must have been created, allocated, or retrieved fromdevice
See Also
VkDevice, VkImage, VkSparseImageMemoryRequirements
Document Notes
For more information, see the Vulkan Specification at URL
vkGetImageSubresourceLayout(3)
Name
vkGetImageSubresourceLayout - Retrieve information about an image subresource
C Specification
To query the host access layout of an image subresource, for an image created with linear tiling, call:
void vkGetImageSubresourceLayout( VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout);
Parameters
-
device
is the logical device that owns the image. -
image
is the image whose layout is being queried. -
pSubresource
is a pointer to a VkImageSubresource structure selecting a specific image for the image subresource. -
pLayout
points to a VkSubresourceLayout structure in which the layout is returned.
Description
vkGetImageSubresourceLayout is invariant for the lifetime of a single image.
Valid Usage
image
must have been created withtiling
equal toVK_IMAGE_TILING_LINEAR
- The
aspectMask
member ofpSubresource
must only have a single bit set
Valid Usage (Implicit)
device
must be a validVkDevice
handleimage
must be a validVkImage
handlepSubresource
must be a pointer to a validVkImageSubresource
structurepLayout
must be a pointer to aVkSubresourceLayout
structureimage
must have been created, allocated, or retrieved fromdevice
See Also
VkDevice, VkImage, VkImageSubresource, VkSubresourceLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetImageSubresourceLayout
vkGetInstanceProcAddr(3)
Name
vkGetInstanceProcAddr - Return a function pointer for a command
C Specification
Vulkan commands are not necessarily exposed statically on a platform. Function pointers for all Vulkan commands can be obtained with the command:
PFN_vkVoidFunction vkGetInstanceProcAddr( VkInstance instance, const char* pName);
Parameters
-
instance
is the instance that the function pointer will be compatible with, orNULL
for commands not dependent on any instance. -
pName
is the name of the command to obtain.
Description
vkGetInstanceProcAddr
itself is obtained in a platform- and loader- specific manner. Typically, the loader library will export this command as a function symbol, so applications can link against the loader library, or load it dynamically and look up the symbol using platform-specific APIs. Loaders are encouraged to export function symbols for all other core Vulkan commands as well; if this is done, then applications that use only the core Vulkan commands have no need to use vkGetInstanceProcAddr
.
The table below defines the various use cases for vkGetInstanceProcAddr
and expected return value ("fp" is function pointer) for each case.
The returned function pointer is of type PFN_vkVoidFunction, and must be cast to the type of the command being queried.
instance | pName | return value |
---|---|---|
* |
| undefined |
invalid instance | * | undefined |
| fp | |
| fp | |
| fp | |
| * (any |
|
instance | core Vulkan command | fp1 |
instance | enabled instance extension commands for | fp1 |
instance | available device extension2 commands for | fp1 |
instance | * (any |
|
- 1
- The returned function pointer must only be called with a dispatchable object (the first parameter) that is
instance
or a child ofinstance
. e.g.VkInstance
,VkPhysicalDevice
,VkDevice
,VkQueue
, orVkCommandBuffer
. - 2
- An “available extension” is an extension function supported by any of the loader, driver or layer.
Valid Usage (Implicit)
- If
instance
is notNULL
,instance
must be a validVkInstance
handlepName
must be a null-terminated UTF-8 string
See Also
PFN_vkVoidFunction, VkInstance
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetInstanceProcAddr
vkGetPhysicalDeviceFeatures(3)
Name
vkGetPhysicalDeviceFeatures - Reports capabilities of a physical device
C Specification
To query supported features, call:
void vkGetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
Parameters
-
physicalDevice
is the physical device from which to query the supported features. -
pFeatures
is a pointer to a VkPhysicalDeviceFeatures structure in which the physical device features are returned. For each feature, a value ofVK_TRUE
indicates that the feature is supported on this physical device, andVK_FALSE
indicates that the feature is not supported.
Description
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlepFeatures
must be a pointer to aVkPhysicalDeviceFeatures
structure
See Also
VkPhysicalDevice, VkPhysicalDeviceFeatures
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetPhysicalDeviceFeatures
vkGetPhysicalDeviceFormatProperties(3)
Name
vkGetPhysicalDeviceFormatProperties - Lists physical device’s format capabilities
C Specification
To query supported format features which are properties of the physical device, call:
void vkGetPhysicalDeviceFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
Parameters
-
physicalDevice
is the physical device from which to query the format properties. -
format
is the format whose properties are queried. -
pFormatProperties
is a pointer to a VkFormatProperties structure in which physical device properties forformat
are returned.
Description
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handleformat
must be a valid VkFormat valuepFormatProperties
must be a pointer to aVkFormatProperties
structure
See Also
VkFormat, VkFormatProperties, VkPhysicalDevice
Document Notes
For more information, see the Vulkan Specification at URL
vkGetPhysicalDeviceImageFormatProperties(3)
Name
vkGetPhysicalDeviceImageFormatProperties - Lists physical device’s image format capabilities
C Specification
To query additional capabilities specific to image types, call:
VkResult vkGetPhysicalDeviceImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties);
Parameters
-
physicalDevice
is the physical device from which to query the image capabilities. -
format
is a VkFormat value specifying the image format, corresponding to VkImageCreateInfo::format
. -
type
is a VkImageType value specifying the image type, corresponding to VkImageCreateInfo::imageType
. -
tiling
is a VkImageTiling value specifying the image tiling, corresponding to VkImageCreateInfo::tiling
. -
usage
is a bitmask of VkImageUsageFlagBits specifying the intended usage of the image, corresponding to VkImageCreateInfo::usage
. -
flags
is a bitmask of VkImageCreateFlagBits specifying additional parameters of the image, corresponding to VkImageCreateInfo::flags
. -
pImageFormatProperties
points to an instance of the VkImageFormatProperties structure in which capabilities are returned.
Description
The format
, type
, tiling
, usage
, and flags
parameters correspond to parameters that would be consumed by vkCreateImage (as members of VkImageCreateInfo
).
If format
is not a supported image format, or if the combination of format
, type
, tiling
, usage
, and flags
is not supported for images, then vkGetPhysicalDeviceImageFormatProperties
returns VK_ERROR_FORMAT_NOT_SUPPORTED
.
The limitations on an image format that are reported by vkGetPhysicalDeviceImageFormatProperties
have the following property: if usage1
and usage2
of type VkImageUsageFlags are such that the bits set in usage1
are a subset of the bits set in usage2
, and flags1
and flags2
of type VkImageCreateFlags are such that the bits set in flags1
are a subset of the bits set in flags2
, then the limitations for usage1
and flags1
must be no more strict than the limitations for usage2
and flags2
, for all values of format
, type
, and tiling
.
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handleformat
must be a valid VkFormat valuetype
must be a valid VkImageType valuetiling
must be a valid VkImageTiling valueusage
must be a valid combination of VkImageUsageFlagBits valuesusage
must not be0
flags
must be a valid combination of VkImageCreateFlagBits valuespImageFormatProperties
must be a pointer to aVkImageFormatProperties
structure
Return Codes
See Also
VkFormat, VkImageCreateFlags, VkImageFormatProperties, VkImageTiling, VkImageType, VkImageUsageFlags, VkPhysicalDevice
Document Notes
For more information, see the Vulkan Specification at URL
vkGetPhysicalDeviceMemoryProperties(3)
Name
vkGetPhysicalDeviceMemoryProperties - Reports memory information for the specified physical device
C Specification
To query memory properties, call:
void vkGetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
Parameters
-
physicalDevice
is the handle to the device to query. -
pMemoryProperties
points to an instance ofVkPhysicalDeviceMemoryProperties
structure in which the properties are returned.
Description
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlepMemoryProperties
must be a pointer to aVkPhysicalDeviceMemoryProperties
structure
See Also
VkPhysicalDevice, VkPhysicalDeviceMemoryProperties
Document Notes
For more information, see the Vulkan Specification at URL
vkGetPhysicalDeviceProperties(3)
Name
vkGetPhysicalDeviceProperties - Returns properties of a physical device
C Specification
To query general properties of physical devices once enumerated, call:
void vkGetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
Parameters
-
physicalDevice
is the handle to the physical device whose properties will be queried. -
pProperties
points to an instance of the VkPhysicalDeviceProperties structure, that will be filled with returned information.
Description
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlepProperties
must be a pointer to aVkPhysicalDeviceProperties
structure
See Also
VkPhysicalDevice, VkPhysicalDeviceProperties
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetPhysicalDeviceProperties
vkGetPhysicalDeviceQueueFamilyProperties(3)
Name
vkGetPhysicalDeviceQueueFamilyProperties - Reports properties of the queues of the specified physical device
C Specification
To query properties of queues available on a physical device, call:
void vkGetPhysicalDeviceQueueFamilyProperties( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties);
Parameters
-
physicalDevice
is the handle to the physical device whose properties will be queried. -
pQueueFamilyPropertyCount
is a pointer to an integer related to the number of queue families available or queried, as described below. -
pQueueFamilyProperties
is eitherNULL
or a pointer to an array of VkQueueFamilyProperties structures.
Description
If pQueueFamilyProperties
is NULL
, then the number of queue families available is returned in pQueueFamilyPropertyCount
. Otherwise, pQueueFamilyPropertyCount
must point to a variable set by the user to the number of elements in the pQueueFamilyProperties
array, and on return the variable is overwritten with the number of structures actually written to pQueueFamilyProperties
. If pQueueFamilyPropertyCount
is less than the number of queue families available, at most pQueueFamilyPropertyCount
structures will be written.
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handlepQueueFamilyPropertyCount
must be a pointer to auint32_t
value- If the value referenced by
pQueueFamilyPropertyCount
is not0
, andpQueueFamilyProperties
is notNULL
,pQueueFamilyProperties
must be a pointer to an array ofpQueueFamilyPropertyCount
VkQueueFamilyProperties
structures
See Also
VkPhysicalDevice, VkQueueFamilyProperties
Document Notes
For more information, see the Vulkan Specification at URL
vkGetPhysicalDeviceSparseImageFormatProperties(3)
Name
vkGetPhysicalDeviceSparseImageFormatProperties - Retrieve properties of an image format applied to sparse images
C Specification
vkGetPhysicalDeviceSparseImageFormatProperties
returns an array of VkSparseImageFormatProperties. Each element will describe properties for one set of image aspects that are bound simultaneously in the image. This is usually one element for each aspect in the image, but for interleaved depth/stencil images there is only one element describing the combined aspects.
void vkGetPhysicalDeviceSparseImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties);
Parameters
-
physicalDevice
is the physical device from which to query the sparse image capabilities. -
format
is the image format. -
type
is the dimensionality of image. -
samples
is the number of samples per pixel as defined in VkSampleCountFlagBits. -
usage
is a bitmask describing the intended usage of the image. -
tiling
is the tiling arrangement of the data elements in memory. -
pPropertyCount
is a pointer to an integer related to the number of sparse format properties available or queried, as described below. -
pProperties
is eitherNULL
or a pointer to an array of VkSparseImageFormatProperties structures.
Description
If pProperties
is NULL
, then the number of sparse format properties available is returned in pPropertyCount
. Otherwise, pPropertyCount
must point to a variable set by the user to the number of elements in the pProperties
array, and on return the variable is overwritten with the number of structures actually written to pProperties
. If pPropertyCount
is less than the number of sparse format properties available, at most pPropertyCount
structures will be written.
If VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
is not supported for the given arguments, pPropertyCount
will be set to zero upon return, and no data will be written to pProperties
.
Multiple aspects are returned for depth/stencil images that are implemented as separate planes by the implementation. The depth and stencil data planes each have unique VkSparseImageFormatProperties
data.
Depth/stencil images with depth and stencil data interleaved into a single plane will return a single VkSparseImageFormatProperties
structure with the aspectMask
set to VK_IMAGE_ASPECT_DEPTH_BIT
| VK_IMAGE_ASPECT_STENCIL_BIT
.
Valid Usage
samples
must be a bit value that is set inVkImageFormatProperties
::sampleCounts
returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,type
,tiling
, andusage
equal to those in this command andflags
equal to the value that is set inVkImageCreateInfo
::flags
when the image is created
Valid Usage (Implicit)
physicalDevice
must be a validVkPhysicalDevice
handleformat
must be a valid VkFormat valuetype
must be a valid VkImageType valuesamples
must be a valid VkSampleCountFlagBits valueusage
must be a valid combination of VkImageUsageFlagBits valuesusage
must not be0
tiling
must be a valid VkImageTiling valuepPropertyCount
must be a pointer to auint32_t
value- If the value referenced by
pPropertyCount
is not0
, andpProperties
is notNULL
,pProperties
must be a pointer to an array ofpPropertyCount
VkSparseImageFormatProperties
structures
See Also
VkFormat, VkImageTiling, VkImageType, VkImageUsageFlags, VkPhysicalDevice, VkSampleCountFlagBits, VkSparseImageFormatProperties
Document Notes
For more information, see the Vulkan Specification at URL
vkGetPipelineCacheData(3)
Name
vkGetPipelineCacheData - Get the data store from a pipeline cache
C Specification
Data can be retrieved from a pipeline cache object using the command:
VkResult vkGetPipelineCacheData( VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData);
Parameters
-
device
is the logical device that owns the pipeline cache. -
pipelineCache
is the pipeline cache to retrieve data from. -
pDataSize
is a pointer to a value related to the amount of data in the pipeline cache, as described below. -
pData
is eitherNULL
or a pointer to a buffer.
Description
If pData
is NULL
, then the maximum size of the data that can be retrieved from the pipeline cache, in bytes, is returned in pDataSize
. Otherwise, pDataSize
must point to a variable set by the user to the size of the buffer, in bytes, pointed to by pData
, and on return the variable is overwritten with the amount of data actually written to pData
.
If pDataSize
is less than the maximum size that can be retrieved by the pipeline cache, at most pDataSize
bytes will be written to pData
, and vkGetPipelineCacheData
will return VK_INCOMPLETE
. Any data written to pData
is valid and can be provided as the pInitialData
member of the VkPipelineCacheCreateInfo
structure passed to vkCreatePipelineCache
.
Two calls to vkGetPipelineCacheData
with the same parameters must retrieve the same data unless a command that modifies the contents of the cache is called between them.
Applications can store the data retrieved from the pipeline cache, and use these data, possibly in a future run of the application, to populate new pipeline cache objects. The results of pipeline compiles, however, may depend on the vendor ID, device ID, driver version, and other details of the device. To enable applications to detect when previously retrieved data is incompatible with the device, the initial bytes written to pData
must be a header consisting of the following members:
Offset | Size | Meaning |
---|---|---|
0 | 4 | length in bytes of the entire pipeline cache header written as a stream of bytes, with the least significant byte first |
4 | 4 | a VkPipelineCacheHeaderVersion value written as a stream of bytes, with the least significant byte first |
8 | 4 | a vendor ID equal to |
12 | 4 | a device ID equal to |
16 |
| a pipeline cache ID equal to |
The first four bytes encode the length of the entire pipeline header, in bytes. This value includes all fields in the header including the pipeline cache version field and the size of the length field.
The next four bytes encode the pipeline cache version, as described for VkPipelineCacheHeaderVersion. A consumer of the pipeline cache should use the cache version to interpret the remainder of the cache header.
If pDataSize
is less than what is necessary to store this header, nothing will be written to pData
and zero will be written to pDataSize
.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepipelineCache
must be a validVkPipelineCache
handlepDataSize
must be a pointer to asize_t
value- If the value referenced by
pDataSize
is not0
, andpData
is notNULL
,pData
must be a pointer to an array ofpDataSize
bytespipelineCache
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetPipelineCacheData
vkGetQueryPoolResults(3)
Name
vkGetQueryPoolResults - Copy results of queries in a query pool to a host memory region
C Specification
To retrieve status and results for a set of queries, call:
VkResult vkGetQueryPoolResults( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags);
Parameters
-
device
is the logical device that owns the query pool. -
queryPool
is the query pool managing the queries containing the desired results. -
firstQuery
is the initial query index. -
queryCount
is the number of queries.firstQuery
andqueryCount
together define a range of queries. For pipeline statistics queries, each query index in the pool contains one integer value for each bit that is enabled in VkQueryPoolCreateInfo::pipelineStatistics
when the pool is created. -
dataSize
is the size in bytes of the buffer pointed to bypData
. -
pData
is a pointer to a user-allocated buffer where the results will be written -
stride
is the stride in bytes between results for individual queries withinpData
. -
flags
is a bitmask of VkQueryResultFlagBits specifying how and when results are returned.
Description
If no bits are set in flags
, and all requested queries are in the available state, results are written as an array of 32-bit unsigned integer values. The behavior when not all queries are available, is described below.
If VK_QUERY_RESULT_64_BIT
is not set and the result overflows a 32-bit value, the value may either wrap or saturate. Similarly, if VK_QUERY_RESULT_64_BIT
is set and the result overflows a 64-bit value, the value may either wrap or saturate.
If VK_QUERY_RESULT_WAIT_BIT
is set, Vulkan will wait for each query to be in the available state before retrieving the numerical results for that query. In this case, vkGetQueryPoolResults
is guaranteed to succeed and return VK_SUCCESS
if the queries become available in a finite time (i.e. if they have been issued and not reset). If queries will never finish (e.g. due to being reset but not issued), then vkGetQueryPoolResults
may not return in finite time.
If VK_QUERY_RESULT_WAIT_BIT
and VK_QUERY_RESULT_PARTIAL_BIT
are both not set then no result values are written to pData
for queries that are in the unavailable state at the time of the call, and vkGetQueryPoolResults
returns VK_NOT_READY
. However, availability state is still written to pData
for those queries if VK_QUERY_RESULT_WITH_AVAILABILITY_BIT
is set.
Note
Applications must take care to ensure that use of the
VK_QUERY_RESULT_WAIT_BIT
bit has the desired effect.For example, if a query has been used previously and a command buffer records the commands
vkCmdResetQueryPool
,vkCmdBeginQuery
, andvkCmdEndQuery
for that query, then the query will remain in the available state until thevkCmdResetQueryPool
command executes on a queue. Applications can use fences or events to ensure that a query has already been reset before checking for its results or availability status. Otherwise, a stale value could be returned from a previous use of the query.The above also applies when
VK_QUERY_RESULT_WAIT_BIT
is used in combination withVK_QUERY_RESULT_WITH_AVAILABILITY_BIT
. In this case, the returned availability status may reflect the result of a previous use of the query unless thevkCmdResetQueryPool
command has been executed since the last use of the query.
Note
Applications can double-buffer query pool usage, with a pool per frame, and reset queries at the end of the frame in which they are read.
If VK_QUERY_RESULT_PARTIAL_BIT
is set, VK_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 to pData
for that query.
VK_QUERY_RESULT_PARTIAL_BIT
must not be used if the pool’s queryType
is VK_QUERY_TYPE_TIMESTAMP
.
If VK_QUERY_RESULT_WITH_AVAILABILITY_BIT
is set, the final integer value written for each query is non-zero if the query’s status was available or zero if the status was unavailable. When VK_QUERY_RESULT_WITH_AVAILABILITY_BIT
is used, implementations must guarantee that if they return a non-zero availability value then the numerical results must be valid, assuming the results are not reset by a subsequent command.
Note
Satisfying this guarantee may require careful ordering by the application, e.g. to read the availability status before reading the results.
Valid Usage
firstQuery
must be less than the number of queries inqueryPool
- If
VK_QUERY_RESULT_64_BIT
is not set inflags
thenpData
andstride
must be multiples of4
- If
VK_QUERY_RESULT_64_BIT
is set inflags
thenpData
andstride
must be multiples of8
- The sum of
firstQuery
andqueryCount
must be less than or equal to the number of queries inqueryPool
dataSize
must be large enough to contain the result of each query, as described here- If the
queryType
used to createqueryPool
wasVK_QUERY_TYPE_TIMESTAMP
,flags
must not containVK_QUERY_RESULT_PARTIAL_BIT
Valid Usage (Implicit)
device
must be a validVkDevice
handlequeryPool
must be a validVkQueryPool
handlepData
must be a pointer to an array ofdataSize
bytesflags
must be a valid combination of VkQueryResultFlagBits valuesdataSize
must be greater than0
queryPool
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VkDevice, VkDeviceSize
, VkQueryPool, VkQueryResultFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetQueryPoolResults
vkGetRenderAreaGranularity(3)
Name
vkGetRenderAreaGranularity - Returns the granularity for optimal render area
C Specification
To query the render area granularity, call:
void vkGetRenderAreaGranularity( VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
Parameters
-
device
is the logical device that owns the render pass. -
renderPass
is a handle to a render pass. -
pGranularity
points to a VkExtent2D structure in which the granularity is returned.
Description
The conditions leading to an optimal renderArea
are:
- the
offset.x
member inrenderArea
is a multiple of thewidth
member of the returned VkExtent2D (the horizontal granularity). - the
offset.y
member inrenderArea
is a multiple of theheight
of the returned VkExtent2D (the vertical granularity). - either the
offset.width
member inrenderArea
is a multiple of the horizontal granularity oroffset.x
+offset.width
is equal to thewidth
of theframebuffer
in the VkRenderPassBeginInfo. - either the
offset.height
member inrenderArea
is a multiple of the vertical granularity oroffset.y
+offset.height
is equal to theheight
of theframebuffer
in the VkRenderPassBeginInfo.
Subpass dependencies are not affected by the render area, and apply to the entire image subresources attached to the framebuffer as specified in the description of automatic layout transitions. Similarly, pipeline barriers are valid even if their effect extends outside the render area.
Valid Usage (Implicit)
device
must be a validVkDevice
handlerenderPass
must be a validVkRenderPass
handlepGranularity
must be a pointer to aVkExtent2D
structurerenderPass
must have been created, allocated, or retrieved fromdevice
See Also
VkDevice, VkExtent2D, VkRenderPass
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkGetRenderAreaGranularity
vkInvalidateMappedMemoryRanges(3)
Name
vkInvalidateMappedMemoryRanges - Invalidate ranges of mapped memory objects
C Specification
To invalidate ranges of non-coherent memory from the host caches, call:
VkResult vkInvalidateMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
Parameters
-
device
is the logical device that owns the memory ranges. -
memoryRangeCount
is the length of thepMemoryRanges
array. -
pMemoryRanges
is a pointer to an array of VkMappedMemoryRange structures describing the memory ranges to invalidate.
Description
vkInvalidateMappedMemoryRanges
guarantees that device writes to the memory ranges described by pMemoryRanges
, which have been made visible to the VK_ACCESS_HOST_WRITE_BIT
and VK_ACCESS_HOST_READ_BIT
access types, are made visible to the host. If a range of non-coherent memory is written by the host and then invalidated without first being flushed, its contents are undefined.
Note
Mapping non-coherent memory does not implicitly invalidate the mapped memory, and device writes that have not been invalidated must be made visible before the host reads or overwrites them.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepMemoryRanges
must be a pointer to an array ofmemoryRangeCount
validVkMappedMemoryRange
structuresmemoryRangeCount
must be greater than0
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkInvalidateMappedMemoryRanges
vkMapMemory(3)
Name
vkMapMemory - Map a memory object into application address space
C Specification
To retrieve a host virtual address pointer to a region of a mappable memory object, call:
VkResult vkMapMemory( VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
Parameters
-
device
is the logical device that owns the memory. -
memory
is theVkDeviceMemory
object to be mapped. -
offset
is a zero-based byte offset from the beginning of the memory object. -
size
is the size of the memory range to map, orVK_WHOLE_SIZE
to map fromoffset
to the end of the allocation. -
flags
is reserved for future use. -
ppData
points to a pointer in which is returned a host-accessible pointer to the beginning of the mapped range. This pointer minusoffset
must be aligned to at leastVkPhysicalDeviceLimits
::minMemoryMapAlignment
.
Description
It is an application error to call vkMapMemory
on a memory object that is already mapped.
Note
vkMapMemory
will fail if the implementation is unable to allocate an appropriately sized contiguous virtual address range, e.g. due to virtual address space fragmentation or platform limits. In such cases,vkMapMemory
must returnVK_ERROR_MEMORY_MAP_FAILED
. The application can improve the likelihood of success by reducing the size of the mapped range and/or removing unneeded mappings usingVkUnmapMemory
.
vkMapMemory
does not check whether the device memory is currently in use before returning the host-accessible pointer. The application must guarantee that any previously submitted command that writes to this range has completed before the host reads from or writes to that range, and that any previously submitted command that reads from that range has completed before the host writes to that region (see here for details on fulfilling such a guarantee). If the device memory was allocated without the VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
set, these guarantees must be made for an extended range: the application must round down the start of the range to the nearest multiple of VkPhysicalDeviceLimits
::nonCoherentAtomSize
, and round the end of the range up to the nearest multiple of VkPhysicalDeviceLimits
::nonCoherentAtomSize
.
While a range of device memory is mapped for host access, the application is responsible for synchronizing both device and host access to that memory range.
Note
It is important for the application developer to become meticulously familiar with all of the mechanisms described in the chapter on Synchronization and Cache Control as they are crucial to maintaining memory access ordering.
Valid Usage
memory
must not currently be mappedoffset
must be less than the size ofmemory
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be greater than0
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be less than or equal to the size of thememory
minusoffset
memory
must have been created with a memory type that reportsVK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
Valid Usage (Implicit)
device
must be a validVkDevice
handlememory
must be a validVkDeviceMemory
handleflags
must be0
ppData
must be a pointer to a pointermemory
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
memory
must be externally synchronized
Return Codes
See Also
VkDevice, VkDeviceMemory, VkDeviceSize
, VkMemoryMapFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkMapMemory
vkMergePipelineCaches(3)
Name
vkMergePipelineCaches - Combine the data stores of pipeline caches
C Specification
Pipeline cache objects can be merged using the command:
VkResult vkMergePipelineCaches( VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches);
Parameters
-
device
is the logical device that owns the pipeline cache objects. -
dstCache
is the handle of the pipeline cache to merge results into. -
srcCacheCount
is the length of thepSrcCaches
array. -
pSrcCaches
is an array of pipeline cache handles, which will be merged intodstCache
. The previous contents ofdstCache
are included after the merge.
Description
Note
The details of the merge operation are implementation dependent, but implementations should merge the contents of the specified pipelines and prune duplicate entries.
Valid Usage
dstCache
must not appear in the list of source caches
Valid Usage (Implicit)
device
must be a validVkDevice
handledstCache
must be a validVkPipelineCache
handlepSrcCaches
must be a pointer to an array ofsrcCacheCount
validVkPipelineCache
handlessrcCacheCount
must be greater than0
dstCache
must have been created, allocated, or retrieved fromdevice
- Each element of
pSrcCaches
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
dstCache
must be externally synchronized
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkMergePipelineCaches
vkQueueBindSparse(3)
Name
vkQueueBindSparse - Bind device memory to a sparse resource object
C Specification
To submit sparse binding operations to a queue, call:
VkResult vkQueueBindSparse( VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence);
Parameters
-
queue
is the queue that the sparse binding operations will be submitted to. -
bindInfoCount
is the number of elements in thepBindInfo
array. -
pBindInfo
is an array of VkBindSparseInfo structures, each specifying a sparse binding submission batch. -
fence
is an optional handle to a fence to be signaled. Iffence
is not VK_NULL_HANDLE, it defines a fence signal operation.
Description
vkQueueBindSparse
is a queue submission command, with each batch defined by an element of pBindInfo
as an instance of the VkBindSparseInfo structure. Batches begin execution in the order they appear in pBindInfo
, but may complete out of order.
Within a batch, a given range of a resource must not be bound more than once. Across batches, if a range is to be bound to one allocation and offset and then to another allocation and offset, then the application must guarantee (usually using semaphores) that the binding operations are executed in the correct order, as well as to order binding operations against the execution of command buffer submissions.
As no operation to vkQueueBindSparse causes any pipeline stage to access memory, synchronization primitives used in this command effectively only define execution dependencies.
Additional information about fence and semaphore operation is described in the synchronization chapter.
Valid Usage
- If
fence
is not VK_NULL_HANDLE,fence
must be unsignaled- If
fence
is not VK_NULL_HANDLE,fence
must not be associated with any other queue command that has not yet completed execution on that queue- Any given element of the
pSignalSemaphores
member of any element ofpBindInfo
must be unsignaled when the semaphore signal operation it defines is executed on the device- When a semaphore unsignal operation defined by any element of the
pWaitSemaphores
member of any element ofpBindInfo
executes onqueue
, no other queue must be waiting on the same semaphore.- All elements of the
pWaitSemaphores
member of all elements ofpBindInfo
must be semaphores that are signaled, or have semaphore signal operations previously submitted for execution.
Valid Usage (Implicit)
queue
must be a validVkQueue
handle- If
bindInfoCount
is not0
,pBindInfo
must be a pointer to an array ofbindInfoCount
validVkBindSparseInfo
structures- If
fence
is not VK_NULL_HANDLE,fence
must be a validVkFence
handle- The
queue
must support sparse binding operations- Both of
fence
, andqueue
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
queue
must be externally synchronized- Host access to
pBindInfo
[].pWaitSemaphores[] must be externally synchronized- Host access to
pBindInfo
[].pSignalSemaphores[] must be externally synchronized- Host access to
pBindInfo
[].pBufferBinds[].buffer must be externally synchronized- Host access to
pBindInfo
[].pImageOpaqueBinds[].image must be externally synchronized- Host access to
pBindInfo
[].pImageBinds[].image must be externally synchronized- Host access to
fence
must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type -
-
SPARSE_BINDING
-
Return Codes
See Also
VkBindSparseInfo, VkFence, VkQueue
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkQueueBindSparse
vkQueueSubmit(3)
Name
vkQueueSubmit - Submits a sequence of semaphores or command buffers to a queue
C Specification
To submit command buffers to a queue, call:
VkResult vkQueueSubmit( VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence);
Parameters
-
queue
is the queue that the command buffers will be submitted to. -
submitCount
is the number of elements in thepSubmits
array. -
pSubmits
is a pointer to an array of VkSubmitInfo structures, each specifying a command buffer submission batch. -
fence
is an optional handle to a fence to be signaled. Iffence
is not VK_NULL_HANDLE, it defines a fence signal operation.
Description
Note
Submission can be a high overhead operation, and applications should attempt to batch work together into as few calls to
vkQueueSubmit
as possible.
vkQueueSubmit
is a queue submission command, with each batch defined by an element of pSubmits
as an instance of the VkSubmitInfo structure. Batches begin execution in the order they appear in pSubmits
, but may complete out of order.
Fence and semaphore operations submitted with vkQueueSubmit have additional ordering constraints compared to other submission commands, with dependencies involving previous and subsequent queue operations. Information about these additional constraints can be found in the semaphore and fence sections of the synchronization chapter.
Details on the interaction of pWaitDstStageMask
with synchronization are described in the semaphore wait operation section of the synchronization chapter.
The order that batches appear in pSubmits
is used to determine submission order, and thus all the implicit ordering guarantees that respect it. Other than these implicit ordering guarantees and any explicit synchronization primitives, these batches may overlap or otherwise execute out of order.
If any command buffer submitted to this queue is in the executable state, it is moved to the pending state. Once execution of all submissions of a command buffer complete, it moves from the pending state, back to the executable state. If a command buffer was recorded with the VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT
flag, it instead moves back to the invalid state.
If vkQueueSubmit
fails, it may return VK_ERROR_OUT_OF_HOST_MEMORY
or VK_ERROR_OUT_OF_DEVICE_MEMORY
. If it does, the implementation must ensure that the state and contents of any resources or synchronization primitives referenced by the submitted command buffers and any semaphores referenced by pSubmits
is unaffected by the call or its failure. If vkQueueSubmit
fails in such a way that the implementation can not make that guarantee, the implementation must return VK_ERROR_DEVICE_LOST
. See Lost Device.
Valid Usage
- If
fence
is not VK_NULL_HANDLE,fence
must be unsignaled- If
fence
is not VK_NULL_HANDLE,fence
must not be associated with any other queue command that has not yet completed execution on that queue- Any calls to vkCmdSetEvent, vkCmdResetEvent or vkCmdWaitEvents that have been recorded into any of the command buffer elements of the
pCommandBuffers
member of any element ofpSubmits
, must not reference any VkEvent that is referenced by any of those commands in a command buffer that has been submitted to another queue and is still in the pending state.- Any stage flag included in any element of the
pWaitDstStageMask
member of any element ofpSubmits
must be a pipeline stage supported by one of the capabilities ofqueue
, as specified in the table of supported pipeline stages.- Any given element of the
pSignalSemaphores
member of any element ofpSubmits
must be unsignaled when the semaphore signal operation it defines is executed on the device- When a semaphore unsignal operation defined by any element of the
pWaitSemaphores
member of any element ofpSubmits
executes onqueue
, no other queue must be waiting on the same semaphore.- All elements of the
pWaitSemaphores
member of all elements ofpSubmits
must be semaphores that are signaled, or have semaphore signal operations previously submitted for execution.- Any given element of the
pCommandBuffers
member of any element ofpSubmits
must be in the pending or executable state.- If any given element of the
pCommandBuffers
member of any element ofpSubmits
was not recorded with theVK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
, it must not be in the pending state.- Any secondary command buffers recorded into any given element of the
pCommandBuffers
member of any element ofpSubmits
must be in the pending or executable state.- If any secondary command buffers recorded into any given element of the
pCommandBuffers
member of any element ofpSubmits
was not recorded with theVK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT
, it must not be in the pending state.- Any given element of the
pCommandBuffers
member of any element ofpSubmits
must have been allocated from aVkCommandPool
that was created for the same queue familyqueue
belongs to.
Valid Usage (Implicit)
queue
must be a validVkQueue
handle- If
submitCount
is not0
,pSubmits
must be a pointer to an array ofsubmitCount
validVkSubmitInfo
structures- If
fence
is not VK_NULL_HANDLE,fence
must be a validVkFence
handle- Both of
fence
, andqueue
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
queue
must be externally synchronized- Host access to
pSubmits
[].pWaitSemaphores[] must be externally synchronized- Host access to
pSubmits
[].pSignalSemaphores[] must be externally synchronized- Host access to
fence
must be externally synchronized
Command Properties
Return Codes
See Also
VkFence, VkQueue, VkSubmitInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkQueueSubmit
vkQueueWaitIdle(3)
Name
vkQueueWaitIdle - Wait for a queue to become idle
C Specification
To wait on the host for the completion of outstanding queue operations for a given queue, call:
VkResult vkQueueWaitIdle( VkQueue queue);
Parameters
-
queue
is the queue on which to wait.
Description
vkQueueWaitIdle
is equivalent to submitting a fence to a queue and waiting with an infinite timeout for that fence to signal.
Valid Usage (Implicit)
queue
must be a validVkQueue
handle
Command Properties
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkQueueWaitIdle
vkResetCommandBuffer(3)
Name
vkResetCommandBuffer - Reset a command buffer to the initial state
C Specification
To reset command buffers, call:
VkResult vkResetCommandBuffer( VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags);
Parameters
-
commandBuffer
is the command buffer to reset. The command buffer can be in any state other than pending, and is moved into the initial state. -
flags
is a bitmask of VkCommandBufferResetFlagBits controlling the reset operation.
Description
Any primary command buffer that is in the recording or executable state and has commandBuffer
recorded into it, becomes invalid.
Valid Usage
commandBuffer
must not be in the pending statecommandBuffer
must have been allocated from a pool that was created with theVK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handleflags
must be a valid combination of VkCommandBufferResetFlagBits values
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
Return Codes
See Also
VkCommandBuffer, VkCommandBufferResetFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkResetCommandBuffer
vkResetCommandPool(3)
Name
vkResetCommandPool - Reset a command pool
C Specification
To reset a command pool, call:
VkResult vkResetCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags);
Parameters
-
device
is the logical device that owns the command pool. -
commandPool
is the command pool to reset. -
flags
is a bitmask of VkCommandPoolResetFlagBits controlling the reset operation.
Description
Resetting a command pool recycles all of the resources from all of the command buffers allocated from the command pool back to the command pool. All command buffers that have been allocated from the command pool are put in the initial state.
Any primary command buffer allocated from another VkCommandPool that is in the recording or executable state and has a secondary command buffer allocated from commandPool
recorded into it, becomes invalid.
Valid Usage
- All
VkCommandBuffer
objects allocated fromcommandPool
must not be in the pending state
Valid Usage (Implicit)
device
must be a validVkDevice
handlecommandPool
must be a validVkCommandPool
handleflags
must be a valid combination of VkCommandPoolResetFlagBits valuescommandPool
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
commandPool
must be externally synchronized
Return Codes
See Also
VkCommandPool, VkCommandPoolResetFlags, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkResetCommandPool
vkResetDescriptorPool(3)
Name
vkResetDescriptorPool - Resets a descriptor pool object
C Specification
To return all descriptor sets allocated from a given pool to the pool, rather than freeing individual descriptor sets, call:
VkResult vkResetDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags);
Parameters
-
device
is the logical device that owns the descriptor pool. -
descriptorPool
is the descriptor pool to be reset. -
flags
is reserved for future use.
Description
Resetting a descriptor pool recycles all of the resources from all of the descriptor sets allocated from the descriptor pool back to the descriptor pool, and the descriptor sets are implicitly freed.
Valid Usage
- All uses of
descriptorPool
(via any allocated descriptor sets) must have completed execution
Valid Usage (Implicit)
device
must be a validVkDevice
handledescriptorPool
must be a validVkDescriptorPool
handleflags
must be0
descriptorPool
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
descriptorPool
must be externally synchronized- Host access to any
VkDescriptorSet
objects allocated fromdescriptorPool
must be externally synchronized
Return Codes
See Also
VkDescriptorPool, VkDescriptorPoolResetFlags, VkDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkResetDescriptorPool
vkResetEvent(3)
Name
vkResetEvent - Reset an event to non-signaled state
C Specification
To set the state of an event to unsignaled from the host, call:
VkResult vkResetEvent( VkDevice device, VkEvent event);
Parameters
-
device
is the logical device that owns the event. -
event
is the event to reset.
Description
When vkResetEvent is executed on the host, it defines an event unsignal operation which resets the event to the unsignaled state.
If event
is already in the unsignaled state when vkResetEvent is executed, then vkResetEvent has no effect, and no event unsignal operation occurs.
Valid Usage
event
must not be waited on by avkCmdWaitEvents
command that is currently executing
Valid Usage (Implicit)
device
must be a validVkDevice
handleevent
must be a validVkEvent
handleevent
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
event
must be externally synchronized
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkResetEvent
vkResetFences(3)
Name
vkResetFences - Resets one or more fence objects
C Specification
To set the state of fences to unsignaled from the host, call:
VkResult vkResetFences( VkDevice device, uint32_t fenceCount, const VkFence* pFences);
Parameters
-
device
is the logical device that owns the fences. -
fenceCount
is the number of fences to reset. -
pFences
is a pointer to an array of fence handles to reset.
Description
When vkResetFences is executed on the host, it defines a fence unsignal operation for each fence, which resets the fence to the unsignaled state.
If any member of pFences
is already in the unsignaled state when vkResetFences is executed, then vkResetFences has no effect on that fence.
Valid Usage
- Any given element of
pFences
must not currently be associated with any queue command that has not yet completed execution on that queue
Valid Usage (Implicit)
device
must be a validVkDevice
handlepFences
must be a pointer to an array offenceCount
validVkFence
handlesfenceCount
must be greater than0
- Each element of
pFences
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to each member of
pFences
must be externally synchronized
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkResetFences
vkSetEvent(3)
Name
vkSetEvent - Set an event to signaled state
C Specification
To set the state of an event to signaled from the host, call:
VkResult vkSetEvent( VkDevice device, VkEvent event);
Parameters
-
device
is the logical device that owns the event. -
event
is the event to set.
Description
When vkSetEvent is executed on the host, it defines an event signal operation which sets the event to the signaled state.
If event
is already in the signaled state when vkSetEvent is executed, then vkSetEvent has no effect, and no event signal operation occurs.
Valid Usage (Implicit)
device
must be a validVkDevice
handleevent
must be a validVkEvent
handleevent
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
event
must be externally synchronized
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkSetEvent
vkUnmapMemory(3)
Name
vkUnmapMemory - Unmap a previously mapped memory object
C Specification
To unmap a memory object once host access to it is no longer needed by the application, call:
void vkUnmapMemory( VkDevice device, VkDeviceMemory memory);
Parameters
-
device
is the logical device that owns the memory. -
memory
is the memory object to be unmapped.
Description
Valid Usage
memory
must currently be mapped
Valid Usage (Implicit)
device
must be a validVkDevice
handlememory
must be a validVkDeviceMemory
handlememory
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
memory
must be externally synchronized
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkUnmapMemory
vkUpdateDescriptorSets(3)
Name
vkUpdateDescriptorSets - Update the contents of a descriptor set object
C Specification
Once allocated, descriptor sets can be updated with a combination of write and copy operations. To update descriptor sets, call:
void vkUpdateDescriptorSets( VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies);
Parameters
-
device
is the logical device that updates the descriptor sets. -
descriptorWriteCount
is the number of elements in thepDescriptorWrites
array. -
pDescriptorWrites
is a pointer to an array of VkWriteDescriptorSet structures describing the descriptor sets to write to. -
descriptorCopyCount
is the number of elements in thepDescriptorCopies
array. -
pDescriptorCopies
is a pointer to an array of VkCopyDescriptorSet structures describing the descriptor sets to copy between.
Description
The operations described by pDescriptorWrites
are performed first, followed by the operations described by pDescriptorCopies
. Within each array, the operations are performed in the order they appear in the array.
Each element in the pDescriptorWrites
array describes an operation updating the descriptor set using descriptors for resources specified in the structure.
Each element in the pDescriptorCopies
array is a VkCopyDescriptorSet structure describing an operation copying descriptors between sets.
If the dstSet
member of any given element of pDescriptorWrites
or pDescriptorCopies
is bound, accessed, or modified by any command that was recorded to a command buffer which is currently in the recording or executable state, that command buffer becomes invalid.
Valid Usage
- The
dstSet
member of any given element ofpDescriptorWrites
orpDescriptorCopies
must not be used by any command that was recorded to a command buffer which is in the pending state.
Valid Usage (Implicit)
device
must be a validVkDevice
handle- If
descriptorWriteCount
is not0
,pDescriptorWrites
must be a pointer to an array ofdescriptorWriteCount
validVkWriteDescriptorSet
structures- If
descriptorCopyCount
is not0
,pDescriptorCopies
must be a pointer to an array ofdescriptorCopyCount
validVkCopyDescriptorSet
structures
Host Synchronization
- Host access to
pDescriptorWrites
[].dstSet must be externally synchronized- Host access to
pDescriptorCopies
[].dstSet must be externally synchronized
See Also
VkCopyDescriptorSet, VkDevice, VkWriteDescriptorSet
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkUpdateDescriptorSets
vkWaitForFences(3)
Name
vkWaitForFences - Wait for one or more fences to become signaled
C Specification
To wait for one or more fences to enter the signaled state on the host, call:
VkResult vkWaitForFences( VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout);
Parameters
-
device
is the logical device that owns the fences. -
fenceCount
is the number of fences to wait on. -
pFences
is a pointer to an array offenceCount
fence handles. -
waitAll
is the condition that must be satisfied to successfully unblock the wait. IfwaitAll
isVK_TRUE
, then the condition is that all fences inpFences
are signaled. Otherwise, the condition is that at least one fence inpFences
is signaled. -
timeout
is the timeout period in units of nanoseconds.timeout
is adjusted to the closest value allowed by the implementation-dependent timeout accuracy, which may be substantially longer than one nanosecond, and may be longer than the requested period.
Description
If the condition is satisfied when vkWaitForFences
is called, then vkWaitForFences
returns immediately. If the condition is not satisfied at the time vkWaitForFences
is called, then vkWaitForFences
will block and wait up to timeout
nanoseconds for the condition to become satisfied.
If timeout
is zero, then vkWaitForFences
does not wait, but simply returns the current state of the fences. VK_TIMEOUT
will be returned in this case if the condition is not satisfied, even though no actual wait was performed.
If the specified timeout period expires before the condition is satisfied, vkWaitForFences
returns VK_TIMEOUT
. If the condition is satisfied before timeout
nanoseconds has expired, vkWaitForFences
returns VK_SUCCESS
.
If device loss occurs (see Lost Device) before the timeout has expired, vkWaitForFences
must return in finite time with either VK_SUCCESS
or VK_DEVICE_LOST
.
Note
While we guarantee that
vkWaitForFences
must return in finite time, no guarantees are made that it returns immediately upon device loss. However, the client can reasonably expect that the delay will be on the order of seconds and that callingvkWaitForFences
will not result in a permanently (or seemingly permanently) dead process.
Valid Usage (Implicit)
device
must be a validVkDevice
handlepFences
must be a pointer to an array offenceCount
validVkFence
handlesfenceCount
must be greater than0
- Each element of
pFences
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkWaitForFences
Object Handles
VkBuffer(3)
Name
VkBuffer - Opaque handle to a buffer object
C Specification
Buffers represent linear arrays of data which are used for various purposes by binding them to a graphics or compute pipeline via descriptor sets or via certain commands, or by directly specifying them as parameters to certain commands.
Buffers are represented by VkBuffer
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer)
See Also
VkBufferMemoryBarrier, VkBufferViewCreateInfo, VkDescriptorBufferInfo, VkSparseBufferMemoryBindInfo, vkBindBufferMemory, vkCmdBindIndexBuffer, vkCmdBindVertexBuffers, vkCmdCopyBuffer, vkCmdCopyBufferToImage, vkCmdCopyImageToBuffer, vkCmdCopyQueryPoolResults, vkCmdDispatchIndirect, vkCmdDrawIndexedIndirect, vkCmdDrawIndirect, vkCmdFillBuffer, vkCmdUpdateBuffer, vkCreateBuffer, vkDestroyBuffer, vkGetBufferMemoryRequirements
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBuffer
VkBufferView(3)
Name
VkBufferView - Opaque handle to a buffer view object
C Specification
A buffer view represents a contiguous range of a buffer and a specific format to be used to interpret the data. Buffer views are used to enable shaders to access buffer contents interpreted as formatted data. In order to create a valid buffer view, the buffer must have been created with at least one of the following usage flags:
-
VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
-
VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
Buffer views are represented by VkBufferView
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView)
See Also
VkWriteDescriptorSet, vkCreateBufferView, vkDestroyBufferView
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferView
VkCommandBuffer(3)
Name
VkCommandBuffer - Opaque handle to a command buffer object
C Specification
Command buffers are objects used to record commands which can be subsequently submitted to a device queue for execution. There are two levels of command buffers - primary command buffers, which can execute secondary command buffers, and which are submitted to queues, and secondary command buffers, which can be executed by primary command buffers, and which are not directly submitted to queues.
Command buffers are represented by VkCommandBuffer
handles:
VK_DEFINE_HANDLE(VkCommandBuffer)
See Also
VkSubmitInfo, vkAllocateCommandBuffers, vkBeginCommandBuffer, vkCmdBeginQuery, vkCmdBeginRenderPass, vkCmdBindDescriptorSets, vkCmdBindIndexBuffer, vkCmdBindPipeline, vkCmdBindVertexBuffers, vkCmdBlitImage, vkCmdClearAttachments, vkCmdClearColorImage, vkCmdClearDepthStencilImage, vkCmdCopyBuffer, vkCmdCopyBufferToImage, vkCmdCopyImage, vkCmdCopyImageToBuffer, vkCmdCopyQueryPoolResults, vkCmdDispatch, vkCmdDispatchIndirect, vkCmdDraw, vkCmdDrawIndexed, vkCmdDrawIndexedIndirect, vkCmdDrawIndirect, vkCmdEndQuery, vkCmdEndRenderPass, vkCmdExecuteCommands, vkCmdFillBuffer, vkCmdNextSubpass, vkCmdPipelineBarrier, vkCmdPushConstants, vkCmdResetEvent, vkCmdResetQueryPool, vkCmdResolveImage, vkCmdSetBlendConstants, vkCmdSetDepthBias, vkCmdSetDepthBounds, vkCmdSetEvent, vkCmdSetLineWidth, vkCmdSetScissor, vkCmdSetStencilCompareMask, vkCmdSetStencilReference, vkCmdSetStencilWriteMask, vkCmdSetViewport, vkCmdUpdateBuffer, vkCmdWaitEvents, vkCmdWriteTimestamp, vkEndCommandBuffer, vkFreeCommandBuffers, vkResetCommandBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCommandBuffer
VkCommandPool(3)
Name
VkCommandPool - Opaque handle to a command pool object
C Specification
Command pools are opaque objects that command buffer memory is allocated from, and which allow the implementation to amortize the cost of resource creation across multiple command buffers. Command pools are externally synchronized, meaning that a command pool must not be used concurrently in multiple threads. That includes use via recording commands on any command buffers allocated from the pool, as well as operations that allocate, free, and reset command buffers or the pool itself.
Command pools are represented by VkCommandPool
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool)
See Also
VkCommandBufferAllocateInfo, vkCreateCommandPool, vkDestroyCommandPool, vkFreeCommandBuffers, vkResetCommandPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCommandPool
VkDescriptorPool(3)
Name
VkDescriptorPool - Opaque handle to a descriptor pool object
C Specification
A descriptor pool maintains a pool of descriptors, from which descriptor sets are allocated. Descriptor pools are externally synchronized, meaning that the application must not allocate and/or free descriptor sets from the same pool in multiple threads simultaneously.
Descriptor pools are represented by VkDescriptorPool
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool)
See Also
VkDescriptorSetAllocateInfo, vkCreateDescriptorPool, vkDestroyDescriptorPool, vkFreeDescriptorSets, vkResetDescriptorPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorPool
VkDescriptorSet(3)
Name
VkDescriptorSet - Opaque handle to a descriptor set object
C Specification
Descriptor sets are allocated from descriptor pool objects, and are represented by VkDescriptorSet
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet)
See Also
VkCopyDescriptorSet, VkWriteDescriptorSet, vkAllocateDescriptorSets, vkCmdBindDescriptorSets, vkFreeDescriptorSets
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorSet
VkDescriptorSetLayout(3)
Name
VkDescriptorSetLayout - Opaque handle to a descriptor set layout object
C Specification
A descriptor set layout object is defined by an array of zero or more descriptor bindings. Each individual descriptor binding is specified by a descriptor type, a count (array size) of the number of descriptors in the binding, a set of shader stages that can access the binding, and (if using immutable samplers) an array of sampler descriptors.
Descriptor set layout objects are represented by VkDescriptorSetLayout
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout)
See Also
VkDescriptorSetAllocateInfo, VkPipelineLayoutCreateInfo, vkCreateDescriptorSetLayout, vkDestroyDescriptorSetLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorSetLayout
VkDevice(3)
Name
VkDevice - Opaque handle to a device object
C Specification
Logical devices are represented by VkDevice
handles:
VK_DEFINE_HANDLE(VkDevice)
See Also
vkAllocateCommandBuffers, vkAllocateDescriptorSets, vkAllocateMemory, vkBindBufferMemory, vkBindImageMemory, vkCreateBuffer, vkCreateBufferView, vkCreateCommandPool, vkCreateComputePipelines, vkCreateDescriptorPool, vkCreateDescriptorSetLayout, vkCreateDevice, vkCreateEvent, vkCreateFence, vkCreateFramebuffer, vkCreateGraphicsPipelines, vkCreateImage, vkCreateImageView, vkCreatePipelineCache, vkCreatePipelineLayout, vkCreateQueryPool, vkCreateRenderPass, vkCreateSampler, vkCreateSemaphore, vkCreateShaderModule, vkDestroyBuffer, vkDestroyBufferView, vkDestroyCommandPool, vkDestroyDescriptorPool, vkDestroyDescriptorSetLayout, vkDestroyDevice, vkDestroyEvent, vkDestroyFence, vkDestroyFramebuffer, vkDestroyImage, vkDestroyImageView, vkDestroyPipeline, vkDestroyPipelineCache, vkDestroyPipelineLayout, vkDestroyQueryPool, vkDestroyRenderPass, vkDestroySampler, vkDestroySemaphore, vkDestroyShaderModule, vkDeviceWaitIdle, vkFlushMappedMemoryRanges, vkFreeCommandBuffers, vkFreeDescriptorSets, vkFreeMemory, vkGetBufferMemoryRequirements, vkGetDeviceMemoryCommitment, vkGetDeviceProcAddr, vkGetDeviceQueue, vkGetEventStatus, vkGetFenceStatus, vkGetImageMemoryRequirements, vkGetImageSparseMemoryRequirements, vkGetImageSubresourceLayout, vkGetPipelineCacheData, vkGetQueryPoolResults, vkGetRenderAreaGranularity, vkInvalidateMappedMemoryRanges, vkMapMemory, vkMergePipelineCaches, vkResetCommandPool, vkResetDescriptorPool, vkResetEvent, vkResetFences, vkSetEvent, vkUnmapMemory, vkUpdateDescriptorSets, vkWaitForFences
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDevice
VkDeviceMemory(3)
Name
VkDeviceMemory - Opaque handle to a device memory object
C Specification
A Vulkan device operates on data in device memory via memory objects that are represented in the API by a VkDeviceMemory
handle.
Memory objects are represented by VkDeviceMemory
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory)
See Also
VkMappedMemoryRange, VkSparseImageMemoryBind, VkSparseMemoryBind, vkAllocateMemory, vkBindBufferMemory, vkBindImageMemory, vkFreeMemory, vkGetDeviceMemoryCommitment, vkMapMemory, vkUnmapMemory
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDeviceMemory
VkEvent(3)
Name
VkEvent - Opaque handle to a event object
C Specification
Events are a synchronization primitive that can be used to insert a fine-grained dependency between commands submitted to the same queue, or between the host and a queue. Events have two states - signaled and unsignaled. An application can signal an event, or unsignal it, on either the host or the device. A device can wait for an event to become signaled before executing further operations. No command exists to wait for an event to become signaled on the host, but the current state of an event can be queried.
Events are represented by VkEvent
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent)
See Also
vkCmdResetEvent, vkCmdSetEvent, vkCmdWaitEvents, vkCreateEvent, vkDestroyEvent, vkGetEventStatus, vkResetEvent, vkSetEvent
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkEvent
VkFence(3)
Name
VkFence - Opaque handle to a fence object
C Specification
Fences are a synchronization primitive that can be used to insert a dependency from a queue to the host. Fences have two states - signaled and unsignaled. A fence can be signaled as part of the execution of a queue submission command. Fences can be unsignaled on the host with vkResetFences. Fences can be waited on by the host with the vkWaitForFences command, and the current state can be queried with vkGetFenceStatus.
Fences are represented by VkFence
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence)
See Also
vkCreateFence, vkDestroyFence, vkGetFenceStatus, vkQueueBindSparse, vkQueueSubmit, vkResetFences, vkWaitForFences
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFence
VkFramebuffer(3)
Name
VkFramebuffer - Opaque handle to a framebuffer object
C Specification
Render passes operate in conjunction with framebuffers. Framebuffers represent a collection of specific memory attachments that a render pass instance uses.
Framebuffers are represented by VkFramebuffer
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer)
See Also
VkCommandBufferInheritanceInfo, VkRenderPassBeginInfo, vkCreateFramebuffer, vkDestroyFramebuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFramebuffer
VkImage(3)
Name
VkImage - Opaque handle to a image object
C Specification
Images represent multidimensional - up to 3 - arrays of data which can be used for various purposes (e.g. attachments, textures), by binding them to a graphics or compute pipeline via descriptor sets, or by directly specifying them as parameters to certain commands.
Images are represented by VkImage
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage)
See Also
VkImageMemoryBarrier, VkImageViewCreateInfo, VkSparseImageMemoryBindInfo, VkSparseImageOpaqueMemoryBindInfo, vkBindImageMemory, vkCmdBlitImage, vkCmdClearColorImage, vkCmdClearDepthStencilImage, vkCmdCopyBufferToImage, vkCmdCopyImage, vkCmdCopyImageToBuffer, vkCmdResolveImage, vkCreateImage, vkDestroyImage, vkGetImageMemoryRequirements, vkGetImageSparseMemoryRequirements, vkGetImageSubresourceLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImage
VkImageView(3)
Name
VkImageView - Opaque handle to a image view object
C Specification
Image objects are not directly accessed by pipeline shaders for reading or writing image data. Instead, image views representing contiguous ranges of the image subresources and containing additional metadata are used for that purpose. Views must be created on images of compatible types, and must represent a valid subset of image subresources.
Image views are represented by VkImageView
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView)
See Also
VkDescriptorImageInfo, VkFramebufferCreateInfo, vkCreateImageView, vkDestroyImageView
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageView
VkInstance(3)
Name
VkInstance - Opaque handle to a instance object
C Specification
There is no global state in Vulkan and all per-application state is stored in a VkInstance
object. Creating a VkInstance
object initializes the Vulkan library and allows the application to pass information about itself to the implementation.
Instances are represented by VkInstance
handles:
VK_DEFINE_HANDLE(VkInstance)
See Also
vkCreateInstance, vkDestroyInstance, vkEnumeratePhysicalDevices, vkGetInstanceProcAddr
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkInstance
VkPhysicalDevice(3)
Name
VkPhysicalDevice - Opaque handle to a physical device object
C Specification
Vulkan separates the concept of physical and logical devices. A physical device usually represents a single device in a system (perhaps made up of several individual hardware devices working together), of which there are a finite number. A logical device represents an application’s view of the device.
Physical devices are represented by VkPhysicalDevice
handles:
VK_DEFINE_HANDLE(VkPhysicalDevice)
See Also
vkCreateDevice, vkEnumerateDeviceExtensionProperties, vkEnumerateDeviceLayerProperties, vkEnumeratePhysicalDevices, vkGetPhysicalDeviceFeatures, vkGetPhysicalDeviceFormatProperties, vkGetPhysicalDeviceImageFormatProperties, vkGetPhysicalDeviceMemoryProperties, vkGetPhysicalDeviceProperties, vkGetPhysicalDeviceQueueFamilyProperties, vkGetPhysicalDeviceSparseImageFormatProperties
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkPhysicalDevice
VkPipeline(3)
Name
VkPipeline - Opaque handle to a pipeline object
C Specification
Compute and graphics pipelines are each represented by VkPipeline
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline)
See Also
VkComputePipelineCreateInfo, VkGraphicsPipelineCreateInfo, vkCmdBindPipeline, vkCreateComputePipelines, vkCreateGraphicsPipelines, vkDestroyPipeline
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkPipeline
VkPipelineCache(3)
Name
VkPipelineCache - Opaque handle to a pipeline cache object
C Specification
Pipeline cache objects allow the result of pipeline construction to be reused between pipelines and between runs of an application. Reuse between pipelines is achieved by passing the same pipeline cache object when creating multiple related pipelines. Reuse across runs of an application is achieved by retrieving pipeline cache contents in one run of an application, saving the contents, and using them to preinitialize a pipeline cache on a subsequent run. The contents of the pipeline cache objects are managed by the implementation. Applications can manage the host memory consumed by a pipeline cache object and control the amount of data retrieved from a pipeline cache object.
Pipeline cache objects are represented by VkPipelineCache
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache)
See Also
vkCreateComputePipelines, vkCreateGraphicsPipelines, vkCreatePipelineCache, vkDestroyPipelineCache, vkGetPipelineCacheData, vkMergePipelineCaches
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkPipelineCache
VkPipelineLayout(3)
Name
VkPipelineLayout - Opaque handle to a pipeline layout object
C Specification
Access to descriptor sets from a pipeline is accomplished through a pipeline layout. Zero or more descriptor set layouts and zero or more push constant ranges are combined to form a pipeline layout object which describes the complete set of resources that can be accessed by a pipeline. The pipeline layout represents a sequence of descriptor sets with each having a specific layout. This sequence of layouts is used to determine the interface between shader stages and shader resources. Each pipeline is created using a pipeline layout.
Pipeline layout objects are represented by VkPipelineLayout
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout)
See Also
VkComputePipelineCreateInfo, VkGraphicsPipelineCreateInfo, vkCmdBindDescriptorSets, vkCmdPushConstants, vkCreatePipelineLayout, vkDestroyPipelineLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkPipelineLayout
VkQueryPool(3)
Name
VkQueryPool - Opaque handle to a query pool object
C Specification
Queries are managed using query pool objects. Each query pool is a collection of a specific number of queries of a particular type.
Query pools are represented by VkQueryPool
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool)
See Also
vkCmdBeginQuery, vkCmdCopyQueryPoolResults, vkCmdEndQuery, vkCmdResetQueryPool, vkCmdWriteTimestamp, vkCreateQueryPool, vkDestroyQueryPool, vkGetQueryPoolResults
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkQueryPool
VkQueue(3)
Name
VkQueue - Opaque handle to a queue object
C Specification
Creating a logical device also creates the queues associated with that device. The queues to create are described by a set of VkDeviceQueueCreateInfo structures that are passed to vkCreateDevice in pQueueCreateInfos
.
Queues are represented by VkQueue
handles:
VK_DEFINE_HANDLE(VkQueue)
See Also
vkGetDeviceQueue, vkQueueBindSparse, vkQueueSubmit, vkQueueWaitIdle
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkQueue
VkRenderPass(3)
Name
VkRenderPass - Opaque handle to a render pass object
C Specification
A render pass represents a collection of attachments, subpasses, and dependencies between the subpasses, and describes how the attachments are used over the course of the subpasses. The use of a render pass in a command buffer is a render pass instance.
Render passes are represented by VkRenderPass
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass)
See Also
VkCommandBufferInheritanceInfo, VkFramebufferCreateInfo, VkGraphicsPipelineCreateInfo, VkRenderPassBeginInfo, vkCreateRenderPass, vkDestroyRenderPass, vkGetRenderAreaGranularity
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkRenderPass
VkSampler(3)
Name
VkSampler - Opaque handle to a sampler object
C Specification
VkSampler
objects represent the state of an image sampler which is used by the implementation to read image data and apply filtering and other transformations for the shader.
Samplers are represented by VkSampler
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler)
See Also
VkDescriptorImageInfo, VkDescriptorSetLayoutBinding, vkCreateSampler, vkDestroySampler
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkSampler
VkSemaphore(3)
Name
VkSemaphore - Opaque handle to a semaphore object
C Specification
Semaphores are a synchronization primitive that can be used to insert a dependency between batches submitted to queues. Semaphores have two states - signaled and unsignaled. The state of a semaphore can be signaled after execution of a batch of commands is completed. A batch can wait for a semaphore to become signaled before it begins execution, and the semaphore is also unsignaled before the batch begins execution.
Semaphores are represented by VkSemaphore
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore)
See Also
VkBindSparseInfo, VkSubmitInfo, vkCreateSemaphore, vkDestroySemaphore
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkSemaphore
VkShaderModule(3)
Name
VkShaderModule - Opaque handle to a shader module object
C Specification
Shader modules contain shader code and one or more entry points. Shaders are selected from a shader module by specifying an entry point as part of pipeline creation. The stages of a pipeline can use shaders that come from different modules. The shader code defining a shader module must be in the SPIR-V format, as described by the Vulkan Environment for SPIR-V appendix.
Shader modules are represented by VkShaderModule
handles:
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule)
See Also
VkPipelineShaderStageCreateInfo, vkCreateShaderModule, vkDestroyShaderModule
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkShaderModule
Structures
VkAllocationCallbacks(3)
Name
VkAllocationCallbacks - Structure containing callback function pointers for memory allocation
C Specification
Allocators are provided by the application as a pointer to a VkAllocationCallbacks
structure:
typedef struct VkAllocationCallbacks { void* pUserData; PFN_vkAllocationFunction pfnAllocation; PFN_vkReallocationFunction pfnReallocation; PFN_vkFreeFunction pfnFree; PFN_vkInternalAllocationNotification pfnInternalAllocation; PFN_vkInternalFreeNotification pfnInternalFree; } VkAllocationCallbacks;
Members
-
pUserData
is a value to be interpreted by the implementation of the callbacks. When any of the callbacks inVkAllocationCallbacks
are called, the Vulkan implementation will pass this value as the first parameter to the callback. This value can vary each time an allocator is passed into a command, even when the same object takes an allocator in multiple commands. -
pfnAllocation
is a pointer to an application-defined memory allocation function of type PFN_vkAllocationFunction. -
pfnReallocation
is a pointer to an application-defined memory reallocation function of type PFN_vkReallocationFunction. -
pfnFree
is a pointer to an application-defined memory free function of type PFN_vkFreeFunction. -
pfnInternalAllocation
is a pointer to an application-defined function that is called by the implementation when the implementation makes internal allocations, and it is of type PFN_vkInternalAllocationNotification. -
pfnInternalFree
is a pointer to an application-defined function that is called by the implementation when the implementation frees internal allocations, and it is of type PFN_vkInternalFreeNotification.
Description
Valid Usage
pfnAllocation
must be a pointer to a valid user-defined PFN_vkAllocationFunctionpfnReallocation
must be a pointer to a valid user-defined PFN_vkReallocationFunctionpfnFree
must be a pointer to a valid user-defined PFN_vkFreeFunction- If either of
pfnInternalAllocation
orpfnInternalFree
is notNULL
, both must be valid callbacks
See Also
PFN_vkAllocationFunction, PFN_vkFreeFunction, PFN_vkInternalAllocationNotification, PFN_vkInternalFreeNotification, PFN_vkReallocationFunction, vkAllocateMemory, vkCreateBuffer, vkCreateBufferView, vkCreateCommandPool, vkCreateComputePipelines, vkCreateDescriptorPool, vkCreateDescriptorSetLayout, vkCreateDevice, vkCreateEvent, vkCreateFence, vkCreateFramebuffer, vkCreateGraphicsPipelines, vkCreateImage, vkCreateImageView, vkCreateInstance, vkCreatePipelineCache, vkCreatePipelineLayout, vkCreateQueryPool, vkCreateRenderPass, vkCreateSampler, vkCreateSemaphore, vkCreateShaderModule, vkDestroyBuffer, vkDestroyBufferView, vkDestroyCommandPool, vkDestroyDescriptorPool, vkDestroyDescriptorSetLayout, vkDestroyDevice, vkDestroyEvent, vkDestroyFence, vkDestroyFramebuffer, vkDestroyImage, vkDestroyImageView, vkDestroyInstance, vkDestroyPipeline, vkDestroyPipelineCache, vkDestroyPipelineLayout, vkDestroyQueryPool, vkDestroyRenderPass, vkDestroySampler, vkDestroySemaphore, vkDestroyShaderModule, vkFreeMemory
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkAllocationCallbacks
VkApplicationInfo(3)
Name
VkApplicationInfo - Structure specifying application info
C Specification
The VkApplicationInfo
structure is defined as:
typedef struct VkApplicationInfo { VkStructureType sType; const void* pNext; const char* pApplicationName; uint32_t applicationVersion; const char* pEngineName; uint32_t engineVersion; uint32_t apiVersion; } VkApplicationInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
pApplicationName
isNULL
or is a pointer to a null-terminated UTF-8 string containing the name of the application. -
applicationVersion
is an unsigned integer variable containing the developer-supplied version number of the application. -
pEngineName
isNULL
or is a pointer to a null-terminated UTF-8 string containing the name of the engine (if any) used to create the application. -
engineVersion
is an unsigned integer variable containing the developer-supplied version number of the engine used to create the application. -
apiVersion
is the version of the Vulkan API against which the application expects to run, encoded as described in the API Version Numbers and Semantics section. IfapiVersion
is 0 the implementation must ignore it, otherwise if the implementation does not support the requestedapiVersion
, or an effective substitute forapiVersion
, it must returnVK_ERROR_INCOMPATIBLE_DRIVER
. The patch version number specified inapiVersion
is ignored when creating an instance object. Only the major and minor versions of the instance must match those requested inapiVersion
.
Description
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_APPLICATION_INFO
pNext
must beNULL
- If
pApplicationName
is notNULL
,pApplicationName
must be a null-terminated UTF-8 string- If
pEngineName
is notNULL
,pEngineName
must be a null-terminated UTF-8 string
See Also
VkInstanceCreateInfo, VkStructureType
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkApplicationInfo
VkAttachmentDescription(3)
Name
VkAttachmentDescription - Structure specifying an attachment description
C Specification
The VkAttachmentDescription
structure is defined as:
typedef struct VkAttachmentDescription { VkAttachmentDescriptionFlags flags; VkFormat format; VkSampleCountFlagBits samples; VkAttachmentLoadOp loadOp; VkAttachmentStoreOp storeOp; VkAttachmentLoadOp stencilLoadOp; VkAttachmentStoreOp stencilStoreOp; VkImageLayout initialLayout; VkImageLayout finalLayout; } VkAttachmentDescription;
Members
-
flags
is a bitmask of VkAttachmentDescriptionFlagBits specifying additional properties of the attachment. -
format
is a VkFormat value specifying the format of the image that will be used for the attachment. -
samples
is the number of samples of the image as defined in VkSampleCountFlagBits. -
loadOp
is a VkAttachmentLoadOp value specifying how the contents of color and depth components of the attachment are treated at the beginning of the subpass where it is first used. -
storeOp
is a VkAttachmentStoreOp value specifying how the contents of color and depth components of the attachment are treated at the end of the subpass where it is last used. -
stencilLoadOp
is a VkAttachmentLoadOp value specifying how the contents of stencil components of the attachment are treated at the beginning of the subpass where it is first used. -
stencilStoreOp
is a VkAttachmentStoreOp value specifying how the contents of stencil components of the attachment are treated at the end of the last subpass where it is used. -
initialLayout
is the layout the attachment image subresource will be in when a render pass instance begins. -
finalLayout
is the layout the attachment image subresource will be transitioned to when a render pass instance ends. During a render pass instance, an attachment can use a different layout in each subpass, if desired.
Description
If the attachment uses a color format, then loadOp
and storeOp
are used, and stencilLoadOp
and stencilStoreOp
are ignored. If the format has depth and/or stencil components, loadOp
and storeOp
apply only to the depth data, while stencilLoadOp
and stencilStoreOp
define how the stencil data is handled. loadOp
and stencilLoadOp
define the load operations that execute as part of the first subpass that uses the attachment. storeOp
and stencilStoreOp
define the store operations that execute as part of the last subpass that uses the attachment.
The load operation for each sample in an attachment happens-before any recorded command which accesses the sample in the first subpass where the attachment is used. Load operations for attachments with a depth/stencil format execute in the VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
pipeline stage. Load operations for attachments with a color format execute in the VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
pipeline stage.
The store operation for each sample in an attachment happens-after any recorded command which accesses the sample in the last subpass where the attachment is used. Store operations for attachments with a depth/stencil format execute in the VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT
pipeline stage. Store operations for attachments with a color format execute in the VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
pipeline stage.
If an attachment is not used by any subpass, then loadOp
, storeOp
, stencilStoreOp
, and stencilLoadOp
are ignored, and the attachment’s memory contents will not be modified by execution of a render pass instance.
During a render pass instance, input/color attachments with color formats that have a component size of 8, 16, or 32 bits must be represented in the attachment’s format throughout the instance. Attachments with other floating- or fixed-point color formats, or with depth components may be represented in a format with a precision higher than the attachment format, but must be represented with the same range. When such a component is loaded via the loadOp
, it will be converted into an implementation-dependent format used by the render pass. Such components must be converted from the render pass format, to the format of the attachment, before they are resolved or stored at the end of a render pass instance via storeOp
. Conversions occur as described in Numeric Representation and Computation and Fixed-Point Data Conversions.
If flags
includes VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT
, then the attachment is treated as if it shares physical memory with another attachment in the same render pass. This information limits the ability of the implementation to reorder certain operations (like layout transitions and the loadOp
) such that it is not improperly reordered against other uses of the same physical memory via a different attachment. This is described in more detail below.
Valid Usage
finalLayout
must not beVK_IMAGE_LAYOUT_UNDEFINED
orVK_IMAGE_LAYOUT_PREINITIALIZED
Valid Usage (Implicit)
flags
must be a valid combination of VkAttachmentDescriptionFlagBits valuesformat
must be a valid VkFormat valuesamples
must be a valid VkSampleCountFlagBits valueloadOp
must be a valid VkAttachmentLoadOp valuestoreOp
must be a valid VkAttachmentStoreOp valuestencilLoadOp
must be a valid VkAttachmentLoadOp valuestencilStoreOp
must be a valid VkAttachmentStoreOp valueinitialLayout
must be a valid VkImageLayout valuefinalLayout
must be a valid VkImageLayout value
See Also
VkAttachmentDescriptionFlags, VkAttachmentLoadOp, VkAttachmentStoreOp, VkFormat, VkImageLayout, VkRenderPassCreateInfo, VkSampleCountFlagBits
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkAttachmentDescription
VkAttachmentReference(3)
Name
VkAttachmentReference - Structure specifying an attachment reference
C Specification
The VkAttachmentReference
structure is defined as:
typedef struct VkAttachmentReference { uint32_t attachment; VkImageLayout layout; } VkAttachmentReference;
Members
-
attachment
is the index of the attachment of the render pass, and corresponds to the index of the corresponding element in thepAttachments
array of theVkRenderPassCreateInfo
structure. If any color or depth/stencil attachments areVK_ATTACHMENT_UNUSED
, then no writes occur for those attachments. -
layout
is a VkImageLayout value specifying the layout the attachment uses during the subpass.
Description
Valid Usage
layout
must not beVK_IMAGE_LAYOUT_UNDEFINED
orVK_IMAGE_LAYOUT_PREINITIALIZED
Valid Usage (Implicit)
layout
must be a valid VkImageLayout value
See Also
VkImageLayout, VkSubpassDescription
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkAttachmentReference
VkBindSparseInfo(3)
Name
VkBindSparseInfo - Structure specifying a sparse binding operation
C Specification
The VkBindSparseInfo
structure is defined as:
typedef struct VkBindSparseInfo { VkStructureType sType; const void* pNext; uint32_t waitSemaphoreCount; const VkSemaphore* pWaitSemaphores; uint32_t bufferBindCount; const VkSparseBufferMemoryBindInfo* pBufferBinds; uint32_t imageOpaqueBindCount; const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds; uint32_t imageBindCount; const VkSparseImageMemoryBindInfo* pImageBinds; uint32_t signalSemaphoreCount; const VkSemaphore* pSignalSemaphores; } VkBindSparseInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
waitSemaphoreCount
is the number of semaphores upon which to wait before executing the sparse binding operations for the batch. -
pWaitSemaphores
is a pointer to an array of semaphores upon which to wait on before the sparse binding operations for this batch begin execution. If semaphores to wait on are provided, they define a semaphore wait operation. -
bufferBindCount
is the number of sparse buffer bindings to perform in the batch. -
pBufferBinds
is a pointer to an array of VkSparseBufferMemoryBindInfo structures. -
imageOpaqueBindCount
is the number of opaque sparse image bindings to perform. -
pImageOpaqueBinds
is a pointer to an array of VkSparseImageOpaqueMemoryBindInfo structures, indicating opaque sparse image bindings to perform. -
imageBindCount
is the number of sparse image bindings to perform. -
pImageBinds
is a pointer to an array of VkSparseImageMemoryBindInfo structures, indicating sparse image bindings to perform. -
signalSemaphoreCount
is the number of semaphores to be signaled once the sparse binding operations specified by the structure have completed execution. -
pSignalSemaphores
is a pointer to an array of semaphores which will be signaled when the sparse binding operations for this batch have completed execution. If semaphores to be signaled are provided, they define a semaphore signal operation.
Description
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_BIND_SPARSE_INFO
pNext
must beNULL
- If
waitSemaphoreCount
is not0
,pWaitSemaphores
must be a pointer to an array ofwaitSemaphoreCount
validVkSemaphore
handles- If
bufferBindCount
is not0
,pBufferBinds
must be a pointer to an array ofbufferBindCount
validVkSparseBufferMemoryBindInfo
structures- If
imageOpaqueBindCount
is not0
,pImageOpaqueBinds
must be a pointer to an array ofimageOpaqueBindCount
validVkSparseImageOpaqueMemoryBindInfo
structures- If
imageBindCount
is not0
,pImageBinds
must be a pointer to an array ofimageBindCount
validVkSparseImageMemoryBindInfo
structures- If
signalSemaphoreCount
is not0
,pSignalSemaphores
must be a pointer to an array ofsignalSemaphoreCount
validVkSemaphore
handles- Both of the elements of
pSignalSemaphores
, and the elements ofpWaitSemaphores
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkSemaphore, VkSparseBufferMemoryBindInfo, VkSparseImageMemoryBindInfo, VkSparseImageOpaqueMemoryBindInfo, VkStructureType, vkQueueBindSparse
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBindSparseInfo
VkBufferCopy(3)
Name
VkBufferCopy - Structure specifying a buffer copy operation
C Specification
The VkBufferCopy
structure is defined as:
typedef struct VkBufferCopy { VkDeviceSize srcOffset; VkDeviceSize dstOffset; VkDeviceSize size; } VkBufferCopy;
Members
-
srcOffset
is the starting offset in bytes from the start ofsrcBuffer
. -
dstOffset
is the starting offset in bytes from the start ofdstBuffer
. -
size
is the number of bytes to copy.
See Also
VkDeviceSize
, vkCmdCopyBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferCopy
VkBufferCreateInfo(3)
Name
VkBufferCreateInfo - Structure specifying the parameters of a newly created buffer object
C Specification
The VkBufferCreateInfo
structure is defined as:
typedef struct VkBufferCreateInfo { VkStructureType sType; const void* pNext; VkBufferCreateFlags flags; VkDeviceSize size; VkBufferUsageFlags usage; VkSharingMode sharingMode; uint32_t queueFamilyIndexCount; const uint32_t* pQueueFamilyIndices; } VkBufferCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkBufferCreateFlagBits specifying additional parameters of the buffer. -
size
is the size in bytes of the buffer to be created. -
usage
is a bitmask of VkBufferUsageFlagBits specifying allowed usages of the buffer. -
sharingMode
is a VkSharingMode value specifying the sharing mode of the buffer when it will be accessed by multiple queue families. -
queueFamilyIndexCount
is the number of entries in thepQueueFamilyIndices
array. -
pQueueFamilyIndices
is a list of queue families that will access this buffer (ignored ifsharingMode
is notVK_SHARING_MODE_CONCURRENT
).
Description
Valid Usage
size
must be greater than0
- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
,pQueueFamilyIndices
must be a pointer to an array ofqueueFamilyIndexCount
uint32_t
values- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
,queueFamilyIndexCount
must be greater than1
- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
, each element ofpQueueFamilyIndices
must be unique and must be less thanpQueueFamilyPropertyCount
returned by vkGetPhysicalDeviceQueueFamilyProperties for thephysicalDevice
that was used to createdevice
- If the sparse bindings feature is not enabled,
flags
must not containVK_BUFFER_CREATE_SPARSE_BINDING_BIT
- If the sparse buffer residency feature is not enabled,
flags
must not containVK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse aliased residency feature is not enabled,
flags
must not containVK_BUFFER_CREATE_SPARSE_ALIASED_BIT
- If
flags
containsVK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT
orVK_BUFFER_CREATE_SPARSE_ALIASED_BIT
, it must also containVK_BUFFER_CREATE_SPARSE_BINDING_BIT
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkBufferCreateFlagBits valuesusage
must be a valid combination of VkBufferUsageFlagBits valuesusage
must not be0
sharingMode
must be a valid VkSharingMode value
See Also
VkBufferCreateFlags, VkBufferUsageFlags, VkDeviceSize
, VkSharingMode, VkStructureType, vkCreateBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferCreateInfo
VkBufferImageCopy(3)
Name
VkBufferImageCopy - Structure specifying a buffer image copy operation
C Specification
For both vkCmdCopyBufferToImage and vkCmdCopyImageToBuffer, each element of pRegions
is a structure defined as:
typedef struct VkBufferImageCopy { VkDeviceSize bufferOffset; uint32_t bufferRowLength; uint32_t bufferImageHeight; VkImageSubresourceLayers imageSubresource; VkOffset3D imageOffset; VkExtent3D imageExtent; } VkBufferImageCopy;
Members
-
bufferOffset
is the offset in bytes from the start of the buffer object where the image data is copied from or to. -
bufferRowLength
andbufferImageHeight
specify the data in buffer memory as a subregion of a larger two- or three-dimensional image, and control the addressing calculations of data in buffer memory. If either of these values is zero, that aspect of the buffer memory is considered to be tightly packed according to theimageExtent
. -
imageSubresource
is a VkImageSubresourceLayers used to specify the specific image subresources of the image used for the source or destination image data. -
imageOffset
selects the initial x, y, z offsets in texels of the sub-region of the source or destination image data. -
imageExtent
is the size in texels of the image to copy inwidth
,height
anddepth
.
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
VK_FORMAT_S8_UINT
value per texel. - data copied to or from the depth aspect of a
VK_FORMAT_D16_UNORM
orVK_FORMAT_D16_UNORM_S8_UINT
format is tightly packed with oneVK_FORMAT_D16_UNORM
value per texel. - data copied to or from the depth aspect of a
VK_FORMAT_D32_SFLOAT
orVK_FORMAT_D32_SFLOAT_S8_UINT
format is tightly packed with oneVK_FORMAT_D32_SFLOAT
value per texel. - data copied to or from the depth aspect of a
VK_FORMAT_X8_D24_UNORM_PACK32
orVK_FORMAT_D24_UNORM_S8_UINT
format 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 inimageSubresource
, 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, the data in buffer memory must be in the the range [0,1] or undefined results occur.
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 the calling command’s
VkImage
parameter’s format is not a depth/stencil format, thenbufferOffset
must be a multiple of the format’s element sizebufferOffset
must be a multiple of4
bufferRowLength
must be0
, or greater than or equal to thewidth
member ofimageExtent
bufferImageHeight
must be0
, or greater than or equal to theheight
member ofimageExtent
imageOffset.x
and (imageExtent.width
+imageOffset.x
) must both be greater than or equal to0
and less than or equal to the image subresource widthimageOffset.y
and (imageExtent.height +imageOffset.y
) must both be greater than or equal to0
and less than or equal to the image subresource height- If the calling command’s
srcImage
(vkCmdCopyImageToBuffer) ordstImage
(vkCmdCopyBufferToImage) is of typeVK_IMAGE_TYPE_1D
, thenimageOffset.y
must be0
andimageExtent.height
must be1
.imageOffset.z
and (imageExtent.depth +imageOffset.z
) must both be greater than or equal to0
and less than or equal to the image subresource depth- If the calling command’s
srcImage
(vkCmdCopyImageToBuffer) ordstImage
(vkCmdCopyBufferToImage) is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thenimageOffset.z
must be0
andimageExtent.depth
must be1
.- If the calling command’s
VkImage
parameter is a compressed format image,bufferRowLength
must be a multiple of the compressed texel block width- If the calling command’s
VkImage
parameter is a compressed format image,bufferImageHeight
must be a multiple of the compressed texel block height- If the calling command’s
VkImage
parameter is a compressed format image, all members ofimageOffset
must be a multiple of the corresponding dimensions of the compressed texel block- If the calling command’s
VkImage
parameter is a compressed format image,bufferOffset
must be a multiple of the compressed texel block size in bytes- If the calling command’s
VkImage
parameter is a compressed format image,imageExtent.width
must 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
VkImage
parameter is a compressed format image,imageExtent.height
must 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
VkImage
parameter is a compressed format image,imageExtent.depth
must be a multiple of the compressed texel block depth or (imageExtent.depth
+imageOffset.z
) must equal the image subresource depthbufferOffset
,bufferRowLength
,bufferImageHeight
and all members ofimageOffset
andimageExtent
must respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in Physical Device Enumeration- The
aspectMask
member ofimageSubresource
must specify aspects present in the calling command’sVkImage
parameter- The
aspectMask
member ofimageSubresource
must only have a single bit set- If the calling command’s
VkImage
parameter is of VkImageTypeVK_IMAGE_TYPE_3D
, thebaseArrayLayer
andlayerCount
members ofimageSubresource
must be0
and1
, respectively- When copying to the depth aspect of an image subresource, the data in the source buffer must be in the range [0,1]
Valid Usage (Implicit)
imageSubresource
must be a validVkImageSubresourceLayers
structure
See Also
VkDeviceSize
, VkExtent3D, VkImageSubresourceLayers, VkOffset3D, vkCmdCopyBufferToImage, vkCmdCopyImageToBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferImageCopy
VkBufferMemoryBarrier(3)
Name
VkBufferMemoryBarrier - Structure specifying a buffer memory barrier
C Specification
The VkBufferMemoryBarrier
structure is defined as:
typedef struct VkBufferMemoryBarrier { VkStructureType sType; const void* pNext; VkAccessFlags srcAccessMask; VkAccessFlags dstAccessMask; uint32_t srcQueueFamilyIndex; uint32_t dstQueueFamilyIndex; VkBuffer buffer; VkDeviceSize offset; VkDeviceSize size; } VkBufferMemoryBarrier;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
srcAccessMask
is a bitmask of VkAccessFlagBits specifying a source access mask. -
dstAccessMask
is a bitmask of VkAccessFlagBits specifying a destination access mask. -
srcQueueFamilyIndex
is the source queue family for a queue family ownership transfer. -
dstQueueFamilyIndex
is the destination queue family for a queue family ownership transfer. -
buffer
is a handle to the buffer whose backing memory is affected by the barrier. -
offset
is an offset in bytes into the backing memory forbuffer
; this is relative to the base offset as bound to the buffer (see vkBindBufferMemory). -
size
is a size in bytes of the affected area of backing memory forbuffer
, orVK_WHOLE_SIZE
to use the range fromoffset
to the end of the buffer.
Description
The first access scope is limited to access to memory through the specified buffer range, via access types in the source access mask specified by srcAccessMask
. If srcAccessMask
includes VK_ACCESS_HOST_WRITE_BIT
, memory writes performed by that access type are also made visible, as that access type is not performed through a resource.
The second access scope is limited to access to memory through the specified buffer range, via access types in the destination access mask. specified by dstAccessMask
. If dstAccessMask
includes VK_ACCESS_HOST_WRITE_BIT
or VK_ACCESS_HOST_READ_BIT
, available memory writes are also made visible to accesses of those types, as those access types are not performed through a resource.
If srcQueueFamilyIndex
is not equal to dstQueueFamilyIndex
, and srcQueueFamilyIndex
is equal to the current queue family, then the memory barrier defines a queue family release operation for the specified buffer range, and the second access scope includes no access, as if dstAccessMask
was 0
.
If dstQueueFamilyIndex
is not equal to srcQueueFamilyIndex
, and dstQueueFamilyIndex
is equal to the current queue family, then the memory barrier defines a queue family acquire operation for the specified buffer range, and the first access scope includes no access, as if srcAccessMask
was 0
.
Valid Usage
offset
must be less than the size ofbuffer
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be greater than0
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be less than or equal to than the size ofbuffer
minusoffset
- If
buffer
was created with a sharing mode ofVK_SHARING_MODE_CONCURRENT
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must both beVK_QUEUE_FAMILY_IGNORED
- If
buffer
was created with a sharing mode ofVK_SHARING_MODE_EXCLUSIVE
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must either both beVK_QUEUE_FAMILY_IGNORED
, or both be a valid queue family (see html/vkspec.html#devsandqueues-queueprops)- If
buffer
was created with a sharing mode ofVK_SHARING_MODE_EXCLUSIVE
, andsrcQueueFamilyIndex
anddstQueueFamilyIndex
are notVK_QUEUE_FAMILY_IGNORED
, at least one of them must be the same as the family of the queue that will execute this barrier
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
pNext
must beNULL
srcAccessMask
must be a valid combination of VkAccessFlagBits valuesdstAccessMask
must be a valid combination of VkAccessFlagBits valuesbuffer
must be a validVkBuffer
handle
See Also
VkAccessFlags, VkBuffer, VkDeviceSize
, VkStructureType, vkCmdPipelineBarrier, vkCmdWaitEvents
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferMemoryBarrier
VkBufferViewCreateInfo(3)
Name
VkBufferViewCreateInfo - Structure specifying parameters of a newly created buffer view
C Specification
The VkBufferViewCreateInfo
structure is defined as:
typedef struct VkBufferViewCreateInfo { VkStructureType sType; const void* pNext; VkBufferViewCreateFlags flags; VkBuffer buffer; VkFormat format; VkDeviceSize offset; VkDeviceSize range; } VkBufferViewCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is reserved for future use. -
buffer
is aVkBuffer
on which the view will be created. -
format
is a VkFormat describing the format of the data elements in the buffer. -
offset
is an offset in bytes from the base address of the buffer. Accesses to the buffer view from shaders use addressing that is relative to this starting offset. -
range
is a size in bytes of the buffer view. Ifrange
is equal toVK_WHOLE_SIZE
, the range fromoffset
to the end of the buffer is used. IfVK_WHOLE_SIZE
is used and the remaining size of the buffer is not a multiple of the element size offormat
, then the nearest smaller multiple is used.
Description
Valid Usage
offset
must be less than the size ofbuffer
offset
must be a multiple ofVkPhysicalDeviceLimits
::minTexelBufferOffsetAlignment
- If
range
is not equal toVK_WHOLE_SIZE
,range
must be greater than0
- If
range
is not equal toVK_WHOLE_SIZE
,range
must be a multiple of the element size offormat
- If
range
is not equal toVK_WHOLE_SIZE
,range
divided by the element size offormat
must be less than or equal toVkPhysicalDeviceLimits
::maxTexelBufferElements
- If
range
is not equal toVK_WHOLE_SIZE
, the sum ofoffset
andrange
must be less than or equal to the size ofbuffer
buffer
must have been created with ausage
value containing at least one ofVK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
orVK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
- If
buffer
was created withusage
containingVK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
,format
must be supported for uniform texel buffers, as specified by theVK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT
flag inVkFormatProperties
::bufferFeatures
returned byvkGetPhysicalDeviceFormatProperties
- If
buffer
was created withusage
containingVK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
,format
must be supported for storage texel buffers, as specified by theVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT
flag inVkFormatProperties
::bufferFeatures
returned byvkGetPhysicalDeviceFormatProperties
- If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
pNext
must beNULL
flags
must be0
buffer
must be a validVkBuffer
handleformat
must be a valid VkFormat value
See Also
VkBuffer, VkBufferViewCreateFlags, VkDeviceSize
, VkFormat, VkStructureType, vkCreateBufferView
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferViewCreateInfo
VkClearAttachment(3)
Name
VkClearAttachment - Structure specifying a clear attachment
C Specification
The VkClearAttachment
structure is defined as:
typedef struct VkClearAttachment { VkImageAspectFlags aspectMask; uint32_t colorAttachment; VkClearValue clearValue; } VkClearAttachment;
Members
-
aspectMask
is a mask selecting the color, depth and/or stencil aspects of the attachment to be cleared.aspectMask
can includeVK_IMAGE_ASPECT_COLOR_BIT
for color attachments,VK_IMAGE_ASPECT_DEPTH_BIT
for depth/stencil attachments with a depth component, andVK_IMAGE_ASPECT_STENCIL_BIT
for depth/stencil attachments with a stencil component. If the subpass’s depth/stencil attachment isVK_ATTACHMENT_UNUSED
, then the clear has no effect. -
colorAttachment
is only meaningful ifVK_IMAGE_ASPECT_COLOR_BIT
is set inaspectMask
, in which case it is an index to thepColorAttachments
array in the VkSubpassDescription structure of the current subpass which selects the color attachment to clear. IfcolorAttachment
isVK_ATTACHMENT_UNUSED
then the clear has no effect. -
clearValue
is the color or depth/stencil value to clear the attachment to, as described in Clear Values below.
Description
No memory barriers are needed between vkCmdClearAttachments
and preceding or subsequent draw or attachment clear commands in the same subpass.
The vkCmdClearAttachments
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 VkAttachmentDescription to VK_ATTACHMENT_LOAD_OP_CLEAR
, as described for vkCreateRenderPass.
Valid Usage
- If
aspectMask
includesVK_IMAGE_ASPECT_COLOR_BIT
, it must not includeVK_IMAGE_ASPECT_DEPTH_BIT
orVK_IMAGE_ASPECT_STENCIL_BIT
aspectMask
must not includeVK_IMAGE_ASPECT_METADATA_BIT
clearValue
must be a validVkClearValue
union
Valid Usage (Implicit)
aspectMask
must be a valid combination of VkImageAspectFlagBits valuesaspectMask
must not be0
See Also
VkClearValue, VkImageAspectFlags, vkCmdClearAttachments
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkClearAttachment
VkClearColorValue(3)
Name
VkClearColorValue - Structure specifying a clear color value
C Specification
The VkClearColorValue
structure is defined as:
typedef union VkClearColorValue { float float32[4]; int32_t int32[4]; uint32_t uint32[4]; } VkClearColorValue;
Members
-
float32
are the color clear values when the format of the image or attachment is one of the formats in the Interpretation of Numeric Format table other than signed integer (SINT
) or unsigned integer (UINT
). Floating point values are automatically converted to the format of the image, with the clear value being treated as linear if the image is sRGB. -
int32
are the color clear values when the format of the image or attachment is signed integer (SINT
). Signed integer values are converted to the format of the image by casting to the smaller type (with negative 32-bit values mapping to negative values in the smaller type). If the integer clear value is not representable in the target type (e.g. would overflow in conversion to that type), the clear value is undefined. -
uint32
are the color clear values when the format of the image or attachment is unsigned integer (UINT
). Unsigned integer values are converted to the format of the image by casting to the integer type with fewer bits.
Description
The four array elements of the clear color map to R, G, B, and A components of image formats, in order.
If the image has more than one sample, the same value is written to all samples for any pixels being cleared.
See Also
VkClearValue, vkCmdClearColorImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkClearColorValue
VkClearDepthStencilValue(3)
Name
VkClearDepthStencilValue - Structure specifying a clear depth stencil value
C Specification
The VkClearDepthStencilValue
structure is defined as:
typedef struct VkClearDepthStencilValue { float depth; uint32_t stencil; } VkClearDepthStencilValue;
Members
-
depth
is the clear value for the depth aspect of the depth/stencil attachment. It is a floating-point value which is automatically converted to the attachment’s format. -
stencil
is the clear value for the stencil aspect of the depth/stencil attachment. It is a 32-bit integer value which is converted to the attachment’s format by taking the appropriate number of LSBs.
Description
Valid Usage
depth
must be between0.0
and1.0
, inclusive
See Also
VkClearValue, vkCmdClearDepthStencilImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkClearDepthStencilValue
VkClearRect(3)
Name
VkClearRect - Structure specifying a clear rectangle
C Specification
The VkClearRect
structure is defined as:
typedef struct VkClearRect { VkRect2D rect; uint32_t baseArrayLayer; uint32_t layerCount; } VkClearRect;
Members
-
rect
is the two-dimensional region to be cleared. -
baseArrayLayer
is the first layer to be cleared. -
layerCount
is the number of layers to clear.
Description
The layers [baseArrayLayer
, baseArrayLayer
+ layerCount
) counting from the base layer of the attachment image view are cleared.
See Also
VkRect2D, vkCmdClearAttachments
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkClearRect
VkClearValue(3)
Name
VkClearValue - Structure specifying a clear value
C Specification
The VkClearValue
union is defined as:
typedef union VkClearValue { VkClearColorValue color; VkClearDepthStencilValue depthStencil; } VkClearValue;
Members
-
color
specifies the color image clear values to use when clearing a color image or attachment. -
depthStencil
specifies the depth and stencil clear values to use when clearing a depth/stencil image or attachment.
Description
This union is used where part of the API requires either color or depth/stencil clear values, depending on the attachment, and defines the initial clear values in the VkRenderPassBeginInfo structure.
Valid Usage
depthStencil
must be a validVkClearDepthStencilValue
structure
See Also
VkClearAttachment, VkClearColorValue, VkClearDepthStencilValue, VkRenderPassBeginInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkClearValue
VkCommandBufferAllocateInfo(3)
Name
VkCommandBufferAllocateInfo - Structure specifying the allocation parameters for command buffer object
C Specification
The VkCommandBufferAllocateInfo
structure is defined as:
typedef struct VkCommandBufferAllocateInfo { VkStructureType sType; const void* pNext; VkCommandPool commandPool; VkCommandBufferLevel level; uint32_t commandBufferCount; } VkCommandBufferAllocateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
commandPool
is the command pool from which the command buffers are allocated. -
level
is an VkCommandBufferLevel value specifying the command buffer level. -
commandBufferCount
is the number of command buffers to allocate from the pool.
Description
Valid Usage
commandBufferCount
must be greater than0
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
pNext
must beNULL
commandPool
must be a validVkCommandPool
handlelevel
must be a valid VkCommandBufferLevel value
See Also
VkCommandBufferLevel, VkCommandPool, VkStructureType, vkAllocateCommandBuffers
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCommandBufferAllocateInfo
VkCommandBufferBeginInfo(3)
Name
VkCommandBufferBeginInfo - Structure specifying a command buffer begin operation
C Specification
The VkCommandBufferBeginInfo
structure is defined as:
typedef struct VkCommandBufferBeginInfo { VkStructureType sType; const void* pNext; VkCommandBufferUsageFlags flags; const VkCommandBufferInheritanceInfo* pInheritanceInfo; } VkCommandBufferBeginInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkCommandBufferUsageFlagBits specifying usage behavior for the command buffer. -
pInheritanceInfo
is a pointer to aVkCommandBufferInheritanceInfo
structure, which is used ifcommandBuffer
is a secondary command buffer. If this is a primary command buffer, then this value is ignored.
Description
Valid Usage
- If
flags
containsVK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
, therenderPass
member ofpInheritanceInfo
must be a validVkRenderPass
- If
flags
containsVK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
, thesubpass
member ofpInheritanceInfo
must be a valid subpass index within therenderPass
member ofpInheritanceInfo
- If
flags
containsVK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
, theframebuffer
member ofpInheritanceInfo
must be either VK_NULL_HANDLE, or a validVkFramebuffer
that is compatible with therenderPass
member ofpInheritanceInfo
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
pNext
must beNULL
flags
must be a valid combination of VkCommandBufferUsageFlagBits values
See Also
VkCommandBufferInheritanceInfo, VkCommandBufferUsageFlags, VkStructureType, vkBeginCommandBuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCommandBufferBeginInfo
VkCommandBufferInheritanceInfo(3)
Name
VkCommandBufferInheritanceInfo - Structure specifying command buffer inheritance info
C Specification
If the command buffer is a secondary command buffer, then the VkCommandBufferInheritanceInfo
structure defines any state that will be inherited from the primary command buffer:
typedef struct VkCommandBufferInheritanceInfo { VkStructureType sType; const void* pNext; VkRenderPass renderPass; uint32_t subpass; VkFramebuffer framebuffer; VkBool32 occlusionQueryEnable; VkQueryControlFlags queryFlags; VkQueryPipelineStatisticFlags pipelineStatistics; } VkCommandBufferInheritanceInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
renderPass
is aVkRenderPass
object defining which render passes theVkCommandBuffer
will be compatible with and can be executed within. If theVkCommandBuffer
will not be executed within a render pass instance,renderPass
is ignored. -
subpass
is the index of the subpass within the render pass instance that theVkCommandBuffer
will be executed within. If theVkCommandBuffer
will not be executed within a render pass instance,subpass
is ignored. -
framebuffer
optionally refers to theVkFramebuffer
object that theVkCommandBuffer
will be rendering to if it is executed within a render pass instance. It can be VK_NULL_HANDLE if the framebuffer is not known, or if theVkCommandBuffer
will not be executed within a render pass instance.Note
Specifying the exact framebuffer that the secondary command buffer will be executed with may result in better performance at command buffer execution time.
-
occlusionQueryEnable
indicates whether the command buffer can be executed while an occlusion query is active in the primary command buffer. If this isVK_TRUE
, then this command buffer can be executed whether the primary command buffer has an occlusion query active or not. If this isVK_FALSE
, then the primary command buffer must not have an occlusion query active. -
queryFlags
indicates the query flags that can be used by an active occlusion query in the primary command buffer when this secondary command buffer is executed. If this value includes theVK_QUERY_CONTROL_PRECISE_BIT
bit, then the active query can return boolean results or actual sample counts. If this bit is not set, then the active query must not use theVK_QUERY_CONTROL_PRECISE_BIT
bit. -
pipelineStatistics
is a bitmask of VkQueryPipelineStatisticFlagBits specifying the set of pipeline statistics that can be counted by an active query in the primary command buffer when this secondary command buffer is executed. If this value includes a given bit, then this command buffer can be executed whether the primary command buffer has a pipeline statistics query active that includes this bit or not. If this value excludes a given bit, then the active pipeline statistics query must not be from a query pool that counts that statistic.
Description
Valid Usage
- If the inherited queries feature is not enabled,
occlusionQueryEnable
must beVK_FALSE
- If the inherited queries feature is enabled,
queryFlags
must be a valid combination of VkQueryControlFlagBits values- If the pipeline statistics queries feature is not enabled,
pipelineStatistics
must be0
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
pNext
must beNULL
- Both of
framebuffer
, andrenderPass
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkBool32
, VkCommandBufferBeginInfo, VkFramebuffer, VkQueryControlFlags, VkQueryPipelineStatisticFlags, VkRenderPass, VkStructureType
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCommandBufferInheritanceInfo
VkCommandPoolCreateInfo(3)
Name
VkCommandPoolCreateInfo - Structure specifying parameters of a newly created command pool
C Specification
The VkCommandPoolCreateInfo
structure is defined as:
typedef struct VkCommandPoolCreateInfo { VkStructureType sType; const void* pNext; VkCommandPoolCreateFlags flags; uint32_t queueFamilyIndex; } VkCommandPoolCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkCommandPoolCreateFlagBits indicating usage behavior for the pool and command buffers allocated from it. -
queueFamilyIndex
designates a queue family as described in section Queue Family Properties. All command buffers allocated from this command pool must be submitted on queues from the same queue family.
Description
Valid Usage
queueFamilyIndex
must be the index of a queue family available in the calling command’sdevice
parameter
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkCommandPoolCreateFlagBits values
See Also
VkCommandPoolCreateFlags, VkStructureType, vkCreateCommandPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCommandPoolCreateInfo
VkComponentMapping(3)
Name
VkComponentMapping - Structure specifying a color component mapping
C Specification
The VkComponentMapping
structure is defined as:
typedef struct VkComponentMapping { VkComponentSwizzle r; VkComponentSwizzle g; VkComponentSwizzle b; VkComponentSwizzle a; } VkComponentMapping;
Members
-
r
is a VkComponentSwizzle specifying the component value placed in the R component of the output vector. -
g
is a VkComponentSwizzle specifying the component value placed in the G component of the output vector. -
b
is a VkComponentSwizzle specifying the component value placed in the B component of the output vector. -
A
is a VkComponentSwizzle specifying the component value placed in the A component of the output vector.
Description
Valid Usage (Implicit)
r
must be a valid VkComponentSwizzle valueg
must be a valid VkComponentSwizzle valueb
must be a valid VkComponentSwizzle valuea
must be a valid VkComponentSwizzle value
See Also
VkComponentSwizzle, VkImageViewCreateInfo
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkComponentMapping
VkComputePipelineCreateInfo(3)
Name
VkComputePipelineCreateInfo - Structure specifying parameters of a newly created compute pipeline
C Specification
The VkComputePipelineCreateInfo
structure is defined as:
typedef struct VkComputePipelineCreateInfo { VkStructureType sType; const void* pNext; VkPipelineCreateFlags flags; VkPipelineShaderStageCreateInfo stage; VkPipelineLayout layout; VkPipeline basePipelineHandle; int32_t basePipelineIndex; } VkComputePipelineCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkPipelineCreateFlagBits specifying how the pipeline will be generated. -
stage
is a VkPipelineShaderStageCreateInfo describing the compute shader. -
layout
is the description of binding locations used by both the pipeline and descriptor sets used with the pipeline. -
basePipelineHandle
is a pipeline to derive from -
basePipelineIndex
is an index into thepCreateInfos
parameter to use as a pipeline to derive from
Description
The parameters basePipelineHandle
and basePipelineIndex
are described in more detail in Pipeline Derivatives.
stage
points to a structure of type VkPipelineShaderStageCreateInfo
.
Valid Usage
- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineIndex
is -1,basePipelineHandle
must be a valid handle to a computeVkPipeline
- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineHandle
is VK_NULL_HANDLE,basePipelineIndex
must be a valid index into the calling command’spCreateInfos
parameter- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineIndex
is not -1,basePipelineHandle
must be VK_NULL_HANDLE- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineHandle
is not VK_NULL_HANDLE,basePipelineIndex
must be -1- The
stage
member ofstage
must beVK_SHADER_STAGE_COMPUTE_BIT
- The shader code for the entry point identified by
stage
and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapterlayout
must be consistent with the layout of the compute shader specified instage
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkPipelineCreateFlagBits valuesstage
must be a validVkPipelineShaderStageCreateInfo
structurelayout
must be a validVkPipelineLayout
handle- Both of
basePipelineHandle
, andlayout
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkPipeline, VkPipelineCreateFlags, VkPipelineLayout, VkPipelineShaderStageCreateInfo, VkStructureType, vkCreateComputePipelines
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkComputePipelineCreateInfo
VkCopyDescriptorSet(3)
Name
VkCopyDescriptorSet - Structure specifying a copy descriptor set operation
C Specification
The VkCopyDescriptorSet
structure is defined as:
typedef struct VkCopyDescriptorSet { VkStructureType sType; const void* pNext; VkDescriptorSet srcSet; uint32_t srcBinding; uint32_t srcArrayElement; VkDescriptorSet dstSet; uint32_t dstBinding; uint32_t dstArrayElement; uint32_t descriptorCount; } VkCopyDescriptorSet;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
srcSet
,srcBinding
, andsrcArrayElement
are the source set, binding, and array element, respectively. -
dstSet
,dstBinding
, anddstArrayElement
are the destination set, binding, and array element, respectively. -
descriptorCount
is the number of descriptors to copy from the source to destination. IfdescriptorCount
is greater than the number of remaining array elements in the source or destination binding, those affect consecutive bindings in a manner similar to VkWriteDescriptorSet above.
Description
Valid Usage
srcBinding
must be a valid binding withinsrcSet
- The sum of
srcArrayElement
anddescriptorCount
must be less than or equal to the number of array elements in the descriptor set binding specified bysrcBinding
, and all applicable consecutive bindings, as described by html/vkspec.html#descriptorsets-updates-consecutivedstBinding
must be a valid binding withindstSet
- The sum of
dstArrayElement
anddescriptorCount
must be less than or equal to the number of array elements in the descriptor set binding specified bydstBinding
, and all applicable consecutive bindings, as described by html/vkspec.html#descriptorsets-updates-consecutive- If
srcSet
is equal todstSet
, then the source and destination ranges of descriptors must not overlap, where the ranges may include array elements from consecutive bindings as described by html/vkspec.html#descriptorsets-updates-consecutive
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
pNext
must beNULL
srcSet
must be a validVkDescriptorSet
handledstSet
must be a validVkDescriptorSet
handle- Both of
dstSet
, andsrcSet
must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkDescriptorSet, VkStructureType, vkUpdateDescriptorSets
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkCopyDescriptorSet
VkDescriptorBufferInfo(3)
Name
VkDescriptorBufferInfo - Structure specifying descriptor buffer info
C Specification
The VkDescriptorBufferInfo
structure is defined as:
typedef struct VkDescriptorBufferInfo { VkBuffer buffer; VkDeviceSize offset; VkDeviceSize range; } VkDescriptorBufferInfo;
Members
-
buffer
is the buffer resource. -
offset
is the offset in bytes from the start ofbuffer
. Access to buffer memory via this descriptor uses addressing that is relative to this starting offset. -
range
is the size in bytes that is used for this descriptor update, orVK_WHOLE_SIZE
to use the range fromoffset
to the end of the buffer.
Description
Note
When setting
range
toVK_WHOLE_SIZE
, the effective range must not be larger than the maximum range for the descriptor type (maxUniformBufferRange or maxStorageBufferRange). This means thatVK_WHOLE_SIZE
is not typically useful in the common case where uniform buffer descriptors are suballocated from a buffer that is much larger thanmaxUniformBufferRange
.
For VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
descriptor types, offset
is the base offset from which the dynamic offset is applied and range
is the static size used for all dynamic offsets.
Valid Usage
offset
must be less than the size ofbuffer
- If
range
is not equal toVK_WHOLE_SIZE
,range
must be greater than0
- If
range
is not equal toVK_WHOLE_SIZE
,range
must be less than or equal to the size ofbuffer
minusoffset
Valid Usage (Implicit)
buffer
must be a validVkBuffer
handle
See Also
VkBuffer, VkDeviceSize
, VkWriteDescriptorSet
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorBufferInfo
VkDescriptorImageInfo(3)
Name
VkDescriptorImageInfo - Structure specifying descriptor image info
C Specification
The VkDescriptorImageInfo
structure is defined as:
typedef struct VkDescriptorImageInfo { VkSampler sampler; VkImageView imageView; VkImageLayout imageLayout; } VkDescriptorImageInfo;
Members
-
sampler
is a sampler handle, and is used in descriptor updates for typesVK_DESCRIPTOR_TYPE_SAMPLER
andVK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
if the binding being updated does not use immutable samplers. -
imageView
is an image view handle, and is used in descriptor updates for typesVK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
,VK_DESCRIPTOR_TYPE_STORAGE_IMAGE
,VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, andVK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT
. -
imageLayout
is the layout that the image subresources accessible fromimageView
will be in at the time this descriptor is accessed.imageLayout
is used in descriptor updates for typesVK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
,VK_DESCRIPTOR_TYPE_STORAGE_IMAGE
,VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, andVK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT
.
Description
Members of VkDescriptorImageInfo
that are not used in an update (as described above) are ignored.
Valid Usage
imageLayout
must match the actual VkImageLayout of each subresource accessible fromimageView
at the time this descriptor is accessed
Valid Usage (Implicit)
- Both of
imageView
, andsampler
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkImageLayout, VkImageView, VkSampler, VkWriteDescriptorSet
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorImageInfo
VkDescriptorPoolCreateInfo(3)
Name
VkDescriptorPoolCreateInfo - Structure specifying parameters of a newly created descriptor pool
C Specification
Additional information about the pool is passed in an instance of the VkDescriptorPoolCreateInfo
structure:
typedef struct VkDescriptorPoolCreateInfo { VkStructureType sType; const void* pNext; VkDescriptorPoolCreateFlags flags; uint32_t maxSets; uint32_t poolSizeCount; const VkDescriptorPoolSize* pPoolSizes; } VkDescriptorPoolCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkDescriptorPoolCreateFlagBits specifying certain supported operations on the pool. -
maxSets
is the maximum number of descriptor sets that can be allocated from the pool. -
poolSizeCount
is the number of elements inpPoolSizes
. -
pPoolSizes
is a pointer to an array ofVkDescriptorPoolSize
structures, each containing a descriptor type and number of descriptors of that type to be allocated in the pool.
Description
If multiple VkDescriptorPoolSize
structures appear in the pPoolSizes
array then the pool will be created with enough storage for the total number of descriptors of each type.
Fragmentation of a descriptor pool is possible and may lead to descriptor set allocation failures. A failure due to fragmentation is defined as failing a descriptor set allocation despite the sum of all outstanding descriptor set allocations from the pool plus the requested allocation requiring no more than the total number of descriptors requested at pool creation. Implementations provide certain guarantees of when fragmentation must not cause allocation failure, as described below.
If a descriptor pool has not had any descriptor sets freed since it was created or most recently reset then fragmentation must not cause an allocation failure (note that this is always the case for a pool created without the VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT
bit set). Additionally, if all sets allocated from the pool since it was created or most recently reset use the same number of descriptors (of each type) and the requested allocation also uses that same number of descriptors (of each type), then fragmentation must not cause an allocation failure.
If an allocation failure occurs due to fragmentation, an application can create an additional descriptor pool to perform further descriptor set allocations.
Valid Usage
maxSets
must be greater than0
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkDescriptorPoolCreateFlagBits valuespPoolSizes
must be a pointer to an array ofpoolSizeCount
validVkDescriptorPoolSize
structurespoolSizeCount
must be greater than0
See Also
VkDescriptorPoolCreateFlags, VkDescriptorPoolSize, VkStructureType, vkCreateDescriptorPool
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorPoolCreateInfo
VkDescriptorPoolSize(3)
Name
VkDescriptorPoolSize - Structure specifying descriptor pool size
C Specification
The VkDescriptorPoolSize
structure is defined as:
typedef struct VkDescriptorPoolSize { VkDescriptorType type; uint32_t descriptorCount; } VkDescriptorPoolSize;
Members
-
type
is the type of descriptor. -
descriptorCount
is the number of descriptors of that type to allocate.
Description
Valid Usage
descriptorCount
must be greater than0
Valid Usage (Implicit)
type
must be a valid VkDescriptorType value
See Also
VkDescriptorPoolCreateInfo, VkDescriptorType
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorPoolSize
VkDescriptorSetAllocateInfo(3)
Name
VkDescriptorSetAllocateInfo - Structure specifying the allocation parameters for descriptor sets
C Specification
The VkDescriptorSetAllocateInfo
structure is defined as:
typedef struct VkDescriptorSetAllocateInfo { VkStructureType sType; const void* pNext; VkDescriptorPool descriptorPool; uint32_t descriptorSetCount; const VkDescriptorSetLayout* pSetLayouts; } VkDescriptorSetAllocateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
descriptorPool
is the pool which the sets will be allocated from. -
descriptorSetCount
determines the number of descriptor sets to be allocated from the pool. -
pSetLayouts
is an array of descriptor set layouts, with each member specifying how the corresponding descriptor set is allocated.
Description
Valid Usage
descriptorSetCount
must not be greater than the number of sets that are currently available for allocation indescriptorPool
descriptorPool
must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
pNext
must beNULL
descriptorPool
must be a validVkDescriptorPool
handlepSetLayouts
must be a pointer to an array ofdescriptorSetCount
validVkDescriptorSetLayout
handlesdescriptorSetCount
must be greater than0
- Both of
descriptorPool
, and the elements ofpSetLayouts
must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkDescriptorPool, VkDescriptorSetLayout, VkStructureType, vkAllocateDescriptorSets
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorSetAllocateInfo
VkDescriptorSetLayoutBinding(3)
Name
VkDescriptorSetLayoutBinding - Structure specifying a descriptor set layout binding
C Specification
The VkDescriptorSetLayoutBinding
structure is defined as:
typedef struct VkDescriptorSetLayoutBinding { uint32_t binding; VkDescriptorType descriptorType; uint32_t descriptorCount; VkShaderStageFlags stageFlags; const VkSampler* pImmutableSamplers; } VkDescriptorSetLayoutBinding;
Members
-
binding
is the binding number of this entry and corresponds to a resource of the same binding number in the shader stages. -
descriptorType
is a VkDescriptorType specifying which type of resource descriptors are used for this binding. -
descriptorCount
is the number of descriptors contained in the binding, accessed in a shader as an array. IfdescriptorCount
is zero this binding entry is reserved and the resource must not be accessed from any stage via this binding within any pipeline using the set layout. -
stageFlags
member is a bitmask of VkShaderStageFlagBits specifying which pipeline shader stages can access a resource for this binding.VK_SHADER_STAGE_ALL
is a shorthand specifying that all defined shader stages, including any additional stages defined by extensions, can access the resource.If a shader stage is not included in
stageFlags
, then a resource must not be accessed from that stage via this binding within any pipeline using the set layout. Other than input attachments which are limited to the fragment shader, there are no limitations on what combinations of stages can be used by a descriptor binding, and in particular a binding can be used by both graphics stages and the compute stage.
Description
-
pImmutableSamplers
affects initialization of samplers. IfdescriptorType
specifies aVK_DESCRIPTOR_TYPE_SAMPLER
orVK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
type descriptor, thenpImmutableSamplers
can be used to initialize a set of immutable samplers. Immutable samplers are permanently bound into the set layout; later binding a sampler into an immutable sampler slot in a descriptor set is not allowed. IfpImmutableSamplers
is notNULL
, then it is considered to be a pointer to an array of sampler handles that will be consumed by the set layout and used for the corresponding binding. IfpImmutableSamplers
isNULL
, then the sampler slots are dynamic and sampler handles must be bound into descriptor sets using this layout. IfdescriptorType
is not one of these descriptor types, thenpImmutableSamplers
is ignored.
The above layout definition allows the descriptor bindings to be specified sparsely such that not all binding numbers between 0 and the maximum binding number need to be specified in the pBindings
array. Bindings that are not specified have a descriptorCount
and stageFlags
of zero, and the descriptorType
is treated as undefined. However, all binding numbers between 0 and the maximum binding number in the VkDescriptorSetLayoutCreateInfo::pBindings
array may consume memory in the descriptor set layout even if not all descriptor bindings are used, though it should not consume additional memory from the descriptor pool.
Note
The maximum binding number specified should be as compact as possible to avoid wasted memory.
Valid Usage
- If
descriptorType
isVK_DESCRIPTOR_TYPE_SAMPLER
orVK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, anddescriptorCount
is not0
andpImmutableSamplers
is notNULL
,pImmutableSamplers
must be a pointer to an array ofdescriptorCount
validVkSampler
handles- If
descriptorCount
is not0
,stageFlags
must be a valid combination of VkShaderStageFlagBits values- If
descriptorType
isVK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT
anddescriptorCount
is not0
, thenstageFlags
must be0
orVK_SHADER_STAGE_FRAGMENT_BIT
Valid Usage (Implicit)
descriptorType
must be a valid VkDescriptorType value
See Also
VkDescriptorSetLayoutCreateInfo, VkDescriptorType, VkSampler, VkShaderStageFlags
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorSetLayoutBinding
VkDescriptorSetLayoutCreateInfo(3)
Name
VkDescriptorSetLayoutCreateInfo - Structure specifying parameters of a newly created descriptor set layout
C Specification
Information about the descriptor set layout is passed in an instance of the VkDescriptorSetLayoutCreateInfo
structure:
typedef struct VkDescriptorSetLayoutCreateInfo { VkStructureType sType; const void* pNext; VkDescriptorSetLayoutCreateFlags flags; uint32_t bindingCount; const VkDescriptorSetLayoutBinding* pBindings; } VkDescriptorSetLayoutCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask specifying options for descriptor set layout creation. -
bindingCount
is the number of elements inpBindings
. -
pBindings
is a pointer to an array of VkDescriptorSetLayoutBinding structures.
Description
Valid Usage
- The VkDescriptorSetLayoutBinding::
binding
members of the elements of thepBindings
array must each have different values.
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkDescriptorSetLayoutCreateFlagBits values- If
bindingCount
is not0
,pBindings
must be a pointer to an array ofbindingCount
validVkDescriptorSetLayoutBinding
structures
See Also
VkDescriptorSetLayoutBinding, VkDescriptorSetLayoutCreateFlags, VkStructureType, vkCreateDescriptorSetLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDescriptorSetLayoutCreateInfo
VkDeviceCreateInfo(3)
Name
VkDeviceCreateInfo - Structure specifying parameters of a newly created device
C Specification
The VkDeviceCreateInfo
structure is defined as:
typedef struct VkDeviceCreateInfo { VkStructureType sType; const void* pNext; VkDeviceCreateFlags flags; uint32_t queueCreateInfoCount; const VkDeviceQueueCreateInfo* pQueueCreateInfos; uint32_t enabledLayerCount; const char* const* ppEnabledLayerNames; uint32_t enabledExtensionCount; const char* const* ppEnabledExtensionNames; const VkPhysicalDeviceFeatures* pEnabledFeatures; } VkDeviceCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is reserved for future use. -
queueCreateInfoCount
is the unsigned integer size of thepQueueCreateInfos
array. Refer to the Queue Creation section below for further details. -
pQueueCreateInfos
is a pointer to an array of VkDeviceQueueCreateInfo structures describing the queues that are requested to be created along with the logical device. Refer to the Queue Creation section below for further details. -
enabledLayerCount
is deprecated and ignored. -
ppEnabledLayerNames
is deprecated and ignored. See Device Layer Deprecation. -
enabledExtensionCount
is the number of device extensions to enable. -
ppEnabledExtensionNames
is a pointer to an array ofenabledExtensionCount
null-terminated UTF-8 strings containing the names of extensions to enable for the created device. See the Extensions section for further details. -
pEnabledFeatures
isNULL
or a pointer to a VkPhysicalDeviceFeatures structure that contains boolean indicators of all the features to be enabled. Refer to the Features section for further details.
Description
Valid Usage
- The
queueFamilyIndex
member of any given element ofpQueueCreateInfos
must be unique withinpQueueCreateInfos
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
pNext
must beNULL
flags
must be0
pQueueCreateInfos
must be a pointer to an array ofqueueCreateInfoCount
validVkDeviceQueueCreateInfo
structures- If
enabledLayerCount
is not0
,ppEnabledLayerNames
must be a pointer to an array ofenabledLayerCount
null-terminated UTF-8 strings- If
enabledExtensionCount
is not0
,ppEnabledExtensionNames
must be a pointer to an array ofenabledExtensionCount
null-terminated UTF-8 strings- If
pEnabledFeatures
is notNULL
,pEnabledFeatures
must be a pointer to a validVkPhysicalDeviceFeatures
structurequeueCreateInfoCount
must be greater than0
See Also
VkDeviceCreateFlags, VkDeviceQueueCreateInfo, VkPhysicalDeviceFeatures, VkStructureType, vkCreateDevice
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDeviceCreateInfo
VkDeviceQueueCreateInfo(3)
Name
VkDeviceQueueCreateInfo - Structure specifying parameters of a newly created device queue
C Specification
The VkDeviceQueueCreateInfo
structure is defined as:
typedef struct VkDeviceQueueCreateInfo { VkStructureType sType; const void* pNext; VkDeviceQueueCreateFlags flags; uint32_t queueFamilyIndex; uint32_t queueCount; const float* pQueuePriorities; } VkDeviceQueueCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is reserved for future use. -
queueFamilyIndex
is an unsigned integer indicating the index of the queue family to create on this device. This index corresponds to the index of an element of thepQueueFamilyProperties
array that was returned byvkGetPhysicalDeviceQueueFamilyProperties
. -
queueCount
is an unsigned integer specifying the number of queues to create in the queue family indicated byqueueFamilyIndex
. -
pQueuePriorities
is an array ofqueueCount
normalized floating point values, specifying priorities of work that will be submitted to each created queue. See Queue Priority for more information.
Description
Valid Usage
queueFamilyIndex
must be less thanpQueueFamilyPropertyCount
returned byvkGetPhysicalDeviceQueueFamilyProperties
queueCount
must be less than or equal to thequeueCount
member of theVkQueueFamilyProperties
structure, as returned byvkGetPhysicalDeviceQueueFamilyProperties
in thepQueueFamilyProperties
[queueFamilyIndex
]- Each element of
pQueuePriorities
must be between0.0
and1.0
inclusive
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
pNext
must beNULL
flags
must be0
pQueuePriorities
must be a pointer to an array ofqueueCount
float
valuesqueueCount
must be greater than0
See Also
VkDeviceCreateInfo, VkDeviceQueueCreateFlags, VkStructureType
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDeviceQueueCreateInfo
VkDispatchIndirectCommand(3)
Name
VkDispatchIndirectCommand - Structure specifying a dispatch indirect command
C Specification
The VkDispatchIndirectCommand
structure is defined as:
typedef struct VkDispatchIndirectCommand { uint32_t x; uint32_t y; uint32_t z; } VkDispatchIndirectCommand;
Members
-
x
is the number of local workgroups to dispatch in the X dimension. -
y
is the number of local workgroups to dispatch in the Y dimension. -
z
is the number of local workgroups to dispatch in the Z dimension.
Description
The members of VkDispatchIndirectCommand
have the same meaning as the corresponding parameters of vkCmdDispatch.
Valid Usage
x
must be less than or equal toVkPhysicalDeviceLimits
::maxComputeWorkGroupCount
[0]y
must be less than or equal toVkPhysicalDeviceLimits
::maxComputeWorkGroupCount
[1]z
must be less than or equal toVkPhysicalDeviceLimits
::maxComputeWorkGroupCount
[2]
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDispatchIndirectCommand
VkDrawIndexedIndirectCommand(3)
Name
VkDrawIndexedIndirectCommand - Structure specifying a draw indexed indirect command
C Specification
The VkDrawIndexedIndirectCommand
structure is defined as:
typedef struct VkDrawIndexedIndirectCommand { uint32_t indexCount; uint32_t instanceCount; uint32_t firstIndex; int32_t vertexOffset; uint32_t firstInstance; } VkDrawIndexedIndirectCommand;
Members
-
indexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstIndex
is the base index within the index buffer. -
vertexOffset
is the value added to the vertex index before indexing into the vertex buffer. -
firstInstance
is the instance ID of the first instance to draw.
Description
The members of VkDrawIndexedIndirectCommand
have the same meaning as the similarly named parameters of vkCmdDrawIndexed.
Valid Usage
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in html/vkspec.html#fxvertex-input
- (
indexSize
* (firstIndex
+indexCount
) +offset
) must be less than or equal to the size of the currently bound index buffer, withindexSize
being based on the type specified byindexType
, where the index buffer,indexType
, andoffset
are specified viavkCmdBindIndexBuffer
- If the drawIndirectFirstInstance feature is not enabled,
firstInstance
must be0
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDrawIndexedIndirectCommand
VkDrawIndirectCommand(3)
Name
VkDrawIndirectCommand - Structure specifying a draw indirect command
C Specification
The VkDrawIndirectCommand
structure is defined as:
typedef struct VkDrawIndirectCommand { uint32_t vertexCount; uint32_t instanceCount; uint32_t firstVertex; uint32_t firstInstance; } VkDrawIndirectCommand;
Members
-
vertexCount
is the number of vertices to draw. -
instanceCount
is the number of instances to draw. -
firstVertex
is the index of the first vertex to draw. -
firstInstance
is the instance ID of the first instance to draw.
Description
The members of VkDrawIndirectCommand
have the same meaning as the similarly named parameters of vkCmdDraw.
Valid Usage
- For a given vertex buffer binding, any attribute data fetched must be entirely contained within the corresponding vertex buffer binding, as described in html/vkspec.html#fxvertex-input
- If the drawIndirectFirstInstance feature is not enabled,
firstInstance
must be0
See Also
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkDrawIndirectCommand
VkEventCreateInfo(3)
Name
VkEventCreateInfo - Structure specifying parameters of a newly created event
C Specification
The VkEventCreateInfo
structure is defined as:
typedef struct VkEventCreateInfo { VkStructureType sType; const void* pNext; VkEventCreateFlags flags; } VkEventCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is reserved for future use.
Description
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_EVENT_CREATE_INFO
pNext
must beNULL
flags
must be0
See Also
VkEventCreateFlags, VkStructureType, vkCreateEvent
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkEventCreateInfo
VkExtensionProperties(3)
Name
VkExtensionProperties - Structure specifying a extension properties
C Specification
The VkExtensionProperties
structure is defined as:
typedef struct VkExtensionProperties { char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; uint32_t specVersion; } VkExtensionProperties;
Members
-
extensionName
is a null-terminated string specifying the name of the extension. -
specVersion
is the version of this extension. It is an integer, incremented with backward compatible changes.
See Also
vkEnumerateDeviceExtensionProperties, vkEnumerateInstanceExtensionProperties
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkExtensionProperties
VkExtent2D(3)
Name
VkExtent2D - Structure specifying a two-dimensional extent
C Specification
A two-dimensional extent is defined by the structure:
typedef struct VkExtent2D { uint32_t width; uint32_t height; } VkExtent2D;
Members
-
width
is the width of the extent. -
height
is the height of the extent.
See Also
VkRect2D, vkGetRenderAreaGranularity
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkExtent2D
VkExtent3D(3)
Name
VkExtent3D - Structure specifying a three-dimensional extent
C Specification
A three-dimensional extent is defined by the structure:
typedef struct VkExtent3D { uint32_t width; uint32_t height; uint32_t depth; } VkExtent3D;
Members
-
width
is the width of the extent. -
height
is the height of the extent. -
depth
is the depth of the extent.
See Also
VkBufferImageCopy, VkImageCopy, VkImageCreateInfo, VkImageFormatProperties, VkImageResolve, VkQueueFamilyProperties, VkSparseImageFormatProperties, VkSparseImageMemoryBind
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkExtent3D
VkFenceCreateInfo(3)
Name
VkFenceCreateInfo - Structure specifying parameters of a newly created fence
C Specification
The VkFenceCreateInfo
structure is defined as:
typedef struct VkFenceCreateInfo { VkStructureType sType; const void* pNext; VkFenceCreateFlags flags; } VkFenceCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkFenceCreateFlagBits specifying the initial state and behavior of the fence.
Description
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_FENCE_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkFenceCreateFlagBits values
See Also
VkFenceCreateFlags, VkStructureType, vkCreateFence
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFenceCreateInfo
VkFormatProperties(3)
Name
VkFormatProperties - Structure specifying image format properties
C Specification
The VkFormatProperties
structure is defined as:
typedef struct VkFormatProperties { VkFormatFeatureFlags linearTilingFeatures; VkFormatFeatureFlags optimalTilingFeatures; VkFormatFeatureFlags bufferFeatures; } VkFormatProperties;
Members
-
linearTilingFeatures
is a bitmask of VkFormatFeatureFlagBits specifying features supported by images created with atiling
parameter ofVK_IMAGE_TILING_LINEAR
. -
optimalTilingFeatures
is a bitmask of VkFormatFeatureFlagBits specifying features supported by images created with atiling
parameter ofVK_IMAGE_TILING_OPTIMAL
. -
bufferFeatures
is a bitmask of VkFormatFeatureFlagBits specifying features supported by buffers.
Description
Note
If no format feature flags are supported, then the only possible use would be image transfers - which alone are not useful. As such, if no format feature flags are supported, the format itself is not supported, and images of that format cannot be created.
If format
is a block-compression format, then buffers must not support any features for the format.
See Also
VkFormatFeatureFlags, vkGetPhysicalDeviceFormatProperties
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormatProperties
VkFramebufferCreateInfo(3)
Name
VkFramebufferCreateInfo - Structure specifying parameters of a newly created framebuffer
C Specification
The VkFramebufferCreateInfo
structure is defined as:
typedef struct VkFramebufferCreateInfo { VkStructureType sType; const void* pNext; VkFramebufferCreateFlags flags; VkRenderPass renderPass; uint32_t attachmentCount; const VkImageView* pAttachments; uint32_t width; uint32_t height; uint32_t layers; } VkFramebufferCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is reserved for future use. -
renderPass
is a render pass that defines what render passes the framebuffer will be compatible with. See Render Pass Compatibility for details. -
attachmentCount
is the number of attachments. -
pAttachments
is an array ofVkImageView
handles, each of which will be used as the corresponding attachment in a render pass instance. -
width
,height
andlayers
define the dimensions of the framebuffer.
Description
Image subresources used as attachments must not be accessed in any other way for the duration of a render pass instance.
Note
This restriction means that the render pass has full knowledge of all uses of all of the attachments, so that the implementation is able to make correct decisions about when and how to perform layout transitions, when to overlap execution of subpasses, etc.
It is legal for a subpass to use no color or depth/stencil attachments, and rather use shader side effects such as image stores and atomics to produce an output. In this case, the subpass continues to use the width
, height
, and layers
of the framebuffer to define the dimensions of the rendering area, and the rasterizationSamples
from each pipeline’s VkPipelineMultisampleStateCreateInfo to define the number of samples used in rasterization; however, if VkPhysicalDeviceFeatures::variableMultisampleRate
is VK_FALSE
, then all pipelines to be bound with a given zero-attachment subpass must have the same value for VkPipelineMultisampleStateCreateInfo::rasterizationSamples
.
Valid Usage
attachmentCount
must be equal to the attachment count specified inrenderPass
- Any given element of
pAttachments
that is used as a color attachment or resolve attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
- Any given element of
pAttachments
that is used as a depth/stencil attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- Any given element of
pAttachments
that is used as an input attachment byrenderPass
must have been created with ausage
value includingVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
- Any given element of
pAttachments
must have been created with an VkFormat value that matches the VkFormat specified by the correspondingVkAttachmentDescription
inrenderPass
- Any given element of
pAttachments
must have been created with asamples
value that matches thesamples
value specified by the correspondingVkAttachmentDescription
inrenderPass
- Any given element of
pAttachments
must have dimensions at least as large as the corresponding framebuffer dimension- Any given element of
pAttachments
must only specify a single mip level- Any given element of
pAttachments
must have been created with the identity swizzlewidth
must be greater than0
.width
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferWidth
height
must be greater than0
.height
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferHeight
layers
must be greater than0
.layers
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferLayers
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
pNext
must beNULL
flags
must be0
renderPass
must be a validVkRenderPass
handle- If
attachmentCount
is not0
,pAttachments
must be a pointer to an array ofattachmentCount
validVkImageView
handles- Both of
renderPass
, and the elements ofpAttachments
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkFramebufferCreateFlags, VkImageView, VkRenderPass, VkStructureType, vkCreateFramebuffer
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFramebufferCreateInfo
VkGraphicsPipelineCreateInfo(3)
Name
VkGraphicsPipelineCreateInfo - Structure specifying parameters of a newly created graphics pipeline
C Specification
The VkGraphicsPipelineCreateInfo
structure is defined as:
typedef struct VkGraphicsPipelineCreateInfo { VkStructureType sType; const void* pNext; VkPipelineCreateFlags flags; uint32_t stageCount; const VkPipelineShaderStageCreateInfo* pStages; const VkPipelineVertexInputStateCreateInfo* pVertexInputState; const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState; const VkPipelineTessellationStateCreateInfo* pTessellationState; const VkPipelineViewportStateCreateInfo* pViewportState; const VkPipelineRasterizationStateCreateInfo* pRasterizationState; const VkPipelineMultisampleStateCreateInfo* pMultisampleState; const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState; const VkPipelineColorBlendStateCreateInfo* pColorBlendState; const VkPipelineDynamicStateCreateInfo* pDynamicState; VkPipelineLayout layout; VkRenderPass renderPass; uint32_t subpass; VkPipeline basePipelineHandle; int32_t basePipelineIndex; } VkGraphicsPipelineCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkPipelineCreateFlagBits specifying how the pipeline will be generated. -
stageCount
is the number of entries in thepStages
array. -
pStages
is an array of sizestageCount
structures of type VkPipelineShaderStageCreateInfo describing the set of the shader stages to be included in the graphics pipeline. -
pVertexInputState
is a pointer to an instance of the VkPipelineVertexInputStateCreateInfo structure. -
pInputAssemblyState
is a pointer to an instance of the VkPipelineInputAssemblyStateCreateInfo structure which determines input assembly behavior, as described in Drawing Commands. -
pTessellationState
is a pointer to an instance of the VkPipelineTessellationStateCreateInfo structure, and is ignored if the pipeline does not include a tessellation control shader stage and tessellation evaluation shader stage. -
pViewportState
is a pointer to an instance of the VkPipelineViewportStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled. -
pRasterizationState
is a pointer to an instance of the VkPipelineRasterizationStateCreateInfo structure. -
pMultisampleState
is a pointer to an instance of the VkPipelineMultisampleStateCreateInfo, and is ignored if the pipeline has rasterization disabled. -
pDepthStencilState
is a pointer to an instance of the VkPipelineDepthStencilStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use a depth/stencil attachment. -
pColorBlendState
is a pointer to an instance of the VkPipelineColorBlendStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use any color attachments. -
pDynamicState
is a pointer to VkPipelineDynamicStateCreateInfo and is used to indicate which properties of the pipeline state object are dynamic and can be changed independently of the pipeline state. This can beNULL
, which means no state in the pipeline is considered dynamic. -
layout
is the description of binding locations used by both the pipeline and descriptor sets used with the pipeline. -
renderPass
is a handle to a render pass object describing the environment in which the pipeline will be used; the pipeline must only be used with an instance of any render pass compatible with the one provided. See Render Pass Compatibility for more information. -
subpass
is the index of the subpass in the render pass where this pipeline will be used. -
basePipelineHandle
is a pipeline to derive from. -
basePipelineIndex
is an index into thepCreateInfos
parameter to use as a pipeline to derive from.
Description
The parameters basePipelineHandle
and basePipelineIndex
are described in more detail in Pipeline Derivatives.
pStages
points to an array of VkPipelineShaderStageCreateInfo structures, which were previously described in Compute Pipelines.
pDynamicState
points to a structure of type VkPipelineDynamicStateCreateInfo.
Valid Usage
- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineIndex
is -1,basePipelineHandle
must be a valid handle to a graphicsVkPipeline
- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineHandle
is VK_NULL_HANDLE,basePipelineIndex
must be a valid index into the calling command’spCreateInfos
parameter- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineIndex
is not -1,basePipelineHandle
must be VK_NULL_HANDLE- If
flags
contains theVK_PIPELINE_CREATE_DERIVATIVE_BIT
flag, andbasePipelineHandle
is not VK_NULL_HANDLE,basePipelineIndex
must be -1- The
stage
member of each element ofpStages
must be unique- The
stage
member of one element ofpStages
must beVK_SHADER_STAGE_VERTEX_BIT
- The
stage
member of any given element ofpStages
must not beVK_SHADER_STAGE_COMPUTE_BIT
- If
pStages
includes a tessellation control shader stage, it must include a tessellation evaluation shader stage- If
pStages
includes a tessellation evaluation shader stage, it must include a tessellation control shader stage- If
pStages
includes a tessellation control shader stage and a tessellation evaluation shader stage,pTessellationState
must be a pointer to a validVkPipelineTessellationStateCreateInfo
structure- If
pStages
includes tessellation shader stages, the shader code of at least one stage must contain anOpExecutionMode
instruction that specifies the type of subdivision in the pipeline- If
pStages
includes tessellation shader stages, and the shader code of both stages contain anOpExecutionMode
instruction that specifies the type of subdivision in the pipeline, they must both specify the same subdivision mode- If
pStages
includes tessellation shader stages, the shader code of at least one stage must contain anOpExecutionMode
instruction that specifies the output patch size in the pipeline- If
pStages
includes tessellation shader stages, and the shader code of both contain anOpExecutionMode
instruction that specifies the out patch size in the pipeline, they must both specify the same patch size- If
pStages
includes tessellation shader stages, thetopology
member ofpInputAssembly
must beVK_PRIMITIVE_TOPOLOGY_PATCH_LIST
- If the
topology
member ofpInputAssembly
isVK_PRIMITIVE_TOPOLOGY_PATCH_LIST
,pStages
must include tessellation shader stages- If
pStages
includes a geometry shader stage, and does not include any tessellation shader stages, its shader code must contain anOpExecutionMode
instruction that specifies an input primitive type that is compatible with the primitive topology specified inpInputAssembly
- If
pStages
includes a geometry shader stage, and also includes tessellation shader stages, its shader code must contain anOpExecutionMode
instruction that specifies an input primitive type that is compatible with the primitive topology that is output by the tessellation stages- If
pStages
includes a fragment shader stage and a geometry shader stage, and the fragment shader code reads from an input variable that is decorated withPrimitiveID
, then the geometry shader code must write to a matching output variable, decorated withPrimitiveID
, in all execution paths- If
pStages
includes a fragment shader stage, its shader code must not read from any input attachment that is defined asVK_ATTACHMENT_UNUSED
insubpass
- The shader code for the entry points identified by
pStages
, and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter- If rasterization is not disabled and
subpass
uses a depth/stencil attachment inrenderpass
that has a layout ofVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
in theVkAttachmentReference
defined bysubpass
, thedepthWriteEnable
member ofpDepthStencilState
must beVK_FALSE
- If rasterization is not disabled and
subpass
uses a depth/stencil attachment inrenderpass
that has a layout ofVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
in theVkAttachmentReference
defined bysubpass
, thefailOp
,passOp
anddepthFailOp
members of each of thefront
andback
members ofpDepthStencilState
must beVK_STENCIL_OP_KEEP
- If rasterization is not disabled and the subpass uses color attachments, then for each color attachment in the subpass the
blendEnable
member of the corresponding element of thepAttachment
member ofpColorBlendState
must beVK_FALSE
if theformat
of the attachment does not support color blend operations, as specified by theVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT
flag inVkFormatProperties
::linearTilingFeatures
orVkFormatProperties
::optimalTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
- If rasterization is not disabled and the subpass uses color attachments, the
attachmentCount
member ofpColorBlendState
must be equal to thecolorAttachmentCount
used to createsubpass
- If no element of the
pDynamicStates
member ofpDynamicState
isVK_DYNAMIC_STATE_VIEWPORT
, thepViewports
member ofpViewportState
must be a pointer to an array ofpViewportState
::viewportCount
VkViewport
structures- If no element of the
pDynamicStates
member ofpDynamicState
isVK_DYNAMIC_STATE_SCISSOR
, thepScissors
member ofpViewportState
must be a pointer to an array ofpViewportState
::scissorCount
VkRect2D
structures- If the wide lines feature is not enabled, and no element of the
pDynamicStates
member ofpDynamicState
isVK_DYNAMIC_STATE_LINE_WIDTH
, thelineWidth
member ofpRasterizationState
must be1.0
- If the
rasterizerDiscardEnable
member ofpRasterizationState
isVK_FALSE
,pViewportState
must be a pointer to a validVkPipelineViewportStateCreateInfo
structure- If the
rasterizerDiscardEnable
member ofpRasterizationState
isVK_FALSE
,pMultisampleState
must be a pointer to a validVkPipelineMultisampleStateCreateInfo
structure- If the
rasterizerDiscardEnable
member ofpRasterizationState
isVK_FALSE
, andsubpass
uses a depth/stencil attachment,pDepthStencilState
must be a pointer to a validVkPipelineDepthStencilStateCreateInfo
structure- If the
rasterizerDiscardEnable
member ofpRasterizationState
isVK_FALSE
, andsubpass
uses color attachments,pColorBlendState
must be a pointer to a validVkPipelineColorBlendStateCreateInfo
structure- If the depth bias clamping feature is not enabled, no element of the
pDynamicStates
member ofpDynamicState
isVK_DYNAMIC_STATE_DEPTH_BIAS
, and thedepthBiasEnable
member ofpDepthStencil
isVK_TRUE
, thedepthBiasClamp
member ofpDepthStencil
must be0.0
- If no element of the
pDynamicStates
member ofpDynamicState
isVK_DYNAMIC_STATE_DEPTH_BOUNDS
, and thedepthBoundsTestEnable
member ofpDepthStencil
isVK_TRUE
, theminDepthBounds
andmaxDepthBounds
members ofpDepthStencil
must be between0.0
and1.0
, inclusivelayout
must be consistent with all shaders specified inpStages
- If
subpass
uses color and/or depth/stencil attachments, then therasterizationSamples
member ofpMultisampleState
must be the same as the sample count for those subpass attachments- If
subpass
does not use any color and/or depth/stencil attachments, then therasterizationSamples
member ofpMultisampleState
must follow the rules for a zero-attachment subpasssubpass
must be a valid subpass withinrenderpass
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkPipelineCreateFlagBits valuespStages
must be a pointer to an array ofstageCount
validVkPipelineShaderStageCreateInfo
structurespVertexInputState
must be a pointer to a validVkPipelineVertexInputStateCreateInfo
structurepInputAssemblyState
must be a pointer to a validVkPipelineInputAssemblyStateCreateInfo
structurepRasterizationState
must be a pointer to a validVkPipelineRasterizationStateCreateInfo
structure- If
pDynamicState
is notNULL
,pDynamicState
must be a pointer to a validVkPipelineDynamicStateCreateInfo
structurelayout
must be a validVkPipelineLayout
handlerenderPass
must be a validVkRenderPass
handlestageCount
must be greater than0
- Each of
basePipelineHandle
,layout
, andrenderPass
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkPipeline, VkPipelineColorBlendStateCreateInfo, VkPipelineCreateFlags, VkPipelineDepthStencilStateCreateInfo, VkPipelineDynamicStateCreateInfo, VkPipelineInputAssemblyStateCreateInfo, VkPipelineLayout, VkPipelineMultisampleStateCreateInfo, VkPipelineRasterizationStateCreateInfo, VkPipelineShaderStageCreateInfo, VkPipelineTessellationStateCreateInfo, VkPipelineVertexInputStateCreateInfo, VkPipelineViewportStateCreateInfo, VkRenderPass, VkStructureType, vkCreateGraphicsPipelines
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkGraphicsPipelineCreateInfo
VkImageBlit(3)
Name
VkImageBlit - Structure specifying an image blit operation
C Specification
The VkImageBlit
structure is defined as:
typedef struct VkImageBlit { VkImageSubresourceLayers srcSubresource; VkOffset3D srcOffsets[2]; VkImageSubresourceLayers dstSubresource; VkOffset3D dstOffsets[2]; } VkImageBlit;
Members
-
srcSubresource
is the subresource to blit from. -
srcOffsets
is an array of two VkOffset3D structures specifying the bounds of the source region withinsrcSubresource
. -
dstSubresource
is the subresource to blit into. -
dstOffsets
is an array of two VkOffset3D structures specifying the bounds of the destination region withindstSubresource
.
Description
For each element of the pRegions
array, a blit operation is performed the specified source and destination regions.
Valid Usage
- The
aspectMask
member ofsrcSubresource
anddstSubresource
must match- The
layerCount
member ofsrcSubresource
anddstSubresource
must match- If either of the calling command’s
srcImage
ordstImage
parameters are of VkImageTypeVK_IMAGE_TYPE_3D
, thebaseArrayLayer
andlayerCount
members of bothsrcSubresource
anddstSubresource
must be0
and1
, respectively- The
aspectMask
member ofsrcSubresource
must specify aspects present in the calling command’ssrcImage
- The
aspectMask
member ofdstSubresource
must specify aspects present in the calling command’sdstImage
srcOffset
[0].x
andsrcOffset
[1].x
must both be greater than or equal to0
and less than or equal to the source image subresource widthsrcOffset
[0].y
andsrcOffset
[1].y
must both be greater than or equal to0
and less than or equal to the source image subresource height- If the calling command’s
srcImage
is of typeVK_IMAGE_TYPE_1D
, thensrcOffset
[0].y must be0
andsrcOffset
[1].y must be1
.srcOffset
[0].z
andsrcOffset
[1].z
must both be greater than or equal to0
and less than or equal to the source image subresource depth- If the calling command’s
srcImage
is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thensrcOffset
[0].z must be0
andsrcOffset
[1].z must be1
.dstOffset
[0].x
anddstOffset
[1].x
must both be greater than or equal to0
and less than or equal to the destination image subresource widthdstOffset
[0].y
anddstOffset
[1].y
must both be greater than or equal to0
and less than or equal to the destination image subresource height- If the calling command’s
dstImage
is of typeVK_IMAGE_TYPE_1D
, thendstOffset
[0].y must be0
anddstOffset
[1].y must be1
.dstOffset
[0].z
anddstOffset
[1].z
must both be greater than or equal to0
and less than or equal to the destination image subresource depth- If the calling command’s
dstImage
is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thendstOffset
[0].z must be0
anddstOffset
[1].z must be1
.
Valid Usage (Implicit)
srcSubresource
must be a validVkImageSubresourceLayers
structuredstSubresource
must be a validVkImageSubresourceLayers
structure
See Also
VkImageSubresourceLayers, VkOffset3D, vkCmdBlitImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageBlit
VkImageCopy(3)
Name
VkImageCopy - Structure specifying an image copy operation
C Specification
The VkImageCopy
structure is defined as:
typedef struct VkImageCopy { VkImageSubresourceLayers srcSubresource; VkOffset3D srcOffset; VkImageSubresourceLayers dstSubresource; VkOffset3D dstOffset; VkExtent3D extent; } VkImageCopy;
Members
-
srcSubresource
anddstSubresource
are VkImageSubresourceLayers structures specifying the image subresources of the images used for the source and destination image data, respectively. -
srcOffset
anddstOffset
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 copy inwidth
,height
anddepth
.
Description
Copies are done layer by layer starting with baseArrayLayer
member of srcSubresource
for the source and dstSubresource
for the destination. layerCount
layers are copied to the destination image.
Valid Usage
- The
aspectMask
member ofsrcSubresource
anddstSubresource
must match- The
layerCount
member ofsrcSubresource
anddstSubresource
must match- If either of the calling command’s
srcImage
ordstImage
parameters are of VkImageTypeVK_IMAGE_TYPE_3D
, thebaseArrayLayer
andlayerCount
members of bothsrcSubresource
anddstSubresource
must be0
and1
, respectively- The
aspectMask
member ofsrcSubresource
must specify aspects present in the calling command’ssrcImage
- The
aspectMask
member ofdstSubresource
must specify aspects present in the calling command’sdstImage
srcOffset.x
and (extent.width
+srcOffset.x
) must both be greater than or equal to0
and less than or equal to the source image subresource widthsrcOffset.y
and (extent.height
+srcOffset.y
) must both be greater than or equal to0
and less than or equal to the source image subresource height- If the calling command’s
srcImage
is of typeVK_IMAGE_TYPE_1D
, thensrcOffset.y
must be0
andextent.height
must be1
.srcOffset.z
and (extent.depth
+srcOffset.z
) must both be greater than or equal to0
and less than or equal to the source image subresource depth- If the calling command’s
srcImage
is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thensrcOffset.z
must be0
andextent.depth
must be1
.srcSubresource.baseArrayLayer
must be less than and (srcSubresource.layerCount
+srcSubresource.baseArrayLayer
) must be less than or equal to the number of layers in the source imagedstOffset.x
and (extent.width
+dstOffset.x
) must both be greater than or equal to0
and less than or equal to the destination image subresource widthdstOffset.y
and (extent.height
+dstOffset.y
) must both be greater than or equal to0
and less than or equal to the destination image subresource height- If the calling command’s
dstImage
is of typeVK_IMAGE_TYPE_1D
, thendstOffset.y
must be0
andextent.height
must be1
.dstOffset.z
and (extent.depth
+dstOffset.z
) must both be greater than or equal to0
and less than or equal to the destination image subresource depth- If the calling command’s
dstImage
is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thendstOffset.z
must be0
andextent.depth
must be1
.dstSubresource.baseArrayLayer
must be less than and (dstSubresource.layerCount
+dstSubresource.baseArrayLayer
) must be less than or equal to the number of layers in the destination image- If the calling command’s
srcImage
is a compressed format image, all members ofsrcOffset
must be a multiple of the corresponding dimensions of the compressed texel block- If the calling command’s
srcImage
is a compressed format image,extent.width
must 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
srcImage
is a compressed format image,extent.height
must 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
srcImage
is a compressed format image,extent.depth
must 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
dstImage
is a compressed format image, all members ofdstOffset
must be a multiple of the corresponding dimensions of the compressed texel block- If the calling command’s
dstImage
is a compressed format image,extent.width
must 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
dstImage
is a compressed format image,extent.height
must 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
dstImage
is a compressed format image,extent.depth
must be a multiple of the compressed texel block depth or (extent.depth
+dstOffset.z
) must equal the destination image subresource depthsrcOffset
,dstOffset
, andextent
must respect the image transfer granularity requirements of the queue family that it will be submitted against, as described in Physical Device Enumeration
Valid Usage (Implicit)
srcSubresource
must be a validVkImageSubresourceLayers
structuredstSubresource
must be a validVkImageSubresourceLayers
structure
See Also
VkExtent3D, VkImageSubresourceLayers, VkOffset3D, vkCmdCopyImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageCopy
VkImageCreateInfo(3)
Name
VkImageCreateInfo - Structure specifying the parameters of a newly created image object
C Specification
The VkImageCreateInfo
structure is defined as:
typedef struct VkImageCreateInfo { VkStructureType sType; const void* pNext; VkImageCreateFlags flags; VkImageType imageType; VkFormat format; VkExtent3D extent; uint32_t mipLevels; uint32_t arrayLayers; VkSampleCountFlagBits samples; VkImageTiling tiling; VkImageUsageFlags usage; VkSharingMode sharingMode; uint32_t queueFamilyIndexCount; const uint32_t* pQueueFamilyIndices; VkImageLayout initialLayout; } VkImageCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is a bitmask of VkImageCreateFlagBits describing additional parameters of the image. -
imageType
is a VkImageType value specifying the basic dimensionality of the image. Layers in array textures do not count as a dimension for the purposes of the image type. -
format
is a VkFormat describing the format and type of the data elements that will be contained in the image. -
extent
is a VkExtent3D describing the number of data elements in each dimension of the base level. -
mipLevels
describes the number of levels of detail available for minified sampling of the image. -
arrayLayers
is the number of layers in the image. -
samples
is the number of sub-data element samples in the image as defined in VkSampleCountFlagBits. See Multisampling. -
tiling
is a VkImageTiling value specifying the tiling arrangement of the data elements in memory. -
usage
is a bitmask of VkImageUsageFlagBits describing the intended usage of the image. -
sharingMode
is a VkSharingMode value specifying the sharing mode of the image when it will be accessed by multiple queue families. -
queueFamilyIndexCount
is the number of entries in thepQueueFamilyIndices
array. -
pQueueFamilyIndices
is a list of queue families that will access this image (ignored ifsharingMode
is notVK_SHARING_MODE_CONCURRENT
). -
initialLayout
is a VkImageLayout value specifying the initial VkImageLayout of all image subresources of the image. See Image Layouts.
Description
Images created with tiling
equal to VK_IMAGE_TILING_LINEAR
have further restrictions on their limits and capabilities compared to images created with tiling
equal to VK_IMAGE_TILING_OPTIMAL
. Creation of images with tiling VK_IMAGE_TILING_LINEAR
may not be supported unless other parameters meet all of the constraints:
-
imageType
isVK_IMAGE_TYPE_2D
-
format
is not a depth/stencil format -
mipLevels
is 1 -
arrayLayers
is 1 -
samples
isVK_SAMPLE_COUNT_1_BIT
-
usage
only includesVK_IMAGE_USAGE_TRANSFER_SRC_BIT
and/orVK_IMAGE_USAGE_TRANSFER_DST_BIT
Implementations may support additional limits and capabilities beyond those listed above.
To query an implementation’s specific capabilities for a given combination of format
, imageType
, tiling
, usage
, and flags
, call vkGetPhysicalDeviceImageFormatProperties. The return value indicates whether that combination of image settings is supported. On success, the VkImageFormatProperties
output parameter indicates the set of valid samples
bits and the limits for extent
, mipLevels
, and arrayLayers
.
To determine the set of valid usage
bits for a given format, call vkGetPhysicalDeviceFormatProperties.
Valid Usage
- The combination of
format
,imageType
,tiling
,usage
, andflags
must be supported, as indicated by aVK_SUCCESS
return value fromvkGetPhysicalDeviceImageFormatProperties
invoked with the same values passed to the corresponding parameters.- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
,pQueueFamilyIndices
must be a pointer to an array ofqueueFamilyIndexCount
uint32_t
values- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
,queueFamilyIndexCount
must be greater than1
- If
sharingMode
isVK_SHARING_MODE_CONCURRENT
, each element ofpQueueFamilyIndices
must be unique and must be less thanpQueueFamilyPropertyCount
returned by vkGetPhysicalDeviceQueueFamilyProperties for thephysicalDevice
that was used to createdevice
format
must not beVK_FORMAT_UNDEFINED
extent
::width
must be greater than0
.extent
::height
must be greater than0
.extent
::depth
must be greater than0
.mipLevels
must be greater than0
arrayLayers
must be greater than0
- If
flags
containsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,imageType
must beVK_IMAGE_TYPE_2D
- If
imageType
isVK_IMAGE_TYPE_1D
,extent.width
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimension1D
, orVkImageFormatProperties
::maxExtent.width
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher- If
imageType
isVK_IMAGE_TYPE_2D
andflags
does not containVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,extent.width
andextent.height
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimension2D
, orVkImageFormatProperties
::maxExtent.width
/height (as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher- If
imageType
isVK_IMAGE_TYPE_2D
andflags
containsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,extent.width
andextent.height
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimensionCube
, orVkImageFormatProperties
::maxExtent.width
/height (as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher- If
imageType
isVK_IMAGE_TYPE_2D
andflags
containsVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,extent.width
andextent.height
must be equal andarrayLayers
must be greater than or equal to 6- If
imageType
isVK_IMAGE_TYPE_3D
,extent.width
,extent.height
andextent.depth
must be less than or equal toVkPhysicalDeviceLimits
::maxImageDimension3D
, orVkImageFormatProperties
::maxExtent.width
/height/depth (as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure) - whichever is higher- If
imageType
isVK_IMAGE_TYPE_1D
, bothextent.height
andextent.depth
must be1
- If
imageType
isVK_IMAGE_TYPE_2D
,extent.depth
must be1
mipLevels
must be less than or equal to ⌊log2(max(extent.width
,extent.height
,extent.depth
))⌋ + 1.- If any of
extent.width
,extent.height
, orextent.depth
are greater than the equivalently named members ofVkPhysicalDeviceLimits
::maxImageDimension3D
,mipLevels
must be less than or equal toVkImageFormatProperties
::maxMipLevels
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure)arrayLayers
must be less than or equal toVkImageFormatProperties
::maxArrayLayers
(as returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure)- If
imageType
isVK_IMAGE_TYPE_3D
,arrayLayers
must be1
.- If
samples
is notVK_SAMPLE_COUNT_1_BIT
,imageType
must beVK_IMAGE_TYPE_2D
,flags
must not containVK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
,tiling
must beVK_IMAGE_TILING_OPTIMAL
, andmipLevels
must be equal to1
- If
usage
includesVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
, then bits other thanVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
, andVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
must not be set- If
usage
includesVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
,VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
,extent.width
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferWidth
- If
usage
includesVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
,VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
,extent.height
must be less than or equal toVkPhysicalDeviceLimits
::maxFramebufferHeight
- If
usage
includesVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
,usage
must also contain at least one ofVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
,VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
, orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
.samples
must be a bit value that is set inVkImageFormatProperties
::sampleCounts
returned byvkGetPhysicalDeviceImageFormatProperties
withformat
,imageType
,tiling
,usage
, andflags
equal to those in this structure- If the multisampled storage images feature is not enabled, and
usage
containsVK_IMAGE_USAGE_STORAGE_BIT
,samples
must beVK_SAMPLE_COUNT_1_BIT
- If the sparse bindings feature is not enabled,
flags
must not containVK_IMAGE_CREATE_SPARSE_BINDING_BIT
- If
imageType
isVK_IMAGE_TYPE_1D
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for 2D images feature is not enabled, and
imageType
isVK_IMAGE_TYPE_2D
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for 3D images feature is not enabled, and
imageType
isVK_IMAGE_TYPE_3D
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 2 samples feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_2_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 4 samples feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_4_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 8 samples feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_8_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse residency for images with 16 samples feature is not enabled,
imageType
isVK_IMAGE_TYPE_2D
, andsamples
isVK_SAMPLE_COUNT_16_BIT
,flags
must not containVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
,format
must be a format that has at least one supported feature bit present in the value ofVkFormatProperties
::linearTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_SAMPLED_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_STORAGE_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
- If
tiling
isVK_IMAGE_TILING_LINEAR
, andVkFormatProperties
::linearTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
,format
must be a format that has at least one supported feature bit present in the value ofVkFormatProperties
::optimalTilingFeatures
returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_SAMPLED_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT
,usage
must not containVK_IMAGE_USAGE_STORAGE_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
- If
tiling
isVK_IMAGE_TILING_OPTIMAL
, andVkFormatProperties
::optimalTilingFeatures
(as returned byvkGetPhysicalDeviceFormatProperties
with the same value offormat
) does not includeVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
,usage
must not containVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
- If
flags
containsVK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
orVK_IMAGE_CREATE_SPARSE_ALIASED_BIT
, it must also containVK_IMAGE_CREATE_SPARSE_BINDING_BIT
initialLayout
must beVK_IMAGE_LAYOUT_UNDEFINED
orVK_IMAGE_LAYOUT_PREINITIALIZED
.
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
pNext
must beNULL
flags
must be a valid combination of VkImageCreateFlagBits valuesimageType
must be a valid VkImageType valueformat
must be a valid VkFormat valuesamples
must be a valid VkSampleCountFlagBits valuetiling
must be a valid VkImageTiling valueusage
must be a valid combination of VkImageUsageFlagBits valuesusage
must not be0
sharingMode
must be a valid VkSharingMode valueinitialLayout
must be a valid VkImageLayout value
See Also
VkExtent3D, VkFormat, VkImageCreateFlags, VkImageLayout, VkImageTiling, VkImageType, VkImageUsageFlags, VkSampleCountFlagBits, VkSharingMode, VkStructureType, vkCreateImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageCreateInfo
VkImageFormatProperties(3)
Name
VkImageFormatProperties - Structure specifying a image format properties
C Specification
The VkImageFormatProperties
structure is defined as:
typedef struct VkImageFormatProperties { VkExtent3D maxExtent; uint32_t maxMipLevels; uint32_t maxArrayLayers; VkSampleCountFlags sampleCounts; VkDeviceSize maxResourceSize; } VkImageFormatProperties;
Members
-
maxExtent
are the maximum image dimensions. See the Allowed Extent Values section below for how these values are constrained bytype
. -
maxMipLevels
is the maximum number of mipmap levels.maxMipLevels
must either be equal to 1 (valid only iftiling
isVK_IMAGE_TILING_LINEAR
) or be equal to ⌈log2(max(width
,height
,depth
))⌉ + 1.width
,height
, anddepth
are taken from the corresponding members ofmaxExtent
. -
maxArrayLayers
is the maximum number of array layers.maxArrayLayers
must either be equal to 1 or be greater than or equal to themaxImageArrayLayers
member of VkPhysicalDeviceLimits. A value of 1 is valid only iftiling
isVK_IMAGE_TILING_LINEAR
or iftype
isVK_IMAGE_TYPE_3D
. -
sampleCounts
is a bitmask of VkSampleCountFlagBits specifying all the supported sample counts for this image as described below. -
maxResourceSize
is an upper bound on the total image size in bytes, inclusive of all image subresources. Implementations may have an address space limit on total size of a resource, which is advertised by this property.maxResourceSize
must be at least 231.
Description
Note
There is no mechanism to query the size of an image before creating it, to compare that size against
maxResourceSize
. If an application attempts to create an image that exceeds this limit, the creation will fail or the image will be invalid. While the advertised limit must be at least 231, it may not be possible to create an image that approaches that size, particularly forVK_IMAGE_TYPE_1D
.
If the combination of parameters to vkGetPhysicalDeviceImageFormatProperties
is not supported by the implementation for use in vkCreateImage, then all members of VkImageFormatProperties
will be filled with zero.
See Also
VkDeviceSize
, VkExtent3D, VkSampleCountFlags, vkGetPhysicalDeviceImageFormatProperties
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageFormatProperties
VkImageMemoryBarrier(3)
Name
VkImageMemoryBarrier - Structure specifying the parameters of an image memory barrier
C Specification
The VkImageMemoryBarrier
structure is defined as:
typedef struct VkImageMemoryBarrier { VkStructureType sType; const void* pNext; VkAccessFlags srcAccessMask; VkAccessFlags dstAccessMask; VkImageLayout oldLayout; VkImageLayout newLayout; uint32_t srcQueueFamilyIndex; uint32_t dstQueueFamilyIndex; VkImage image; VkImageSubresourceRange subresourceRange; } VkImageMemoryBarrier;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
srcAccessMask
is a bitmask of VkAccessFlagBits specifying a source access mask. -
dstAccessMask
is a bitmask of VkAccessFlagBits specifying a destination access mask. -
oldLayout
is the old layout in an image layout transition. -
newLayout
is the new layout in an image layout transition. -
srcQueueFamilyIndex
is the source queue family for a queue family ownership transfer. -
dstQueueFamilyIndex
is the destination queue family for a queue family ownership transfer. -
image
is a handle to the image affected by this barrier. -
subresourceRange
describes the image subresource range withinimage
that is affected by this barrier.
Description
The first access scope is limited to access to memory through the specified image subresource range, via access types in the source access mask specified by srcAccessMask
. If srcAccessMask
includes VK_ACCESS_HOST_WRITE_BIT
, memory writes performed by that access type are also made visible, as that access type is not performed through a resource.
The second access scope is limited to access to memory through the specified image subresource range, via access types in the destination access mask specified by dstAccessMask
. If dstAccessMask
includes VK_ACCESS_HOST_WRITE_BIT
or VK_ACCESS_HOST_READ_BIT
, available memory writes are also made visible to accesses of those types, as those access types are not performed through a resource.
If srcQueueFamilyIndex
is not equal to dstQueueFamilyIndex
, and srcQueueFamilyIndex
is equal to the current queue family, then the memory barrier defines a queue family release operation for the specified image subresource range, and the second access scope includes no access, as if dstAccessMask
was 0
.
If dstQueueFamilyIndex
is not equal to srcQueueFamilyIndex
, and dstQueueFamilyIndex
is equal to the current queue family, then the memory barrier defines a queue family acquire operation for the specified image subresource range, and the first access scope includes no access, as if srcAccessMask
was 0
.
If oldLayout
is not equal to newLayout
, then the memory barrier defines an image layout transition for the specified image subresource range.
Layout transitions that are performed via image memory barriers execute in their entirety in submission order, relative to other image layout transitions submitted to the same queue, including those performed by render passes. In effect there is an implicit execution dependency from each such layout transition to all layout transitions previously submitted to the same queue.
Valid Usage
oldLayout
must beVK_IMAGE_LAYOUT_UNDEFINED
or the current layout of the image subresources affected by the barriernewLayout
must not beVK_IMAGE_LAYOUT_UNDEFINED
orVK_IMAGE_LAYOUT_PREINITIALIZED
- If
image
was created with a sharing mode ofVK_SHARING_MODE_CONCURRENT
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must both beVK_QUEUE_FAMILY_IGNORED
- If
image
was created with a sharing mode ofVK_SHARING_MODE_EXCLUSIVE
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must either both beVK_QUEUE_FAMILY_IGNORED
, or both be a valid queue family (see html/vkspec.html#devsandqueues-queueprops).- If
image
was created with a sharing mode ofVK_SHARING_MODE_EXCLUSIVE
, andsrcQueueFamilyIndex
anddstQueueFamilyIndex
are notVK_QUEUE_FAMILY_IGNORED
, at least one of them must be the same as the family of the queue that will execute this barriersubresourceRange
::baseMipLevel
must be less than themipLevels
specified in VkImageCreateInfo whenimage
was created- If
subresourceRange
::levelCount
is notVK_REMAINING_MIP_LEVELS
,subresourceRange
::levelCount
must be non-zero andsubresourceRange
::baseMipLevel
+subresourceRange
::levelCount
must be less than or equal to themipLevels
specified in VkImageCreateInfo whenimage
was createdsubresourceRange
::baseArrayLayer
must be less than thearrayLayers
specified in VkImageCreateInfo whenimage
was created- If
subresourceRange
::layerCount
is notVK_REMAINING_ARRAY_LAYERS
,subresourceRange
::layerCount
must be non-zero andsubresourceRange
::baseArrayLayer
+subresourceRange
::layerCount
must be less than or equal to thearrayLayers
specified in VkImageCreateInfo whenimage
was created- If
image
has a depth/stencil format with both depth and stencil components, thenaspectMask
member ofsubresourceRange
must include bothVK_IMAGE_ASPECT_DEPTH_BIT
andVK_IMAGE_ASPECT_STENCIL_BIT
- If either
oldLayout
ornewLayout
isVK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
thenimage
must have been created withVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
set- If either
oldLayout
ornewLayout
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
thenimage
must have been created withVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
set- If either
oldLayout
ornewLayout
isVK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
thenimage
must have been created withVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
set- If either
oldLayout
ornewLayout
isVK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
thenimage
must have been created withVK_IMAGE_USAGE_SAMPLED_BIT
orVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
set- If either
oldLayout
ornewLayout
isVK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
thenimage
must have been created withVK_IMAGE_USAGE_TRANSFER_SRC_BIT
set- If either
oldLayout
ornewLayout
isVK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
thenimage
must have been created withVK_IMAGE_USAGE_TRANSFER_DST_BIT
set
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
pNext
must beNULL
srcAccessMask
must be a valid combination of VkAccessFlagBits valuesdstAccessMask
must be a valid combination of VkAccessFlagBits valuesoldLayout
must be a valid VkImageLayout valuenewLayout
must be a valid VkImageLayout valueimage
must be a validVkImage
handlesubresourceRange
must be a validVkImageSubresourceRange
structure
See Also
VkAccessFlags, VkImage, VkImageLayout, VkImageSubresourceRange, VkStructureType, vkCmdPipelineBarrier, vkCmdWaitEvents
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageMemoryBarrier
VkImageResolve(3)
Name
VkImageResolve - Structure specifying an image resolve operation
C Specification
The VkImageResolve
structure is defined as:
typedef struct VkImageResolve { VkImageSubresourceLayers srcSubresource; VkOffset3D srcOffset; VkImageSubresourceLayers dstSubresource; VkOffset3D dstOffset; VkExtent3D extent; } VkImageResolve;
Members
-
srcSubresource
anddstSubresource
are VkImageSubresourceLayers structures specifying the image subresources of the images used for the source and destination image data, respectively. Resolve of depth/stencil images is not supported. -
srcOffset
anddstOffset
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 inwidth
,height
anddepth
.
Description
Valid Usage
- The
aspectMask
member ofsrcSubresource
anddstSubresource
must only containVK_IMAGE_ASPECT_COLOR_BIT
- The
layerCount
member ofsrcSubresource
anddstSubresource
must match- If either of the calling command’s
srcImage
ordstImage
parameters are of VkImageTypeVK_IMAGE_TYPE_3D
, thebaseArrayLayer
andlayerCount
members of bothsrcSubresource
anddstSubresource
must be0
and1
, respectivelysrcOffset.x
and (extent.width
+srcOffset.x
) must both be greater than or equal to0
and less than or equal to the source image subresource widthsrcOffset.y
and (extent.height
+srcOffset.y
) must both be greater than or equal to0
and less than or equal to the source image subresource height- If the calling command’s
srcImage
is of typeVK_IMAGE_TYPE_1D
, thensrcOffset.y
must be0
andextent.height
must be1
.srcOffset.z
and (extent.depth
+srcOffset.z
) must both be greater than or equal to0
and less than or equal to the source image subresource depth- If the calling command’s
srcImage
is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thensrcOffset.z
must be0
andextent.depth
must be1
.dstOffset.x
and (extent.width
+dstOffset.x
) must both be greater than or equal to0
and less than or equal to the destination image subresource widthdstOffset.y
and (extent.height
+dstOffset.y
) must both be greater than or equal to0
and less than or equal to the destination image subresource height- If the calling command’s
dstImage
is of typeVK_IMAGE_TYPE_1D
, thendstOffset.y
must be0
andextent.height
must be1
.dstOffset.z
and (extent.depth
+dstOffset.z
) must both be greater than or equal to0
and less than or equal to the destination image subresource depth- If the calling command’s
dstImage
is of typeVK_IMAGE_TYPE_1D
orVK_IMAGE_TYPE_2D
, thendstOffset.z
must be0
andextent.depth
must be1
.
Valid Usage (Implicit)
srcSubresource
must be a validVkImageSubresourceLayers
structuredstSubresource
must be a validVkImageSubresourceLayers
structure
See Also
VkExtent3D, VkImageSubresourceLayers, VkOffset3D, vkCmdResolveImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageResolve
VkImageSubresource(3)
Name
VkImageSubresource - Structure specifying a image subresource
C Specification
The VkImageSubresource
structure is defined as:
typedef struct VkImageSubresource { VkImageAspectFlags aspectMask; uint32_t mipLevel; uint32_t arrayLayer; } VkImageSubresource;
Members
-
aspectMask
is a VkImageAspectFlags selecting the image aspect. -
mipLevel
selects the mipmap level. -
arrayLayer
selects the array layer.
Description
Valid Usage
mipLevel
must be less than themipLevels
specified in VkImageCreateInfo when the image was createdarrayLayer
must be less than thearrayLayers
specified in VkImageCreateInfo when the image was created
Valid Usage (Implicit)
aspectMask
must be a valid combination of VkImageAspectFlagBits valuesaspectMask
must not be0
See Also
VkImageAspectFlags, VkSparseImageMemoryBind, vkGetImageSubresourceLayout
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageSubresource
VkImageSubresourceLayers(3)
Name
VkImageSubresourceLayers - Structure specifying a image subresource layers
C Specification
The VkImageSubresourceLayers
structure is defined as:
typedef struct VkImageSubresourceLayers { VkImageAspectFlags aspectMask; uint32_t mipLevel; uint32_t baseArrayLayer; uint32_t layerCount; } VkImageSubresourceLayers;
Members
-
aspectMask
is a combination of VkImageAspectFlagBits, selecting the color, depth and/or stencil aspects to be copied. -
mipLevel
is the mipmap level to copy from. -
baseArrayLayer
andlayerCount
are the starting layer and number of layers to copy.
Description
Valid Usage
- If
aspectMask
containsVK_IMAGE_ASPECT_COLOR_BIT
, it must not contain either ofVK_IMAGE_ASPECT_DEPTH_BIT
orVK_IMAGE_ASPECT_STENCIL_BIT
aspectMask
must not containVK_IMAGE_ASPECT_METADATA_BIT
mipLevel
must be less than themipLevels
specified in VkImageCreateInfo when the image was created- (
baseArrayLayer
+layerCount
) must be less than or equal to thearrayLayers
specified in VkImageCreateInfo when the image was created
Valid Usage (Implicit)
aspectMask
must be a valid combination of VkImageAspectFlagBits valuesaspectMask
must not be0
See Also
VkBufferImageCopy, VkImageAspectFlags, VkImageBlit, VkImageCopy, VkImageResolve
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageSubresourceLayers
VkImageSubresourceRange(3)
Name
VkImageSubresourceRange - Structure specifying a image subresource range
C Specification
The VkImageSubresourceRange
structure is defined as:
typedef struct VkImageSubresourceRange { VkImageAspectFlags aspectMask; uint32_t baseMipLevel; uint32_t levelCount; uint32_t baseArrayLayer; uint32_t layerCount; } VkImageSubresourceRange;
Members
-
aspectMask
is a bitmask of VkImageAspectFlagBits specifying which aspect(s) of the image are included in the view. -
baseMipLevel
is the first mipmap level accessible to the view. -
levelCount
is the number of mipmap levels (starting frombaseMipLevel
) accessible to the view. -
baseArrayLayer
is the first array layer accessible to the view. -
layerCount
is the number of array layers (starting frombaseArrayLayer
) accessible to the view.
Description
The number of mipmap levels and array layers must be a subset of the image subresources in the image. If an application wants to use all mip levels or layers in an image after the baseMipLevel
or baseArrayLayer
, it can set levelCount
and layerCount
to the special values VK_REMAINING_MIP_LEVELS
and VK_REMAINING_ARRAY_LAYERS
without knowing the exact number of mip levels or layers.
For cube and cube array image views, the layers of the image view starting at baseArrayLayer
correspond to faces in the order +X, -X, +Y, -Y, +Z, -Z. For cube arrays, each set of six sequential layers is a single cube, so the number of cube maps in a cube map array view is layerCount
/ 6, and image array layer (baseArrayLayer
+ i) is face index (i mod 6) of cube i / 6. If the number of layers in the view, whether set explicitly in layerCount
or implied by VK_REMAINING_ARRAY_LAYERS
, is not a multiple of 6, behavior when indexing the last cube is undefined.
aspectMask
must be only VK_IMAGE_ASPECT_COLOR_BIT
, VK_IMAGE_ASPECT_DEPTH_BIT
or VK_IMAGE_ASPECT_STENCIL_BIT
if format
is a color, depth-only or stencil-only format, respectively. If using a depth/stencil format with both depth and stencil components, aspectMask
must include at least one of VK_IMAGE_ASPECT_DEPTH_BIT
and VK_IMAGE_ASPECT_STENCIL_BIT
, and can include both.
When using an imageView of a depth/stencil image to populate a descriptor set (e.g. for sampling in the shader, or for use as an input attachment), the aspectMask
must only include one bit and selects whether the imageView is used for depth reads (i.e. using a floating-point sampler or input attachment in the shader) or stencil reads (i.e. using an unsigned integer sampler or input attachment in the shader). When an imageView of a depth/stencil image is used as a depth/stencil framebuffer attachment, the aspectMask
is ignored and both depth and stencil image subresources are used.
The components
member is of type VkComponentMapping, and describes a remapping from components of the image to components of the vector returned by shader image instructions. This remapping must be identity for storage image descriptors, input attachment descriptors, and framebuffer attachments.
Valid Usage (Implicit)
aspectMask
must be a valid combination of VkImageAspectFlagBits valuesaspectMask
must not be0
See Also
VkImageAspectFlags, VkImageMemoryBarrier, VkImageViewCreateInfo, vkCmdClearColorImage, vkCmdClearDepthStencilImage
Document Notes
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkImageSubresourceRange
VkImageViewCreateInfo(3)
Name
VkImageViewCreateInfo - Structure specifying parameters of a newly created image view
C Specification
The VkImageViewCreateInfo
structure is defined as:
typedef struct VkImageViewCreateInfo { VkStructureType sType; const void* pNext; VkImageViewCreateFlags flags; VkImage image; VkImageViewType viewType; VkFormat format; VkComponentMapping components; VkImageSubresourceRange subresourceRange; } VkImageViewCreateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
flags
is reserved for future use. -
image
is aVkImage
on which the view will be created. -
viewType
is an VkImageViewType value specifying the type of the image view. -
format
is a VkFormat describing the format and type used to interpret data elements in the image. -
components
is a VkComponentMapping specifies a remapping of color components (or of depth or stencil components after they have been converted into color components). -
subresourceRange
is a VkImageSubresourceRange selecting the set of m