diff options
| author | iFeyz <62035583+iFeyz@users.noreply.github.com> | 2026-11-24 19:53:18 +0100 |
|---|---|---|
| committer | iFeyz <62035583+iFeyz@users.noreply.github.com> | 2026-11-24 19:53:18 +0100 |
| commit | 00fc23b9a9eeb1a75f1fec2b58024bea15c26663 (patch) | |
| tree | e2bd20349c6f0ec1bdb9f8317a06a369eb8894e6 /runtime/src/root_signature.cpp | |
| parent | b2da1c0add9009678130b9bf898f2e6b8a4ae30f (diff) | |
D3D-448-GRAPHICS: a graphics signature past the console window keeps its inline part; the rest goes to the argument block
On the console the parameter that does not fit and every one after it go to the argument block behind
s[0:1], the ones before stay inline. No VS, PS or GS of 1.0.2.1 reads s[0:1] as an address
(root_spill_census), so the graphics bind point now lays the inline part out from s8 and stores nothing
for the rest (rt::rootsig::Spill::block), instead of giving the whole signature the PC layout. A write
to such a parameter is dropped before kNoSgpr plus an offset could wrap to dword 0. The retail start-up
signatures (25 and 30 dwords, every parameter visible to every stage, #974 review) are the case; the
per-visibility log line is gone, LEONIDA_GRAPHICS_ROOT_LAYOUT=pc stays. Compute still refuses a spill.
Diffstat (limited to 'runtime/src/root_signature.cpp')
| -rw-r--r-- | runtime/src/root_signature.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/runtime/src/root_signature.cpp b/runtime/src/root_signature.cpp index a0eb96cce..3852c587c 100644 --- a/runtime/src/root_signature.cpp +++ b/runtime/src/root_signature.cpp | |||
| @@ -48,7 +48,7 @@ PackResult pack(const RootSignature& sig) { | |||
| 48 | return out; | 48 | return out; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | StagePackResult pack_stage(const RootSignature& sig, Stage stage) { | 51 | StagePackResult pack_stage(const RootSignature& sig, Stage stage, Spill spill) { |
| 52 | StagePackResult out; | 52 | StagePackResult out; |
| 53 | out.stage = stage; | 53 | out.stage = stage; |
| 54 | out.base = stage_base(stage); | 54 | out.base = stage_base(stage); |
| @@ -73,12 +73,22 @@ StagePackResult pack_stage(const RootSignature& sig, Stage stage) { | |||
| 73 | return out; | 73 | return out; |
| 74 | } | 74 | } |
| 75 | const uint64_t dwords = stage_dwords(p.type, p.num_values); | 75 | const uint64_t dwords = stage_dwords(p.type, p.num_values); |
| 76 | if (out.first_spilled != SIZE_MAX) { // already in the argument block: every later parameter follows | ||
| 77 | first.push_back(kNoSgpr); | ||
| 78 | out.spilled_dwords += static_cast<uint32_t>(dwords); | ||
| 79 | continue; | ||
| 80 | } | ||
| 76 | if (next + dwords > kMaxUserSgprs) { | 81 | if (next + dwords > kMaxUserSgprs) { |
| 77 | // The console moves this parameter and every later one to the spill array behind s[0:1]; that array's | 82 | // The console moves this parameter and every later one to the spill array behind s[0:1]. |
| 78 | // layout is not modelled here, so refuse rather than drop arguments. | 83 | if (spill == Spill::refuse) { |
| 79 | out.error = "root parameter " + std::to_string(i) + " does not fit in the user SGPRs from s" + | 84 | out.error = "root parameter " + std::to_string(i) + " does not fit in the user SGPRs from s" + |
| 80 | std::to_string(out.base) + " (spill array not modelled)"; | 85 | std::to_string(out.base) + " (spill array not modelled)"; |
| 81 | return out; | 86 | return out; |
| 87 | } | ||
| 88 | out.first_spilled = i; | ||
| 89 | out.spilled_dwords = static_cast<uint32_t>(dwords); | ||
| 90 | first.push_back(kNoSgpr); | ||
| 91 | continue; | ||
| 82 | } | 92 | } |
| 83 | first.push_back(static_cast<uint32_t>(next)); | 93 | first.push_back(static_cast<uint32_t>(next)); |
| 84 | next += dwords; | 94 | next += dwords; |