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

Submitted by Eric Anholt on May 28, 2014, 6:37 p.m.

Details

Message ID 1401302267-5038-3-git-send-email-eric@anholt.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Eric Anholt May 28, 2014, 6:37 p.m.
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(+)

Patch hide | download patch | download mbox

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: