st/nine: Use PIPE_MAP_ONCE for persistent buffers

This enables radeonsi to really unmap on release,
which reduces virtual memory usage.

Do it only on 32 bits, as it can reduce performance if the
allocation is reused.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
Axel Davy
2021-03-13 22:39:28 +01:00
committed by Marge Bot
parent 7ac9c9c667
commit 5702b15cd9
@@ -97,6 +97,9 @@ nine_upload_create_buffer_group(struct nine_buffer_upload *upload,
group->map = pipe_buffer_map_range(upload->pipe, group->resource,
0, upload->buffers_size,
PIPE_MAP_WRITE |
#ifdef PIPE_ARCH_X86
PIPE_MAP_ONCE |
#endif
PIPE_MAP_PERSISTENT |
PIPE_MAP_COHERENT,
&group->transfer);
@@ -228,6 +231,9 @@ nine_upload_create_buffer(struct nine_buffer_upload *upload,
buf->map = pipe_buffer_map_range(upload->pipe, buf->resource,
0, buffer_size,
PIPE_MAP_WRITE |
#ifdef PIPE_ARCH_X86
PIPE_MAP_ONCE |
#endif
PIPE_MAP_PERSISTENT |
PIPE_MAP_COHERENT,
&buf->transfer);