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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user