zink: remove input attachment usage when pruning surface usage

if the format doesn't support color attachment, it doesn't need to
be an input attachment

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16563>
This commit is contained in:
Mike Blumenkrantz 2022-04-20 13:28:09 -04:00
parent 73c79f3cc1
commit 5bc14505a5

View file

@ -145,7 +145,7 @@ create_surface(struct pipe_context *pctx,
VkFormatFeatureFlags feats = res->optimal_tiling ?
screen->format_props[templ->format].optimalTilingFeatures :
screen->format_props[templ->format].linearTilingFeatures;
VkImageUsageFlags attachment = (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
VkImageUsageFlags attachment = (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT);
usage_info.usage = res->obj->vkusage & ~attachment;
if ((res->obj->vkusage & attachment) &&
!(feats & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))) {