From 6792969cbc0d233942b15285e0fa84e6602733c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 17 May 2012 15:48:50 -0600 Subject: [PATCH] st/mesa: added st_print_current_vertex_program(), for debugging --- src/mesa/state_tracker/st_program.c | 23 +++++++++++++++++++++++ src/mesa/state_tracker/st_program.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index deee722cfa6..e6664fb7cc2 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -1285,3 +1285,26 @@ st_destroy_program_variants(struct st_context *st) _mesa_HashWalk(st->ctx->Shared->ShaderObjects, destroy_shader_program_variants_cb, st); } + + +/** + * For debugging, print/dump the current vertex program. + */ +void +st_print_current_vertex_program(void) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->VertexProgram._Current) { + struct st_vertex_program *stvp = + (struct st_vertex_program *) ctx->VertexProgram._Current; + struct st_vp_variant *stv; + + debug_printf("Vertex program %u\n", stvp->Base.Base.Id); + + for (stv = stvp->variants; stv; stv = stv->next) { + debug_printf("variant %p\n", stv); + tgsi_dump(stv->tgsi.tokens, 0); + } + } +} diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 6c4b4f6c372..23a262cccc0 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -315,4 +315,8 @@ extern void st_destroy_program_variants(struct st_context *st); +extern void +st_print_current_vertex_program(void); + + #endif -- 2.30.2