mesa/st: Only care about the uploader if it was 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 care for unmapping the upload buffer
if we actually used it.

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 19a5ef29a98480f9cbb958acce018c9f0861ce6e..9831045b340da5b2ef8c1b3f9a598b4706f743c1 100644 (file)
@@ -498,10 +498,10 @@ st_update_array(struct st_context *st)
                     0, cursor - data, max_alignment, data,
                     &vbuffer[bufidx].buffer_offset,
                     &vbuffer[bufidx].buffer.resource);
-   }
 
-   if (!ctx->Const.AllowMappedBuffersDuringExecution) {
-      u_upload_unmap(st->pipe->stream_uploader);
+      if (!ctx->Const.AllowMappedBuffersDuringExecution) {
+         u_upload_unmap(st->pipe->stream_uploader);
+      }
    }
 
    const unsigned num_inputs = st->vp_variant->num_inputs;