diff options
author | Vadim Girlin <[email protected]> | 2013-02-01 11:46:29 +0400 |
---|---|---|
committer | Vadim Girlin <[email protected]> | 2013-02-01 12:08:42 +0400 |
commit | e42111ecbaca8b6dab3c8a7a8cbc295bb6b404eb (patch) | |
tree | 28237fd059a88da1d5a767047d12da393ee70c5b /src/gallium/drivers/r600/r600_shader.c | |
parent | 022122ee63b8a00afc23eaa347df934a79fb1d4c (diff) |
r600g: implement shader disassembler v3
R600_DUMP_SHADERS environment var now allows to choose dump method:
0 (default) - no dump
1 - full dump (old dump)
2 - disassemble
3 - both
v2: fix output for burst_count > 1
v3: use more human-readable output for kcache data in CF_ALU_xxx clauses,
improve output for ALU_EXTENDED, other minor fixes
Signed-off-by: Vadim Girlin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index f30ca42c16f..8d07b638555 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -142,7 +142,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx, /* Would like some magic "get_bool_option_once" routine. */ if (dump_shaders == -1) - dump_shaders = debug_get_bool_option("R600_DUMP_SHADERS", FALSE); + dump_shaders = debug_get_num_option("R600_DUMP_SHADERS", 0); if (dump_shaders) { fprintf(stderr, "--------------------------------------------------------------\n"); @@ -162,10 +162,17 @@ int r600_pipe_shader_create(struct pipe_context *ctx, R600_ERR("building bytecode failed !\n"); return r; } - if (dump_shaders) { + if (dump_shaders & 1) { + fprintf(stderr, "--------------------------------------------------------------\n"); r600_bytecode_dump(&shader->shader.bc); fprintf(stderr, "______________________________________________________________\n"); } + if (dump_shaders & 2) { + fprintf(stderr, "--------------------------------------------------------------\n"); + r600_bytecode_disasm(&shader->shader.bc); + fprintf(stderr, "______________________________________________________________\n"); + } + return r600_pipe_shader(ctx, shader); } |