KhronosGroup / Vulkan-Utility-Libraries

Utility libraries for Vulkan developers
Other
56 stars 25 forks source link

Revert "safestruct: Remove safe_VkDescriptorDataEXT" #201

Closed ziga-lunarg closed 5 months ago

ziga-lunarg commented 5 months ago

Revert #196

VkDescriptorDataEXT needs to be safe.

When running with validation layers the CTS test dEQP-VK.binding_model.descriptor_buffer.single.graphics_vert_sampled_image and other descriptor buffer tests crash after the tests finish.

If VkDescriptorDataEXT is not safe, then in layer_chassis_dispatch_manual.cpp in function DispatchGetDescriptorEXT() the descriptors are overwritten with the unwrapped handles, because local_pDescriptorInfo.data has the same pointers as pDescriptorInfo->data, and when tests finish the invalid unwrapped handles are used to delete the descriptors (sampler is this case), which leads to:

Test case 'dEQP-VK.binding_model.descriptor_buffer.single.graphics_vert_sampled_image'..
VUID-vkDestroySampler-sampler-parameter(ERROR / SPEC): msgNum: -576740016 - Validation Error: [ VUID-vkDestroySampler-sampler-parameter ] Object 0: handle = 0x27f96f1bcd0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xdd9fa550 | vkDestroySampler(): sampler Invalid VkSampler Object 0x27ff7abb6b0. The Vulkan spec states: If sampler is not VK_NULL_HANDLE, sampler must be a valid VkSampler handle (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroySampler-sampler-parameter)
    Objects: 1
        [0] 0x27f96f1bcd0, type: 1, name: NULL
Assertion failed: object_table.contains(object), file C:\Projects\Vulkan-ValidationLayers\layers\thread_tracker/thread_safety_validation.h, line 116