Repository navigation
[Graphics] fix: a name given after creation reaches the debugger on Direct3D12 and Vulkan - #3558
Open
Nicogo1705 wants to merge 2 commits into
Open
Nicogo1705 wants to merge 2 commits into
Nicogo1705 wants to merge 2 commits into
Conversation
…irect3D12 Direct3D 12 resources took their debug name once, when the native object was set, so a name given afterwards (the usual case: create, then set Name) never reached PIX or the debug layer. GraphicsResourceBase now forwards OnNameChanged to SetDebugName, as the Direct3D 11 backend does. SetDebugName reads IsDebugMode instead of GraphicsDevice.IsDebugMode: it is now reached from a name change, and the property is null-safe for a resource without a device. Test: TestResourceDebugNames renames a texture and a buffer after creation and reads the name back with GetPrivateData(WKPDID_D3DDebugObjectNameW); it fails without the fix (the name stays the creation-time one), on WARP and on a hardware device. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…yer on Vulkan The Vulkan backend never named its objects: OnNameChanged still held the 2018 DebugMarker code, commented out. It now calls vkSetDebugUtilsObjectNameEXT on the texture's image or the buffer, when VK_EXT_debug_utils is enabled (IsProfilingSupported). A texture view is skipped, since it shares its parent's image and naming it would rename the parent. Test: TestResourceDebugNames (Vulkan) renames a texture, provokes one validation report on its image (vkGetImageSubresourceLayout on an optimal tiling image, allowed for this test) and reads the object names of the report through its own debug utils messenger; it fails without the fix, on Lavapipe and on a hardware device, and is skipped when the validation layer is missing. The test project references Vortice.Vulkan for the Vulkan build only, for these native calls. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Setting
Nameon a resource after it is created now reaches the graphics debugger on Direct3D 12 and Vulkan, as it already does on Direct3D 11.OnNameChangednow callsSetDebugName.SetDebugNameuses the null-safeIsDebugMode.OnNameChangedstill held the 2018 DebugMarker code, commented out, so no object was ever named. It now callsvkSetDebugUtilsObjectNameEXTon the texture's image or the buffer whenVK_EXT_debug_utilsis enabled. Texture views are skipped, because they share the parent's image.TestResourceDebugNamesrenames resources after creation:GetPrivateData(WKPDID_D3DDebugObjectNameW).[AllowGpuValidationError], and the test project referencesVortice.Vulkanfor the Vulkan build only.Both tests fail without the fix, on software and hardware devices. One commit per backend.
Related Issue
None found.
Types of changes
Checklist