diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index de79618..d4b036a 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -2078,6 +2078,7 @@ out_unknown: int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, struct r600_vertex_element *ve) { + static int dump_shaders = -1; unsigned ndw, i; u32 *bytecode; unsigned fetch_resource_start = 0, format, num_format, format_comp; @@ -2153,6 +2154,17 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru S_SQ_VTX_WORD2_MEGA_FETCH(1); bytecode[8 + i * 4 + 3] = 0; } + if (dump_shaders == -1) + dump_shaders = debug_get_bool_option("R600_DUMP_SHADERS", FALSE); + + if (dump_shaders) { + fprintf(stderr, "--------------------------------------------------------------\n"); + for (i = 0; i < ndw; i++) { + fprintf(stderr, "%04d %08X\n", i, bytecode[i]); + } + fprintf(stderr, "______________________________________________________________\n"); + } + r600_bo_unmap(rctx->radeon, ve->fetch_shader); return 0; }