mirror of https://github.com/PCSX2/pcsx2.git
gsdx: openglES fix
* require a 3.1 context * unattach texture of the fbo when they're not used (avoid to have a texture and depth_stencil with different size) Note: except minor shader bug it works on Nvidia 340.23.01
This commit is contained in:
parent
9656fad0f5
commit
d51f008c72
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2011-2013 Gregory hainaut
|
* Copyright (C) 2011-2014 Gregory hainaut
|
||||||
* Copyright (C) 2007-2009 Gabest
|
* Copyright (C) 2007-2009 Gabest
|
||||||
*
|
*
|
||||||
* This Program is free software; you can redistribute it and/or modify
|
* This Program is free software; you can redistribute it and/or modify
|
||||||
|
@ -1140,19 +1140,21 @@ void GSDeviceOGL::OMSetBlendState(GSBlendStateOGL* bs, float bf)
|
||||||
void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector4i* scissor)
|
void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector4i* scissor)
|
||||||
{
|
{
|
||||||
if (rt == NULL || !static_cast<GSTextureOGL*>(rt)->IsBackbuffer()) {
|
if (rt == NULL || !static_cast<GSTextureOGL*>(rt)->IsBackbuffer()) {
|
||||||
|
OMSetFBO(m_fbo);
|
||||||
if (rt) {
|
if (rt) {
|
||||||
OMSetFBO(m_fbo);
|
|
||||||
OMSetWriteBuffer();
|
OMSetWriteBuffer();
|
||||||
OMAttachRt(static_cast<GSTextureOGL*>(rt)->GetID());
|
OMAttachRt(static_cast<GSTextureOGL*>(rt)->GetID());
|
||||||
} else {
|
} else {
|
||||||
// Note: NULL rt is only used in DATE so far.
|
// Note: NULL rt is only used in DATE so far.
|
||||||
OMSetFBO(m_fbo);
|
OMAttachRt(0);
|
||||||
OMSetWriteBuffer(GL_NONE);
|
OMSetWriteBuffer(GL_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: it must be done after OMSetFBO
|
// Note: it must be done after OMSetFBO
|
||||||
if (ds)
|
if (ds)
|
||||||
OMAttachDs(static_cast<GSTextureOGL*>(ds)->GetID());
|
OMAttachDs(static_cast<GSTextureOGL*>(ds)->GetID());
|
||||||
|
else
|
||||||
|
OMAttachDs(0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Render in the backbuffer
|
// Render in the backbuffer
|
||||||
|
@ -1209,7 +1211,7 @@ void GSDeviceOGL::CheckDebugLog()
|
||||||
void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message)
|
void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message)
|
||||||
{
|
{
|
||||||
#ifndef ENABLE_GLES
|
#ifndef ENABLE_GLES
|
||||||
char debType[20], debSev[5];
|
char debType[20], debSev[6];
|
||||||
static int sev_counter = 0;
|
static int sev_counter = 0;
|
||||||
|
|
||||||
if(type == GL_DEBUG_TYPE_ERROR_ARB)
|
if(type == GL_DEBUG_TYPE_ERROR_ARB)
|
||||||
|
@ -1235,6 +1237,8 @@ void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsi
|
||||||
strcpy(debSev, "Med");
|
strcpy(debSev, "Med");
|
||||||
else if(severity == GL_DEBUG_SEVERITY_LOW_ARB)
|
else if(severity == GL_DEBUG_SEVERITY_LOW_ARB)
|
||||||
strcpy(debSev, "Low");
|
strcpy(debSev, "Low");
|
||||||
|
else
|
||||||
|
strcpy(debSev, "None");
|
||||||
|
|
||||||
#ifdef LOUD_DEBUGGING
|
#ifdef LOUD_DEBUGGING
|
||||||
fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", debType, g_draw_count, debSev,message);
|
fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", debType, g_draw_count, debSev,message);
|
||||||
|
|
|
@ -137,7 +137,7 @@ bool GSWndEGL::Attach(void* handle, bool managed)
|
||||||
|
|
||||||
#ifdef ENABLE_GLES
|
#ifdef ENABLE_GLES
|
||||||
// FIXME: update it to GLES 3.1 when they support it
|
// FIXME: update it to GLES 3.1 when they support it
|
||||||
CreateContext(3, 0);
|
CreateContext(3, 1);
|
||||||
#else
|
#else
|
||||||
CreateContext(3, 3);
|
CreateContext(3, 3);
|
||||||
#endif
|
#endif
|
||||||
|
@ -189,7 +189,7 @@ bool GSWndEGL::Create(const string& title, int w, int h)
|
||||||
|
|
||||||
#ifdef ENABLE_GLES
|
#ifdef ENABLE_GLES
|
||||||
// FIXME: update it to GLES 3.1 when they support it
|
// FIXME: update it to GLES 3.1 when they support it
|
||||||
CreateContext(3, 0);
|
CreateContext(3, 1);
|
||||||
#else
|
#else
|
||||||
CreateContext(3, 3);
|
CreateContext(3, 3);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue