Skip to content

d3d12: compute pipelines carry their shader's name through VK_EXT_debug_utils (RT-NAME-COMPUTE-PIPELINES) - #1909

Open
HasiKe wants to merge 1 commit into
ProjectLeonida:mainfrom
HasiKe:rt-name-compute-pipelines
Open

HasiKe wants to merge 1 commit into
ProjectLeonida:mainfrom
HasiKe:rt-name-compute-pipelines

Conversation

@HasiKe

@HasiKe HasiKe commented Nov 25, 2026

Copy link
Copy Markdown

Item: RT-NAME-COMPUTE-PIPELINES (claimed in #1608 (comment))

What

When the instance enabled VK_EXT_debug_utils (the title device already turns it on for the debug markers whenever the loader has it), build_compute names each compute VkPipeline after its shader (library/lib_cs_NNNNN, ..._Wrapped) through vkSetDebugUtilsObjectNameEXT. Without the extension set_object_name stays null and nothing changes.

Why

On a device loss, VK_LAYER_LUNARG_crash_diagnostic prints the pipeline of the last started dispatch only as a bare handle, so matching it to a shader took a local handle log and a rebuild. With the name, the dump reads handle: 0x...[library/lib_cs_01144] directly. RenderDoc shows the same names.

Tested

AI-assisted (Claude Code). No game data.

🤖 Generated with Claude Code

@MoonEyes

Copy link
Copy Markdown
Collaborator

Hi @HasiKe, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/d3d12_vulkan_device.cpp), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

…g_utils

When the instance enabled VK_EXT_debug_utils, each compute VkPipeline gets its
shader's name with vkSetDebugUtilsObjectNameEXT. A crash-diagnostic dump or a
RenderDoc capture then names the pipeline of the dispatch that faulted.
@HasiKe
HasiKe force-pushed the rt-name-compute-pipelines branch from 22cc6a9 to b8b8669 Compare November 28, 2026 18:12
@HasiKe

HasiKe commented Nov 28, 2026

Copy link
Copy Markdown
Author

Rebased on main (7daa4a4a5). The conflict was only in runtime/shims/d3d12_vulkan_device.cpp: the compute build moved into build_compute_pipeline, so the name is now set there, and only when the pipeline was created. The change is still the same 16 lines. gta6rt builds (RelWithDebInfo, MSVC). I did not run it in the game again after the rebase.

AI-assisted (Claude Code, Claude Opus 5.5)

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 28, 2026
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

#1909 | head b8b8669 (merged cleanly with main aa918e5) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^(d3d12_compute|d3d12_debug_markers)$" --output-on-failure (LEONIDA_VK_VALIDATION=1) + live info.debug_utils = true vkSetDebugUtilsObjectNameEXT pipeline-naming probe | control & probe: with debug_utils == false (set_object_name == nullptr), name_object is a clean no-op; with info.debug_utils = true under VK_LAYER_KHRONOS_validation 1.4.363.1, vkSetDebugUtilsObjectNameEXT resolves from the live Vulkan instance and names all 4 built cs_user_data compute VkPipeline handles with VK_SUCCESS (0) | green on PR+main: d3d12_compute and d3d12_debug_markers pass on RTX 3090 across both debug_utils off and on with 0 Khronos validation errors; check_no_game_data.py 0 violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes

@enlight3d

Copy link
Copy Markdown
Contributor

RUN #1909 | head b8b8669, merged cleanly with main 54b2a81 (local merge, not pushed)

This pull request has no test of its own (its description says so), so there is no red: nothing in the tree checks that a compute pipeline gets its name. What I ran is the tests of the code it touches.

Commands (from the repository root, in a worktree):

git fetch origin pull/1909/head:pr-1909
git checkout --detach origin/main && git merge --no-edit --no-ff pr-1909
cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON
cmake --build runtime/build -j 8 --target gta6rt d3d12_compute_test d3d12_debug_markers_test
ctest -C RelWithDebInfo -R "^(d3d12_compute|d3d12_debug_markers)$" --output-on-failure -j1
  • Build: gta6rt and both test targets build, no error.
  • Green: d3d12_debug_markers and d3d12_compute pass (2/2). The same two pass again with LEONIDA_VK_VALIDATION=1 set.
  • Red: not applicable (no test for the change, so not invented).
  • Link: no new imports vs main (gta6rt.exe, 723 DLL!symbol entries, same list as the baseline built from main).

Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants