From 745f0cbe0528ac925096f5c1b85de7280fee7fbc Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 20 Sep 2007 13:39:17 -0600 Subject: [PATCH] Always update st->state.vs, not just when the program is dirty. This fixes a regression in the cubemap.c demo which alternates between two different vertex shaders. --- src/mesa/state_tracker/st_atom_fs.c | 8 +++++--- src/mesa/state_tracker/st_atom_vs.c | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mesa/state_tracker/st_atom_fs.c b/src/mesa/state_tracker/st_atom_fs.c index 91e58f5..340c7ec 100644 --- a/src/mesa/state_tracker/st_atom_fs.c +++ b/src/mesa/state_tracker/st_atom_fs.c @@ -177,11 +177,13 @@ static void update_fs( struct st_context *st ) /* if new binding, or shader has changed */ if (st->fp != stfp || stfp->dirty) { - /* Bind the program */ - st->fp = stfp; if (stfp->dirty) - st->state.fs = st_translate_fragment_shader( st, st->fp ); + (void) st_translate_fragment_shader( st, stfp ); + + /* Bind the vertex program and TGSI shader */ + st->fp = stfp; + st->state.fs = stfp->fs; st->pipe->bind_fs_state(st->pipe, st->state.fs->data); } diff --git a/src/mesa/state_tracker/st_atom_vs.c b/src/mesa/state_tracker/st_atom_vs.c index cc61436..9c2994f 100644 --- a/src/mesa/state_tracker/st_atom_vs.c +++ b/src/mesa/state_tracker/st_atom_vs.c @@ -188,11 +188,12 @@ static void update_vs( struct st_context *st ) } if (st->vp != stvp || stvp->dirty) { - /* Bind the vertex program */ - st->vp = stvp; - if (stvp->dirty) - st->state.vs = st_translate_vertex_shader( st, st->vp ); + (void) st_translate_vertex_shader( st, stvp ); + + /* Bind the vertex program and TGSI shader */ + st->vp = stvp; + st->state.vs = stvp->vs; st->pipe->bind_vs_state(st->pipe, st->state.vs->data); } -- 2.7.4