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.
This commit is contained in:
Brian Paul 2010-04-28 10:24:54 -06:00
parent e0383d7bb6
commit ce0844b44c
1 changed files with 11 additions and 10 deletions

View File

@ -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");