Implement matrix inverse built-in
Inverse is emulated in HLSL by calculating the cofactor matrix and
dividing that with the determinant. This results in the transpose of the
inverse as is required. Better performing options might exist especially
for 4x4 matrices, but this is enough for a working implementation.
BUG=angle:859
Change-Id: I5185797cc1ed86865f5f4342707abdc2977a186b
Reviewed-on: https://chromium-review.googlesource.com/240331
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 5553960..23dcef3 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -522,6 +522,9 @@
case EOpDeterminant:
preString = "determinant(";
break;
+ case EOpInverse:
+ preString = "inverse(";
+ break;
case EOpAny:
preString = "any(";