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.
This commit is contained in:
Brian 2007-09-20 13:39:17 -06:00
parent 768302c539
commit 745f0cbe05
2 changed files with 10 additions and 7 deletions

View 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);
}

View 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);
}