From 27f313ee1641cab4f28bc9faef4e97dea1a80612 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 3 Aug 2016 11:20:56 +0200 Subject: [PATCH] gsdx hw: limit OI_GsMemClear to large clear Help to reduce the speed impact --- plugins/GSdx/GSRendererHW.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 273e3891a4..a952b82904 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -880,10 +880,14 @@ void GSRendererHW::OI_GsMemClear() && (!m_context->TEST.ZTE || m_context->TEST.ZTST == ZTST_ALWAYS) // no depth test && (m_vt.m_eq.rgba == 0xFFFF && m_vt.m_min.c.eq(GSVector4i(0))) // Constant 0 write ) { - GL_INS("OI_GsMemClear"); GSOffset* off = m_context->offset.fb; GSVector4i r = GSVector4i(m_vt.m_min.p.xyxy(m_vt.m_max.p)).rintersect(GSVector4i(m_context->scissor.in)); + // Limit the hack to a single fullscreen clear. Some games might use severals column to clear a screen + // but hopefully it will be enough. + if (r.width() <= 128 || r.height() <= 128) + return; + GL_INS("OI_GsMemClear (%d,%d => %d,%d)", r.x, r.y, r.z, r.w); int format = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt; // FIXME: loop can likely be optimized with AVX/SSE. Pixels aren't