Package org.lwjgl.vulkan
Class KHRDescriptorUpdateTemplate
- java.lang.Object
-
- org.lwjgl.vulkan.KHRDescriptorUpdateTemplate
-
public class KHRDescriptorUpdateTemplate extends java.lang.ObjectApplications 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 singleVkDescriptorSetwith a pointer to a user defined data structure which describes the new descriptors.Promotion to Vulkan 1.1
CmdPushDescriptorSetWithTemplateKHRis 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 intVK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXTExtendsVkDebugReportObjectTypeEXT.static intVK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR
VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHRExtendsVkDescriptorUpdateTemplateType.static java.lang.StringVK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAMEThe extension name.static intVK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSIONThe extension specification version.static intVK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHRExtendsVkObjectType.static intVK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHRExtendsVkStructureType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intnvkCreateDescriptorUpdateTemplateKHR(VkDevice device, long pCreateInfo, long pAllocator, long pDescriptorUpdateTemplate)Unsafe version of:CreateDescriptorUpdateTemplateKHRstatic voidnvkDestroyDescriptorUpdateTemplateKHR(VkDevice device, long descriptorUpdateTemplate, long pAllocator)Unsafe version of:DestroyDescriptorUpdateTemplateKHRstatic voidvkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, long descriptorUpdateTemplate, long layout, int set, long pData)Pushes descriptor updates into a command buffer using a descriptor update template.static intvkCreateDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateCreateInfo pCreateInfo, VkAllocationCallbacks pAllocator, long[] pDescriptorUpdateTemplate)Array version of:CreateDescriptorUpdateTemplateKHRstatic intvkCreateDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateCreateInfo pCreateInfo, VkAllocationCallbacks pAllocator, java.nio.LongBuffer pDescriptorUpdateTemplate)static voidvkDestroyDescriptorUpdateTemplateKHR(VkDevice device, long descriptorUpdateTemplate, VkAllocationCallbacks pAllocator)static voidvkUpdateDescriptorSetWithTemplateKHR(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 theVkDescriptorUpdateTemplateCreateInfostructure specifying the set of descriptors to update with a single call toCmdPushDescriptorSetWithTemplateKHRorUpdateDescriptorSetWithTemplate.pAllocator- controls host memory allocation as described in the Memory Allocation chapter.pDescriptorUpdateTemplate- points to aVkDescriptorUpdateTemplatehandle 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- theVkDescriptorUpdateTemplatewhich specifies the update mapping betweenpDataand the descriptor set to update.pData- a pointer to memory which contains one or more structures ofVkDescriptorImageInfo,VkDescriptorBufferInfo, orVkBufferViewused 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
pipelineBindPointspecified during the creation of the descriptor update template must be supported by thecommandBuffer’s parentVkCommandPool’s queue family pDatamust be a valid pointer to a memory that contains one or more valid instances ofVkDescriptorImageInfo,VkDescriptorBufferInfo, orVkBufferViewin a layout defined bydescriptorUpdateTemplatewhen it was created withCreateDescriptorUpdateTemplateKHR
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandledescriptorUpdateTemplatemust be a validVkDescriptorUpdateTemplatehandlelayoutmust be a validVkPipelineLayouthandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - Each of
commandBuffer,descriptorUpdateTemplate, andlayoutmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized - Host access to the
VkCommandPoolthatcommandBufferwas 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- aVkPipelineLayoutobject used to program the bindings. It must be compatible with the layout used to create thedescriptorUpdateTemplatehandle.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 thedescriptorUpdateTemplatehandle.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
-
-