@@ -175,7 +175,6 @@ static bool parseRootDescriptors(LLVMContext *Ctx,
175
175
}
176
176
177
177
static bool parseDescriptorRange (LLVMContext *Ctx,
178
- mcdxbc::RootSignatureDesc &RSD,
179
178
mcdxbc::DescriptorTable &Table,
180
179
MDNode *RangeDescriptorNode) {
181
180
@@ -197,9 +196,9 @@ static bool parseDescriptorRange(LLVMContext *Ctx,
197
196
.Case (" UAV" , llvm::to_underlying (dxbc::DescriptorRangeType::UAV))
198
197
.Case (" Sampler" ,
199
198
llvm::to_underlying (dxbc::DescriptorRangeType::Sampler))
200
- .Default (- 1u );
199
+ .Default (~ 0U );
201
200
202
- if (Range.RangeType == - 1u )
201
+ if (Range.RangeType == ~ 0U )
203
202
return reportError (Ctx, " Invalid Descriptor Range type: " + *ElementText);
204
203
205
204
if (std::optional<uint32_t > Val = extractMdIntValue (RangeDescriptorNode, 1 ))
@@ -254,7 +253,7 @@ static bool parseDescriptorTable(LLVMContext *Ctx,
254
253
if (Element == nullptr )
255
254
return reportError (Ctx, " Missing Root Element Metadata Node." );
256
255
257
- if (parseDescriptorRange (Ctx, RSD, Table, Element))
256
+ if (parseDescriptorRange (Ctx, Table, Element))
258
257
return true ;
259
258
}
260
259
@@ -354,8 +353,8 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
354
353
355
354
if (Version == 1 ) {
356
355
if (IsSampler)
357
- return Flags == FlagT::NONE ;
358
- return Flags == FlagT::DESCRIPTORS_VOLATILE;
356
+ return Flags == FlagT::DESCRIPTORS_VOLATILE ;
357
+ return Flags == ( FlagT::DATA_VOLATILE | FlagT:: DESCRIPTORS_VOLATILE) ;
359
358
}
360
359
361
360
// The data-specific flags are mutually exclusive.
@@ -392,7 +391,10 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
392
391
Mask |= FlagT::DATA_STATIC;
393
392
Mask |= FlagT::DATA_STATIC_WHILE_SET_AT_EXECUTE;
394
393
}
395
- return (Flags & ~Mask) == FlagT::NONE;
394
+
395
+ if (!IsSampler)
396
+ return (Flags & ~Mask) == FlagT::NONE;
397
+ return false ;
396
398
}
397
399
398
400
// When no descriptor flag is set, any data flag is allowed.
0 commit comments