mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fix sRGB texture internal formats in OpenGL ES 3.
This commit is contained in:
@@ -1701,7 +1701,14 @@ OpenGL::TextureFormat OpenGL::convertPixelFormat(PixelFormat pixelformat, bool r
|
||||
|
||||
if (!isPixelFormatCompressed(pixelformat))
|
||||
{
|
||||
if (GLAD_ES_VERSION_2_0 && !(GLAD_ES_VERSION_3_0 && pixelformat == PIXELFORMAT_LA8)
|
||||
// glTexImage in OpenGL ES 2 only accepts internal format enums that
|
||||
// match the external format. GLES3 doesn't have that restriction -
|
||||
// except for GL_LUMINANCE_ALPHA which doesn't have a sized version in
|
||||
// ES3. However we always use RG8 for PIXELFORMAT_LA8 on GLES3 so it
|
||||
// doesn't matter there.
|
||||
// Also note that GLES2+extension sRGB format enums are different from
|
||||
// desktop GL and GLES3+ (this is handled above).
|
||||
if (GLAD_ES_VERSION_2_0 && !GLAD_ES_VERSION_3_0
|
||||
&& !renderbuffer && !isTexStorageSupported())
|
||||
{
|
||||
f.internalformat = f.externalformat;
|
||||
|
||||
Reference in New Issue
Block a user