gsdx-ogl: keep the draw buffer enabled by default

Note: Only DATE requires to disable the draw buffer
This commit is contained in:
Gregory Hainaut 2014-09-30 22:12:56 +02:00
parent f46e8cc6ac
commit 79e8a912cd
3 changed files with 9 additions and 19 deletions

View File

@ -24,7 +24,6 @@
namespace GLState {
GLuint fbo = 0;
GLenum draw = GL_NONE;
GSVector2i viewport(0, 0);
GSVector4i scissor(0, 0, 0, 0);
@ -78,7 +77,6 @@ namespace GLState {
void Clear() {
fbo = 0;
draw = GL_NONE;
viewport = GSVector2i(0, 0);
scissor = GSVector4i(0, 0, 0, 0);

View File

@ -26,7 +26,6 @@
namespace GLState {
extern GLuint fbo; // frame buffer object
extern GLenum draw; // Drawing buffer
extern GSVector2i viewport;
extern GSVector4i scissor;

View File

@ -475,7 +475,6 @@ void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
gl_ClearBufferfv(GL_COLOR, 0, c.v);
} else {
OMSetFBO(m_fbo);
OMSetWriteBuffer();
OMAttachRt(static_cast<GSTextureOGL*>(t)->GetID());
gl_ClearBufferfv(GL_COLOR, 0, c.v);
@ -500,7 +499,6 @@ void GSDeviceOGL::ClearRenderTarget_ui(GSTexture* t, uint32 c)
glDisable(GL_SCISSOR_TEST);
OMSetFBO(m_fbo);
OMSetWriteBuffer();
OMAttachRt(static_cast<GSTextureOGL*>(t)->GetID());
gl_ClearBufferuiv(GL_COLOR, 0, col);
@ -529,7 +527,6 @@ void GSDeviceOGL::ClearDepth(GSTexture* t, float c)
#endif
} else {
OMSetFBO(m_fbo);
OMSetWriteBuffer();
OMAttachDs(static_cast<GSTextureOGL*>(t)->GetID());
glDisable(GL_SCISSOR_TEST);
@ -554,7 +551,6 @@ void GSDeviceOGL::ClearStencil(GSTexture* t, uint8 c)
#endif
} else {
OMSetFBO(m_fbo);
OMSetWriteBuffer();
OMAttachDs(static_cast<GSTextureOGL*>(t)->GetID());
GLint color = c;
@ -1007,9 +1003,14 @@ void GSDeviceOGL::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPxyT1* v
//
#ifdef ENABLE_OGL_STENCIL_DEBUG
DrawPrimitive();
//
#else
// normally ok without it if GL_ARB_framebuffer_no_attachments is supported (minus driver bug)
OMSetWriteBuffer(GL_NONE);
DrawPrimitive();
OMSetWriteBuffer();
#endif
EndScene();
@ -1123,13 +1124,8 @@ void GSDeviceOGL::OMSetFBO(GLuint fbo)
void GSDeviceOGL::OMSetWriteBuffer(GLenum buffer)
{
// Note if fbo is 0, standard GL_BACK will be used instead
if (GLState::fbo && GLState::draw != buffer) {
GLState::draw = buffer;
GLenum target[1] = {buffer};
gl_DrawBuffers(1, target);
}
GLenum target[1] = {buffer};
gl_DrawBuffers(1, target);
}
void GSDeviceOGL::OMSetDepthStencilState(GSDepthStencilOGL* dss, uint8 sref)
@ -1160,12 +1156,10 @@ void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVecto
if (rt == NULL || !static_cast<GSTextureOGL*>(rt)->IsBackbuffer()) {
OMSetFBO(m_fbo);
if (rt) {
OMSetWriteBuffer();
OMAttachRt(static_cast<GSTextureOGL*>(rt)->GetID());
} else {
// Note: NULL rt is only used in DATE so far.
OMAttachRt(0);
OMSetWriteBuffer(GL_NONE);
}
// Note: it must be done after OMSetFBO
@ -1180,7 +1174,6 @@ void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVecto
}
GSVector2i size = rt ? rt->GetSize() : ds->GetSize();
if(GLState::viewport != size)
{