================
@@ -236,22 +273,35 @@ static void validateRootSignature(Module &M,
         BoundRegs.findBoundReg(RC, Binding.Space, Binding.LowerBound,
                                Binding.LowerBound + Binding.Size - 1);
 
-    if (Reg != nullptr) {
-      const auto *ParamInfo =
-          static_cast<const mcdxbc::RootParameterInfo *>(Reg->Cookie);
-
-      if (RC != ResourceClass::SRV && RC != ResourceClass::UAV)
-        continue;
-
-      if (ParamInfo->Type == dxbc::RootParameterType::DescriptorTable)
-        continue;
-
-      if (RK != ResourceKind::RawBuffer && RK != 
ResourceKind::StructuredBuffer)
-        reportInvalidHandleTyError(M, RC, Binding);
-    } else {
+    if (!Reg) {
       reportRegNotBound(M, RC, Binding);
+      continue;
+    }
+
+    const auto *ParamInfo =
+        static_cast<const mcdxbc::RootParameterInfo *>(Reg->Cookie);
+
+    const bool IsSRVOrUAV =
+        RC == ResourceClass::SRV || RC == ResourceClass::UAV;
+    const bool IsDescriptorTable =
+        ParamInfo->Type == dxbc::RootParameterType::DescriptorTable;
+    const bool IsRawOrStructuredBuffer =
+        RK != ResourceKind::RawBuffer && RK != ResourceKind::StructuredBuffer;
+    if (IsSRVOrUAV && !IsDescriptorTable && IsRawOrStructuredBuffer) {
+      reportInvalidHandleTyError(M, RC, Binding);
+      continue;
     }
+
+    HasBindings = true;
   }
+  const std::optional<dxbc::RootFlags> Mask =
+      getEnvironmentDenyFlagMask(MMI.ShaderProfile);
+
+  if (!Mask.has_value() || !HasBindings)
+    return;
+
+  const dxbc::RootFlags Flags = dxbc::RootFlags(RSD.Flags);
----------------
joaosaffran wrote:

Yeah, `RSD.Flags` is validated when we read from the metadata, this data is not 
changed after such validation, so is valid. 

https://github.com/llvm/llvm-project/pull/153287
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to