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 91e58f58316ad2d737ae7f5bb8816de268df4b66..340c7ec69f61eb26d6356b4c126c50332d97402f 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 cc61436f53c4777dfcec7982c470d1d1512c2684..9c2994fddf363a2e73072b56ad0a565801ce2797 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);
    }