dri/nouveau: Optimize VBO binding re-emission.
[mesa.git] / src / mesa / drivers / dri / nouveau / nv10_render.c
index 4a396f88937cd7015ba994215705724f8c6e8339..94ff3ed01e274361199214a3254e64c3db15baa4 100644 (file)
@@ -138,7 +138,6 @@ nv10_render_bind_vertices(struct gl_context *ctx)
 {
        struct nouveau_render_state *render = to_render_state(ctx);
        struct nouveau_bo_context *bctx = context_bctx(ctx, VERTEX);
-       struct nouveau_channel *chan = context_chan(ctx);
        struct nouveau_grobj *celsius = context_eng3d(ctx);
        int i, attr;
 
@@ -150,15 +149,16 @@ nv10_render_bind_vertices(struct gl_context *ctx)
                                 a->bo, a->offset,
                                 NOUVEAU_BO_GART | NOUVEAU_BO_RD);
        }
-
-       BEGIN_RING(chan, celsius, NV10TCL_VERTEX_ARRAY_VALIDATE, 1);
-       OUT_RING(chan, 0);
 }
 
 /* Vertex array rendering defs. */
 #define RENDER_LOCALS(ctx)                                     \
        struct nouveau_grobj *celsius = context_eng3d(ctx)
 
+#define BATCH_VALIDATE()                                               \
+       BEGIN_RING(chan, celsius, NV10TCL_VERTEX_ARRAY_VALIDATE, 1);    \
+       OUT_RING(chan, 0)
+
 #define BATCH_BEGIN(prim)                                              \
        BEGIN_RING(chan, celsius, NV10TCL_VERTEX_BUFFER_BEGIN_END, 1);  \
        OUT_RING(chan, prim)