From 94490f63c8294efbce8822cf2be6da9be67c8789 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 9 Oct 2007 14:12:26 -0600 Subject: [PATCH] Use linked fragment shader inputs (if present) to determine which outputs are needed. --- src/mesa/tnl/t_vp_build.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.30.2