From ce0844b44cb3924323ed1fd2b75cda4dbd0013c7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Apr 2010 10:24:54 -0600 Subject: [PATCH] st/mesa: move/improve Mesa GPU program debugging Print the program (plus its parameters) before calling st_translate_mesa_program() in case we die in that function. --- src/mesa/state_tracker/st_program.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 6e8c446f783..772a2ee17c9 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -217,6 +217,12 @@ st_translate_vertex_program(struct st_context *st, num_outputs++; } + if (ST_DEBUG & DEBUG_MESA) { + _mesa_print_program(&stvp->Base.Base); + _mesa_print_program_parameters(st->ctx, &stvp->Base.Base); + debug_printf("\n"); + } + error = st_translate_mesa_program(st->ctx, TGSI_PROCESSOR_VERTEX, @@ -246,11 +252,6 @@ st_translate_vertex_program(struct st_context *st, vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->tgsi); - if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { - _mesa_print_program(&stvp->Base.Base); - debug_printf("\n"); - } - if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( vpv->tgsi.tokens, 0 ); debug_printf("\n"); @@ -423,6 +424,11 @@ st_translate_fragment_program(struct st_context *st, if (ureg == NULL) return; + if (ST_DEBUG & DEBUG_MESA) { + _mesa_print_program(&stfp->Base.Base); + _mesa_print_program_parameters(st->ctx, &stfp->Base.Base); + debug_printf("\n"); + } error = st_translate_mesa_program(st->ctx, @@ -445,11 +451,6 @@ st_translate_fragment_program(struct st_context *st, ureg_destroy( ureg ); stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi); - if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { - _mesa_print_program(&stfp->Base.Base); - debug_printf("\n"); - } - if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); debug_printf("\n"); -- 2.30.2