From 54c48a95e6e0573886433f94ac83293876ffe03d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 Feb 2011 15:48:27 -0800 Subject: mesa: Add partial constant propagation pass for Mesa IR This cleans up some code generated by the IR-to-Mesa pass for i915. In particular, some shaders involving arrays of constant matrices result in really bad code. v2: Silence several warnings from merging the gl_constant_value work. Fix DP[23] folding. Add support for a bunch more opcodes that appear in piglit runs on i915. Reviewed-by: Eric Anholt --- src/mesa/program/prog_optimize.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/program/prog_optimize.c') diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c index 3340ce0498b..25d9684b137 100644 --- a/src/mesa/program/prog_optimize.c +++ b/src/mesa/program/prog_optimize.c @@ -1358,6 +1358,8 @@ _mesa_optimize_program(struct gl_context *ctx, struct gl_program *program) any_change = GL_TRUE; if (_mesa_remove_dead_code_local(program)) any_change = GL_TRUE; + + any_change = _mesa_constant_fold(program) || any_change; _mesa_reallocate_registers(program); } while (any_change); } -- cgit v1.2.3