KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
727 stars 396 forks source link

Improve missing descriptor binding message #8190

Closed jeroenbakker-atmind closed 1 week ago

jeroenbakker-atmind commented 1 week ago

Current Message:

VUID-vkCmdDispatchIndirect-None-08114(ERROR / SPEC): 
msgNum: 651623841 - Validation Error: [ VUID-vkCmdDispatchIndirect-None-08114 ] 
Object 0: handle = 0x7011b0000000aad5, name = eevee_ray_trace_screen_16049, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | 
MessageID = 0x26d6fda1 | vkCmdDispatchIndirect(): 
the descriptor (VkDescriptorSet 0x7011b0000000aad5[eevee_ray_trace_screen_16049], binding 17, index 0) is being
used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call. The Vulkan spec states:
Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid as described by
descriptor validity if they are statically used by the VkPipeline bound to the pipeline bind point used by this command
and the bound VkPipeline was not created with VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
(https://vulkan.lunarg.com/doc/view/1.3.283.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdDispatchIndirect-None-08114)
    Objects: 1
        [0] 0x7011b0000000aad5, type: 23, name: eevee_ray_trace_screen_16049

Proposal:

Would it be possible to extract a name from SPIR-V (when compiled with debug information) of this binding. This message can be raised by a Draw or dispatch call and a shader module should be present.

Nice to have:

Benefit:

Currently we are refactoring our EEVEE engine. When running using the (in development) vulkan backend we came across several of these messages which are of course a developer error. Our OpenGL backend didn't complain and perhaps was using the previous binding which most likely was the missing resource.

The improvement of the message would make it easier to find the missing resource without finding the missing call in a debug tool or in logs.

spencer-lunarg commented 1 week ago

so something I found is it very legal to go

layout(set = 0, binding = 2) uniform sampler3D tex3d[];
layout(set = 0, binding = 2) uniform sampler2D tex[];

in GLSL, so I will only be adding the variable name if I can detect a single variable name