[clang] [llvm] [VK][HLSL][SPIRV] Accept vk::builtin("PointSize") on pixel shader inputs (PR #243513)
Gregory Roth via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 24 12:02:20 PST 2026
================
@@ -1075,7 +1075,11 @@ static void validateVkBuiltinUsage(Sema &S, FunctionDecl *FD,
((Stage == llvm::Triple::Vertex && IsOut) ||
Stage == llvm::Triple::Hull || Stage == llvm::Triple::Domain ||
Stage == llvm::Triple::Geometry ||
- (Stage == llvm::Triple::Mesh && IsOut));
+ (Stage == llvm::Triple::Mesh && IsOut) ||
+ // Allowed so a pixel shader can take the vertex shader's output
+ // struct. The SPIR-V backend rejects the module if the input is
+ // still used after optimization.
+ (Stage == llvm::Triple::Pixel && IsIn && !IsOut));
----------------
pow2clk wrote:
I don't object to this caution, but at present, IsIn and IsOut are mutually exclusive where this is passed in https://github.com/llvm/llvm-project/blob/3b140ba2c744e36517db2a46a9419d3c277b1c11/clang/lib/Sema/SemaHLSL.cpp#L1286-L1289
https://github.com/llvm/llvm-project/pull/243513
More information about the cfe-commits
mailing list