Skip to content

Commit 61d2b61

Browse files
committed
self-review: output unbounded instead of UINT_MAX for numDescriptors
1 parent 8ac398d commit 61d2b61

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

clang/test/AST/HLSL/RootSignatures-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// CHECK-SAME: t1, numDescriptors = 8, space = 0, offset = DescriptorTableOffsetAppend, flags = DescriptorsVolatile
4242
// CHECK-SAME: ),
4343
// CHECK-SAME: UAV(
44-
// CHECK-SAME: u1, numDescriptors = 4294967295, space = 0, offset = DescriptorTableOffsetAppend, flags = DescriptorsVolatile
44+
// CHECK-SAME: u1, numDescriptors = unbounded, space = 0, offset = DescriptorTableOffsetAppend, flags = DescriptorsVolatile
4545
// CHECK-SAME: ),
4646
// CHECK-SAME: DescriptorTable(
4747
// CHECK-SAME: numClauses = 3, visibility = All

llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,12 @@ raw_ostream &operator<<(raw_ostream &OS, const DescriptorTable &Table) {
287287
}
288288

289289
raw_ostream &operator<<(raw_ostream &OS, const DescriptorTableClause &Clause) {
290-
OS << Clause.Type << "(" << Clause.Reg
291-
<< ", numDescriptors = " << Clause.NumDescriptors
292-
<< ", space = " << Clause.Space << ", offset = ";
290+
OS << Clause.Type << "(" << Clause.Reg << ", numDescriptors = ";
291+
if (Clause.NumDescriptors == NumDescriptorsUnbounded)
292+
OS << "unbounded";
293+
else
294+
OS << Clause.NumDescriptors;
295+
OS << ", space = " << Clause.Space << ", offset = ";
293296
if (Clause.Offset == DescriptorTableOffsetAppend)
294297
OS << "DescriptorTableOffsetAppend";
295298
else

llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TEST(HLSLRootSignatureTest, DescriptorSRVClauseDump) {
3434
DescriptorTableClause Clause;
3535
Clause.Type = ClauseType::SRV;
3636
Clause.Reg = {RegisterType::TReg, 0};
37-
Clause.NumDescriptors = 2;
37+
Clause.NumDescriptors = NumDescriptorsUnbounded;
3838
Clause.Space = 42;
3939
Clause.Offset = 3;
4040
Clause.Flags = DescriptorRangeFlags::None;
@@ -44,8 +44,8 @@ TEST(HLSLRootSignatureTest, DescriptorSRVClauseDump) {
4444
OS << Clause;
4545
OS.flush();
4646

47-
std::string Expected =
48-
"SRV(t0, numDescriptors = 2, space = 42, offset = 3, flags = None)";
47+
std::string Expected = "SRV(t0, numDescriptors = unbounded, space = 42, "
48+
"offset = 3, flags = None)";
4949
EXPECT_EQ(Out, Expected);
5050
}
5151

0 commit comments

Comments
 (0)