diff options
author | Kenneth Graunke <[email protected]> | 2012-09-19 13:27:58 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-09-29 00:36:45 -0700 |
commit | 33dbac78a8b6094e3b266fbfa0ee0b33bd859a76 (patch) | |
tree | 826c35719ca577cfdcb95a5c7d2c7df366a794cd /src | |
parent | 5cadb3ef7e6c1a67c45b0fdb2b0c2c1a369a97d8 (diff) |
i965: Dump linked shaders on MESA_GLSL=dump.
Often, the original shader IR isn't terribly interesting because a lot
of crucial optimizations haven't been done (such as inlining built-ins).
ir_to_mesa used to print this out for us, but since we don't use it, we
have to do it ourselves.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 54545c0df74..1cd9095f2ea 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -210,6 +210,15 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) _mesa_associate_uniform_storage(ctx, shProg, prog->Parameters); _mesa_reference_program(ctx, &prog, NULL); + + if (ctx->Shader.Flags & GLSL_DUMP) { + static const char *target_strings[] + = { "vertex", "fragment", "geometry" }; + printf("\n"); + printf("GLSL IR for linked %s program %d:\n", target_strings[stage], + shProg->Name); + _mesa_print_ir(shader->base.ir, NULL); + } } if (!brw_shader_precompile(ctx, shProg)) |