From 568b96b8859c21deaccf8a5e0a0213320def55f8 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 10 Apr 2019 12:00:32 +0200 Subject: [PATCH] gsdx ogl: only always uncommit texture in debug build It is good for memory but bad for the speed. There is likely a better trade-off but it should be enough for now --- plugins/GSdx/Renderers/Common/GSDevice.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/GSdx/Renderers/Common/GSDevice.cpp b/plugins/GSdx/Renderers/Common/GSDevice.cpp index 96f2477019..77d6575c9e 100644 --- a/plugins/GSdx/Renderers/Common/GSDevice.cpp +++ b/plugins/GSdx/Renderers/Common/GSDevice.cpp @@ -163,7 +163,12 @@ void GSDevice::Recycle(GSTexture* t) { if(t) { +#ifdef _DEBUG + // Uncommit saves memory but it means a futur allocation when we want to reuse the texture. + // Which is slow and defeat the purpose of the m_pool cache. + // However, it can help to spot part of texture that we forgot to commit t->Uncommit(); +#endif t->last_frame_used = m_frame; m_pool.push_front(t);