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

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

📋 Pull Request Information

Original PR: https://github.com/stenzek/duckstation/pull/2438
Author: @Wunkolo
Created: 7/24/2021
Status: Merged
Merged: 8/7/2021
Merged by: @stenzek

Base: masterHead: vk-debug


📝 Commits (2)

  • 494b6e0 GPU/Vulkan: Add complete VK_EXT_debug_utils API entry points
  • 9808918 GPU/Vulkan: Add debug utility functions

📊 Changes

9 files changed (+599 additions, -44 deletions)

View changed files

📝 dep/vulkan-loader/include/vulkan_entry_points.h (+11 -0)
📝 dep/vulkan-loader/include/vulkan_entry_points.inl (+9 -0)
📝 src/common/vulkan/context.cpp (+26 -12)
📝 src/common/vulkan/staging_texture.cpp (+10 -0)
📝 src/common/vulkan/texture.cpp (+9 -1)
📝 src/common/vulkan/util.cpp (+139 -0)
📝 src/common/vulkan/util.h (+195 -1)
📝 src/core/gpu_hw_vulkan.cpp (+147 -17)
📝 src/frontend-common/vulkan_host_display.cpp (+53 -13)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/stenzek/duckstation/pull/2438 **Author:** [@Wunkolo](https://github.com/Wunkolo) **Created:** 7/24/2021 **Status:** ✅ Merged **Merged:** 8/7/2021 **Merged by:** [@stenzek](https://github.com/stenzek) **Base:** `master` ← **Head:** `vk-debug` --- ### 📝 Commits (2) - [`494b6e0`](https://github.com/stenzek/duckstation/commit/494b6e029f2cc24421b3be79f9be6a8a9470b3aa) GPU/Vulkan: Add complete VK_EXT_debug_utils API entry points - [`9808918`](https://github.com/stenzek/duckstation/commit/98089180c032c59984f3683dc927a93fb31e08f6) GPU/Vulkan: Add debug utility functions ### 📊 Changes **9 files changed** (+599 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `dep/vulkan-loader/include/vulkan_entry_points.h` (+11 -0) 📝 `dep/vulkan-loader/include/vulkan_entry_points.inl` (+9 -0) 📝 `src/common/vulkan/context.cpp` (+26 -12) 📝 `src/common/vulkan/staging_texture.cpp` (+10 -0) 📝 `src/common/vulkan/texture.cpp` (+9 -1) 📝 `src/common/vulkan/util.cpp` (+139 -0) 📝 `src/common/vulkan/util.h` (+195 -1) 📝 `src/core/gpu_hw_vulkan.cpp` (+147 -17) 📝 `src/frontend-common/vulkan_host_display.cpp` (+53 -13) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1053