From 315524a89c4ec2a9db5da7215c80862590032fb2 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 24 Mar 2024 22:18:49 +1000 Subject: [PATCH] VulkanDevice: Fix render pass fallback path with MRT --- src/util/vulkan_device.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/util/vulkan_device.cpp b/src/util/vulkan_device.cpp index 326846819..13abf3bed 100644 --- a/src/util/vulkan_device.cpp +++ b/src/util/vulkan_device.cpp @@ -1657,7 +1657,7 @@ bool VulkanDevice::IsBrokenMobileDriver() const VkRenderPass VulkanDevice::CreateCachedRenderPass(RenderPassCacheKey key) { - VkAttachmentReference color_reference; + std::array color_references; VkAttachmentReference* color_reference_ptr = nullptr; VkAttachmentReference depth_reference; VkAttachmentReference* depth_reference_ptr = nullptr; @@ -1688,12 +1688,13 @@ VkRenderPass VulkanDevice::CreateCachedRenderPass(RenderPassCacheKey key) VK_ATTACHMENT_STORE_OP_DONT_CARE, layout, layout}; - color_reference.attachment = num_attachments; - color_reference.layout = layout; - color_reference_ptr = &color_reference; + color_references[num_attachments].attachment = num_attachments; + color_references[num_attachments].layout = layout; + color_reference_ptr = color_references.data(); if (key.color_feedback_loop) { + DebugAssert(i == 0); if (!UseFeedbackLoopLayout()) { input_reference.attachment = num_attachments;