From 617e7596d1be058eba29bd4314065bc04acfb1a5 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 4 Jan 2023 09:13:39 -0800 Subject: [PATCH] zink: Add an assert for not seeing any more MSAA image-to-buffer copies. Now that transfer_map gets MSAA handled by the helper, we shouldn't have to worry about this any more. Part-of: --- src/gallium/drivers/zink/zink_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 70c0e0d..b2bc91e 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -4419,7 +4419,8 @@ zink_copy_image_buffer(struct zink_context *ctx, struct zink_resource *dst, stru int aspect = 1 << u_bit_scan(&aspects); region.imageSubresource.aspectMask = aspect; - /* this may or may not work with multisampled depth/stencil buffers depending on the driver implementation: + /* MSAA transfers should have already been handled by U_TRANSFER_HELPER_MSAA_MAP, since + * there's no way to resolve using this interface: * * srcImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT * - vkCmdCopyImageToBuffer spec @@ -4427,6 +4428,7 @@ zink_copy_image_buffer(struct zink_context *ctx, struct zink_resource *dst, stru * dstImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT * - vkCmdCopyBufferToImage spec */ + assert(img->base.b.nr_samples <= 1); if (buf2img) VKCTX(CmdCopyBufferToImage)(cmdbuf, buf->obj->buffer, img->obj->image, img->layout, 1, ®ion); else -- 2.7.4