[Mesa-dev] [PATCH] mesa: Allow MESA_FORMAT_LAYOUT_S3TC in non-desktop mesa

Gao, Chun chun.gao at intel.com
Wed May 17 08:49:51 UTC 2017


Thanks for your comments. Are we working on GL_EXT_sRGB, or is there any plan for that?

-----Original Message-----
From: Palli, Tapani 
Sent: Wednesday, May 17, 2017 4:35 PM
To: Gao, Chun <chun.gao at intel.com>; mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH] mesa: Allow MESA_FORMAT_LAYOUT_S3TC in non-desktop mesa



On 05/17/2017 11:09 AM, Gao, Chun wrote:
> I know EXT_texture_sRGB  is desktop OpenGL extension.
> On Android-IA and ChromeOS ARC++, the game https://play.google.com/store/apps/details?id=com.eline.neveralonemobile could not display some texture correctly. I found the following formats which the game uses were blocked in _mesa_is_compressed_format():
> GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
> GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
> GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
> GL_COMPRESSED_RGB_S3TC_DXT1_EXT
> 
> After removing _mesa_is_desktop_gl(ctx), the issue get fixed. I don't know why the android game uses desktop OpenGL formats GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT and GL_COMPRESSED_SRGB_S3TC_DXT1_EXT.  To make it work, I removed the desktop check.

OK, this is useful information and means that the game has a bug.

If I understand requirements correctly here if/when GL_EXT_sRGB extension support is added, then this game should start to work OK.


> 
> -----Original Message-----
> From: Palli, Tapani
> Sent: Wednesday, May 17, 2017 3:36 PM
> To: Gao, Chun <chun.gao at intel.com>; mesa-dev at lists.freedesktop.org
> Subject: Re: [Mesa-dev] [PATCH] mesa: Allow MESA_FORMAT_LAYOUT_S3TC in non-desktop mesa
> 
> IMO this is not correct. Are you having problems with some application?
> 
> For Android games Mesa should already return true for the previous check
> (ANGLE_texture_compression_dxt) and things should work OK. The check you are touching is desktop specific because EXT_texture_sRGB is available only on desktop GL (closest gles equivalent being GL_EXT_sRGB which we don't support).
> 
> 
> On 05/17/2017 10:22 AM, Gao Chun wrote:
>> As s3tc formats are used in many Android games, desktop mesa check
>> should be removed for MESA_FORMAT_LAYOUT_S3TC.
>> ---
>>    src/mesa/main/glformats.c | 3 +--
>>    1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
>> index 4f240206ff45..e4f283c4dfa8 100644
>> --- a/src/mesa/main/glformats.c
>> +++ b/src/mesa/main/glformats.c
>> @@ -1376,8 +1376,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
>>              */
>>             return ctx->Extensions.ANGLE_texture_compression_dxt;
>>          } else {
>> -         return _mesa_is_desktop_gl(ctx)
>> -            && ctx->Extensions.EXT_texture_sRGB
>> +         return ctx->Extensions.EXT_texture_sRGB
>>                && ctx->Extensions.EXT_texture_compression_s3tc;
>>          }
>>       case MESA_FORMAT_LAYOUT_FXT1:
>>


More information about the mesa-dev mailing list