From 7bb6febc32569dc473afb6d42fcf4e1eb1120eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Aug 2019 09:23:02 +0200 Subject: [PATCH] Add a few more checks. --- ext/native/thin3d/VulkanQueueRunner.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/native/thin3d/VulkanQueueRunner.cpp b/ext/native/thin3d/VulkanQueueRunner.cpp index c92031149a..8be1ca7120 100644 --- a/ext/native/thin3d/VulkanQueueRunner.cpp +++ b/ext/native/thin3d/VulkanQueueRunner.cpp @@ -741,7 +741,6 @@ std::string VulkanQueueRunner::StepToString(const VKRStep &step) const { void VulkanQueueRunner::ApplyRenderPassMerge(std::vector &steps) { // First let's count how many times each framebuffer is rendered to. // If it's more than one, let's do our best to merge them. This can help God of War quite a bit. - std::map counts; for (int i = 0; i < (int)steps.size(); i++) { if (steps[i]->stepType == VKRStepType::RENDER) { @@ -778,20 +777,20 @@ void VulkanQueueRunner::ApplyRenderPassMerge(std::vector &steps) { if (steps[j]->render.framebuffer != fb) { touchedFramebuffers.insert(steps[j]->render.framebuffer); } - // keep going. break; case VKRStepType::COPY: - if (steps[j]->copy.src == fb) { - // We're done. + if (steps[j]->copy.src == fb || steps[j]->copy.dst == fb) { goto done_fb; } break; case VKRStepType::BLIT: - if (steps[j]->blit.src == fb) { + if (steps[j]->blit.src == fb || steps[j]->blit.dst == fb) { goto done_fb; } break; case VKRStepType::READBACK: + // Not sure this has much effect, when executed READBACK is always the last step + // since we stall the GPU and wait immediately after. if (steps[j]->readback.src == fb) { goto done_fb; }