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: d320e8328d ("zink: set up image create bits for sparse textures")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28115>
This commit is contained in:
Mike Blumenkrantz 2024-03-11 14:26:32 -04:00 committed by Marge Bot
parent 63f5a6cbe3
commit c248411907

View file

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