Mesa (glsl2): ir_to_mesa: Don't do lowering passes on an errored-out shader .

Eric Anholt anholt at kemper.freedesktop.org
Mon Jul 19 17:03:24 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 4802fd905ae7c1a1122ec71c0556c2b19214a7fd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4802fd905ae7c1a1122ec71c0556c2b19214a7fd

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jul 19 09:44:30 2010 -0700

ir_to_mesa: Don't do lowering passes on an errored-out shader.

---

 src/mesa/shader/ir_to_mesa.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index c75a13d..a7799cc 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -2185,13 +2185,13 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
    if (!state->error && !state->translation_unit.is_empty())
       _mesa_ast_to_hir(shader->ir, state);
 
-   /* Lowering */
-   do_mat_op_to_vec(shader->ir);
-   do_mod_to_fract(shader->ir);
-   do_div_to_mul_rcp(shader->ir);
-
-   /* Optimization passes */
    if (!state->error && !shader->ir->is_empty()) {
+      /* Lowering */
+      do_mat_op_to_vec(shader->ir);
+      do_mod_to_fract(shader->ir);
+      do_div_to_mul_rcp(shader->ir);
+
+      /* Optimization passes */
       bool progress;
       do {
 	 progress = false;




More information about the mesa-commit mailing list