diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index 7c12de620..674be5fcb 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/src/modules/graphics/opengl/OpenGL.cpp @@ -156,6 +156,18 @@ bool OpenGL::initContext() } #endif +#ifdef LOVE_WINDOWS + if (getVendor() == VENDOR_AMD) + { + // Radeon HD drivers switched from "ATI Radeon" to "AMD Radeon" around + // the 7000 series. We'll assume this bug doesn't affect those newer + // GPUs / drivers. + const char *device = (const char *) glGetString(GL_RENDERER); + if (strstr(device, "ATI Radeon HD ")) + bugs.texStorageBreaksSubImage = true; + } +#endif + contextInitialized = true; return true; @@ -282,7 +294,7 @@ void OpenGL::initVendor() // http://feedback.wildfiregames.com/report/opengl/feature/GL_VENDOR // http://stackoverflow.com/questions/2093594/opengl-extensions-available-on-different-android-devices - // http://opengl.gpuinfo.org/gl_stats_caps_single.php?listreportsbycap=GL_VENDOR + // https://opengl.gpuinfo.org/displaycapability.php?name=GL_VENDOR if (strstr(vstr, "ATI Technologies") || strstr(vstr, "AMD") || strstr(vstr, "Advanced Micro Devices")) vendor = VENDOR_AMD; else if (strstr(vstr, "NVIDIA")) @@ -1168,6 +1180,9 @@ bool OpenGL::isTexStorageSupported() supportsTexStorage = true; #endif + if (gl.bugs.texStorageBreaksSubImage) + supportsTexStorage = false; + return supportsTexStorage; } diff --git a/src/modules/graphics/opengl/OpenGL.h b/src/modules/graphics/opengl/OpenGL.h index 1551e2c9b..5dff6dc64 100644 --- a/src/modules/graphics/opengl/OpenGL.h +++ b/src/modules/graphics/opengl/OpenGL.h @@ -159,6 +159,16 @@ public: **/ bool clientWaitSyncStalls; + /** + * glTexStorage on some older AMD/ATI graphics drivers on Windows seems + * to break subsequent sub-rectangle glTexSubImage calls after an + * initial full-size one (determined after some investigation with an + * affected user on Discord.) + * https://bitbucket.org/rude/love/issues/1436/bug-with-lovegraphicsprint-on-older-ati + * + **/ + bool texStorageBreaksSubImage; + /** * Other bugs which have workarounds that don't use conditional code at * the moment: