diff options
Diffstat (limited to 'runtime/src/root_signature.cpp')
| -rw-r--r-- | runtime/src/root_signature.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/src/root_signature.cpp b/runtime/src/root_signature.cpp index 8aac0f554..762dd704e 100644 --- a/runtime/src/root_signature.cpp +++ b/runtime/src/root_signature.cpp | |||
| @@ -11,7 +11,7 @@ PackResult pack(const RootSignature& sig) { | |||
| 11 | out.error = "root signature has more than 64 root parameters"; | 11 | out.error = "root signature has more than 64 root parameters"; |
| 12 | return out; | 12 | return out; |
| 13 | } | 13 | } |
| 14 | uint32_t cost = 0; | 14 | uint64_t cost = 0; // 64-bit: a parameter of 0xFFFFFFFF constants must not wrap past the limits |
| 15 | for (const RootParameter& p : sig.params) { | 15 | for (const RootParameter& p : sig.params) { |
| 16 | if (p.type == ParamType::Constants && p.num_values == 0) { | 16 | if (p.type == ParamType::Constants && p.num_values == 0) { |
| 17 | out.error = "root constant parameter needs at least 1 dword"; | 17 | out.error = "root constant parameter needs at least 1 dword"; |
| @@ -25,7 +25,7 @@ PackResult pack(const RootSignature& sig) { | |||
| 25 | out.error = "root signature exceeds the 64-dword D3D12 cost limit"; | 25 | out.error = "root signature exceeds the 64-dword D3D12 cost limit"; |
| 26 | return out; | 26 | return out; |
| 27 | } | 27 | } |
| 28 | if (out.dword_count + dwords > kMaxUserSgprs) { | 28 | if (uint64_t(out.dword_count) + dwords > kMaxUserSgprs) { |
| 29 | // Spill layout is unknown (see __XB_GetRootSignatureSpillPointer): | 29 | // Spill layout is unknown (see __XB_GetRootSignatureSpillPointer): |
| 30 | // refuse loudly instead of silently truncating every draw. | 30 | // refuse loudly instead of silently truncating every draw. |
| 31 | out.error = "root signature needs more than 32 user SGPRs (spill unsupported)"; | 31 | out.error = "root signature needs more than 32 user SGPRs (spill unsupported)"; |
| @@ -39,7 +39,7 @@ PackResult pack(const RootSignature& sig) { | |||
| 39 | ++out.dword_count; | 39 | ++out.dword_count; |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| 42 | out.d3d12_cost = cost; | 42 | out.d3d12_cost = static_cast<uint32_t>(cost); // <= kMaxD3d12Cost here |
| 43 | out.ok = true; | 43 | out.ok = true; |
| 44 | return out; | 44 | return out; |
| 45 | } | 45 | } |