[llvm] [DX] Support pipeline state masks (PR #66425)

Chris B via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 19:34:09 PDT 2023


================
@@ -140,6 +159,22 @@ class PSVRuntimeInfo {
 
   const InfoStruct &getInfo() const { return BasicInfo; }
 
+  template <typename T> const T *getInfoAs() const {
+    if (const auto *P = std::get_if<dxbc::PSV::v2::RuntimeInfo>(&BasicInfo))
----------------
llvm-beanz wrote:

That wouldn’t do the same thing. This allows us to do `getInfoAs<dxbc::PSV::v1::RuntimeInfo>()` and get back a v1 pointer even when the underlying object is a `v2` object, or get a `v0` object regardless of the underlying type.

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


More information about the llvm-commits mailing list