@@ -352,6 +352,8 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
352352 (Type == llvm::to_underlying (dxbc::DescriptorRangeType::Sampler));
353353
354354 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.
355357 if (IsSampler)
356358 return Flags == FlagT::DESCRIPTORS_VOLATILE;
357359 return Flags == (FlagT::DATA_VOLATILE | FlagT::DESCRIPTORS_VOLATILE);
@@ -395,9 +397,13 @@ static bool verifyDescriptorRangeFlag(uint32_t Version, uint32_t Type,
395397 }
396398
397399 // 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;
401407}
402408
403409static bool validate (LLVMContext *Ctx, const mcdxbc::RootSignatureDesc &RSD) {
@@ -434,7 +440,7 @@ static bool validate(LLVMContext *Ctx, const mcdxbc::RootSignatureDesc &RSD) {
434440
435441 if (RSD.Version > 1 ) {
436442 if (!verifyDescriptorFlag (Descriptor.Flags ))
437- return reportValueError (Ctx, " DescriptorFlag " , Descriptor.Flags );
443+ return reportValueError (Ctx, " DescriptorRangeFlag " , Descriptor.Flags );
438444 }
439445 break ;
440446 }
0 commit comments