From 05295254b65630f31c3e63c201147a91f77ea183 Mon Sep 17 00:00:00 2001 From: Francisco Zurita Date: Thu, 21 Dec 2017 00:17:27 -0500 Subject: [PATCH] Fix slow down on Adreno 540 GPUs. --- .../opengl_BufferManipulationObjectFactory.cpp | 2 +- src/Graphics/OpenGLContext/opengl_GLInfo.cpp | 7 +++++-- src/Graphics/OpenGLContext/opengl_GLInfo.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp b/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp index 853c8c48..f63d6484 100644 --- a/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp +++ b/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp @@ -478,7 +478,7 @@ struct FramebufferTextureFormatsGLES3 : public graphics::FramebufferTextureForma protected: void init() override { - if (m_glinfo.renderer == Renderer::Adreno500) { + if (m_glinfo.renderer == Renderer::Adreno530) { colorInternalFormat = GL_RGBA32F; colorFormat = GL_RGBA; colorType = GL_FLOAT; diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp index 900bc4e6..9c954004 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp @@ -27,8 +27,11 @@ void GLInfo::init() { LOG(LOG_VERBOSE, "OpenGL vendor: %s\n", glGetString(GL_VENDOR)); const GLubyte * strRenderer = glGetString(GL_RENDERER); - if (std::regex_match(std::string((const char*)strRenderer), std::regex("Adreno.*5\\d\\d") )) - renderer = Renderer::Adreno500; + if (std::regex_match(std::string((const char*)strRenderer), std::regex("Adreno.*530"))) + renderer = Renderer::Adreno530; + else if (std::regex_match(std::string((const char*)strRenderer), std::regex("Adreno.*540")) || + std::regex_match(std::string((const char*)strRenderer), std::regex("Adreno.*6\\d\\d"))) + renderer = Renderer::Adreno_no_bugs; else if (strstr((const char*)strRenderer, "Adreno") != nullptr) renderer = Renderer::Adreno; else if (strstr((const char*)strRenderer, "VideoCore IV") != nullptr) diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.h b/src/Graphics/OpenGLContext/opengl_GLInfo.h index 50e2ff27..97681153 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.h +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.h @@ -4,7 +4,8 @@ namespace opengl { enum class Renderer { - Adreno500, + Adreno530, + Adreno_no_bugs, Adreno, VideoCore, Intel,