summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-07-02 11:37:39 -0700
committerEric Anholt <eric@anholt.net>2010-07-02 11:38:02 -0700
commit28faa12dc2413d93c7f4778327a5e7c4c8f57c85 (patch)
tree1fea763598b8725ad2ece0f0a72b7b6a320b4857
parent9a0e421983edc31371440c08687fa2bb2207924d (diff)
ir_to_mesa: Don't forget to run the Mesa IR optimization passes.
With how we generate assignments, the trivial copy propagation in it is really important, and some drivers will really want the register allocation, too.
-rw-r--r--src/mesa/shader/ir_to_mesa.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index d5664e7b91..11fb7b9f16 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -44,6 +44,7 @@
extern "C" {
#include "main/mtypes.h"
#include "shader/prog_instruction.h"
+#include "shader/prog_optimize.h"
#include "shader/prog_print.h"
#include "shader/program.h"
#include "shader/prog_uniform.h"
@@ -1675,6 +1676,10 @@ get_mesa_program(GLcontext *ctx, void *mem_ctx, struct gl_shader *shader)
_mesa_reference_program(ctx, &shader->Program, prog);
+ if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
+ _mesa_optimize_program(ctx, prog);
+ }
+
return prog;
}