nv50,nvc0: reset base element in draw_arrays
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 14 Oct 2011 20:22:04 +0000 (22:22 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 21 Oct 2011 21:00:39 +0000 (23:00 +0200)
It affects VERTEX_BUFFER_FIRST,COUNT submission, too.

src/gallium/drivers/nv50/nv50_vbo.c
src/gallium/drivers/nvc0/nvc0_vbo.c

index 82ac35e84eaf0c953d29335fdc35cf5fd4c11925..0ce19bec4af1426bc3cea152119d50e1541edd9e 100644 (file)
@@ -404,6 +404,12 @@ nv50_draw_arrays(struct nv50_context *nv50,
    struct nouveau_channel *chan = nv50->screen->base.channel;
    unsigned prim;
 
+   if (nv50->state.index_bias) {
+      BEGIN_RING(chan, RING_3D(VB_ELEMENT_BASE), 1);
+      OUT_RING  (chan, 0);
+      nv50->state.index_bias = 0;
+   }
+
    prim = nv50_prim_gl(mode);
 
    while (instance_count--) {
index 41b45521d8a8695bf93f14b22ea800637e3aff33..ac778a7491c5808c08901b9619eea7060711d41e 100644 (file)
@@ -382,6 +382,11 @@ nvc0_draw_arrays(struct nvc0_context *nvc0,
    struct nouveau_channel *chan = nvc0->screen->base.channel;
    unsigned prim;
 
+   if (nvc0->state.index_bias) {
+      IMMED_RING(chan, RING_3D(VB_ELEMENT_BASE), 0);
+      nvc0->state.index_bias = 0;
+   }
+
    prim = nvc0_prim_gl(mode);
 
    while (instance_count--) {