diff --git a/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp b/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp index b36c3a03..853c8c48 100644 --- a/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp +++ b/src/Graphics/OpenGLContext/opengl_BufferManipulationObjectFactory.cpp @@ -469,7 +469,8 @@ struct FramebufferTextureFormatsGLES3 : public graphics::FramebufferTextureForma return _glinfo.isGLESX && !_glinfo.isGLES2; } - FramebufferTextureFormatsGLES3() + FramebufferTextureFormatsGLES3(const GLInfo & _glinfo): + m_glinfo(_glinfo) { init(); } @@ -477,10 +478,17 @@ struct FramebufferTextureFormatsGLES3 : public graphics::FramebufferTextureForma protected: void init() override { - colorInternalFormat = GL_RGBA8; - colorFormat = GL_RGBA; - colorType = GL_UNSIGNED_BYTE; - colorFormatBytes = 4; + if (m_glinfo.renderer == Renderer::Adreno500) { + colorInternalFormat = GL_RGBA32F; + colorFormat = GL_RGBA; + colorType = GL_FLOAT; + colorFormatBytes = 16; + } else { + colorInternalFormat = GL_RGBA8; + colorFormat = GL_RGBA; + colorType = GL_UNSIGNED_BYTE; + colorFormatBytes = 4; + } monochromeInternalFormat = GL_R8; monochromeFormat = GL_RED; @@ -507,6 +515,8 @@ protected: noiseType = GL_UNSIGNED_BYTE; noiseFormatBytes = 1; } + + const GLInfo & m_glinfo; }; struct FramebufferTextureFormatsOpenGL : public graphics::FramebufferTextureFormats @@ -629,7 +639,7 @@ graphics::FramebufferTextureFormats * BufferManipulationObjectFactory::getFrameb return new FramebufferTextureFormatsOpenGL; if (FramebufferTextureFormatsGLES3::Check(m_glInfo)) - return new FramebufferTextureFormatsGLES3; + return new FramebufferTextureFormatsGLES3(m_glInfo); if (FramebufferTextureFormatsGLES2::Check(m_glInfo)) return new FramebufferTextureFormatsGLES2(m_glInfo); diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp index 25b7dd63..8bf2b929 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp @@ -2,6 +2,7 @@ #include #include "opengl_Utils.h" #include "opengl_GLInfo.h" +#include #ifdef EGL #include #endif @@ -25,7 +26,10 @@ void GLInfo::init() { LOG(LOG_VERBOSE, "OpenGL vendor: %s\n", glGetString(GL_VENDOR)); const GLubyte * strRenderer = glGetString(GL_RENDERER); - if (strstr((const char*)strRenderer, "Adreno") != nullptr) + + if (std::regex_match((const char*)strRenderer, std::regex("Adreno.*5\\d\\d") )) + renderer = Renderer::Adreno500; + else if (strstr((const char*)strRenderer, "Adreno") != nullptr) renderer = Renderer::Adreno; else if (strstr((const char*)strRenderer, "VideoCore IV") != nullptr) renderer = Renderer::VideoCore; diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.h b/src/Graphics/OpenGLContext/opengl_GLInfo.h index cacf72be..50e2ff27 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.h +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.h @@ -4,6 +4,7 @@ namespace opengl { enum class Renderer { + Adreno500, Adreno, VideoCore, Intel,