[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 09:54:53 PST 2025
================
@@ -51,6 +51,38 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(unsigned BuiltinID,
TheCall->setType(RetTy);
break;
}
+ case SPIRV::BI__builtin_spirv_reflect: {
+ if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+
+ ExprResult A = TheCall->getArg(0);
+ QualType ArgTyA = A.get()->getType();
+ auto *VTyA = ArgTyA->getAs<VectorType>();
----------------
farzonl wrote:
I think the helpers you are thinking about might be in SemaHLSL.cpp. SemaSPIRV.cpp is very barebones. If you think there is a helper that could be used across both files, we probably want to move it to a more generic place.
https://github.com/llvm/llvm-project/pull/122992
More information about the llvm-commits
mailing list