gallium: separate out floating-point CAPs into its own enum
[mesa.git] / src / gallium / drivers / nvc0 / nvc0_vbo.c
index 8a5bf8dc582bdd4398211465933f2e3c75926a85..50e99ac5df3476b97f10662895a7be9737bf42d4 100644 (file)
@@ -327,6 +327,8 @@ nvc0_vertex_arrays_validate(struct nvc0_context *nvc0)
    for (; i < nvc0->state.num_vtxelts; ++i) {
       BEGIN_RING(chan, RING_3D(VERTEX_ATTRIB_FORMAT(i)), 1);
       OUT_RING  (chan, NVC0_3D_VERTEX_ATTRIB_INACTIVE);
+      if (unlikely(nvc0->state.instance_elts & (1 << i)))
+         IMMED_RING(chan, RING_3D(VERTEX_ARRAY_PER_INSTANCE(i)), 0);
       BEGIN_RING(chan, RING_3D(VERTEX_ARRAY_FETCH(i)), 1);
       OUT_RING  (chan, 0);
    }
@@ -382,6 +384,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--) {
@@ -584,7 +591,8 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    if (nvc0->vbo_user && !(nvc0->dirty & (NVC0_NEW_VERTEX | NVC0_NEW_ARRAYS)))
       nvc0_update_user_vbufs(nvc0);
 
-   nvc0_state_validate(nvc0);
+   /* 8 as minimum to avoid immediate double validation of new buffers */
+   nvc0_state_validate(nvc0, ~0, 8);
 
    chan->flush_notify = nvc0_draw_vbo_flush_notify;