zink: try getting sparse page size again without storage bit on fail

only certain formats are required to have the storage bit, so be more
tolerant of failure in the case where drivers actually check flags
and reject storage usage when it's actually unsupported

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28115>
(cherry picked from commit 61e5b6ad9d)
This commit is contained in:
Mike Blumenkrantz 2024-03-11 13:41:45 -04:00 committed by Eric Engestrom
parent babead0a4b
commit 47bbdbec9b
2 changed files with 15 additions and 5 deletions

View file

@ -784,7 +784,7 @@
"description": "zink: try getting sparse page size again without storage bit on fail",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2563,11 +2563,21 @@ zink_get_sparse_texture_virtual_page_size(struct pipe_screen *pscreen,
VK_IMAGE_TILING_OPTIMAL,
&prop_count, props);
if (!prop_count) {
if (pformat == PIPE_FORMAT_R9G9B9E5_FLOAT) {
screen->faked_e5sparse = true;
goto hack_it_up;
/* format may not support storage; try without */
flags &= ~VK_IMAGE_USAGE_STORAGE_BIT;
prop_count = ARRAY_SIZE(props);
VKSCR(GetPhysicalDeviceSparseImageFormatProperties)(screen->pdev, format, type,
multi_sample ? VK_SAMPLE_COUNT_2_BIT : VK_SAMPLE_COUNT_1_BIT,
flags,
VK_IMAGE_TILING_OPTIMAL,
&prop_count, props);
if (!prop_count) {
if (pformat == PIPE_FORMAT_R9G9B9E5_FLOAT) {
screen->faked_e5sparse = true;
goto hack_it_up;
}
return 0;
}
return 0;
}
if (size) {