diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 18:18:55 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 18:18:55 -0500 |
| commit | d4fb292344088e7925ddeb3bbceb5a9ac46de8c2 (patch) | |
| tree | 551a4e8b93953b3b481b3a30739ca73eb45615e8 /runtime/src/root_signature.cpp | |
| parent | 244387529b6fb4992b601704d32016e7beeadd28 (diff) | |
| parent | ffcfe68f12891826a2b15e19f31149d8bb44e778 (diff) | |
Merge main into rt-title-hud-vram-budget
Brings in #2137 (LEONIDA_DEV_OVERLAY), which the next commit extends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/root_signature.cpp')
| -rw-r--r-- | runtime/src/root_signature.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/runtime/src/root_signature.cpp b/runtime/src/root_signature.cpp index 10dd1e02c..41d3f6c5a 100644 --- a/runtime/src/root_signature.cpp +++ b/runtime/src/root_signature.cpp | |||
| @@ -17,10 +17,8 @@ PackResult pack(const RootSignature& sig) { | |||
| 17 | out.error = "unknown root parameter type"; | 17 | out.error = "unknown root parameter type"; |
| 18 | return out; | 18 | return out; |
| 19 | } | 19 | } |
| 20 | if (p.type == ParamType::Constants && p.num_values == 0) { | 20 | // A constant parameter of 0 values is valid (the host serializer warns, CreateRootSignature answers S_OK): |
| 21 | out.error = "root constant parameter needs at least 1 dword"; | 21 | // it takes no dwords, so it gets no provenance entry and the parameters after it pack as if it were absent. |
| 22 | return out; | ||
| 23 | } | ||
| 24 | const uint32_t dwords = p.type == ParamType::Table ? 2 | 22 | const uint32_t dwords = p.type == ParamType::Table ? 2 |
| 25 | : p.type == ParamType::Descriptor ? 2 | 23 | : p.type == ParamType::Descriptor ? 2 |
| 26 | : p.num_values; | 24 | : p.num_values; |
| @@ -71,15 +69,12 @@ StagePackResult pack_stage(const RootSignature& sig, Stage stage) { | |||
| 71 | out.error = "unknown root parameter type"; | 69 | out.error = "unknown root parameter type"; |
| 72 | return out; | 70 | return out; |
| 73 | } | 71 | } |
| 74 | if (p.type == ParamType::Constants && p.num_values == 0) { | ||
| 75 | out.error = "root constant parameter needs at least 1 dword"; | ||
| 76 | return out; | ||
| 77 | } | ||
| 78 | cost += param_cost(p.type, p.num_values); | 72 | cost += param_cost(p.type, p.num_values); |
| 79 | if (cost > kMaxD3d12Cost) { | 73 | if (cost > kMaxD3d12Cost) { |
| 80 | out.error = "root signature exceeds the 64-dword D3D12 cost limit"; | 74 | out.error = "root signature exceeds the 64-dword D3D12 cost limit"; |
| 81 | return out; | 75 | return out; |
| 82 | } | 76 | } |
| 77 | // 0 for a constant parameter of 0 values, which then shares its first SGPR with the next parameter. | ||
| 83 | const uint64_t dwords = stage_dwords(p.type, p.num_values); | 78 | const uint64_t dwords = stage_dwords(p.type, p.num_values); |
| 84 | if (!spilling && next + dwords <= kMaxUserSgprs) { | 79 | if (!spilling && next + dwords <= kMaxUserSgprs) { |
| 85 | first.push_back(static_cast<uint32_t>(next)); | 80 | first.push_back(static_cast<uint32_t>(next)); |