gsdx-ogl: print some message when blending is not properly supported

This commit is contained in:
Gregory Hainaut 2015-05-06 08:34:45 +02:00
parent 6fca3b421d
commit 3fcac07120
2 changed files with 19 additions and 4 deletions

View File

@ -42,7 +42,8 @@ class GSBlendStateOGL {
GLenum m_equation_RGB; GLenum m_equation_RGB;
GLenum m_func_sRGB; GLenum m_func_sRGB;
GLenum m_func_dRGB; GLenum m_func_dRGB;
bool constant_factor; bool m_constant_factor;
char m_bogus;
public: public:
@ -50,7 +51,8 @@ public:
, m_equation_RGB(0) , m_equation_RGB(0)
, m_func_sRGB(0) , m_func_sRGB(0)
, m_func_dRGB(0) , m_func_dRGB(0)
, constant_factor(false) , m_constant_factor(false)
, m_bogus(0)
{} {}
void SetRGB(GLenum op, GLenum src, GLenum dst) void SetRGB(GLenum op, GLenum src, GLenum dst)
@ -58,9 +60,11 @@ public:
m_equation_RGB = op; m_equation_RGB = op;
m_func_sRGB = src; m_func_sRGB = src;
m_func_dRGB = dst; 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() void RevertOp()
{ {
if(m_equation_RGB == GL_FUNC_ADD) 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 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) void SetupBlend(float factor)
{ {
@ -86,6 +90,11 @@ public:
} }
if (m_enable) { 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 (HasConstantFactor()) {
if (GLState::bf != factor) { if (GLState::bf != factor) {
GLState::bf = factor; GLState::bf = factor;

View File

@ -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. //Breath of Fire Dragon Quarter triggers this in battles. Graphics are fine though.
//ASSERT(0); //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); dev->SetupCB(&vs_cb, &ps_cb, ps_sel.sprite ? &gs_cb : NULL);
if (DATE_GL42) { 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 // Create an r32i image that will contain primitive ID
// Note: do it at the beginning because the clean will dirty the FBO state // Note: do it at the beginning because the clean will dirty the FBO state
//dev->InitPrimDateTexture(rtsize.x, rtsize.y); //dev->InitPrimDateTexture(rtsize.x, rtsize.y);