Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -769,23 +769,81 @@ void SemaHLSL::ActOnTopLevelFunction(FunctionDecl *FD) {
}
}
-bool SemaHLSL::isSemanticValid(FunctionDecl *FD, DeclaratorDecl *D) {
- const auto *AnnotationAttr = D->getAttr<HLSLAnnotationAttr>();
- if (AnnotationAttr) {
- CheckSemanticAnnotation(FD, D, AnnotationAttr);
- return true;
+HLSLSemanticAttr *SemaHLSL::createSemantic(const SemanticInfo &Info,
+ DeclaratorDecl *TargetDecl) {
+ std::string SemanticName = Info.Semantic->getAttrName()->getName().upper();
+
+ if (SemanticName == "SV_DISPATCHTHREADID") {
----------------
llvm-beanz wrote:
DXC does make the assumption that `SV_` prefixed semantics are system values
and that they have specific places they are allowed. It might be preferable to
check if the semantic name starts with `"SV_"` and have a separate function to
parse known system values to enums.
Here's an example of DXC rejecting an unknown system value:
https://godbolt.org/z/PqhsTE84E
The message is somewhat awkward, I'd rather we had something like "unsupported
system value semantic" for completely unrecognized values.
https://github.com/llvm/llvm-project/pull/159047
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits