st/mesa: added st_print_current_vertex_program(), for debugging
authorBrian Paul <brianp@vmware.com>
Thu, 17 May 2012 21:48:50 +0000 (15:48 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 19 May 2012 14:28:56 +0000 (08:28 -0600)
src/mesa/state_tracker/st_program.c
src/mesa/state_tracker/st_program.h

index deee722cfa6514a3fd0a52636c1f5c31af2cfc9d..e6664fb7cc271a041c01739d0c6712e4c4c2d480 100644 (file)
@@ -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);
+      }
+   }
+}
index 6c4b4f6c37229fe60f69f6d700fafad52de551e3..23a262cccc00b6da6f0131dd939715fa67f8602a 100644 (file)
@@ -315,4 +315,8 @@ extern void
 st_destroy_program_variants(struct st_context *st);
 
 
+extern void
+st_print_current_vertex_program(void);
+
+
 #endif