[HLSL] Add Semantic syntax, and SV_GroupIndex
authorChris Bieneman <chris.bieneman@me.com>
Wed, 30 Mar 2022 19:20:15 +0000 (14:20 -0500)
committerChris Bieneman <chris.bieneman@me.com>
Thu, 14 Apr 2022 15:21:58 +0000 (10:21 -0500)
commit1fdf952deeb9a02aa34794af3c1a7d13a30e068e
treeaf3a219c2a4c0a2d369c567cce93158014f9c754
parent4f1065156b828f447b8b1a6848c3264184b5c860
[HLSL] Add Semantic syntax, and SV_GroupIndex

HLSL has a language feature called Semantics which get attached to
declarations like attributes and are used in a variety of ways.

One example of semantic use is here with the `SV_GroupIndex` semantic
which, when applied to an input for a compute shader is pre-populated
by the driver with a flattened thread index.

Differential Revision: https://reviews.llvm.org/D122699

# Conflicts:
# clang/include/clang/Basic/Attr.td
# clang/include/clang/Basic/AttrDocs.td
14 files changed:
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Basic/AttributeCommonInfo.h
clang/include/clang/Basic/Attributes.h
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Parse/Parser.h
clang/lib/Parse/CMakeLists.txt
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseHLSL.cpp [new file with mode: 0644]
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/ParserHLSL/lit.local.cfg [new file with mode: 0644]
clang/test/ParserHLSL/semantic_parsing.hlsl [new file with mode: 0644]
clang/test/SemaHLSL/Semantics/entry_parameter.hlsl [new file with mode: 0644]
clang/utils/TableGen/ClangAttrEmitter.cpp