[Mesa-dev] [PATCH 1/2] mesa: fix comments for RG formats

Brian Paul brianp at vmware.com
Mon Nov 28 14:16:58 PST 2011


On 11/28/2011 12:24 PM, Eric Anholt wrote:
> On Mon, 28 Nov 2011 11:14:17 -0700, Brian Paul<brianp at vmware.com>  wrote:
>> The position of the red and green bits was misstated in the comments.
>> Arguably, the names of these formats should be changed to "GR" to reflect
>> the component ordering and to be consistent with other formats.
>
> Actually, could we get consistency in that naming?  Or at least a
> comment for now here and in _mesa_format_matches_format_and_type(),
> where it's likely to get screwed up?

I'm happy to rename the formats later but I'm going to push the fixed 
comment for the short term.

Looking at _mesa_format_matches_format_and_type() for RG88:

    case MESA_FORMAT_RG88:
       return format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_BYTE 
&& littleEndian;

I think that's wrong.  Is GL_LUMINANCE_ALPHA somehow compatible with 
GL_RG?  I think the code should read:

case MESA_FORMAT_RG88:
       return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian;

-Brian


More information about the mesa-dev mailing list