From 53b93f8cd55c7fe84a3e24879bee74ee621e8ecb Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 22 Sep 2013 13:54:47 +0000 Subject: [PATCH] Allow GLES3 hardware to support FSAA. Need a GUI option for this on Android devices. --- Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp | 4 +--- Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp | 4 ++-- Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp index f3b8578b23..9eac9f603b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp @@ -99,7 +99,6 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms GL_REPORT_FBO_ERROR(); } -#ifndef USE_GLES3 else { // EFB targets will be renderbuffers in MSAA mode (required by OpenGL). @@ -150,7 +149,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms glBindTexture(getFbType(), m_resolvedDepthTexture); glTexParameteri(getFbType(), GL_TEXTURE_MAX_LEVEL, 0); - glTexImage2D(getFbType(), 0, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(getFbType(), 0, GL_DEPTH_COMPONENT24, m_targetWidth, m_targetHeight, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); // Bind resolved textures to resolved framebuffer. @@ -165,7 +164,6 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms glBindFramebuffer(GL_FRAMEBUFFER, m_efbFramebuffer); } -#endif // Create XFB framebuffer; targets will be created elsewhere. glGenFramebuffers(1, &m_xfbFramebuffer); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index d7a891ecd1..d5299e4c3e 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -141,7 +141,6 @@ void OpenGL_ReportARBProgramError() bool OpenGL_ReportFBOError(const char *function, const char *file, int line) { -#ifndef USE_GLES unsigned int fbo_status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (fbo_status != GL_FRAMEBUFFER_COMPLETE) { @@ -154,12 +153,14 @@ bool OpenGL_ReportFBOError(const char *function, const char *file, int line) case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: error = "INCOMPLETE_MISSING_ATTACHMENT"; break; +#ifndef USE_GLES case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: error = "INCOMPLETE_DRAW_BUFFER"; break; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: error = "INCOMPLETE_READ_BUFFER"; break; +#endif case GL_FRAMEBUFFER_UNSUPPORTED: error = "UNSUPPORTED"; break; @@ -168,7 +169,6 @@ bool OpenGL_ReportFBOError(const char *function, const char *file, int line) file, line, function, error); return false; } -#endif return true; } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index c94776ef7f..54a2ac5735 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -32,6 +32,7 @@ #define GL_BGRA GL_RGBA #define glDrawElementsBaseVertex(...) #define glDrawRangeElementsBaseVertex(...) +#define glRenderbufferStorageMultisampleCoverageNV(...) #endif #else #define TEX2D GL_TEXTURE_RECTANGLE_ARB