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>
This commit is contained in:
Mike Blumenkrantz
2021-10-29 12:13:43 -04:00
committed by Marge Bot
parent aacdc6eb44
commit 675519f1d0
2 changed files with 6 additions and 4 deletions

View File

@@ -225,10 +225,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;
}
}

View File

@@ -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);