gallium: added st_print_shaders() function to help w/ debugging
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 6 Nov 2008 22:00:01 +0000 (15:00 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 6 Nov 2008 22:00:01 +0000 (15:00 -0700)
src/mesa/state_tracker/st_program.c
src/mesa/state_tracker/st_program.h

index 55b52c374516a7a61ce9761436f5d73f7f91e0f2..af0df22dc59cc6ecb13dcd1c1a6faec5818b5090 100644 (file)
@@ -512,3 +512,19 @@ st_translate_fragment_program(struct st_context *st,
       tgsi_dump( fs.tokens, 0/*TGSI_DUMP_VERBOSE*/ );
 }
 
+
+/**
+ * Debug- print current shader text
+ */
+void
+st_print_shaders(GLcontext *ctx)
+{
+   struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
+   if (shProg) {
+      GLuint i;
+      for (i = 0; i < shProg->NumShaders; i++) {
+         printf("GLSL shader %u of %u:\n", i, shProg->NumShaders);
+         printf("%s\n", shProg->Shaders[i]->Source);
+      }
+   }
+}
index 078e2c42a6960bf60c8cb9d34e6384e37e7ccb3d..e2e5eddef22c170bc0e86de2dcca2d928d42a012 100644 (file)
@@ -151,4 +151,8 @@ st_translate_vertex_program(struct st_context *st,
                             const ubyte *fs_input_semantic_index);
 
 
+extern void
+st_print_shaders(GLcontext *ctx);
+
+
 #endif