mesa/st: Only unmap the uploader that was actually used.
authorMathias Fröhlich <mathias.froehlich@web.de>
Thu, 1 Nov 2018 18:03:26 +0000 (19:03 +0100)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Mon, 26 Nov 2018 06:57:09 +0000 (07:57 +0100)
In st_atom_array, we only need to unmap the upload buffer that
was actually used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/mesa/state_tracker/st_atom_array.c

index 9831045b340da5b2ef8c1b3f9a598b4706f743c1..cd00529ddf3e7972b114de4cf5ca87fca659ae39 100644 (file)
@@ -499,7 +499,8 @@ st_update_array(struct st_context *st)
                     &vbuffer[bufidx].buffer_offset,
                     &vbuffer[bufidx].buffer.resource);
 
-      if (!ctx->Const.AllowMappedBuffersDuringExecution) {
+      if (!ctx->Const.AllowMappedBuffersDuringExecution &&
+          !st->can_bind_const_buffer_as_vertex) {
          u_upload_unmap(st->pipe->stream_uploader);
       }
    }