aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-31 20:50:42 -0500
committerMarge Bot <[email protected]>2020-02-11 00:34:57 +0000
commitee5bd8638bd123ab3ea49d513f8bba9e7cd4ae28 (patch)
tree5fbfabb8638b3163d15f4c67eb78d783228af2df /src/mesa
parent27bd241103e8fa1fc34859cac6bd23d5a5fb04fe (diff)
vbo: also map the immediate mode buffer for read
because we read from it sometimes and we want cached reads. We can only do it with the persistent mapping, because the non-persistent mapping uses incompatible flags. Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index a46a2b03568..7c3b7ef4330 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -286,8 +286,13 @@ vbo_exec_vtx_map(struct vbo_exec_context *exec)
GL_MAP_UNSYNCHRONIZED_BIT;
if (ctx->Extensions.ARB_buffer_storage) {
+ /* We sometimes read from the buffer, so map it for read too.
+ * Only the persistent mapping can do that, because the non-persistent
+ * mapping uses flags that are incompatible with GL_MAP_READ_BIT.
+ */
accessRange |= GL_MAP_PERSISTENT_BIT |
- GL_MAP_COHERENT_BIT;
+ GL_MAP_COHERENT_BIT |
+ GL_MAP_READ_BIT;
} else {
accessRange |= GL_MAP_INVALIDATE_RANGE_BIT |
GL_MAP_FLUSH_EXPLICIT_BIT |
@@ -328,7 +333,8 @@ vbo_exec_vtx_map(struct vbo_exec_context *exec)
GL_MAP_WRITE_BIT |
(ctx->Extensions.ARB_buffer_storage ?
GL_MAP_PERSISTENT_BIT |
- GL_MAP_COHERENT_BIT : 0) |
+ GL_MAP_COHERENT_BIT |
+ GL_MAP_READ_BIT : 0) |
GL_DYNAMIC_STORAGE_BIT |
GL_CLIENT_STORAGE_BIT,
exec->vtx.bufferobj)) {