zink: fall back from cached to non-cached memory

This fixes basic rendering on top of V3DV, which doesn't seem to expose
the cached memory we expect and love.

Fixes: 598dc3dca4 ("zink: use cached memory for all resources when possible")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10230>
This commit is contained in:
Erik Faye-Lund 2021-04-14 13:35:34 +02:00 committed by Marge Bot
parent 75cd43741a
commit 1cf6b8d461

View file

@ -187,6 +187,14 @@ get_memory_type_index(struct zink_screen *screen,
if (idx >= 0)
return idx;
if (props & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) {
/* if no suitable cached memory can be found, fall back
* to non-cached memory instead.
*/
return get_memory_type_index(screen, reqs,
props & ~VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
}
unreachable("Unsupported memory-type");
return 0;
}