[clang] [HLSL][SPIR-V] Handle SV_Postion builtin in PS (PR #141759)
Nathan Gauër via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 06:09:05 PDT 2025
================
@@ -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";
----------------
Keenuts wrote:
Not sure what you mean by 'use language to indicate the range'.
The message says which type is expected, if I used `VT->getNumElements()` it would say what type has been given, not what's expected.
https://github.com/llvm/llvm-project/pull/141759
More information about the cfe-commits
mailing list