summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-10-29 12:13:43 -0400
committerEric Engestrom <eric@engestrom.ch>2021-11-03 20:15:50 +0000
commit1146a8ef50295c87638a89602ba9de249968b79e (patch)
treebb38a3d979b1cb8da164ccabaa575a6b07e864f0
parent371a73a602802c953cb9165bf11f6a1309f5e4d6 (diff)
zink: reject all storage multisampling if the feature is unsupported
this also enables removing a stupid conditional cc: mesa-stable Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13631> (cherry picked from commit 675519f1d0eb26ecb5712a8bdbb82d7a92c07ed7)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/zink/zink_resource.c7
-rw-r--r--src/gallium/drivers/zink/zink_screen.c3
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);