Always update st->state.vs, not just when the program is dirty.
authorBrian <brian.paul@tungstengraphics.com>
Thu, 20 Sep 2007 19:39:17 +0000 (13:39 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 20 Sep 2007 19:43:23 +0000 (13:43 -0600)
This fixes a regression in the cubemap.c demo which alternates between
two different vertex shaders.

src/mesa/state_tracker/st_atom_fs.c
src/mesa/state_tracker/st_atom_vs.c

index 91e58f5..340c7ec 100644 (file)
@@ -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);
    }
index cc61436..9c2994f 100644 (file)
@@ -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);
    }