From: Brian Date: Tue, 9 Oct 2007 20:12:26 +0000 (-0600) Subject: Use linked fragment shader inputs (if present) to determine which outputs are needed. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94490f63c8294efbce8822cf2be6da9be67c8789;p=mesa.git Use linked fragment shader inputs (if present) to determine which outputs are needed. --- diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index f923b8e1326..b28102b1b91 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -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);