From: Kenneth Graunke Date: Thu, 15 May 2014 21:12:48 +0000 (-0700) Subject: i965: Use brw_dump_compile for clip, SF, and old GS programs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3285bc97ef9f5f6bdf38ced121ddedd111a5e410;p=mesa.git i965: Use brw_dump_compile for clip, SF, and old GS programs. Looping over the instructions and calling brw_disasm doesn't handle compacted instructions. In most cases, this hasn't been a problem since we don't compact prior to Sandybridge. However, Sandybridge's transform feedback GS program should already be compacted, and so this ought to fix decoding of that. Signed-off-by: Kenneth Graunke Reviewed-by: Matt Turner --- diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 1c54b918d73..a164d15998e 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -55,7 +55,6 @@ static void compile_clip_prog( struct brw_context *brw, const GLuint *program; void *mem_ctx; GLuint program_size; - GLuint i; memset(&c, 0, sizeof(c)); @@ -119,9 +118,7 @@ static void compile_clip_prog( struct brw_context *brw, if (unlikely(INTEL_DEBUG & DEBUG_CLIP)) { fprintf(stderr, "clip:\n"); - for (i = 0; i < program_size / sizeof(struct brw_instruction); i++) - brw_disasm(stderr, &((struct brw_instruction *)program)[i], - brw->gen, false); + brw_dump_compile(brw, c.func.store, 0, program_size, stderr); fprintf(stderr, "\n"); } diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index eaa527f778f..72e5f5a14a8 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -135,12 +135,8 @@ static void compile_ff_gs_prog(struct brw_context *brw, program = brw_get_program(&c.func, &program_size); if (unlikely(INTEL_DEBUG & DEBUG_GS)) { - int i; - fprintf(stderr, "gs:\n"); - for (i = 0; i < program_size / sizeof(struct brw_instruction); i++) - brw_disasm(stderr, &((struct brw_instruction *)program)[i], - brw->gen, false); + brw_dump_compile(brw, c.func.store, 0, program_size, stderr); fprintf(stderr, "\n"); } diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 401fa7bf45a..5556c46d377 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -54,7 +54,6 @@ static void compile_sf_prog( struct brw_context *brw, const GLuint *program; void *mem_ctx; GLuint program_size; - GLuint i; memset(&c, 0, sizeof(c)); @@ -118,9 +117,7 @@ static void compile_sf_prog( struct brw_context *brw, if (unlikely(INTEL_DEBUG & DEBUG_SF)) { fprintf(stderr, "sf:\n"); - for (i = 0; i < program_size / sizeof(struct brw_instruction); i++) - brw_disasm(stderr, &((struct brw_instruction *)program)[i], - brw->gen, false); + brw_dump_compile(brw, c.func.store, 0, program_size, stderr); fprintf(stderr, "\n"); }