[llvm] [DX] Add support for program signatures (PR #67346)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 15:44:54 PDT 2023


================
@@ -232,6 +233,36 @@ class PSVRuntimeInfo {
   }
 };
 
+class Signature {
+  ViewArray<dxbc::ProgramSignatureElement> Parameters;
+  StringRef StringTable;
+
+public:
+  ViewArray<dxbc::ProgramSignatureElement>::iterator begin() const {
+    return Parameters.begin();
+  }
+
+  ViewArray<dxbc::ProgramSignatureElement>::iterator end() const {
+    return Parameters.end();
+  }
+
+  StringRef getName(uint32_t Idx) const {
+    if (Idx == 0)
+      return "";
----------------
bogner wrote:

Could probably use a comment here - It's not obvious to me why an index of zero should be an empty name rather than some kind of error. I also don't think this path is tested.

https://github.com/llvm/llvm-project/pull/67346


More information about the llvm-commits mailing list