From 61e5b6ad9dcde1f2a75dfd09cdbf9ea86b352223 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 11 Mar 2024 13:41:45 -0400 Subject: [PATCH] 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: --- src/gallium/drivers/zink/zink_screen.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 9d4952eb4ef..4e19d5e2cc4 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -2653,11 +2653,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) {