This fixes basic rendering on top of V3DV, which doesn't seem to expose
the cached memory we expect and love.
Fixes:
598dc3dca41 ("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>
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;
}