From 65ea1eb91a435ccc125f977199cd5cb19d1306e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 26 Aug 2019 02:02:24 +0200 Subject: [PATCH] GL: properly use sRGB PixelFormat for sRGB ETC compressed formats. --- src/Magnum/GL/AbstractTexture.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp index 3320dced9..209c1b767 100644 --- a/src/Magnum/GL/AbstractTexture.cpp +++ b/src/Magnum/GL/AbstractTexture.cpp @@ -678,7 +678,6 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::CompressedRGB8Etc2: - case TextureFormat::CompressedSRGB8Etc2: #endif case TextureFormat::CompressedRGBS3tcDxt1: #ifdef MAGNUM_TARGET_GLES @@ -693,6 +692,9 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8: #endif + #ifndef MAGNUM_TARGET_GLES2 + case TextureFormat::CompressedSRGB8Etc2: + #endif case TextureFormat::CompressedSRGBS3tcDxt1: #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) case TextureFormat::CompressedSRGBPvrtc2bppV1: @@ -748,9 +750,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::CompressedRGB8PunchthroughAlpha1Etc2: - case TextureFormat::CompressedSRGB8PunchthroughAlpha1Etc2: case TextureFormat::CompressedRGBA8Etc2Eac: - case TextureFormat::CompressedSRGB8Alpha8Etc2Eac: #endif case TextureFormat::CompressedRGBAS3tcDxt1: case TextureFormat::CompressedRGBAS3tcDxt3: @@ -784,6 +784,10 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL) case TextureFormat::CompressedSRGBAlphaBptcUnorm: #endif + #ifndef MAGNUM_TARGET_GLES2 + case TextureFormat::CompressedSRGB8PunchthroughAlpha1Etc2: + case TextureFormat::CompressedSRGB8Alpha8Etc2Eac: + #endif case TextureFormat::CompressedSRGBAlphaS3tcDxt1: case TextureFormat::CompressedSRGBAlphaS3tcDxt3: case TextureFormat::CompressedSRGBAlphaS3tcDxt5: