@@ -352,6 +352,8 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
352
352
(Type == llvm::to_underlying (dxbc::DescriptorRangeType::Sampler));
353
353
354
354
if (Version == 1 ) {
355
+ // Since the metadata is unversioned, we expect to explicitly see the values
356
+ // that map to the version 1 behaviour here.
355
357
if (IsSampler)
356
358
return Flags == FlagT::DESCRIPTORS_VOLATILE;
357
359
return Flags == (FlagT::DATA_VOLATILE | FlagT::DESCRIPTORS_VOLATILE);
@@ -395,9 +397,13 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
395
397
}
396
398
397
399
// When no descriptor flag is set, any data flag is allowed.
398
- if (!IsSampler)
399
- return (Flags & ~DataFlags) == FlagT::NONE;
400
- return (Flags & ~FlagT::NONE) == FlagT::NONE;
400
+ FlagT Mask = FlagT::NONE;
401
+ if (!IsSampler) {
402
+ Mask |= FlagT::DATA_VOLATILE;
403
+ Mask |= FlagT::DATA_STATIC;
404
+ Mask |= FlagT::DATA_STATIC_WHILE_SET_AT_EXECUTE;
405
+ }
406
+ return (Flags & ~Mask) == FlagT::NONE;
401
407
}
402
408
403
409
static bool validate (LLVMContext *Ctx, const mcdxbc::RootSignatureDesc &RSD) {
@@ -434,7 +440,7 @@ static bool validate(LLVMContext *Ctx, const mcdxbc::RootSignatureDesc &RSD) {
434
440
435
441
if (RSD.Version > 1 ) {
436
442
if (!verifyDescriptorFlag (Descriptor.Flags ))
437
- return reportValueError (Ctx, " DescriptorFlag " , Descriptor.Flags );
443
+ return reportValueError (Ctx, " DescriptorRangeFlag " , Descriptor.Flags );
438
444
}
439
445
break ;
440
446
}
0 commit comments