OSDN Git Service

Add support for GLSLstd450Cross ExtInst
authorChris Forbes <chrisforbes@google.com>
Fri, 8 Mar 2019 19:31:31 +0000 (11:31 -0800)
committerChris Forbes <chrisforbes@google.com>
Fri, 8 Mar 2019 19:57:27 +0000 (19:57 +0000)
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>

src/Pipeline/SpirvShader.cpp

index 7d293f7..f63c9fe 100644 (file)
@@ -1699,6 +1699,15 @@ namespace sw
                        }
                        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);
                }