[PR #2438] GPU/Vulkan: Add debug utility functions #1057

Open
opened 2026-01-29 19:10:46 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/stenzek/duckstation/pull/2438

State: closed
Merged: Yes


Adds a way to set the name of vulkan objects, and automatically determining
their VkObjectType enum value at compile-time. As well as a utility-object
for creating debug-scopes for VkQueue and VkCommandBuffer objects.
DebugScope objects will automatically emit Begin and End commands
within the ctor and dtor and allow for C++ scopes to name and color
sections of a vulkan command. These DebugScopes are also able
to be nested within each other and will automatically pick a color
depending on the current recursive depth.

These functions are all null-stubbed in non-debug compilations.

before:
This is how a captured command buffer would look like in renderdoc and nsight
before
before-nsight

after:
Now we have the exact C++-side scope of the function emitting the particular commands for each particular queue being submitted to, as well as profiling data for each scope
after
after-nsight

**Original Pull Request:** https://github.com/stenzek/duckstation/pull/2438 **State:** closed **Merged:** Yes --- Adds a way to set the name of vulkan objects, and automatically determining their `VkObjectType` enum value at compile-time. As well as a utility-object for creating debug-scopes for `VkQueue` and `VkCommandBuffer` objects. `DebugScope` objects will automatically emit `Begin` and `End` commands within the ctor and dtor and allow for C++ scopes to name and color sections of a vulkan command. These DebugScopes are also able to be nested within each other and will automatically pick a color depending on the current recursive depth. These functions are all null-stubbed in non-debug compilations. before: This is how a captured command buffer would look like in renderdoc and nsight ![before](https://user-images.githubusercontent.com/644247/126850742-558427c6-f4d2-4db1-b0cb-408467edb57b.png) ![before-nsight](https://user-images.githubusercontent.com/644247/126850942-f9c07fa7-acc9-49db-9455-607979e59bf1.png) after: Now we have the exact C++-side scope of the function emitting the particular commands for each particular queue being submitted to, as well as profiling data for each scope ![after](https://user-images.githubusercontent.com/644247/126850769-672b09f9-460d-4731-a9f7-755a49a02c1d.png) ![after-nsight](https://user-images.githubusercontent.com/644247/126850955-1c94c6fd-b89e-4ee6-a089-0f717e0769f2.png)
claunia added the pull-request label 2026-01-29 19:10:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#1057