1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Use floating point frame buffer format for Adreno 500 series GPUs

This commit is contained in:
Francisco Zurita 2017-04-15 23:05:15 -04:00 committed by Sergey Lipskiy
parent 38060cc368
commit 4a8ae7e1cf
3 changed files with 22 additions and 7 deletions

View File

@ -469,7 +469,8 @@ struct FramebufferTextureFormatsGLES3 : public graphics::FramebufferTextureForma
return _glinfo.isGLESX && !_glinfo.isGLES2; return _glinfo.isGLESX && !_glinfo.isGLES2;
} }
FramebufferTextureFormatsGLES3() FramebufferTextureFormatsGLES3(const GLInfo & _glinfo):
m_glinfo(_glinfo)
{ {
init(); init();
} }
@ -477,10 +478,17 @@ struct FramebufferTextureFormatsGLES3 : public graphics::FramebufferTextureForma
protected: protected:
void init() override void init() override
{ {
colorInternalFormat = GL_RGBA8; if (m_glinfo.renderer == Renderer::Adreno500) {
colorFormat = GL_RGBA; colorInternalFormat = GL_RGBA32F;
colorType = GL_UNSIGNED_BYTE; colorFormat = GL_RGBA;
colorFormatBytes = 4; colorType = GL_FLOAT;
colorFormatBytes = 16;
} else {
colorInternalFormat = GL_RGBA8;
colorFormat = GL_RGBA;
colorType = GL_UNSIGNED_BYTE;
colorFormatBytes = 4;
}
monochromeInternalFormat = GL_R8; monochromeInternalFormat = GL_R8;
monochromeFormat = GL_RED; monochromeFormat = GL_RED;
@ -507,6 +515,8 @@ protected:
noiseType = GL_UNSIGNED_BYTE; noiseType = GL_UNSIGNED_BYTE;
noiseFormatBytes = 1; noiseFormatBytes = 1;
} }
const GLInfo & m_glinfo;
}; };
struct FramebufferTextureFormatsOpenGL : public graphics::FramebufferTextureFormats struct FramebufferTextureFormatsOpenGL : public graphics::FramebufferTextureFormats
@ -629,7 +639,7 @@ graphics::FramebufferTextureFormats * BufferManipulationObjectFactory::getFrameb
return new FramebufferTextureFormatsOpenGL; return new FramebufferTextureFormatsOpenGL;
if (FramebufferTextureFormatsGLES3::Check(m_glInfo)) if (FramebufferTextureFormatsGLES3::Check(m_glInfo))
return new FramebufferTextureFormatsGLES3; return new FramebufferTextureFormatsGLES3(m_glInfo);
if (FramebufferTextureFormatsGLES2::Check(m_glInfo)) if (FramebufferTextureFormatsGLES2::Check(m_glInfo))
return new FramebufferTextureFormatsGLES2(m_glInfo); return new FramebufferTextureFormatsGLES2(m_glInfo);

View File

@ -2,6 +2,7 @@
#include <Config.h> #include <Config.h>
#include "opengl_Utils.h" #include "opengl_Utils.h"
#include "opengl_GLInfo.h" #include "opengl_GLInfo.h"
#include <regex>
#ifdef EGL #ifdef EGL
#include <EGL/egl.h> #include <EGL/egl.h>
#endif #endif
@ -25,7 +26,10 @@ void GLInfo::init() {
LOG(LOG_VERBOSE, "OpenGL vendor: %s\n", glGetString(GL_VENDOR)); LOG(LOG_VERBOSE, "OpenGL vendor: %s\n", glGetString(GL_VENDOR));
const GLubyte * strRenderer = glGetString(GL_RENDERER); 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; renderer = Renderer::Adreno;
else if (strstr((const char*)strRenderer, "VideoCore IV") != nullptr) else if (strstr((const char*)strRenderer, "VideoCore IV") != nullptr)
renderer = Renderer::VideoCore; renderer = Renderer::VideoCore;

View File

@ -4,6 +4,7 @@
namespace opengl { namespace opengl {
enum class Renderer { enum class Renderer {
Adreno500,
Adreno, Adreno,
VideoCore, VideoCore,
Intel, Intel,