119 lines
4.9 KiB
Plaintext
119 lines
4.9 KiB
Plaintext
// Copyright (c) 2014-2016 Khronos Group. This work is licensed under a
|
|
// Creative Commons Attribution 4.0 International License; see
|
|
// http://creativecommons.org/licenses/by/4.0/
|
|
|
|
vkCmdBindDescriptorSets(3)
|
|
==========================
|
|
|
|
Name
|
|
----
|
|
vkCmdBindDescriptorSets - Binds descriptor sets to a command buffer.
|
|
|
|
C Specification
|
|
---------------
|
|
|
|
// refBegin vkCmdBindDescriptorSets Binds descriptor sets to a command buffer.
|
|
|
|
To bind one or more descriptor sets to a command buffer, call:
|
|
|
|
include::../protos/vkCmdBindDescriptorSets.txt[]
|
|
|
|
|
|
Parameters
|
|
----------
|
|
|
|
* pname:commandBuffer is the command buffer that the descriptor sets will
|
|
be bound to.
|
|
* pname:pipelineBindPoint is a elink: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.
|
|
* pname:layout is a sname:VkPipelineLayout object used to program the
|
|
bindings.
|
|
* pname:firstSet is the set number of the first descriptor set to be
|
|
bound.
|
|
* pname:descriptorSetCount is the number of elements in the
|
|
pname:pDescriptorSets array.
|
|
* pname:pDescriptorSets is an array of handles to sname:VkDescriptorSet
|
|
objects describing the descriptor sets to write to.
|
|
* pname:dynamicOffsetCount is the number of dynamic offsets
|
|
in the pname:pDynamicOffsets array.
|
|
* pname:pDynamicOffsets is a pointer to an array of basetype:uint32_t
|
|
values specifying dynamic offsets.
|
|
|
|
|
|
Description
|
|
-----------
|
|
|
|
fname:vkCmdBindDescriptorSets causes the sets numbered [pname:firstSet..
|
|
pname:firstSet+pname:descriptorSetCount-1] to use the bindings stored in
|
|
pname:pDescriptorSets[0..pname:descriptorSetCount-1] for subsequent
|
|
rendering commands (either compute or graphics, according to the
|
|
pname: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
|
|
<<descriptorsets-compatibility, 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 pname:pDynamicOffsets includes one element for each array element
|
|
in each dynamic descriptor type binding in each set. Values are taken from
|
|
pname: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. pname: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 pname: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 pname:pDescriptorSets must: be compatible with the pipeline
|
|
layout specified by pname: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 <<descriptorsets-compatibility, Pipeline
|
|
Layout Compatibility>> section.
|
|
|
|
The descriptor set contents bound by a call to fname: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 mustnot: 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 pname:pDynamicOffsets are consumed
|
|
immediately during execution of fname:vkCmdBindDescriptorSets. Once all
|
|
pending uses have completed, it is legal to update and reuse a descriptor
|
|
set.
|
|
|
|
include::../validity/protos/vkCmdBindDescriptorSets.txt[]
|
|
|
|
|
|
See Also
|
|
--------
|
|
|
|
slink:VkCommandBuffer, slink:VkDescriptorSet, elink:VkPipelineBindPoint, slink:VkPipelineLayout
|
|
|
|
|
|
Document Notes
|
|
--------------
|
|
|
|
For more information, see the Vulkan Specification at URL
|
|
|
|
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdBindDescriptorSets
|
|
|
|
This page is extracted from the Vulkan Specification.
|
|
Fixes and changes should be made to the Specification,not directly.
|
|
|
|
include::footer.txt[]
|
|
|