[Mesa-dev] [PATCH 02/16] ir_to_mesa: Dump the optimized Mesa IR as well.

Eric Anholt eric at anholt.net
Wed May 28 11:37:33 PDT 2014


We were dumping the intial code generated before optimization, with
annotation, because we don't have support for tracking the annotation info
across optimization.  It's still really useful to see the optimized code,
though.
---
 src/mesa/program/ir_to_mesa.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 978b6cf..1b9a519 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2965,6 +2965,14 @@ get_mesa_program(struct gl_context *ctx,
       goto fail_exit;
    }
 
+   if (ctx->_Shader->Flags & GLSL_DUMP) {
+      fprintf(stderr, "\n");
+      fprintf(stderr, "Optimized Mesa IR for linked %s program %d:\n",
+              target_string, shader_program->Name);
+      _mesa_fprint_program_opt(stderr, prog, PROG_PRINT_DEBUG, true);
+      fflush(stderr);
+   }
+
    return prog;
 
 fail_exit:
-- 
2.0.0.rc2



More information about the mesa-dev mailing list