================
@@ -236,21 +272,33 @@ 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 (!Reg) {
+      reportRegNotBound(M, RC, Binding);
+      continue;
+    }
 
-      if (RC != ResourceClass::SRV && RC != ResourceClass::UAV)
-        continue;
+    const auto *ParamInfo =
+        static_cast<const mcdxbc::RootParameterInfo *>(Reg->Cookie);
+
+    const bool IsRootSRVOrUAV =
+        RC == ResourceClass::SRV || RC == ResourceClass::UAV;
+    const bool IsDescriptorTable =
+        ParamInfo->Type == dxbc::RootParameterType::DescriptorTable;
+    const bool IsRawOrStructuredBuffer =
+        RK != ResourceKind::RawBuffer && RK != ResourceKind::StructuredBuffer;
+    if (IsRootSRVOrUAV && !IsDescriptorTable && IsRawOrStructuredBuffer) {
+      reportInvalidHandleTyError(M, RC, Binding);
+      continue;
+    }
 
-      if (ParamInfo->Type == dxbc::RootParameterType::DescriptorTable)
-        continue;
+    HasBindings = true;
+  }
 
-      if (RK != ResourceKind::RawBuffer && RK != 
ResourceKind::StructuredBuffer)
-        reportInvalidHandleTyError(M, RC, Binding);
-    } else {
-      reportRegNotBound(M, RC, Binding);
-    }
+  if (HasBindings && MMI.ShaderProfile != Triple::Compute) {
+    const dxbc::RootFlags Flags = dxbc::RootFlags(RSD.Flags);
+    const dxbc::RootFlags Mask = getEnvironmentDenyFlagMask(MMI.ShaderProfile);
----------------
bogner wrote:

Does this do the right thing for Library shaders? What about the various 
raytracing profiles (RayGeneration, Intersection, AnyHit, etc)? Is there some 
reason we can't get here for those?

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

Reply via email to