From d48de5b56f5c35e1a31da995a79522dc15fbdfdb Mon Sep 17 00:00:00 2001 From: Samuliak Date: Wed, 14 Aug 2024 15:37:06 +0200 Subject: [PATCH] fix: buffer cache crash on shutdown --- src/Cafe/HW/Latte/Core/LatteBufferCache.cpp | 3 +-- src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp b/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp index 174a8684..821651dd 100644 --- a/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteBufferCache.cpp @@ -290,8 +290,7 @@ public: { if (m_hasCacheAlloc) { - // HACK - //cemu_assert_debug(isInUse() == false); + cemu_assert_debug(isInUse() == false); g_gpuBufferHeap->freeOffset(m_cacheOffset); m_hasCacheAlloc = false; } diff --git a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp index b94f73bd..ed9e90cb 100644 --- a/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Metal/MetalRenderer.cpp @@ -676,6 +676,7 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32 // TODO: uncomment //if (m_state.m_skipDrawSequence) //{ + // LatteGPUState.drawCallCounter++; // return; //} @@ -811,6 +812,8 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32 { renderCommandEncoder->drawPrimitives(mtlPrimitiveType, baseVertex, count, instanceCount, baseInstance); } + + LatteGPUState.drawCallCounter++; } void MetalRenderer::draw_endSequence()