icd: Translate handles in debug utils object info - #51
Conversation
Dispatchable objects are wrapped by the emulation ICD, so a handle the application uses is not the handle of the corresponding object in the underlying Vulkan implementation. SetDebugUtilsObjectNameEXT and SetDebugUtilsObjectTagEXT forwarded the object info structure unchanged, so the underlying implementation received a handle it does not own. Translate the handle of the wrapped dispatchable object types before forwarding.
No test called the debug utils object naming or tagging entry points, so nothing observed which handle reached the underlying implementation. Add a test checking that the physical device, device, queue and command buffer handles arriving at the underlying implementation are the unwrapped ones, for both names and tags. The object info is only forwarded if the underlying implementation supports VK_EXT_debug_utils, which the Vulkan loader always reports, so the test runs in the configurations using it. Instance handles are not covered because the Vulkan loader replaces them with its own before the underlying implementation sees them, whether the emulation ICD translated them or not.
|
The issue triggering this PR is indeed valid, but I cannot accept code with the signature style of Claude using free-standing anonymous namespace functions, as it's ugly and does not even fit the style of the rest of the code base. I would prefer issues being raised instead of such PRs because it takes much less time to write the code than getting Claude to produce the code in the appropriate style/architecture. |
|
Btw, it's an interesting question why this isn't caught by CTS. I think there ought to be some CTS test that actually verifies the correct behavior of these commands. |
|
This would deserve a generic, future proof solution, which, in theory, should be doable because |
Device::SetDebugUtilsObjectNameEXTandSetDebugUtilsObjectTagEXTforwarded the object infostructure to the underlying implementation unchanged, so
objectHandlereached it as an emulation ICDwrapper rather than a handle it owns. The loader does not correct this. The first commit translates
the wrapped dispatchable object types before forwarding.
The second commit adds a test that the physical device, device, queue and command buffer handles
arriving at the underlying implementation are the unwrapped ones, for both names and tags. It runs in
the configurations where the underlying implementation supports
VK_EXT_debug_utilsand skipsotherwise.
VK_OBJECT_TYPE_INSTANCEis not covered because the loader replaces the instance handlewith its own regardless of what the ICD passes.
The code and tests in this PR were written with Claude (Anthropic).