[clang] [HLSL] make semantic matching case insensitive (PR #129773)
Sarah Spall via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 7 13:44:02 PST 2025
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/129773
>From 6c2e22d2fa59f34401156ac6fd85c44730bf8c45 Mon Sep 17 00:00:00 2001
From: Sarah Spall <sarahspall at microsoft.com>
Date: Tue, 4 Mar 2025 12:58:13 -0800
Subject: [PATCH 1/2] make semantics case insensitive. update tests. add new
tests
---
clang/include/clang/Basic/Attr.td | 8 ++---
clang/lib/Parse/ParseHLSL.cpp | 2 ++
clang/test/ParserHLSL/semantic_parsing.hlsl | 2 +-
clang/test/SemaHLSL/Semantics/groupindex.hlsl | 12 +++----
.../Semantics/invalid_entry_parameter.hlsl | 32 +++++++++----------
.../Semantics/valid_entry_parameter.hlsl | 18 +++++++++++
6 files changed, 47 insertions(+), 27 deletions(-)
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 458747a1f7155..973e6a6015e98 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -4724,21 +4724,21 @@ def HLSLNumThreads: InheritableAttr {
}
def HLSLSV_GroupThreadID: HLSLAnnotationAttr {
- let Spellings = [HLSLAnnotation<"SV_GroupThreadID">];
+ let Spellings = [HLSLAnnotation<"sv_groupthreadid">];
let Subjects = SubjectList<[ParmVar, Field]>;
let LangOpts = [HLSL];
let Documentation = [HLSLSV_GroupThreadIDDocs];
}
def HLSLSV_GroupID: HLSLAnnotationAttr {
- let Spellings = [HLSLAnnotation<"SV_GroupID">];
+ let Spellings = [HLSLAnnotation<"sv_groupid">];
let Subjects = SubjectList<[ParmVar, Field]>;
let LangOpts = [HLSL];
let Documentation = [HLSLSV_GroupIDDocs];
}
def HLSLSV_GroupIndex: HLSLAnnotationAttr {
- let Spellings = [HLSLAnnotation<"SV_GroupIndex">];
+ let Spellings = [HLSLAnnotation<"sv_groupindex">];
let Subjects = SubjectList<[ParmVar, GlobalVar]>;
let LangOpts = [HLSL];
let Documentation = [HLSLSV_GroupIndexDocs];
@@ -4790,7 +4790,7 @@ def HLSLPackOffset: HLSLAnnotationAttr {
}
def HLSLSV_DispatchThreadID: HLSLAnnotationAttr {
- let Spellings = [HLSLAnnotation<"SV_DispatchThreadID">];
+ let Spellings = [HLSLAnnotation<"sv_dispatchthreadid">];
let Subjects = SubjectList<[ParmVar, Field]>;
let LangOpts = [HLSL];
let Documentation = [HLSLSV_DispatchThreadIDDocs];
diff --git a/clang/lib/Parse/ParseHLSL.cpp b/clang/lib/Parse/ParseHLSL.cpp
index f4c109f9a81a2..423b919ffbbee 100644
--- a/clang/lib/Parse/ParseHLSL.cpp
+++ b/clang/lib/Parse/ParseHLSL.cpp
@@ -141,6 +141,8 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
return;
}
+ II = PP.getIdentifierInfo(II->getName().lower());
+
SourceLocation Loc = ConsumeToken();
if (EndLoc)
*EndLoc = Tok.getLocation();
diff --git a/clang/test/ParserHLSL/semantic_parsing.hlsl b/clang/test/ParserHLSL/semantic_parsing.hlsl
index 34df1805c5a95..0a921773c1d6f 100644
--- a/clang/test/ParserHLSL/semantic_parsing.hlsl
+++ b/clang/test/ParserHLSL/semantic_parsing.hlsl
@@ -3,5 +3,5 @@
// expected-error at +1 {{expected HLSL Semantic identifier}}
void Entry(int GI : ) { }
-// expected-error at +1 {{unknown HLSL semantic 'SV_IWantAPony'}}
+// expected-error at +1 {{unknown HLSL semantic 'sv_iwantapony'}}
void Pony(int GI : SV_IWantAPony) { }
diff --git a/clang/test/SemaHLSL/Semantics/groupindex.hlsl b/clang/test/SemaHLSL/Semantics/groupindex.hlsl
index a33e060c82906..d5f28f066cc65 100644
--- a/clang/test/SemaHLSL/Semantics/groupindex.hlsl
+++ b/clang/test/SemaHLSL/Semantics/groupindex.hlsl
@@ -4,26 +4,26 @@
[shader("compute")][numthreads(32,1,1)]
void compute(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'pixel' shaders}}
+// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'pixel' shaders}}
[shader("pixel")]
void pixel(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'vertex' shaders}}
+// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'vertex' shaders}}
[shader("vertex")]
void vertex(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'geometry' shaders}}
+// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'geometry' shaders}}
[shader("geometry")]
void geometry(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'domain' shaders}}
+// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'domain' shaders}}
[shader("domain")]
void domain(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'amplification' shaders}}
+// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'amplification' shaders}}
[shader("amplification")][numthreads(32,1,1)]
void amplification(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'mesh' shaders}}
+// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'mesh' shaders}}
[shader("mesh")][numthreads(32,1,1)]
void mesh(int GI : SV_GroupIndex) {}
diff --git a/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl b/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
index 1bb4ee5182d62..71131754fa4f1 100644
--- a/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
+++ b/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -x hlsl -ast-dump -verify -o - %s
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'SV_DispatchThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'sv_dispatchthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain(float ID : SV_DispatchThreadID) {
}
@@ -11,71 +11,71 @@ struct ST {
float b;
};
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'SV_DispatchThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'sv_dispatchthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain2(ST ID : SV_DispatchThreadID) {
}
void foo() {
-// expected-warning at +1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'sv_dispatchthreadid' attribute only applies to parameters and non-static data members}}
uint V : SV_DispatchThreadID;
}
struct ST2 {
-// expected-warning at +1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'sv_dispatchthreadid' attribute only applies to parameters and non-static data members}}
static uint X : SV_DispatchThreadID;
uint s : SV_DispatchThreadID;
};
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'sv_groupid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain_GID(float ID : SV_GroupID) {
}
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'sv_groupid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain2_GID(ST GID : SV_GroupID) {
}
void foo_GID() {
-// expected-warning at +1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'sv_groupid' attribute only applies to parameters and non-static data members}}
uint GIS : SV_GroupID;
}
struct ST2_GID {
-// expected-warning at +1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'sv_groupid' attribute only applies to parameters and non-static data members}}
static uint GID : SV_GroupID;
uint s_gid : SV_GroupID;
};
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'SV_GroupThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'sv_groupthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain_GThreadID(float ID : SV_GroupThreadID) {
}
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'SV_GroupThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'sv_groupthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain2_GThreadID(ST GID : SV_GroupThreadID) {
}
void foo_GThreadID() {
-// expected-warning at +1 {{'SV_GroupThreadID' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'sv_groupthreadid' attribute only applies to parameters and non-static data members}}
uint GThreadIS : SV_GroupThreadID;
}
struct ST2_GThreadID {
-// expected-warning at +1 {{'SV_GroupThreadID' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'sv_groupthreadid' attribute only applies to parameters and non-static data members}}
static uint GThreadID : SV_GroupThreadID;
uint s_gthreadid : SV_GroupThreadID;
};
[shader("vertex")]
-// expected-error at +4 {{attribute 'SV_GroupIndex' is unsupported in 'vertex' shaders, requires compute}}
-// expected-error at +3 {{attribute 'SV_DispatchThreadID' is unsupported in 'vertex' shaders, requires compute}}
-// expected-error at +2 {{attribute 'SV_GroupID' is unsupported in 'vertex' shaders, requires compute}}
-// expected-error at +1 {{attribute 'SV_GroupThreadID' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +4 {{attribute 'sv_groupindex' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +3 {{attribute 'sv_dispatchthreadid' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +2 {{attribute 'sv_groupid' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +1 {{attribute 'sv_groupthreadid' is unsupported in 'vertex' shaders, requires compute}}
void vs_main(int GI : SV_GroupIndex, uint ID : SV_DispatchThreadID, uint GID : SV_GroupID, uint GThreadID : SV_GroupThreadID) {}
diff --git a/clang/test/SemaHLSL/Semantics/valid_entry_parameter.hlsl b/clang/test/SemaHLSL/Semantics/valid_entry_parameter.hlsl
index 6781f9241df24..a2203692b582b 100644
--- a/clang/test/SemaHLSL/Semantics/valid_entry_parameter.hlsl
+++ b/clang/test/SemaHLSL/Semantics/valid_entry_parameter.hlsl
@@ -24,6 +24,12 @@ void CSMain3(uint3 : SV_DispatchThreadID) {
// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:20 'uint3'
// CHECK-NEXT: HLSLSV_DispatchThreadIDAttr
}
+[numthreads(8,8,1)]
+void CSMain4(uint3 : SV_DispatchThreadId) {
+// CHECK: FunctionDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> line:[[@LINE-1]]:6 CSMain4 'void (uint3)'
+// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:20 'uint3'
+// CHECK-NEXT: HLSLSV_DispatchThreadIDAttr
+}
[numthreads(8,8,1)]
void CSMain_GID(uint ID : SV_GroupID) {
@@ -49,6 +55,12 @@ void CSMain3_GID(uint3 : SV_GroupID) {
// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:24 'uint3'
// CHECK-NEXT: HLSLSV_GroupIDAttr
}
+[numthreads(8,8,1)]
+void CSMain4_GID(uint3 : Sv_GroupId) {
+// CHECK: FunctionDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> line:[[@LINE-1]]:6 CSMain4_GID 'void (uint3)'
+// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:24 'uint3'
+// CHECK-NEXT: HLSLSV_GroupIDAttr
+}
[numthreads(8,8,1)]
void CSMain_GThreadID(uint ID : SV_GroupThreadID) {
@@ -74,3 +86,9 @@ void CSMain3_GThreadID(uint3 : SV_GroupThreadID) {
// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:30 'uint3'
// CHECK-NEXT: HLSLSV_GroupThreadIDAttr
}
+[numthreads(8,8,1)]
+void CSMain4_GThreadID(uint3 : sv_GroupThreadid) {
+// CHECK: FunctionDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> line:[[@LINE-1]]:6 CSMain4_GThreadID 'void (uint3)'
+// CHECK-NEXT: ParmVarDecl 0x{{[0-9a-fA-F]+}} <{{.*}}> col:30 'uint3'
+// CHECK-NEXT: HLSLSV_GroupThreadIDAttr
+}
>From 94f9146c815faf57664fa0a646e2926c5e7a25ec Mon Sep 17 00:00:00 2001
From: Sarah Spall <sarahspall at microsoft.com>
Date: Fri, 7 Mar 2025 12:19:38 -0800
Subject: [PATCH 2/2] move where the attribute string is made lowercase so
error messages are in capitalization the user wrote
---
clang/lib/Basic/Attributes.cpp | 6 +++-
clang/lib/Parse/ParseHLSL.cpp | 2 --
clang/lib/Sema/SemaHLSL.cpp | 2 +-
clang/test/ParserHLSL/semantic_parsing.hlsl | 2 +-
clang/test/SemaHLSL/Semantics/groupindex.hlsl | 12 +++----
.../Semantics/invalid_entry_parameter.hlsl | 32 +++++++++----------
6 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/clang/lib/Basic/Attributes.cpp b/clang/lib/Basic/Attributes.cpp
index 2035d4c0a5768..6a070a99c8d96 100644
--- a/clang/lib/Basic/Attributes.cpp
+++ b/clang/lib/Basic/Attributes.cpp
@@ -143,13 +143,17 @@ static SmallString<64> normalizeName(const IdentifierInfo *Name,
StringRef ScopeName = normalizeAttrScopeName(Scope, SyntaxUsed);
StringRef AttrName = normalizeAttrName(Name, ScopeName, SyntaxUsed);
+ std::string StrAttrName = AttrName.str();
+ if (SyntaxUsed == AttributeCommonInfo::AS_HLSLAnnotation)
+ StrAttrName = AttrName.lower();
+
SmallString<64> FullName = ScopeName;
if (!ScopeName.empty()) {
assert(SyntaxUsed == AttributeCommonInfo::AS_CXX11 ||
SyntaxUsed == AttributeCommonInfo::AS_C23);
FullName += "::";
}
- FullName += AttrName;
+ FullName += StrAttrName;
return FullName;
}
diff --git a/clang/lib/Parse/ParseHLSL.cpp b/clang/lib/Parse/ParseHLSL.cpp
index 423b919ffbbee..f4c109f9a81a2 100644
--- a/clang/lib/Parse/ParseHLSL.cpp
+++ b/clang/lib/Parse/ParseHLSL.cpp
@@ -141,8 +141,6 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
return;
}
- II = PP.getIdentifierInfo(II->getName().lower());
-
SourceLocation Loc = ConsumeToken();
if (EndLoc)
*EndLoc = Tok.getLocation();
diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index bfe84b16218b7..cd16b2aa69ed8 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -752,7 +752,7 @@ void SemaHLSL::DiagnoseAttrStageMismatch(
HLSLShaderAttr::ConvertEnvironmentTypeToStr(ST));
});
Diag(A->getLoc(), diag::err_hlsl_attr_unsupported_in_stage)
- << A << llvm::Triple::getEnvironmentTypeName(Stage)
+ << A->getAttrName() << llvm::Triple::getEnvironmentTypeName(Stage)
<< (AllowedStages.size() != 1) << join(StageStrings, ", ");
}
diff --git a/clang/test/ParserHLSL/semantic_parsing.hlsl b/clang/test/ParserHLSL/semantic_parsing.hlsl
index 0a921773c1d6f..34df1805c5a95 100644
--- a/clang/test/ParserHLSL/semantic_parsing.hlsl
+++ b/clang/test/ParserHLSL/semantic_parsing.hlsl
@@ -3,5 +3,5 @@
// expected-error at +1 {{expected HLSL Semantic identifier}}
void Entry(int GI : ) { }
-// expected-error at +1 {{unknown HLSL semantic 'sv_iwantapony'}}
+// expected-error at +1 {{unknown HLSL semantic 'SV_IWantAPony'}}
void Pony(int GI : SV_IWantAPony) { }
diff --git a/clang/test/SemaHLSL/Semantics/groupindex.hlsl b/clang/test/SemaHLSL/Semantics/groupindex.hlsl
index d5f28f066cc65..a33e060c82906 100644
--- a/clang/test/SemaHLSL/Semantics/groupindex.hlsl
+++ b/clang/test/SemaHLSL/Semantics/groupindex.hlsl
@@ -4,26 +4,26 @@
[shader("compute")][numthreads(32,1,1)]
void compute(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'pixel' shaders}}
+// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'pixel' shaders}}
[shader("pixel")]
void pixel(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'vertex' shaders}}
+// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'vertex' shaders}}
[shader("vertex")]
void vertex(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'geometry' shaders}}
+// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'geometry' shaders}}
[shader("geometry")]
void geometry(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'domain' shaders}}
+// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'domain' shaders}}
[shader("domain")]
void domain(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'amplification' shaders}}
+// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'amplification' shaders}}
[shader("amplification")][numthreads(32,1,1)]
void amplification(int GI : SV_GroupIndex) {}
-// expected-error at +2 {{attribute 'sv_groupindex' is unsupported in 'mesh' shaders}}
+// expected-error at +2 {{attribute 'SV_GroupIndex' is unsupported in 'mesh' shaders}}
[shader("mesh")][numthreads(32,1,1)]
void mesh(int GI : SV_GroupIndex) {}
diff --git a/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl b/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
index 71131754fa4f1..1bb4ee5182d62 100644
--- a/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
+++ b/clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -x hlsl -ast-dump -verify -o - %s
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'sv_dispatchthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'SV_DispatchThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain(float ID : SV_DispatchThreadID) {
}
@@ -11,71 +11,71 @@ struct ST {
float b;
};
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'sv_dispatchthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'SV_DispatchThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain2(ST ID : SV_DispatchThreadID) {
}
void foo() {
-// expected-warning at +1 {{'sv_dispatchthreadid' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}}
uint V : SV_DispatchThreadID;
}
struct ST2 {
-// expected-warning at +1 {{'sv_dispatchthreadid' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}}
static uint X : SV_DispatchThreadID;
uint s : SV_DispatchThreadID;
};
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'sv_groupid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain_GID(float ID : SV_GroupID) {
}
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'sv_groupid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain2_GID(ST GID : SV_GroupID) {
}
void foo_GID() {
-// expected-warning at +1 {{'sv_groupid' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
uint GIS : SV_GroupID;
}
struct ST2_GID {
-// expected-warning at +1 {{'sv_groupid' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
static uint GID : SV_GroupID;
uint s_gid : SV_GroupID;
};
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'sv_groupthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'SV_GroupThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain_GThreadID(float ID : SV_GroupThreadID) {
}
[numthreads(8,8,1)]
-// expected-error at +1 {{attribute 'sv_groupthreadid' only applies to a field or parameter of type 'uint/uint2/uint3'}}
+// expected-error at +1 {{attribute 'SV_GroupThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
void CSMain2_GThreadID(ST GID : SV_GroupThreadID) {
}
void foo_GThreadID() {
-// expected-warning at +1 {{'sv_groupthreadid' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'SV_GroupThreadID' attribute only applies to parameters and non-static data members}}
uint GThreadIS : SV_GroupThreadID;
}
struct ST2_GThreadID {
-// expected-warning at +1 {{'sv_groupthreadid' attribute only applies to parameters and non-static data members}}
+// expected-warning at +1 {{'SV_GroupThreadID' attribute only applies to parameters and non-static data members}}
static uint GThreadID : SV_GroupThreadID;
uint s_gthreadid : SV_GroupThreadID;
};
[shader("vertex")]
-// expected-error at +4 {{attribute 'sv_groupindex' is unsupported in 'vertex' shaders, requires compute}}
-// expected-error at +3 {{attribute 'sv_dispatchthreadid' is unsupported in 'vertex' shaders, requires compute}}
-// expected-error at +2 {{attribute 'sv_groupid' is unsupported in 'vertex' shaders, requires compute}}
-// expected-error at +1 {{attribute 'sv_groupthreadid' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +4 {{attribute 'SV_GroupIndex' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +3 {{attribute 'SV_DispatchThreadID' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +2 {{attribute 'SV_GroupID' is unsupported in 'vertex' shaders, requires compute}}
+// expected-error at +1 {{attribute 'SV_GroupThreadID' is unsupported in 'vertex' shaders, requires compute}}
void vs_main(int GI : SV_GroupIndex, uint ID : SV_DispatchThreadID, uint GID : SV_GroupID, uint GThreadID : SV_GroupThreadID) {}
More information about the cfe-commits
mailing list