gallium: added st_print_shaders() function to help w/ debugging

This commit is contained in:
Brian Paul
2008-11-06 15:00:01 -07:00
parent 6c3e7365d5
commit 678f80b347
2 changed files with 20 additions and 0 deletions
+16
View 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);
}
}
}
+4
View 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