aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_array.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-31 09:31:38 +0100
committermarha <marha@users.sourceforge.net>2012-10-31 09:31:38 +0100
commit5b22d4d5511efbd4fb0658c370edadd39829e39b (patch)
tree96a36b429ff2a0819653279a5e63a1bed79d4434 /mesalib/src/mesa/state_tracker/st_atom_array.c
parent7bc456b7052b9591a58bfb6b509abb09d5464990 (diff)
parent67c290de36ddc1caae94c0892157ac16b90e4f99 (diff)
downloadvcxsrv-5b22d4d5511efbd4fb0658c370edadd39829e39b.tar.gz
vcxsrv-5b22d4d5511efbd4fb0658c370edadd39829e39b.tar.bz2
vcxsrv-5b22d4d5511efbd4fb0658c370edadd39829e39b.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa git update 31 oct 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_array.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_array.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_array.c b/mesalib/src/mesa/state_tracker/st_atom_array.c
index ab46f1188..15f5d1c95 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_array.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_array.c
@@ -574,7 +574,13 @@ static void update_array(struct st_context *st)
num_velements = vpv->num_inputs;
}
- cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer);
+ cso_set_vertex_buffers(st->cso_context, 0, num_vbuffers, vbuffer);
+ if (st->last_num_vbuffers > num_vbuffers) {
+ /* Unbind remaining buffers, if any. */
+ cso_set_vertex_buffers(st->cso_context, num_vbuffers,
+ st->last_num_vbuffers - num_vbuffers, NULL);
+ }
+ st->last_num_vbuffers = num_vbuffers;
cso_set_vertex_elements(st->cso_context, num_velements, velements);
}
@@ -582,7 +588,7 @@ static void update_array(struct st_context *st)
const struct st_tracked_state st_update_array = {
"st_update_array", /* name */
{ /* dirty */
- (_NEW_PROGRAM | _NEW_BUFFER_OBJECT), /* mesa */
+ _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_VERTEX_ARRAYS | ST_NEW_VERTEX_PROGRAM, /* st */
},
update_array /* update */