diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 7ed7b2b46ed..384d2c7dd42 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -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; } } 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);