Class KHRPushDescriptor
- java.lang.Object
-
- org.lwjgl.vulkan.KHRPushDescriptor
-
public class KHRPushDescriptor extends java.lang.Object
This extension allows descriptors to be written into the command buffer, with the implementation being responsible for managing their memory. Push descriptors may enable easier porting from older APIs and in some cases can be more efficient than writing descriptors into descriptor sets.Examples
None.
- Name String
- VK_KHR_push_descriptor
- Extension Type
- Device extension
- Registered Extension Number
- 81
- Status
- Draft.
- Last Modified Date
- 2016-10-15
- Revision
- 1
- IP Status
- No known IP claims.
- Dependencies
- This extension is written against version 1.0 of the Vulkan API.
- Requires VK_KHR_get_physical_device_properties2.
- Contributors
- Jeff Bolz, NVIDIA
- Michael Worcester, Imagination Technologies
- Contacts
- Jeff Bolz (jbolz 'at' nvidia.com)
-
-
Field Summary
Fields Modifier and Type Field and Description static int
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
ExtendsVkDescriptorSetLayoutCreateFlagBits
.static java.lang.String
VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME
The extension name.static int
VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION
The extension specification version.static int
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR
ExtendsVkStructureType
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, int pipelineBindPoint, long layout, int set, VkWriteDescriptorSet.Buffer pDescriptorWrites)
Pushes descriptor updates into a command buffer.
-
-
-
Field Detail
-
VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION
public static final int VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION
The extension specification version.- See Also:
- Constant Field Values
-
VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME
public static final java.lang.String VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME
The extension name.- See Also:
- Constant Field Values
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR
ExtendsVkStructureType
.- See Also:
- Constant Field Values
-
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
public static final int VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
ExtendsVkDescriptorSetLayoutCreateFlagBits
.- See Also:
- Constant Field Values
-
-
Method Detail
-
vkCmdPushDescriptorSetKHR
public static void vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, int pipelineBindPoint, long layout, int set, VkWriteDescriptorSet.Buffer pDescriptorWrites)
Pushes descriptor updates into a command buffer.C Specification
In addition to allocating descriptor sets and binding them to a command buffer, an application can record descriptor updates into the command buffer.
To push descriptor updates into a command buffer, call:
void vkCmdPushDescriptorSetKHR( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites);
Description
Push descriptors are a small bank of descriptors whose storage is internally managed by the command buffer rather than being written into a descriptor set and later bound to a command buffer. Push descriptors allow for incremental updates of descriptors without managing the lifetime of descriptor sets.
When a command buffer begins recording, all push descriptors have undefined contents. Push descriptors can be updated incrementally and cause shaders to use the updated descriptors for subsequent rendering commands (either compute or graphics, according to the
pipelineBindPoint
) until the descriptor is overwritten, or else until the set is disturbed as described in Pipeline Layout Compatibility. When the set is disturbed or push descriptors with a different descriptor set layout are set, all push descriptors become invalid.Valid descriptors must be pushed for all bindings that any shaders in a pipeline access, at the time that a draw or dispatch command is recorded to execute using that pipeline. This includes immutable sampler descriptors, which must be pushed before they are accessed by a pipeline. However, if none of the shaders in a pipeline statically use certain bindings in the push descriptor set, then those descriptors need not be valid.
Push descriptors do not use dynamic offsets. Instead, the corresponding non-dynamic descriptor types can be used and the
offset
member ofVkDescriptorBufferInfo
can be changed each time the descriptor is written.Each element of
pDescriptorWrites
is interpreted as inVkWriteDescriptorSet
, except thedstSet
member is ignored.To push an immutable sampler, use a
VkWriteDescriptorSet
withdstBinding
anddstArrayElement
selecting the immutable sampler's binding. If the descriptor type isDESCRIPTOR_TYPE_SAMPLER
, thepImageInfo
parameter is ignored and the immutable sampler is taken from the push descriptor set layout in the pipeline layout. If the descriptor type isDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, thesampler
member of the thepImageInfo
parameter is ignored and the immutable sampler is taken from the push descriptor set layout in the pipeline layout.Valid Usage
pipelineBindPoint
must be supported by thecommandBuffer
’s parentVkCommandPool
’s queue familyset
must be less thanVkPipelineLayoutCreateInfo
::setLayoutCount
provided whenlayout
was createdset
must be the unique set number in the pipeline layout that uses a descriptor set layout that was created withDESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepipelineBindPoint
must be a validVkPipelineBindPoint
valuelayout
must be a validVkPipelineLayout
handlepDescriptorWrites
must be a pointer to an array ofdescriptorWriteCount
validVkWriteDescriptorSet
structurescommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations descriptorWriteCount
must be greater than 0- 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 Secondary Both Graphics compute See Also
- Parameters:
commandBuffer
- the command buffer that the descriptors will be recorded in.pipelineBindPoint
- aVkPipelineBindPoint
indicating whether the descriptors will be used by graphics pipelines or compute pipelines. There is a separate set of push descriptor bindings for each of graphics and compute, so binding one does not disturb the other.layout
- aVkPipelineLayout
object used to program the bindings.set
- the set number of the descriptor set in the pipeline layout that will be updated.pDescriptorWrites
- a pointer to an array ofVkWriteDescriptorSet
structures describing the descriptors to be updated.
-
-