From ec57f1305a60bd0f345fc17bd5a6e8224eb68cfa Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 10 Mar 2016 18:28:08 +0100 Subject: [PATCH] gsdx: detect rendering outside of the framebuffer Could help to detect rendering issue (for example missing fmv) --- plugins/GSdx/GSRendererHW.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index e877ca28b2..34cfafa452 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -560,6 +560,16 @@ void GSRendererHW::Draw() GSVector4i r = GSVector4i(m_vt.m_min.p.xyxy(m_vt.m_max.p)).rintersect(GSVector4i(context->scissor.in)); + // Help to detect rendering outside of the framebuffer +#if _DEBUG + if (m_upscale_multiplier * r.z > m_width) { + GL_INS("ERROR: RT width is too small only %d but require %d", m_width, m_upscale_multiplier * r.z); + } + if (m_upscale_multiplier * r.w > m_height) { + GL_INS("ERROR: RT height is too small only %d but require %d", m_height, m_upscale_multiplier * r.w); + } +#endif + if(fm != 0xffffffff && rt) { rt->m_valid = rt->m_valid.runion(r);