From c24841190748987e8f273135c6b34c21fbb91aa8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 11 Mar 2024 14:26:32 -0400 Subject: [PATCH] zink: only add STORAGE bit for sparse images based on multisample usage if the driver doesn't support multisample storage images, don't create them Fixes: d320e8328d6 ("zink: set up image create bits for sparse textures") Part-of: --- src/gallium/drivers/zink/zink_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 734fa7cdc51..dcd4f1359bd 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1587,7 +1587,8 @@ resource_create(struct pipe_screen *pscreen, bool linear = false; struct pipe_resource templ2 = *templ; - if (templ2.flags & PIPE_RESOURCE_FLAG_SPARSE) + if (templ2.flags & PIPE_RESOURCE_FLAG_SPARSE && + (util_res_sample_count(templ) == 1 || screen->info.feats.features.shaderStorageImageMultisample)) templ2.bind |= PIPE_BIND_SHADER_IMAGE; if (screen->faked_e5sparse && templ->format == PIPE_FORMAT_R9G9B9E5_FLOAT) { templ2.flags &= ~PIPE_RESOURCE_FLAG_SPARSE;