Skip to content

Commit 8b831f8

Browse files
author
joaosaffran
committed
adding check for mutually exclusive descriptor flags
1 parent 638d961 commit 8b831f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/DirectX/DXILRootSignature.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
365365
if (popcount(llvm::to_underlying(Flags & DataFlags)) > 1)
366366
return false;
367367

368+
// The descriptor-specific flags are mutually exclusive.
369+
FlagT DescriptorFlags = FlagT::DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS |
370+
FlagT::DESCRIPTORS_VOLATILE;
371+
if (popcount(llvm::to_underlying(Flags & DescriptorFlags)) > 1)
372+
return false;
373+
368374
// For volatile descriptors, DATA_STATIC is never valid.
369375
if ((Flags & FlagT::DESCRIPTORS_VOLATILE) == FlagT::DESCRIPTORS_VOLATILE) {
370376
FlagT Mask = FlagT::DESCRIPTORS_VOLATILE;

0 commit comments

Comments
 (0)