Skip to content

Commit 447dca9

Browse files
committed
add collection of RootConstants
1 parent e6ee2c7 commit 447dca9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,17 @@ bool SemaHLSL::handleRootSignatureDecl(HLSLRootSignatureDecl *D,
11171117
Info.Visibility = Descriptor->Visibility;
11181118
Infos.push_back(Info);
11191119
}
1120+
if (const auto *Constants =
1121+
std::get_if<llvm::hlsl::rootsig::RootConstants>(&Elem)) {
1122+
RangeInfo Info;
1123+
Info.LowerBound = Constants->Reg.Number;
1124+
Info.UpperBound = Info.LowerBound; // use inclusive ranges []
1125+
1126+
Info.Class = llvm::dxil::ResourceClass::CBuffer;
1127+
Info.Space = Constants->Space;
1128+
Info.Visibility = Constants->Visibility;
1129+
Infos.push_back(Info);
1130+
}
11201131
}
11211132

11221133
// 2. Sort the RangeInfo's by their GroupT to form groupings

0 commit comments

Comments
 (0)