Skip to content

feat(runtime): add D3D12 CBV/SRV/UAV buffer views (#895 rebase) - #1779

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

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

Conversation

@cobalt-pebble-804

Copy link
Copy Markdown
Contributor

Description

Rebased follow-up to #895 onto current main (since CreateRootSignature and texture GFX10 T# views are now on main):

  • Implements CreateConstantBufferView (ShaderViewKind::CBV)
  • Implements buffer view handling in CreateShaderResourceView and CreateUnorderedAccessView (!r->image()) without disturbing main's texture T# path or d3d12_vulkan_device_test.

Architecture / Subsystem Affected

  • runtime/shims/d3d12_vulkan_device.cpp (ShaderView, CreateConstantBufferView, buffer SRV/UAV)
  • runtime/test/d3d12_shader_views_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 (CBV, SRV, UAV)

Checklist

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

@dcastell1 dcastell1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built the runtime from this tree and ran it on the RTX 5090 (621.24, Windows 11):

1/1 Test #57: d3d12_shader_views ... Passed 0.76 sec

CBV/SRV/UAV buffer views are the last piece of the descriptor contract the game needs before its own root signatures appear, so having all three exercised in one test is worth more than three separate ones. No concerns.

@ItsNotRexed
ItsNotRexed merged commit 542586d into ItsNotRexed:main Nov 22, 2026
2 of 4 checks passed
@ItsNotRexed

Copy link
Copy Markdown
Owner

I merged this and then reverted it (7f38b07), for the same reason as #895: the CBV/SRV/UAV slots get placeholder ShaderView records, and it adds a second CreateConstantBufferView next to #1729's, so the runtime didn't compile. main's slots hold the GFX10 V#/T# words translated shaders read, and #1729's CBV already writes the raw buffer V#. Buffer SRV/UAV views would need to write V#s the same way.

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