glsl: Replace open-coded dot-product with dot

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Ian Romanick 2013-03-25 14:40:53 -07:00
parent dbf94d105a
commit 65cc68f430
1 changed files with 5 additions and 4 deletions

View File

@ -22,6 +22,10 @@
*/
#version 120
// Forward declaration because builtins don't know about other builtins.
float dot(vec4, vec4);
float determinant(mat2 m)
{
return m[0].x * m[1].y - m[1].x * m[0].y;
@ -63,8 +67,5 @@ float determinant(mat4 m)
adj_0.z = + (m[1].x * SubFactor01 - m[1].y * SubFactor03 + m[1].w * SubFactor05);
adj_0.w = - (m[1].x * SubFactor02 - m[1].y * SubFactor04 + m[1].z * SubFactor05);
return (+ m[0].x * adj_0.x
+ m[0].y * adj_0.y
+ m[0].z * adj_0.z
+ m[0].w * adj_0.w);
return dot(m[0], adj_0);
}