================
@@ -730,10 +730,18 @@ llvm::Value *CGHLSLRuntime::emitSystemSemanticLoad(
}
if (SemanticName == "SV_POSITION") {
- if (CGM.getTriple().getEnvironment() == Triple::EnvironmentType::Pixel)
- return createSPIRVBuiltinLoad(B, CGM.getModule(), Type,
- Semantic->getAttrName()->getName(),
- /* BuiltIn::FragCoord */ 15);
+ if (CGM.getTriple().getEnvironment() == Triple::EnvironmentType::Pixel) {
+ if (CGM.getTarget().getTriple().isSPIRV())
+ return createSPIRVBuiltinLoad(B, CGM.getModule(), Type,
+ Semantic->getAttrName()->getName(),
+ /* BuiltIn::FragCoord */ 15);
+ if (CGM.getTarget().getTriple().isDXIL())
+ return emitDXILUserSemanticLoad(B, Type, Semantic, Index);
+ }
+
+ if (CGM.getTriple().getEnvironment() == Triple::EnvironmentType::Vertex) {
+ return emitUserSemanticLoad(B, Type, Decl, Semantic, Index);
+ }
}
llvm_unreachable("non-handled system semantic. FIXME.");
----------------
Keenuts wrote:
Sure, rephrased it a bit. Note this should never happen unless the
implementation is halfway done. If the user uses an unknown semantic, or a
semantic we don't support yet, SEMA will catch it. This is about a sync issue
between the Sema and codegen code.
https://github.com/llvm/llvm-project/pull/168735
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits