Rework matrix-related code.
authorBrian <brian@yutani.localnet.net>
Thu, 8 Mar 2007 16:38:35 +0000 (09:38 -0700)
committerBrian <brian@yutani.localnet.net>
Thu, 8 Mar 2007 16:38:35 +0000 (09:38 -0700)
commitde8172673e23bad1186553b91a7c22e65d93692a
tree98d34048bba510acc26f3e420e1bf52942cdde03
parent6ff0a04f7ccc6a7049bccedb3dc52382e854848b
Rework matrix-related code.

GLSL matrices are stored in column-major order while GL_ARB_vertex/fragment_program
use row-major.  So, need to use STATE_MATRIX_TRANSPOSE for built-in matrices.
Unfortunately, this means that the expression M * V isn't very efficient since we
need to extract the rows out of M.  And that's the typical expression for vertex
transformation:  gl_ModelViewProjectionMatrix * gl_Position.
Solve this inefficiency by looking for M*V expressions and replacing them
with V*Transpose(M).
Also, add support for GLSL 1.20's MatrixTranspose, Inverse and InverseTranspose
matrices.
src/mesa/shader/slang/library/slang_common_builtin.gc
src/mesa/shader/slang/library/slang_common_builtin_gc.h
src/mesa/shader/slang/library/slang_core.gc
src/mesa/shader/slang/library/slang_core_gc.h
src/mesa/shader/slang/slang_builtin.c
src/mesa/shader/slang/slang_codegen.c
src/mesa/shader/slang/slang_compile_operation.c
src/mesa/shader/slang/slang_compile_operation.h