Use linked fragment shader inputs (if present) to determine which outputs are needed.
authorBrian <brian.paul@tungstengraphics.com>
Tue, 9 Oct 2007 20:12:26 +0000 (14:12 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 9 Oct 2007 20:12:26 +0000 (14:12 -0600)
src/mesa/tnl/t_vp_build.c

index f923b8e13264494c409c87af210e365742ce014c..b28102b1b91ecd07b5cf41cc11904564c26b1c32 100644 (file)
@@ -118,10 +118,17 @@ static struct state_key *make_state_key( GLcontext *ctx )
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    struct vertex_buffer *VB = &tnl->vb;
-   const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+   const struct gl_fragment_program *fp;
    struct state_key *key = CALLOC_STRUCT(state_key);
    GLuint i;
 
+   if (ctx->Shader.CurrentProgram &&
+       ctx->Shader.CurrentProgram->LinkStatus &&
+       ctx->Shader.CurrentProgram->FragmentProgram)
+      fp = ctx->Shader.CurrentProgram->FragmentProgram;
+   else
+      fp = ctx->FragmentProgram._Current;
+
    /* This now relies on texenvprogram.c being active:
     */
    assert(fp);