nv30/draw: avoid leaving stale pointers in draw state
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 24 May 2015 15:56:21 +0000 (11:56 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 25 May 2015 18:11:16 +0000 (14:11 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/nv30/nv30_draw.c

index 74f0d66df95e7c13a88d25f793b89d9ca1855297..8db15c6c05979a6e763a06855c7f9e6079fa7508 100644 (file)
@@ -400,16 +400,16 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
          void *map = nv04_resource(nv30->vertprog.constbuf)->data;
          draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
                                          map, nv30->vertprog.constbuf_nr);
+      } else {
+         draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
       }
    }
 
    for (i = 0; i < nv30->num_vtxbufs; i++) {
       const void *map = nv30->vtxbuf[i].user_buffer;
       if (!map) {
-         if (!nv30->vtxbuf[i].buffer) {
-            continue;
-         }
-         map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
+         if (nv30->vtxbuf[i].buffer)
+            map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
                                   PIPE_TRANSFER_UNSYNCHRONIZED |
                                   PIPE_TRANSFER_READ, &transfer[i]);
       }