diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2009-10-17 19:58:23 -0700 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2009-10-17 19:58:23 -0700 |
commit | 4a98d19d1b93651acd8f7f428151667e411ad718 (patch) | |
tree | 3661186a29c22374c22b328c03032dd1391b99b1 /src/mesa/shader/shader_api.c | |
parent | 3e56bef5a5f56feb65ae94a51e5db9cf943ce0ce (diff) | |
parent | 114417a2f52ab463f37fcabb5e9b0636574623dc (diff) |
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa/shader/shader_api.c')
-rw-r--r-- | src/mesa/shader/shader_api.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 6de97984e6..f473bd1173 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -390,6 +390,8 @@ get_shader_flags(void) flags |= GLSL_OPT; if (_mesa_strstr(env, "uniform")) flags |= GLSL_UNIFORMS; + if (_mesa_strstr(env, "useprog")) + flags |= GLSL_USE_PROG; } return flags; @@ -1524,19 +1526,32 @@ _mesa_use_program(GLcontext *ctx, GLuint program) } /* debug code */ - if (0) { + if (ctx->Shader.Flags & GLSL_USE_PROG) { GLuint i; - _mesa_printf("Use Shader Program %u\n", shProg->Name); + _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x, checksum %u\n", + const char *s; + switch (shProg->Shaders[i]->Type) { + case GL_VERTEX_SHADER: + s = "vertex"; + break; + case GL_FRAGMENT_SHADER: + s = "fragment"; + break; + case GL_GEOMETRY_SHADER: + s = "geometry"; + break; + default: + s = ""; + } + _mesa_printf(" %s shader %u, checksum %u\n", s, shProg->Shaders[i]->Name, - shProg->Shaders[i]->Type, shProg->Shaders[i]->SourceChecksum); } if (shProg->VertexProgram) - printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); if (shProg->FragmentProgram) - printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); } } else { |