From 37ac8647fca4ab8aa1be6879fa810def7404449c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 13 Apr 2022 14:19:58 -0400 Subject: [PATCH] zink: reject resource creation if format features don't match attachment if a rendertarget-specified image can't be a rendertarget or a blit dst then it can't be used for the designated functionality and must be rejected cc: mesa-stable fixes hangs on various nv driver versions: dEQP-GLES2.functional.texture.mipmap.2d.generate.rgba5551_fastest Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 9f3069e7fe4..d72aa5fa1e5 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -260,7 +260,7 @@ get_image_usage_for_feats(struct zink_screen *screen, VkFormatFeatureFlags feats usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; if ((bind & (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) != (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) usage |= VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; - } else if (templ->nr_samples) + } else if (templ->nr_samples || !(feats & VK_FORMAT_FEATURE_BLIT_DST_BIT)) /* this can't be populated, so we can't do it */ return 0; }