summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-11-06 15:00:01 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-11-06 15:00:01 -0700
commit678f80b347801d925c07a774faee1ed3f716de15 (patch)
tree2939e976f2b3f4812e87fc6840a1d4cf7bd7b594
parent6c3e7365d5245cfad597cd69e2f8f689e62546b9 (diff)
gallium: added st_print_shaders() function to help w/ debugging
-rw-r--r--src/mesa/state_tracker/st_program.c16
-rw-r--r--src/mesa/state_tracker/st_program.h4
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 55b52c374..af0df22dc 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -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);
+ }
+ }
+}
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index 078e2c42a..e2e5eddef 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -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