From 3e35101895aed4e0cf2be3f90459fbad6e417203 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 22 Apr 2020 21:21:10 -0300 Subject: vk_rasterizer: Fix framebuffer creation validation errors Framebuffer creation was ignoring the number of color attachments. --- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8a5482e55..8f4de5665 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -692,7 +692,7 @@ std::tuple RasterizerVulkan::ConfigureFramebuffers( FramebufferCacheKey key{renderpass, std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()}; - const auto try_push = [&](const View& view) { + const auto try_push = [&key](const View& view) { if (!view) { return false; } @@ -703,7 +703,9 @@ std::tuple RasterizerVulkan::ConfigureFramebuffers( return true; }; - for (std::size_t index = 0; index < std::size(color_attachments); ++index) { + const auto& regs = system.GPU().Maxwell3D().regs; + const std::size_t num_attachments = static_cast(regs.rt_control.count); + for (std::size_t index = 0; index < num_attachments; ++index) { if (try_push(color_attachments[index])) { texture_cache.MarkColorBufferInUse(index); } -- cgit v1.2.3