[Mesa-dev] [PATCH 2/2] mesa: Add fall-back formats for unsupported snorm formats

Ian Romanick idr at freedesktop.org
Mon Apr 4 09:29:20 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/02/2011 08:52 PM, Kenneth Graunke wrote:
> On 04/02/2011 07:18 PM, Ian Romanick wrote:
>> From: Ian Romanick<ian.d.romanick at intel.com>
>>
>> At some point it would be interesting to try providing
>> device-independent conversions using EXT_texture_swizzle.  The drivers
>> that support EXT_texture_swizzle could, for example, see
>> GL_LUMINANCE16_SNORM as MESA_FORMAT_SIGNED_R16 with a { r, r, r, 1 }
>> swizzle.  Care would need to be taken to prevent issues with using
>> those textures for FBO rendering.

[snip]

>> @@ -411,18 +411,27 @@ _mesa_choose_tex_format( struct gl_context *ctx,
>> GLint internalFormat,
>>            case GL_ALPHA_SNORM:
>>            case GL_ALPHA8_SNORM:
>>               RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A8);
>> +        RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
>> +        RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
> 
> I'm probably being dense here, but if RGBA8888 works as a fallback,
> couldn't R8 work as well?

I missed the actual review comments when I first read this. :)  R8 would
be possible, but only with the texture swizzle changes that I mention
above.  As Marek mentioned in his reply, R8 reads R001, but A8 reads
000A.  With texture swizzle we could change 000X to X001.

As I mentioned above, this would take a lot more time than I have to
spend right now.  It would also be a fairly invasive change, so it would
need quite a bit more testing (both performance and correctness).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2Z8eAACgkQX1gOwKyEAw9i9ACfUIFvNcuYBUpqb13Jt2tuncZd
1GQAnAsthY9K0ZP59zYdTiB0yPjS+r5D
=6HH6
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list