[clang] [HLSL][SPIR-V] Handle SV_Postion builtin in PS (PR #141759)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 08:54:58 PDT 2025
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/141759 at github.com>
================
@@ -1147,6 +1154,26 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) {
HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
}
+bool SemaHLSL::diagnosePositionType(QualType T, const ParsedAttr &AL) {
+ const auto *VT = T->getAs<VectorType>();
+
+ if (!T->hasFloatingRepresentation() || (VT && VT->getNumElements() > 4)) {
+ Diag(AL.getLoc(), diag::err_hlsl_attr_invalid_type)
+ << AL << "float/float1/float2/float3";
----------------
farzonl wrote:
I was just thinking with shader model 6.9 allowing n dimensional vectors should we be future proof this so we don’t have to iterate all the float vectors. That said the coop vectors stuff is more for compute shaders so what you have is probably fine.
https://github.com/llvm/llvm-project/pull/141759
More information about the cfe-commits
mailing list