Skip to content

feat(runtime): add D3D12 CBV/SRV/UAV buffer views and VkPipelineLayout root signatures - #895

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
cobalt-pebble-804:feat/d3d12-views-rootsig
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
cobalt-pebble-804:feat/d3d12-views-rootsig

Conversation

@cobalt-pebble-804

@cobalt-pebble-804 cobalt-pebble-804 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implements D3D12 CBV/SRV/UAV buffer views (CreateConstantBufferView, CreateShaderResourceView, CreateUnorderedAccessView) and CreateRootSignature backed by VkPipelineLayout with the 144-byte push-constant contract.

Part 1 of a series toward the Vulkan-backed D3D12 execution path (PSOs, DrawInstanced/Dispatch replay, and VkSwapchainKHR follow in subsequent PRs).

Architecture / Subsystem Affected

  • runtime/shims/d3d12_vulkan_device.cpp (ShaderView, RootSignature)
  • runtime/test/d3d12_vulkan_device_test.cpp, d3d12_shader_views_test.cpp, d3d12_root_signature_vk_test.cpp
  • runtime/CMakeLists.txt

Verification & Testing

  • Tested locally on: Windows 10/11 x64, NVIDIA GeForce RTX 2060, Vulkan SDK 1.4.363.0
  • d3d12_shader_views_test.exe (LEONIDA_VK_VALIDATION=1): PASS
  • d3d12_root_signature_vk_test.exe (LEONIDA_VK_VALIDATION=1): PASS

Checklist

  • Code adheres to the repository's style guidelines.
  • Self-review performed.
  • New/existing tests pass locally with LEONIDA_VK_VALIDATION=1.

@UlteriorMotive00

Copy link
Copy Markdown
Contributor

Tested 70f184a on AMD RDNA2 iGPU and RTX 5070: the PR's own tests pass, but d3d12_vulkan_device now fails on the RTX 5070.

Windows 11 Home 10.0.26300, MSVC 14.44.35207, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja RelWithDebInfo (scripts\build_runtime.ps1), LEONIDA_VK_VALIDATION=1, VK_LOADER_LAYERS_DISABLE=~implicit~. One PC, two GPUs, picked with VK_LOADER_DRIVERS_SELECT: AMD Radeon iGPU of a Ryzen 7 9800X3D (RDNA2, 1002:13C0, AMD 2026.04.17) and NVIDIA GeForce RTX 5070 (Blackwell, 617.42).

  • d3d12_shader_views_test: PASS (CBV, SRV, UAV) on both GPUs.
  • d3d12_root_signature_vk_test: PASS (negative, empty, constants + VkPipelineLayout) on both GPUs.
  • ctest, RTX 5070: 31/32. d3d12_vulkan_device fails at the check this PR adds, line 2157: *reinterpret_cast<const std::uint32_t*>(srv0.ptr) == 2 (the texture SRV on untouched). On the same base (fix(gta6rt): reject mutually exclusive mode flags (--dry-run/--init/--run) #902 and Runtime: the two /W4 warnings left in a full build #904, also 99 behind main), d3d12_vulkan_device passes on this GPU, so it comes from this branch. The same run also prints allocation info 64x64 BC1 small: alignment 4096, size ours 8192 host 4096, which the same-base runs don't print. I haven't dug into why.
  • ctest, AMD iGPU: 31/32. The failure there is the base's OPTIONS19.SupportedSampleCountsWithNoOutputs mismatch (since fixed on main), not this PR. Line 2157 passes on this GPU.

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

@ItsNotRexed
ItsNotRexed merged commit 6ac93b2 into ItsNotRexed:main Nov 22, 2026
ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
#895's CBV/SRV/UAV views write placeholder tags (1, 2, 3) into the descriptor heap, and its new check in
d3d12_vulkan_device_test expects an SRV's first dword to be 2. main's SRVs are GFX10 T# words (D3D-72 and the
descriptor table), so the device test failed at line 2211. The PR needs a rebase onto main's descriptor model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ItsNotRexed

Copy link
Copy Markdown
Owner

I merged this and then reverted it (7a6b97c). The views write placeholder tags 1/2/3 into the descriptor heap, and the new d3d12_vulkan_device_test check expects an SRV's first dword to be 2, but main's SRVs are GFX10 T# words, so the test failed at line 2211. Please rebase onto main's descriptor model and open a new PR.

ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
#1779 (the #895 rebase) writes placeholder ShaderView records (kind, resource id, offset) into CBV/SRV/UAV slots
and adds a second CreateConstantBufferView next to #1729's, so the runtime no longer compiled. main's descriptor
slots hold GFX10 V#/T# words that translated shaders read; #1729's CBV already writes the raw buffer V#.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants