diff options
| author | kawaii-shakal <deusex1998@gmail.com> | 2026-11-26 05:27:39 +0500 |
|---|---|---|
| committer | kawaii-shakal <deusex1998@gmail.com> | 2026-11-26 05:27:39 +0500 |
| commit | a42bffdc3e0d30347eedb3c433405e9a141cc06b (patch) | |
| tree | 600a611377c0575bbc7a967fd5894e9e6e4e32f6 /runtime/src/root_signature.cpp | |
| parent | aab7653566e4ecf80a8026cfbd48e74966a4d04c (diff) | |
| parent | c50ed94b35b37b697ab9c5fd176f3738480b4db5 (diff) | |
Merge origin/main into heavy-pipeline-cache
main's per-pipeline compute journal (pipeline_cache_journal.h) now persists every compute build and survives a
crash, so the compute build takes main's build_compute_pipeline and the heavy cache keeps graphics pipelines only.
CMake keeps both test sets; docs and the create_pipeline comment say so.
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)); |