upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/src/root_signature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/root_signature.cpp')
-rw-r--r--runtime/src/root_signature.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/runtime/src/root_signature.cpp b/runtime/src/root_signature.cpp
index a0eb96cce..89ea5ef4c 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;
@@ -63,15 +61,12 @@ StagePackResult pack_stage(const RootSignature& sig, Stage stage) {
63 first.reserve(sig.params.size()); 61 first.reserve(sig.params.size());
64 for (size_t i = 0; i < sig.params.size(); ++i) { 62 for (size_t i = 0; i < sig.params.size(); ++i) {
65 const RootParameter& p = sig.params[i]; 63 const RootParameter& p = sig.params[i];
66 if (p.type == ParamType::Constants && p.num_values == 0) {
67 out.error = "root constant parameter needs at least 1 dword";
68 return out;
69 }
70 cost += param_cost(p.type, p.num_values); 64 cost += param_cost(p.type, p.num_values);
71 if (cost > kMaxD3d12Cost) { 65 if (cost > kMaxD3d12Cost) {
72 out.error = "root signature exceeds the 64-dword D3D12 cost limit"; 66 out.error = "root signature exceeds the 64-dword D3D12 cost limit";
73 return out; 67 return out;
74 } 68 }
69 // 0 for a constant parameter of 0 values, which then shares its first SGPR with the next parameter.
75 const uint64_t dwords = stage_dwords(p.type, p.num_values); 70 const uint64_t dwords = stage_dwords(p.type, p.num_values);
76 if (next + dwords > kMaxUserSgprs) { 71 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 72 // The console moves this parameter and every later one to the spill array behind s[0:1]; that array's