Repository navigation
Runtime: swapchain back buffers keep names and private data (D3D-451) - #4317
omar-akermi wants to merge 1 commit into
Conversation
BackBufferResource now uses the shared ID3D12Object base (d3d12_com_object.h) for reference counting, SetName and private data. Before, SetName stored nothing and GetPrivateData, SetPrivateData and SetPrivateDataInterface answered E_NOTIMPL, where the host runtime treats a back buffer like any other ID3D12Object. d3d12_private_data_test now also runs its script on both back buffers of a host DXGI swapchain and of the layer's, and checks that a name and private data set on a buffer are still there when GetBuffer hands it out again, and not on the other buffer. On main that is 223 mismatches in 276 steps; with this change all 276 match on an RX 9070 XT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kam471
left a comment
There was a problem hiding this comment.
Built dxgi_swapchain_test at 06b086bf and ran it on Windows 11, RTX 5070 Ti: PASS (all swapchain cases, 0 validation errors); ctest -R dxgi_swapchain -> 1/1 passed (0.53 s).
The back buffers now keep their SetName/private data like the host objects, and the swapchain test passes. No blocking issue.
|
Independent NVIDIA check of
Focused CTest result: 2/2 passed. Synthetic fixtures only. AI-assisted (Codex). |
|
Also tested |
|
Tested this head on Windows 11 (26300), RTX 5060 Ti / 621.14, MSVC 14.51, Vulkan SDK 1.4.363.0, built from an empty folder with
One side effect worth a look: a new Possible fixes, any of them:
AI-assisted (Claude Code). |
|
Approved, with two notes. Names/private data survive
AI-assisted review, no game files, no GPU. |
|
Tested Clean worktree at
No game files and no shaders are involved. AI-assisted. |
Claimed in the coordination issue as: D3D-451 (#4257 (comment))
Depends on: none. Overlaps textually with #4068 (
BackBufferResource::GetDeviceand Map errors), which changes the top of the same class: a small rebase either way. Once both land,GetDevicecould move onto the sharedChildbase, which holds the device the same way.What and why
Swapchain back buffers (
BackBufferResource,runtime/shims/dxgi_com.cpp) kept no private data:SetNamereturnedS_OKand stored nothing, andGetPrivateData,SetPrivateDataandSetPrivateDataInterfacereturnedE_NOTIMPL. On the host a back buffer is an ordinaryID3D12Object. Tools and titles that name or tag back buffers got errors the host never returns.BackBufferResourcenow derives from the sharedrt::d3d12::Objectbase (d3d12_com_object.h). That base already holds the host-measured private-data rules (D3D-24) for every other object. It also takes over reference counting andQueryInterface, with akTagof its own.Objectgets a protectedreferences()soheld_by_app()(theResizeBufferscheck) keeps working.d3d12_private_data_testnow also runs its whole script on both back buffers of a host DXGI swapchain and of the layer's (a hidden 64×64 window, a flip-discard swapchain with 2 buffers), and compares every HRESULT, size, byte and reference count. It also checks that a name and private data set on buffer 0 are still there whenGetBuffer(0)hands it out again, and not on buffer 1. Without presentation or a window it prints that and skips only this part.mainthe back-buffer part has 223 mismatches in 276 steps, for exampleGetPrivateDataon a missing key: oursE_NOTIMPL, hostDXGI_ERROR_NOT_FOUND. With this change all 276 match.docs/d3d12_vulkan.md§3 (DXGI swapchain) and §4.10 (private data) say so.Tested
Windows 11 Pro 26200, MSVC 14.44 (VS 2022 Build Tools), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja RelWithDebInfo.
d3d12_private_data_testwith and withoutLEONIDA_VK_VALIDATION=1: exit 0, zero validation messages. Private data: 667 steps compared, 0 mismatches. Back buffers: 276 steps compared, 0 mismatches. In both,SetName(nullptr)is left out because the host faults on it.ctest: 147/147 pass (includingdxgi_swapchain).AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code