From 1b44269d70a315770ff4ec78ccfd6701141b00bd Mon Sep 17 00:00:00 2001 From: Samuliak Date: Wed, 28 Aug 2024 13:24:01 +0200 Subject: [PATCH] simplify flush --- src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp index f917e889..eb009ecd 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp @@ -16,6 +16,7 @@ #include "Cafe/HW/Latte/Core/LatteShader.h" #include "Cafe/HW/Latte/Core/LatteIndices.h" #include "Cemu/Logging/CemuDebugLogging.h" +#include "Common/precompiled.h" #include "Foundation/NSTypes.hpp" #include "HW/Latte/Core/LatteConst.h" #include "HW/Latte/Renderer/Metal/MetalCommon.h" @@ -311,14 +312,15 @@ bool MetalRenderer::BeginFrame(bool mainWindow) void MetalRenderer::Flush(bool waitIdle) { - if (m_recordedDrawcalls > 0) + if (m_recordedDrawcalls > 0 || waitIdle) CommitCommandBuffer(); if (waitIdle) { for (auto commandBuffer : m_commandBuffers) { - if (commandBuffer.m_commited) - WaitForCommandBufferCompletion(commandBuffer.m_commandBuffer); + cemu_assert_debug(commandBuffer.m_commited); + + WaitForCommandBufferCompletion(commandBuffer.m_commandBuffer); } } }