================
@@ -94,10 +144,56 @@ static bool parse(LLVMContext *Ctx, 
mcdxbc::RootSignatureDesc &RSD,
 
 static bool verifyRootFlag(uint32_t Flags) { return (Flags & ~0xfff) == 0; }
 
+static bool verifyShaderVisibility(dxbc::ShaderVisibility Flags) {
+  switch (Flags) {
+
+  case dxbc::ShaderVisibility::All:
+  case dxbc::ShaderVisibility::Vertex:
+  case dxbc::ShaderVisibility::Hull:
+  case dxbc::ShaderVisibility::Domain:
+  case dxbc::ShaderVisibility::Geometry:
+  case dxbc::ShaderVisibility::Pixel:
+  case dxbc::ShaderVisibility::Amplification:
+  case dxbc::ShaderVisibility::Mesh:
+    return true;
+  }
+
+  return false;
+}
+
+static bool verifyParameterType(dxbc::RootParameterType Flags) {
+  switch (Flags) {
+  case dxbc::RootParameterType::Constants32Bit:
----------------
joaosaffran wrote:

We are reusing the structures defined in `mcdxbc`, these structs are used to 
serialize the Root Signature into the binary format. This is used in 
`obj2yaml/yaml2obj` binary. Those require to be `uint32_t`, that is the value 
that will be actually encoded in the binary and, most importantly, 
`obj2yaml/yaml2obj` must be able to write invalid root signatures, and that is 
not possible using an enum, due to a limitation of the yaml infrastructure.

https://github.com/llvm/llvm-project/pull/135085
_______________________________________________
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