Add support for GLSLstd450Cross ExtInst Fixes dEQP-VK.glsl.operator.geometric.cross.* Bug: b/127804400 Change-Id: I62337ba547048426c76adb1e90a1ebc4079e2a3d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26571 Tested-by: Chris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp index 7d293f7..f63c9fe 100644 --- a/src/Pipeline/SpirvShader.cpp +++ b/src/Pipeline/SpirvShader.cpp
@@ -1699,6 +1699,15 @@ } break; } + case GLSLstd450Cross: + { + auto lhs = GenericValue(this, routine, insn.word(5)); + auto rhs = GenericValue(this, routine, insn.word(6)); + dst.emplace(0, lhs[1] * rhs[2] - rhs[1] * lhs[2]); + dst.emplace(1, lhs[2] * rhs[0] - rhs[2] * lhs[0]); + dst.emplace(2, lhs[0] * rhs[1] - rhs[0] * lhs[1]); + break; + } default: UNIMPLEMENTED("Unhandled ExtInst %d", extInstIndex); }