diff --git a/src/dawn_native/vulkan/RenderPassCache.cpp b/src/dawn_native/vulkan/RenderPassCache.cpp index 47330f1204..9e105fd5ac 100644 --- a/src/dawn_native/vulkan/RenderPassCache.cpp +++ b/src/dawn_native/vulkan/RenderPassCache.cpp @@ -161,6 +161,13 @@ namespace dawn_native { namespace vulkan { ++resolveAttachmentIndex; } + // All color attachments without a corresponding resolve attachment must be set to VK_ATTACHMENT_UNUSED + for (; resolveAttachmentIndex < colorAttachmentIndex; resolveAttachmentIndex++) { + auto& attachmentRef = resolveAttachmentRefs[resolveAttachmentIndex]; + attachmentRef.attachment = VK_ATTACHMENT_UNUSED; + attachmentRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; // The Khronos Vulkan validation layer will complain if not set + } + VkAttachmentReference* resolveTargetAttachmentRefs = query.resolveTargetMask.any() ? resolveAttachmentRefs.data() : nullptr;