Package org.lwjgl.vulkan
Class KHRDescriptorUpdateTemplate
- java.lang.Object
-
- org.lwjgl.vulkan.KHRDescriptorUpdateTemplate
-
public class KHRDescriptorUpdateTemplate extends java.lang.Object
Applications may wish to update a fixed set of descriptors in a large number of descriptors sets very frequently, i.e. during initializaton phase or if it is required to rebuild descriptor sets for each frame. For those cases it is also not unlikely that all information required to update a single descriptor set is stored in a single struct. This extension provides a way to update a fixed set of descriptors in a singleVkDescriptorSet
with a pointer to a user defined data structure which describes the new descriptors.Promotion to Vulkan 1.1
CmdPushDescriptorSetWithTemplateKHR
is included as an interaction withVK_KHR_push_descriptor
. If Vulkan 1.1 and VK_KHR_push_descriptor are supported, this is included byVK_KHR_push_descriptor
.The base functionality in this extension is included in core Vulkan 1.1, with the KHR suffix omitted. The original type, enum and command names are still available as aliases of the core functionality.
- Name String
VK_KHR_descriptor_update_template
- Extension Type
- Device extension
- Registered Extension Number
- 86
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Deprecation state
- Promoted to Vulkan 1.1
- Contact
- Markus Tavenrath mtavenrath
- Last Modified Date
- 2017-09-05
- IP Status
- No known IP claims.
- Interactions and External Dependencies
- Interacts with
VK_KHR_push_descriptor
- Promoted to Vulkan 1.1 Core
- Interacts with
- Contributors
- Jeff Bolz, NVIDIA
- Michael Worcester, Imagination Technologies
-
-
Field Summary
Fields Modifier and Type Field Description static int
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT
ExtendsVkDebugReportObjectTypeEXT
.static int
VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR
VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHRExtendsVkDescriptorUpdateTemplateType
.static java.lang.String
VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME
The extension name.static int
VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION
The extension specification version.static int
VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR
ExtendsVkObjectType
.static int
VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR
ExtendsVkStructureType
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
nvkCreateDescriptorUpdateTemplateKHR(VkDevice device, long pCreateInfo, long pAllocator, long pDescriptorUpdateTemplate)
Unsafe version of:CreateDescriptorUpdateTemplateKHR
static void
nvkDestroyDescriptorUpdateTemplateKHR(VkDevice device, long descriptorUpdateTemplate, long pAllocator)
Unsafe version of:DestroyDescriptorUpdateTemplateKHR
static void
vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, long descriptorUpdateTemplate, long layout, int set, long pData)
Pushes descriptor updates into a command buffer using a descriptor update template.static int
vkCreateDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateCreateInfo pCreateInfo, VkAllocationCallbacks pAllocator, long[] pDescriptorUpdateTemplate)
Array version of:CreateDescriptorUpdateTemplateKHR
static int
vkCreateDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateCreateInfo pCreateInfo, VkAllocationCallbacks pAllocator, java.nio.LongBuffer pDescriptorUpdateTemplate)
static void
vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, long descriptorUpdateTemplate, VkAllocationCallbacks pAllocator)
static void
vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, long descriptorSet, long descriptorUpdateTemplate, long pData)
-
-
-
Field Detail
-
VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION
The extension specification version.
-
VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME
The extension name.
-
VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR
ExtendsVkStructureType
.
-
VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR
ExtendsVkObjectType
.
-
VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
ExtendsVkDescriptorUpdateTemplateType
.
-
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT
ExtendsVkDebugReportObjectTypeEXT
.
-
-
Method Detail
-
nvkCreateDescriptorUpdateTemplateKHR
public static int nvkCreateDescriptorUpdateTemplateKHR(VkDevice device, long pCreateInfo, long pAllocator, long pDescriptorUpdateTemplate)
Unsafe version of:CreateDescriptorUpdateTemplateKHR
-
vkCreateDescriptorUpdateTemplateKHR
public static int vkCreateDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateCreateInfo pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, java.nio.LongBuffer pDescriptorUpdateTemplate)
- Parameters:
device
- the logical device that creates the descriptor update template.pCreateInfo
- a pointer to an instance of theVkDescriptorUpdateTemplateCreateInfo
structure specifying the set of descriptors to update with a single call toCmdPushDescriptorSetWithTemplateKHR
orUpdateDescriptorSetWithTemplate
.pAllocator
- controls host memory allocation as described in the Memory Allocation chapter.pDescriptorUpdateTemplate
- points to aVkDescriptorUpdateTemplate
handle in which the resulting descriptor update template object is returned.
-
nvkDestroyDescriptorUpdateTemplateKHR
public static void nvkDestroyDescriptorUpdateTemplateKHR(VkDevice device, long descriptorUpdateTemplate, long pAllocator)
Unsafe version of:DestroyDescriptorUpdateTemplateKHR
-
vkDestroyDescriptorUpdateTemplateKHR
public static void vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, long descriptorUpdateTemplate, @Nullable VkAllocationCallbacks pAllocator)
- Parameters:
device
- the logical device that has been used to create the descriptor update templatedescriptorUpdateTemplate
- the descriptor update template to destroy.pAllocator
- controls host memory allocation as described in the Memory Allocation chapter.
-
vkUpdateDescriptorSetWithTemplateKHR
public static void vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, long descriptorSet, long descriptorUpdateTemplate, long pData)
- Parameters:
device
- the logical device that updates the descriptor sets.descriptorSet
- the descriptor set to updatedescriptorUpdateTemplate
- theVkDescriptorUpdateTemplate
which specifies the update mapping betweenpData
and the descriptor set to update.pData
- a pointer to memory which contains one or more structures ofVkDescriptorImageInfo
,VkDescriptorBufferInfo
, orVkBufferView
used to write the descriptors.
-
vkCmdPushDescriptorSetWithTemplateKHR
public static void vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, long descriptorUpdateTemplate, long layout, int set, long pData)
Pushes descriptor updates into a command buffer using a descriptor update template.C Specification
It is also possible to use a descriptor update template to specify the push descriptors to update. To do so, call:
void vkCmdPushDescriptorSetWithTemplateKHR( VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData);
Valid Usage
- The
pipelineBindPoint
specified during the creation of the descriptor update template must be supported by thecommandBuffer
’s parentVkCommandPool
’s queue family pData
must be a valid pointer to a memory that contains one or more valid instances ofVkDescriptorImageInfo
,VkDescriptorBufferInfo
, orVkBufferView
in a layout defined bydescriptorUpdateTemplate
when it was created withCreateDescriptorUpdateTemplateKHR
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handledescriptorUpdateTemplate
must be a validVkDescriptorUpdateTemplate
handlelayout
must be a validVkPipelineLayout
handlecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations - Each of
commandBuffer
,descriptorUpdateTemplate
, 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 struct AppDataStructure { VkDescriptorImageInfo imageInfo; // a single image info // ... some more application related data }; const VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] = { // binding to a single image descriptor { 0, // binding 0, // dstArrayElement 1, // descriptorCount VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, // descriptorType offsetof(AppDataStructure, imageInfo), // offset 0 // stride is not required if descriptorCount is 1 } }; // create a descriptor update template for descriptor set updates const VkDescriptorUpdateTemplateCreateInfo createInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, // sType NULL, // pNext 0, // flags 1, // descriptorUpdateEntryCount descriptorUpdateTemplateEntries, // pDescriptorUpdateEntries VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, // templateType 0, // descriptorSetLayout, ignored by given templateType VK_PIPELINE_BIND_POINT_GRAPHICS, // pipelineBindPoint myPipelineLayout, // pipelineLayout 0, // set }; VkDescriptorUpdateTemplate myDescriptorUpdateTemplate; myResult = vkCreateDescriptorUpdateTemplate( myDevice, &createInfo, NULL, &myDescriptorUpdateTemplate); } AppDataStructure appData; // fill appData here or cache it in your engine vkCmdPushDescriptorSetWithTemplateKHR(myCmdBuffer, myDescriptorUpdateTemplate, myPipelineLayout, 0,&appData);
- Parameters:
commandBuffer
- the command buffer that the descriptors will be recorded in.descriptorUpdateTemplate
- a descriptor update template that defines how to interpret the descriptor information inpData
.layout
- aVkPipelineLayout
object used to program the bindings. It must be compatible with the layout used to create thedescriptorUpdateTemplate
handle.set
- the set number of the descriptor set in the pipeline layout that will be updated. This must be the same number used to create thedescriptorUpdateTemplate
handle.pData
- points to memory which contains the descriptors for the templated update.
- The
-
vkCreateDescriptorUpdateTemplateKHR
public static int vkCreateDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateCreateInfo pCreateInfo, @Nullable VkAllocationCallbacks pAllocator, long[] pDescriptorUpdateTemplate)
Array version of:CreateDescriptorUpdateTemplateKHR
-
-