diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-10-13 13:58:44 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-10-27 13:35:53 -0700 |
commit | 84eba3ef71dfa822e5ff0463032cdd2e3515b888 (patch) | |
tree | dc737eed47f4e7ec35581a1ec9daf598765cb978 /src/mesa/state_tracker/st_draw.c | |
parent | 75c6f472880706dcbb9d1e20727fa8f71db8b11c (diff) |
Track separate programs for each stage
The assumption is that all stages are the same program or that
varyings are passed between stages using built-in varyings.
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 5387499eb9..61a0e1b087 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -547,11 +547,21 @@ setup_index_buffer(struct gl_context *ctx, static void check_uniforms(struct gl_context *ctx) { - const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - if (shProg && shProg->LinkStatus) { - GLuint i; - for (i = 0; i < shProg->Uniforms->NumUniforms; i++) { - const struct gl_uniform *u = &shProg->Uniforms->Uniforms[i]; + struct gl_shader_program *shProg[3] = { + ctx->Shader.CurrentVertexProgram, + ctx->Shader.CurrentGeometryProgram, + ctx->Shader.CurrentFragmentProgram, + }; + unsigned j; + + for (j = 0; j < 3; j++) { + unsigned i; + + if (shProg[j] == NULL || !shProg[j]->LinkStatus) + continue; + + for (i = 0; i < shProg[j]->Uniforms->NumUniforms; i++) { + const struct gl_uniform *u = &shProg[j]->Uniforms->Uniforms[i]; if (!u->Initialized) { _mesa_warning(ctx, "Using shader with uninitialized uniform: %s", |