st/mesa: always unmap the uploader in st_atom_array.c
authorMarek Olšák <marek.olsak@amd.com>
Thu, 31 Jan 2019 01:45:39 +0000 (20:45 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 21 Feb 2019 02:04:29 +0000 (21:04 -0500)
This is a no-op for drivers supporting persistent mappings.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/mesa/state_tracker/st_atom_array.c

index 7a63d7504f37cb915206976cc85e44d7cee0e2c8..c5e0792cc1d7c71c35fcd810f645e7e3737f9fc2 100644 (file)
@@ -496,17 +496,15 @@ st_setup_current(struct st_context *st,
        * times (thousands of times), so a better placement is going to
        * perform better.
        */
-      u_upload_data(st->can_bind_const_buffer_as_vertex ?
-                    st->pipe->const_uploader :
-                    st->pipe->stream_uploader,
+      struct u_upload_mgr *uploader = st->can_bind_const_buffer_as_vertex ?
+                                      st->pipe->const_uploader :
+                                      st->pipe->stream_uploader;
+      u_upload_data(uploader,
                     0, cursor - data, max_alignment, data,
                     &vbuffer[bufidx].buffer_offset,
                     &vbuffer[bufidx].buffer.resource);
-
-      if (!ctx->Const.AllowMappedBuffersDuringExecution &&
-          !st->can_bind_const_buffer_as_vertex) {
-         u_upload_unmap(st->pipe->stream_uploader);
-      }
+      /* Always unmap. The uploader might use explicit flushes. */
+      u_upload_unmap(uploader);
    }
 }