Merge branch 'master' into 12.0-development

This commit is contained in:
Alex Szpakowski
2020-07-18 21:29:36 -03:00
5 changed files with 63 additions and 27 deletions
+2 -2
View File
@@ -155,11 +155,11 @@ bool OpenGL::initContext()
#ifdef LOVE_WINDOWS
if (getVendor() == VENDOR_AMD)
{
// Radeon HD drivers switched from "ATI Radeon" to "AMD Radeon" around
// Radeon 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 ") || strstr(device, "ATI Mobility Radeon HD"))
if (strstr(device, "ATI Radeon") || strstr(device, "ATI Mobility Radeon"))
bugs.texStorageBreaksSubImage = true;
}
#endif
+1 -1
View File
@@ -166,7 +166,7 @@ public:
* 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
*
* https://github.com/love2d/love/issues/1563
**/
bool texStorageBreaksSubImage;
+10
View File
@@ -42,6 +42,11 @@ static GLenum createFBO(GLuint &framebuffer, TextureType texType, PixelFormat fo
glGenFramebuffers(1, &framebuffer);
gl.bindFramebuffer(OpenGL::FRAMEBUFFER_ALL, framebuffer);
// Intel driver bug: https://github.com/love2d/love/issues/1592
bool current_srgb = gl.isStateEnabled(OpenGL::ENABLE_FRAMEBUFFER_SRGB);
if (current_srgb && isPixelFormatDepthStencil(format))
gl.setEnableState(OpenGL::ENABLE_FRAMEBUFFER_SRGB, false);
if (texture != 0)
{
if (isPixelFormatDepthStencil(format) && (GLAD_ES_VERSION_3_0 || !GLAD_ES_VERSION_2_0))
@@ -103,6 +108,11 @@ static GLenum createFBO(GLuint &framebuffer, TextureType texType, PixelFormat fo
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
gl.bindFramebuffer(OpenGL::FRAMEBUFFER_ALL, current_fbo);
// Restore sRGB state if we turned it off above.
if (current_srgb && isPixelFormatDepthStencil(format))
gl.setEnableState(OpenGL::ENABLE_FRAMEBUFFER_SRGB, current_srgb);
return status;
}