Module: Mesa Branch: staging/21.3 Commit: 7110421e2679eeee5836c3a3b99b5271e66e977b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7110421e2679eeee5836c3a3b99b5271e66e977b
Author: Mike Blumenkrantz <[email protected]> Date: Fri Oct 29 12:13:43 2021 -0400 zink: reject all storage multisampling if the feature is unsupported this also enables removing a stupid conditional cc: mesa-stable Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13631> (cherry picked from commit 675519f1d0eb26ecb5712a8bdbb82d7a92c07ed7) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_resource.c | 7 +++---- src/gallium/drivers/zink/zink_screen.c | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 10bbba00a56..c48453e5af7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -139,7 +139,7 @@ "description": "zink: reject all storage multisampling if the feature is unsupported", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index ed8f408ddf2..78101d70b96 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -223,10 +223,9 @@ get_image_usage_for_feats(struct zink_screen *screen, VkFormatFeatureFlags feats if (feats & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT && (bind & (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) != (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) usage |= VK_IMAGE_USAGE_SAMPLED_BIT; - if ((templ->nr_samples <= 1 || screen->info.feats.features.shaderStorageImageMultisample) && - (bind & PIPE_BIND_SHADER_IMAGE)) { - if (feats & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) - usage |= VK_IMAGE_USAGE_STORAGE_BIT; + if ((feats & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) && (bind & PIPE_BIND_SHADER_IMAGE)) { + assert(templ->nr_samples <= 1 || screen->info.feats.features.shaderStorageImageMultisample); + usage |= VK_IMAGE_USAGE_STORAGE_BIT; } } diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 58a147fa172..0d027d2a55d 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -951,6 +951,9 @@ zink_is_format_supported(struct pipe_screen *pscreen, { struct zink_screen *screen = zink_screen(pscreen); + if (storage_sample_count && !screen->info.feats.features.shaderStorageImageMultisample && bind & PIPE_BIND_SHADER_IMAGE) + return false; + if (format == PIPE_FORMAT_NONE) return screen->info.props.limits.framebufferNoAttachmentsSampleCounts & vk_sample_count_flags(sample_count);
