From 47bbdbec9b369c949d5d35edf7066616facffc2b 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: (cherry picked from commit 61e5b6ad9dcde1f2a75dfd09cdbf9ea86b352223) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_screen.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f081581f4f8..fb9f5e13a36 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index ee2f61d80ce..7089f8041a1 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -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) {