zink: don't add other usage bits for transient images

this is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19065>
This commit is contained in:
Mike Blumenkrantz 2022-10-13 13:51:43 -04:00 committed by Marge Bot
parent 3dcc03d979
commit 2710ef4c2a

View file

@ -285,9 +285,10 @@ get_image_usage_for_feats(struct zink_screen *screen, VkFormatFeatureFlags feats
if (bind & PIPE_BIND_RENDER_TARGET) {
if (feats & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) {
usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
if ((bind & (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) != (PIPE_BIND_LINEAR | PIPE_BIND_SHARED))
if (!(bind & ZINK_BIND_TRANSIENT) && (bind & (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) != (PIPE_BIND_LINEAR | PIPE_BIND_SHARED))
usage |= VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
usage |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT;
if (!(bind & ZINK_BIND_TRANSIENT))
usage |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT;
} else {
/* trust that gallium isn't going to give us anything wild */
*need_extended = true;