From 1853d0d16d975b83d397bfb82dbc0596249b85e2 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 17 Feb 2016 19:58:27 +0100 Subject: [PATCH] gsdx: no depth lookup optimization Don't lookup a depth buffer if depth test is always pass without write Boost performance on Tekken5 when depth emulation is enabled in openGL (Tekken5 sets same address for both the RT and the depth but depth is disabled) v2: Keep ds if DATE is enabled (some implementation uses a stencil buffer) Be more aggressive to avoid an useless depth lookup --- plugins/GSdx/GSRendererHW.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 349977af19..1ea6d49802 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -342,7 +342,12 @@ void GSRendererHW::Draw() // 3/ 50cents really draws (0,0,0,128) color and a (0) 24 bits depth // Note: FF DoC has both buffer at same location but disable the depth test (write?) with ZTE = 0 const bool no_rt = (context->ALPHA.IsCd() && PRIM->ABE && (context->FRAME.PSM == 1)); - const bool no_ds = !no_rt && (context->FRAME.FBP == context->ZBUF.ZBP && !PRIM->TME && !context->ZBUF.ZMSK && !context->FRAME.FBMSK && context->TEST.ZTE); + const bool no_ds = !no_rt && ( + // Depth is always pass (no read) and write are discarded (tekken 5). (Note: DATE is currently implemented with a stencil buffer) + (context->ZBUF.ZMSK && m_context->TEST.ZTST == ZTST_ALWAYS && !m_context->TEST.DATE) || + // Depth will be written through the RT + (context->FRAME.FBP == context->ZBUF.ZBP && !PRIM->TME && !context->ZBUF.ZMSK && !context->FRAME.FBMSK && context->TEST.ZTE) + ); GIFRegTEX0 TEX0;