upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
diff options
context:
space:
mode:
authoriFeyz <62035583+iFeyz@users.noreply.github.com>2026-11-24 17:52:02 +0100
committeriFeyz <62035583+iFeyz@users.noreply.github.com>2026-11-24 17:52:02 +0100
commit74e55acfbcabb49e387625b14328af1b1309375d (patch)
treed897c2dcb7b48c77ee060bf3048a90cff864d7b9 /runtime/shims/d3d12_com.cpp
parent5fdd6abbc07a0b2e4120944b4e624e3a70ddb76e (diff)
D3D-448-GRAPHICS: a graphics signature past the console window keeps the PC layout instead of being refused
Measured by madhyn on the retail title with this pull request (#974 review): one of its start-up root signatures is past the console's inline graphics window (24 dwords from s8) and the compute one (28 from s4), so CreateRootSignature refused it outright and the title stopped with an unhandled exception before the frame loop it reached without this change. On the console such a signature goes to the argument block behind s[0:1], modelled for compute only (ROOT-SIG-SPILL-MODEL, #1009). Until it is for graphics, the graphics bind point keeps pack()'s layout for it (from s0, two dwords per table), what the layer did before the console layout, so no signature is worse off than on main. The new RootArgumentLayout::graphics_console tells address() which layout the table is in; a mesh shader still refuses such a signature. d3d12_mesh_test: a 30-constant signature is created and DispatchMesh with it invalidates the list.
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index f67254bc5..7fcfceebb 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -1248,8 +1248,10 @@ private:
1248 const std::uint32_t first = first_dword(state, *p); 1248 const std::uint32_t first = first_dword(state, *p);
1249 write(state, first, std::uint32_t(va)); 1249 write(state, first, std::uint32_t(va));
1250 // In the console layout of both bind points a descriptor table is one dword, the 32-bit VA of its first 1250 // In the console layout of both bind points a descriptor table is one dword, the 32-bit VA of its first
1251 // descriptor (the heaps live below 4 GiB); a root view keeps both halves (D3D-448). 1251 // descriptor (the heaps live below 4 GiB); a root view keeps both halves (D3D-448). A graphics signature
1252 if (type != rt::rootsig::ParamType::Table) write(state, first + 1, std::uint32_t(va >> 32)); 1252 // past the console window keeps pack()'s layout, where every address takes two dwords.
1253 const bool console = is_compute(state) || state.layout->graphics_console;
1254 if (!(console && type == rt::rootsig::ParamType::Table)) write(state, first + 1, std::uint32_t(va >> 32));
1253 } 1255 }
1254 1256
1255 D3D12_COMMAND_LIST_TYPE type_; 1257 D3D12_COMMAND_LIST_TYPE type_;