summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_shader.c
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2013-05-03 12:01:20 +0400
committerVadim Girlin <[email protected]>2013-05-03 16:53:41 +0400
commit4ca67dbf0cc4cd509c225c5feb5e45387739a48b (patch)
treed95c7c86da5a7419b2ffba4f5e6bed0882d58e0c /src/gallium/drivers/r600/r600_shader.c
parentb4b3041132e5b73b263217b7c25ebec3f3d879ce (diff)
r600g: use old shader disassembler by default
New disassembler is not completely isolated yet from further processing in r600g/sb that is not required for printing the dump, so it has higher probability to fail in case of any unexpected features in the bytecode. This patch adds "sbdisasm" flag for R600_DEBUG that allows to use new disassembler in r600g/sb for shader dumps when shader optimization is not enabled. If shader optimization is enabled, new disassembler is used by default. 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.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index fd3fe3933a0..ab05b5ac997 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -141,6 +141,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
uint32_t *ptr;
bool dump = r600_can_dump_shader(rctx->screen, tgsi_get_processor_type(sel->tokens));
unsigned use_sb = rctx->screen->debug_flags & DBG_SB;
+ unsigned sb_disasm = use_sb || (rctx->screen->debug_flags & DBG_SB_DISASM);
shader->shader.bc.isa = rctx->isa;
@@ -163,21 +164,18 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
return r;
}
-#if 0
- if (dump) {
+ if (dump && !sb_disasm) {
fprintf(stderr, "--------------------------------------------------------------\n");
r600_bytecode_disasm(&shader->shader.bc);
fprintf(stderr, "______________________________________________________________\n");
- }
-#else
- if (dump || use_sb) {
- r = r600_sb_bytecode_process(rctx, &shader->shader.bc, &shader->shader, dump, use_sb);
+ } else if ((dump && sb_disasm) || use_sb) {
+ r = r600_sb_bytecode_process(rctx, &shader->shader.bc, &shader->shader,
+ dump, use_sb);
if (r) {
R600_ERR("r600_sb_bytecode_process failed !\n");
return r;
}
}
-#endif
/* Store the shader in a buffer. */
if (shader->bo == NULL) {
@@ -307,6 +305,8 @@ int r600_compute_shader_create(struct pipe_context * ctx,
boolean use_kill = false;
bool dump = (r600_ctx->screen->debug_flags & DBG_CS) != 0;
unsigned use_sb = r600_ctx->screen->debug_flags & DBG_SB_CS;
+ unsigned sb_disasm = use_sb ||
+ (r600_ctx->screen->debug_flags & DBG_SB_DISASM);
shader_ctx.bc = bytecode;
r600_bytecode_init(shader_ctx.bc, r600_ctx->chip_class, r600_ctx->family,
@@ -321,16 +321,12 @@ int r600_compute_shader_create(struct pipe_context * ctx,
}
r600_bytecode_build(shader_ctx.bc);
-#if 0
- if (dump) {
+ if (dump && !sb_disasm) {
r600_bytecode_disasm(shader_ctx.bc);
- }
-#else
- if (dump || use_sb) {
+ } else if ((dump && sb_disasm) || use_sb) {
if (r600_sb_bytecode_process(r600_ctx, shader_ctx.bc, NULL, dump, use_sb))
R600_ERR("r600_sb_bytecode_process failed!\n");
}
-#endif
free(bytes);
return 1;