diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2007-11-20 22:34:55 +1100 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2007-11-20 22:34:55 +1100 |
commit | 0655cdcf48daecbe10ff8c16c443686a64848d1b (patch) | |
tree | ff9fb36d56d55ac325ee3552b8f61c36c4a51b80 /src/mesa/pipe/nv40 | |
parent | 0d0349faff07df663eb49fe1a7209e1c6a28505b (diff) |
nv40: force reupload of all consts on vtxprog change
Diffstat (limited to 'src/mesa/pipe/nv40')
-rw-r--r-- | src/mesa/pipe/nv40/nv40_state_emit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/pipe/nv40/nv40_state_emit.c b/src/mesa/pipe/nv40/nv40_state_emit.c index a29c70538f..3224c82999 100644 --- a/src/mesa/pipe/nv40/nv40_state_emit.c +++ b/src/mesa/pipe/nv40/nv40_state_emit.c @@ -42,11 +42,14 @@ nv40_state_update_vertprog(struct nv40_context *nv40) struct pipe_context *pipe = (struct pipe_context *)nv40; struct nv40_vertex_program *vp = nv40->vertprog.vp; float *map; - int i; + int i, force_consts = 0; if (!nv40->vertprog.vp->translated) nv40_vertprog_translate(nv40, nv40->vertprog.vp); + if (nv40->vertprog.vp != nv40->vertprog.active_vp) + force_consts = 1; + if (vp->num_consts) { map = pipe->winsys->buffer_map(pipe->winsys, nv40->vertprog.constant_buf, @@ -55,7 +58,8 @@ nv40_state_update_vertprog(struct nv40_context *nv40) uint pid = vp->consts[i].pipe_id; if (pid >= 0) { - if (!memcmp(vp->consts[i].value, &map[pid*4], + if (!force_consts && + !memcmp(vp->consts[i].value, &map[pid*4], 4 * sizeof(float))) continue; memcpy(vp->consts[i].value, &map[pid*4], |