================
@@ -759,11 +767,14 @@ void CGHLSLRuntime::emitSystemSemanticStore(IRBuilder<>
&B, llvm::Value *Source,
std::optional<unsigned> Index) {
std::string SemanticName = Semantic->getAttrName()->getName().upper();
- if (SemanticName == "SV_POSITION")
- createSPIRVBuiltinStore(B, CGM.getModule(), Source,
- Semantic->getAttrName()->getName(),
- /* BuiltIn::Position */ 0);
- else
+ if (SemanticName == "SV_POSITION") {
+ if (CGM.getTarget().getTriple().isDXIL())
+ emitDXILUserSemanticStore(B, Source, Semantic, Index);
+ else if (CGM.getTarget().getTriple().isSPIRV())
+ createSPIRVBuiltinStore(B, CGM.getModule(), Source,
+ Semantic->getAttrName()->getName(),
+ /* BuiltIn::Position */ 0);
+ } else
llvm_unreachable("non-handled system semantic. FIXME.");
----------------
s-perron wrote:
This unreachable will not be hit if targeting a different target. Can we remove
the `else` so that this is hit in all cases that the semantic is not handled?
Also, are more meaningful message would be good.
https://github.com/llvm/llvm-project/pull/168735
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits