[clang] [llvm] [HLSL][SPIR-V] Add support for SV_Target semantic (PR #168743)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 24 06:12:48 PST 2025


Nathan =?utf-8?q?Gauër?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/168743 at github.com>


================
@@ -1010,14 +1010,26 @@ void SemaHLSL::diagnoseSemanticStageMismatch(
     if (Case.Stage != Stage)
       continue;
 
-    if (IsInput && Case.Direction & IOType::In)
+    if (IsInput && Case.AllowedIOTypesMask & IOType::In)
       return;
-    if (!IsInput && Case.Direction & IOType::Out)
+    if (!IsInput && Case.AllowedIOTypesMask & IOType::Out)
       return;
 
-    Diag(A->getLoc(), diag::err_hlsl_semantic_unsupported_direction_for_stage)
+    SmallVector<std::string, 8> ValidCases;
+    llvm::transform(
+        Allowed, std::back_inserter(ValidCases), [](SemanticStageInfo Case) {
+          std::string Type =
+              Case.AllowedIOTypesMask == IOType::InOut
+                  ? " inout"
----------------
s-perron wrote:

`inout` is a keyword in HLSL, and the message might come across as the parameter has to be `inout` (both an input and an output), not that it can be an input or an output.



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


More information about the llvm-commits mailing list