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:
@@ -217,6 +217,12 @@ st_translate_vertex_program(struct st_context *st,
|
|||||||
num_outputs++;
|
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 =
|
error =
|
||||||
st_translate_mesa_program(st->ctx,
|
st_translate_mesa_program(st->ctx,
|
||||||
TGSI_PROCESSOR_VERTEX,
|
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);
|
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) {
|
if (ST_DEBUG & DEBUG_TGSI) {
|
||||||
tgsi_dump( vpv->tgsi.tokens, 0 );
|
tgsi_dump( vpv->tgsi.tokens, 0 );
|
||||||
debug_printf("\n");
|
debug_printf("\n");
|
||||||
@@ -423,6 +424,11 @@ st_translate_fragment_program(struct st_context *st,
|
|||||||
if (ureg == NULL)
|
if (ureg == NULL)
|
||||||
return;
|
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 =
|
error =
|
||||||
st_translate_mesa_program(st->ctx,
|
st_translate_mesa_program(st->ctx,
|
||||||
@@ -445,11 +451,6 @@ st_translate_fragment_program(struct st_context *st,
|
|||||||
ureg_destroy( ureg );
|
ureg_destroy( ureg );
|
||||||
stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi);
|
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) {
|
if (ST_DEBUG & DEBUG_TGSI) {
|
||||||
tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ );
|
tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ );
|
||||||
debug_printf("\n");
|
debug_printf("\n");
|
||||||
|
Reference in New Issue
Block a user