summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtins/profiles/140.glsl
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-04-18 11:00:44 -0700
committerEric Anholt <[email protected]>2012-04-24 10:15:47 -0700
commite9df9636b986b09ba37095d963b388571f528e1b (patch)
treeffdcab788c28dfdcb0d9c89e19293c2872deb78a /src/glsl/builtins/profiles/140.glsl
parent7de1331662816d31fb9bed423b1e5372284a260e (diff)
glsl: Add implementation of inverse() for mat2/3/4.
This is taken from the ogl-math project, with Inverse renamed to adj (since it's not actually the inverse), transposed, and our types plugged in. There are potential CSE opportunities in this code (particularly for hardware with RCP but not DIV), but we should be doing CSE anyway, so don't hand-optimize. Fixes piglit inverse tests. Acked-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/builtins/profiles/140.glsl')
-rw-r--r--src/glsl/builtins/profiles/140.glsl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/builtins/profiles/140.glsl b/src/glsl/builtins/profiles/140.glsl
index 159e89def45..90e04816d4e 100644
--- a/src/glsl/builtins/profiles/140.glsl
+++ b/src/glsl/builtins/profiles/140.glsl
@@ -383,6 +383,10 @@ mat4x2 transpose(mat2x4 m);
mat3x4 transpose(mat4x3 m);
mat4x3 transpose(mat3x4 m);
+mat2 inverse(mat2 m);
+mat3 inverse(mat3 m);
+mat4 inverse(mat4 m);
+
/*
* 8.6 - Vector Relational Functions
*/