C Specification

To write resource descriptors to memory, call:

// Provided by VK_EXT_descriptor_heap
VkResult vkWriteResourceDescriptorsEXT(
    VkDevice                                    device,
    uint32_t                                    resourceCount,
    const VkResourceDescriptorInfoEXT*          pResources,
    const VkHostAddressRangeEXT*                pDescriptors);

Parameters

  • device is the logical device that the descriptors are for.

  • resourceCount is the number of elements in pResources and pDescriptors.

  • pResources is a pointer to an array of VkResourceDescriptorInfoEXT structures defining properties of the resource descriptors that will be written.

  • pDescriptors is a pointer to an array of VkHostAddressRangeEXT structures defining the host address ranges that will be written to for each descriptor.

Description

Each descriptor will be written to pDescriptors[i]→address where i is the index of its create info in pResources.

If any image descriptor written by this command includes a VkSamplerYcbcrConversion, multiple descriptors will be written adjacent to each other for that descriptor, equal to VkSamplerYcbcrConversionImageFormatProperties::combinedImageSamplerDescriptorCount for the image.

If any image descriptor written by this command is for an image created with flags containing VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT, multiple descriptors will be written adjacent to each other for that descriptor, equal to VkSubsampledImageFormatPropertiesEXT::subsampledImageDescriptorCount for the image.

Descriptors using the same type and written using a fully identical VkTexelBufferDescriptorInfoEXT or VkDeviceAddressRangeEXT structure on the same VkDevice will always return the same bit pattern. If the descriptorHeapCaptureReplay feature is enabled, this applies to any VkDevice created with identical parameters from the same VkPhysicalDevice.

Note

Recreating the same buffer descriptor during replay of a prior capture requires that the device address is the same, which requires additional data to be captured and provided during replay when creating a buffer and allocating memory for it.

Image descriptors using the same type and written using a fully identical VkImageDescriptorInfoEXT other than VkImageDescriptorInfoEXT::pView->image, where image was successfully created with VK_IMAGE_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_EXT and a VkOpaqueCaptureDataCreateInfoEXT with data captured via vkGetImageOpaqueCaptureDataEXT from an image used previously, will write a descriptor with the same bit pattern if possible; if the same bit pattern cannot be generated, VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS will be returned instead.

Tensor descriptors using the same type and written using a fully identical VkTensorViewCreateInfoARM other than VkTensorViewCreateInfoARM::tensor, where tensor was successfully created with VkOpaqueCaptureDataCreateInfoEXT with VK_TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM and a VkOpaqueCaptureDataCreateInfoEXT with data captured via vkGetTensorOpaqueCaptureDataARM from a tensor used previously, will write a descriptor with the same bit pattern if possible; if the same bit pattern cannot be generated, VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS will be returned instead.

Note

Image creation is sufficiently complex that it may not be possible to recreate all possible descriptors from an image during replay, even if the image itself was successfully recreated. The conditions for this happening will be largely the same as those which could cause allocating a buffer with the same device address during replay to fail. Replay tools are advised to recreate captured descriptors for an image immediately after recreating the image itself wherever possible. The same is true for tensors.

Valid Usage
Valid Usage (Implicit)
  • VUID-vkWriteResourceDescriptorsEXT-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkWriteResourceDescriptorsEXT-pResources-parameter
    pResources must be a valid pointer to an array of resourceCount valid VkResourceDescriptorInfoEXT structures

  • VUID-vkWriteResourceDescriptorsEXT-pDescriptors-parameter
    pDescriptors must be a valid pointer to an array of resourceCount valid VkHostAddressRangeEXT structures

  • VUID-vkWriteResourceDescriptorsEXT-resourceCount-arraylength
    resourceCount must be greater than 0

Return Codes
On success, this command returns
On failure, this command returns

See Also

Document Notes

For more information, see the Vulkan Specification.

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0