mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Moved another AMD-specific driver bug workaround to the OpenGL Bugs struct.
This commit is contained in:
@@ -202,11 +202,8 @@ void Image::generateMipmaps()
|
|||||||
if (flags.mipmaps && !isCompressed() &&
|
if (flags.mipmaps && !isCompressed() &&
|
||||||
(GLAD_ES_VERSION_2_0 || GLAD_VERSION_3_0 || GLAD_ARB_framebuffer_object))
|
(GLAD_ES_VERSION_2_0 || GLAD_VERSION_3_0 || GLAD_ARB_framebuffer_object))
|
||||||
{
|
{
|
||||||
// Driver bug: http://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation
|
if (gl.bugs.generateMipmapsRequiresTexture2DEnable)
|
||||||
#if defined(LOVE_WINDOWS) || defined(LOVE_LINUX)
|
|
||||||
if (gl.getVendor() == OpenGL::VENDOR_AMD)
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
#endif
|
|
||||||
|
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,9 +93,12 @@ bool OpenGL::initContext()
|
|||||||
bugs = {};
|
bugs = {};
|
||||||
|
|
||||||
#if defined(LOVE_WINDOWS) || defined(LOVE_LINUX)
|
#if defined(LOVE_WINDOWS) || defined(LOVE_LINUX)
|
||||||
// See the comment in OpenGL.h.
|
// See the comments in OpenGL.h.
|
||||||
if (getVendor() == VENDOR_AMD)
|
if (getVendor() == VENDOR_AMD)
|
||||||
|
{
|
||||||
bugs.clearRequiresDriverTextureStateUpdate = true;
|
bugs.clearRequiresDriverTextureStateUpdate = true;
|
||||||
|
bugs.generateMipmapsRequiresTexture2DEnable = true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
contextInitialized = true;
|
contextInitialized = true;
|
||||||
|
|||||||
@@ -184,6 +184,15 @@ public:
|
|||||||
**/
|
**/
|
||||||
bool clearRequiresDriverTextureStateUpdate;
|
bool clearRequiresDriverTextureStateUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AMD's Windows drivers don't always properly generate mipmaps unless
|
||||||
|
* glEnable(GL_TEXTURE_2D) is called directly before glGenerateMipmap.
|
||||||
|
* This only applies to legacy and Compatibility Profile contexts, of
|
||||||
|
* course.
|
||||||
|
* https://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation
|
||||||
|
**/
|
||||||
|
bool generateMipmapsRequiresTexture2DEnable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other bugs which have workarounds that don't use conditional code at
|
* Other bugs which have workarounds that don't use conditional code at
|
||||||
* the moment:
|
* the moment:
|
||||||
|
|||||||
Reference in New Issue
Block a user