Work around certain buggy Vivante GPU drivers on Android

love2d/love-android#204
This commit is contained in:
Alex Szpakowski
2021-04-17 15:09:21 -03:00
parent 977c690fa9
commit e9c58c8192
3 changed files with 22 additions and 4 deletions
+14 -3
View File
@@ -124,6 +124,20 @@ bool OpenGL::initContext()
if (!gladLoadGLLoader(LOVEGetProcAddress))
return false;
initVendor();
bugs = {};
if (GLAD_ES_VERSION_3_0 && !GLAD_ES_VERSION_3_1)
{
const char *device = (const char *) glGetString(GL_RENDERER);
if (getVendor() == VENDOR_VIVANTE && strstr(device, "Vivante GC7000UL"))
bugs.brokenGLES3 = true;
}
if (bugs.brokenGLES3)
GLAD_ES_VERSION_3_0 = false;
if (GLAD_VERSION_3_2)
{
GLint profileMask = 0;
@@ -134,9 +148,6 @@ bool OpenGL::initContext()
coreProfile = false;
initOpenGLFunctions();
initVendor();
bugs = {};
#if defined(LOVE_WINDOWS) || defined(LOVE_LINUX)
// See the comments in OpenGL.h.
+7
View File
@@ -184,6 +184,13 @@ public:
**/
bool brokenSRGB;
/**
* Some Android graphics drivers claim to support GLES3.0 but have bugs
* with certain aspects that users expect to work. For example:
* https://github.com/love2d/love-android/issues/204
**/
bool brokenGLES3;
/**
* Other bugs which have workarounds that don't use conditional code at
* the moment: