mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:50:51 +01:00
[PR #1232] [MERGED] d3d12: graphics draws supply the directly indexed heaps after their root arguments (RT-DIRECT-HEAP-GRAPHICS) #1264
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1264
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1232
Author: @iFeyz
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:feat/direct-heap-graphics📝 Commits (6)
7c47fd9d3d12: supply directly indexed heaps to compute dispatches (RT-DIRECT-HEAP-COMPUTE)bfe8d5cMerge commit 'refs/pull/1064/head' of https://github.com/ubiquitarianism/leonida into feat/direct-heap-graphics9b8707cRT-DIRECT-HEAP-GRAPHICS: graphics draws supply the directly indexed heaps after their root argumentsc8f7515d3d12: supply directly indexed heaps to compute dispatches (RT-DIRECT-HEAP-COMPUTE)5115f08Merge main into RT-DIRECT-HEAP-COMPUTE (#1064)3ee0037Merge main into RT-DIRECT-HEAP-GRAPHICS (#1232)📊 Changes
6 files changed (+401 additions, -18 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+23 -5)📝
runtime/shims/d3d12_com.cpp(+36 -5)📝
runtime/test/d3d12_compute_test.cpp(+45 -6)📝
runtime/test/d3d12_mesh_test.cpp(+65 -2)➕
tests/test_compute_heap_layout_census.py(+64 -0)➕
tools/compute_heap_layout_census.py(+168 -0)📄 Description
Claimed in the coordination issue as: RT-DIRECT-HEAP-GRAPHICS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143274207)
Depends on: #974 (graphics root arguments in the console layout), #1064 (RT-DIRECT-HEAP-COMPUTE). This branch is #974 with #1064 merged in; its last commit is this pull request.
What and why
With
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED/SAMPLER_HEAP_DIRECTLY_INDEXED, a console program finds the descriptor heaps in the dwords right after its root arguments. @DadaCap measured on the retail library that this holds for every stage: from s4 in compute, s8 in VS/PS/GS and s16 in mesh shaders, the resource heap's address in the first dword after the root arguments and the sampler heap's in the next (issue #14, comment 7143020922, item 4). #1064 supplies them for compute. A graphics draw with a bound heap only got a note that its heap-base SGPR was not supplied, so a directly indexed VS/PS/MS read a zero heap base.runtime/shims/d3d12_com.cpp:graphics_user_data(), the graphics side of #1064'scompute_user_data(). EachDrawInstanced,DrawIndexedInstancedandDispatchMeshrecords the bound heaps' 32-bit addresses atgraphics_arguments_endand the next dword.LEONIDA_GRAPHICS_DIRECT_HEAPS=0restores the previous arguments.runtime/shims/d3d12_vulkan_device.cpp/d3d12_com.h:RootArgumentLayout::graphics_arguments_end(frompack_stage'send_sgpr). It is not set for a signature with parameters in the argument block, or underLEONIDA_GRAPHICS_ROOT_LAYOUT=pc, because no slot is measured there; nothing is written then, with one note.docs/d3d12_vulkan.mdsection 3.4, next to #1064's compute paragraph.Tested
d3d12_mesh_test(RX 9070 XT), throughrt::d3d12::recorded_commands:d3d12_compute_test(#1064's checks) androot_signature_testpass on the merge.ctest303 of 307 pass. The 4 failures are the same as onmainhere (d3d12_clear,d3d12_execute_indirect_validation,d3d12_texture_tiles,d3d12_pipeline_library_host, reported in #14).tests/test_docs_env_vars.py,tests/test_docs_links.py,scripts/check_no_game_data.pyon every changed file.Not run here: the retail title. On
main's own address path (noboot-prototypearena), a directly indexed draw now gets the same heap addresses a compute dispatch gets under #1064.GPUs tested: AMD Radeon RX 9070 XT, AMD Adrenalin 26.11.2 (Vulkan 1.4.359), Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.