From 1ea83ba3a741cdd1993c8ce95e109d6e8ff1d601 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 31 Jul 2016 13:13:01 +0200 Subject: [PATCH] gsdx debug: log current area of the draw This way it is easier to see which part of the texture is read, and which part of the framebuffer is updated --- plugins/GSdx/GSRendererOGL.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 0b1875e1df..069a51743f 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -940,9 +940,17 @@ void GSRendererOGL::ResetStates() void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex) { - GL_PUSH("GL Draw from %d in %d (Depth %d)", - tex && tex->m_texture ? tex->m_texture->GetID() : 0, - rt ? rt->GetID() : -1, ds ? ds->GetID() : -1); +#ifdef ENABLE_OGL_DEBUG + GSVector4i area_out = GSVector4i(m_vt.m_min.p.xyxy(m_vt.m_max.p)).rintersect(GSVector4i(m_context->scissor.in)); + GSVector4i area_in = GSVector4i(m_vt.m_min.t.xyxy(m_vt.m_max.t)); + + GL_PUSH("GL Draw from %d (area %d,%d => %d,%d) in %d (Depth %d) (area %d,%d => %d,%d)", + tex && tex->m_texture ? tex->m_texture->GetID() : -1, + area_in.x, area_in.y, area_in.z, area_in.w, + rt ? rt->GetID() : -1, ds ? ds->GetID() : -1, + area_out.x, area_out.y, area_out.z, area_out.w + ); +#endif GSTexture* hdr_rt = NULL;