mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Merge branch '12.0-development' into GraphicsBuffer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user