st/mesa: unmap the stream_uploader buffer before drawing
authorBrian Paul <brianp@vmware.com>
Sat, 10 Jun 2017 03:21:12 +0000 (21:21 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 13 Jun 2017 13:52:54 +0000 (07:52 -0600)
Some drivers require that the vertex buffers be unmapped prior to
drawing.  This change unmaps the stream_uploader buffer after we've
uploaded the zero-stride attributes (unless the driver supports
rendering with mapped buffers).

This fixes a regression in the VMware driver since 17f776c27be266f2.
Some Mesa demos such as mandelbrot and brick would display black
quads instead of the expected rendering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_atom_array.c

index c7467eb20b7198b9b8b5bb9b12a77a8103f9c679..6af1355ee17bd41268208fa8100711f2b1e6443d 100644 (file)
@@ -670,6 +670,10 @@ setup_non_interleaved_attribs(struct st_context *st,
                             array->Size, array->Doubles, &attr);
    }
 
+   if (!ctx->Const.AllowMappedBuffersDuringExecution) {
+      u_upload_unmap(st->pipe->stream_uploader);
+   }
+
    set_vertex_attribs(st, vbuffer, num_vbuffers, velements, num_inputs);
 
    /* Unreference uploaded zero-stride vertex buffers. */