summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/tnl/t_vp_build.c9
1 files changed, 8 insertions, 1 deletions
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);