diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 18:36:19 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 18:36:19 -0500 |
| commit | 3a2820b3bff812ff3cff6a4d4087912edb0541bb (patch) | |
| tree | ab2522760b3930781a3531f7ded56ba449041e77 /runtime/src/root_signature.cpp | |
| parent | 75f6890bb98214d5112c7eb1126f67f9e2948a0a (diff) | |
| parent | c1e1ef0b81234ac46ca25a810ab81219408ea6ba (diff) | |
Merge main c1e1ef0b8 into RT-POST-LOAD-GPU-MEMORY (#2098)
Two conflicts:
- d3d12_com.cpp, note_direct_heap_indexing: main's console_descriptor_table_va(cbv_srv_uav_base_) for the tracked
table, with this branch's per-site once() flag instead of note_once on every draw.
- d3d12_vulkan_device.cpp, PipelineState::build_compute: this branch's body (build_compute_pipeline, journal, compile
helper). main's dev_status::Build around the compute create moves into build_compute_pipeline, next to the
pipeline_profile::DriverCall, so the status line still names the compute pipeline in the driver.
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)); |