From 3fcac071202b0a805193b8d4900cf300d27ae1e4 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 6 May 2015 08:34:45 +0200 Subject: [PATCH] gsdx-ogl: print some message when blending is not properly supported --- plugins/GSdx/GSDeviceOGL.h | 17 +++++++++++++---- plugins/GSdx/GSRendererOGL.cpp | 6 ++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/GSDeviceOGL.h b/plugins/GSdx/GSDeviceOGL.h index fa844cb4af..9296228bf3 100644 --- a/plugins/GSdx/GSDeviceOGL.h +++ b/plugins/GSdx/GSDeviceOGL.h @@ -42,7 +42,8 @@ class GSBlendStateOGL { GLenum m_equation_RGB; GLenum m_func_sRGB; GLenum m_func_dRGB; - bool constant_factor; + bool m_constant_factor; + char m_bogus; public: @@ -50,7 +51,8 @@ public: , m_equation_RGB(0) , m_func_sRGB(0) , m_func_dRGB(0) - , constant_factor(false) + , m_constant_factor(false) + , m_bogus(0) {} void SetRGB(GLenum op, GLenum src, GLenum dst) @@ -58,9 +60,11 @@ public: m_equation_RGB = op; m_func_sRGB = src; m_func_dRGB = dst; - if (IsConstant(src) || IsConstant(dst)) constant_factor = true; + if (IsConstant(src) || IsConstant(dst)) m_constant_factor = true; } + void SetBogus(char bogus) { m_bogus = bogus; } + void RevertOp() { if(m_equation_RGB == GL_FUNC_ADD) @@ -73,7 +77,7 @@ public: bool IsConstant(GLenum factor) { return ((factor == GL_CONSTANT_COLOR) || (factor == GL_ONE_MINUS_CONSTANT_COLOR)); } - bool HasConstantFactor() { return constant_factor; } + bool HasConstantFactor() { return m_constant_factor; } void SetupBlend(float factor) { @@ -86,6 +90,11 @@ public: } if (m_enable) { +#ifdef ENABLE_OGL_DEBUG + if (m_bogus) { + fprintf(stderr, "Bogus blending effect used : %s\n", (m_bogus == 1) ? "impossible effect" : "clear effect"); + } +#endif if (HasConstantFactor()) { if (GLState::bf != factor) { GLState::bf = factor; diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index c83d2d1fd5..99a495a2bc 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -229,6 +229,9 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour { //Breath of Fire Dragon Quarter triggers this in battles. Graphics are fine though. //ASSERT(0); +#ifdef ENABLE_OGL_DEBUG + fprintf(stderr, "env PABE not supported\n"); +#endif } } } @@ -530,6 +533,9 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour dev->SetupCB(&vs_cb, &ps_cb, ps_sel.sprite ? &gs_cb : NULL); if (DATE_GL42) { + // It could be good idea to use stencil in the same time. + // Early stencil test will reduce the number of atomic-load operation + // Create an r32i image that will contain primitive ID // Note: do it at the beginning because the clean will dirty the FBO state //dev->InitPrimDateTexture(rtsize.x, rtsize.y);