zink: also check for host-visible on staging uploads

this has strange mechanics on lavapipe

Fixes: e63acdd2b7 ("zink: force cached mem for streaming uploads")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35239>
This commit is contained in:
Mike Blumenkrantz
2025-05-28 10:26:19 -04:00
parent cfeda2d8ae
commit d8d913c341
2 changed files with 3 additions and 5 deletions
@@ -128,7 +128,3 @@ spec@ext_transform_feedback@tessellation quad_strip wireframe,Crash
spec@!opengl 1.0@gl-1.0-dlist-beginend,Crash
spec@arb_viewport_array@display-list,Fail
# uprev Piglit in Mesa
spec@arb_sparse_buffer@buffer-data,Crash
spec@arb_sparse_buffer@commit,Crash
+3 -1
View File
@@ -2347,7 +2347,9 @@ zink_buffer_map(struct pipe_context *pctx,
/* ideally never ever read or write to non-cached mem */
bool is_cached_mem = (screen->info.mem_props.memoryTypes[res->obj->bo->base.base.placement].propertyFlags & VK_STAGING_RAM) == VK_STAGING_RAM;
/* but this is only viable with a certain amount of vram since it may fully duplicate lots of large buffers */
bool host_mem_type_check = screen->always_cached_upload ? is_cached_mem : res->obj->host_visible;
bool host_mem_type_check = res->obj->host_visible;
if (screen->always_cached_upload)
host_mem_type_check &= is_cached_mem;
if (usage & PIPE_MAP_DISCARD_RANGE && !(usage & PIPE_MAP_PERSISTENT) &&
(!host_mem_type_check || !(usage & (PIPE_MAP_UNSYNCHRONIZED)))) {