diff options
author | Brian <[email protected]> | 2008-04-03 21:51:31 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2008-04-03 21:51:31 -0600 |
commit | 1757acc293b936f0196e983ddea281c346952c45 (patch) | |
tree | b08229bc872a65d3c18a64f74e1799d743afb7bd /src/mesa/shader/slang/slang_codegen.c | |
parent | 96b4ac05be90df6ada88eb7bd64283aff4964655 (diff) |
rewrite some of the mat*mat, mat*vec intrinsics
Also, remove obsolete matrix codegen code.
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index f6ea57b3f2e..ebead3274e1 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2515,49 +2515,6 @@ _slang_gen_subscript(slang_assemble_ctx * A, slang_operation *oper) /** - * Look for expressions such as: gl_ModelviewMatrix * gl_Vertex - * and replace with this: gl_Vertex * gl_ModelviewMatrixTranpose - * Since matrices are stored in column-major order, the second form of - * multiplication is much more efficient (just 4 dot products). - */ -static void -_slang_check_matmul_optimization(slang_assemble_ctx *A, slang_operation *oper) -{ - static const struct { - const char *orig; - const char *tranpose; - } matrices[] = { - {"gl_ModelViewMatrix", "gl_ModelViewMatrixTranspose"}, - {"gl_ProjectionMatrix", "gl_ProjectionMatrixTranspose"}, - {"gl_ModelViewProjectionMatrix", "gl_ModelViewProjectionMatrixTranspose"}, - {"gl_TextureMatrix", "gl_TextureMatrixTranspose"}, - {"gl_NormalMatrix", "__NormalMatrixTranspose"}, - { NULL, NULL } - }; - - assert(oper->type == SLANG_OPER_MULTIPLY); - if (oper->children[0].type == SLANG_OPER_IDENTIFIER) { - GLuint i; - for (i = 0; matrices[i].orig; i++) { - if (oper->children[0].a_id - == slang_atom_pool_atom(A->atoms, matrices[i].orig)) { - /* - _mesa_printf("Replace %s with %s\n", - matrices[i].orig, matrices[i].tranpose); - */ - assert(oper->children[0].type == SLANG_OPER_IDENTIFIER); - oper->children[0].a_id - = slang_atom_pool_atom(A->atoms, matrices[i].tranpose); - /* finally, swap the operands */ - _slang_operation_swap(&oper->children[0], &oper->children[1]); - return; - } - } - } -} - - -/** * Generate IR tree for a slang_operation (AST node) */ static slang_ir_node * @@ -2690,7 +2647,6 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) { slang_ir_node *n; assert(oper->num_children == 2); - _slang_check_matmul_optimization(A, oper); n = _slang_gen_function_call_name(A, "*", oper, NULL); return n; } |