[Mesa-dev] [PATCH] mesa: add MESA_FORMAT_R8G8B8A8_SRGB

Brian Paul brianp at vmware.com
Thu Mar 6 10:22:04 PST 2014


On 03/06/2014 11:09 AM, Roland Scheidegger wrote:
> Just one typo otherwise looks good (though I couldn't tell if it would
> be missing in one of these swtich statements...).
>
> Roland
>
> Am 06.03.2014 18:58, schrieb Brian Paul:
>> To match PIPE_FORMAT_R8G8B8A8_SRGB.
>> ---
>>   src/mesa/main/format_pack.c      |   27 +++++++++++++++++++++++++++
>>   src/mesa/main/format_unpack.c    |   14 ++++++++++++++
>>   src/mesa/main/formats.c          |   15 +++++++++++++++
>>   src/mesa/main/formats.h          |    1 +
>>   src/mesa/main/texstore.c         |    3 +++
>>   src/mesa/swrast/s_texfetch.c     |    6 ++++++
>>   src/mesa/swrast/s_texfetch_tmp.h |   13 +++++++++++++
>>   7 files changed, 79 insertions(+)
>>
>> diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
>> index b870001..3c14d8f 100644
>> --- a/src/mesa/main/format_pack.c
>> +++ b/src/mesa/main/format_pack.c
>> @@ -1108,6 +1108,31 @@ pack_float_SARGB8(const GLfloat src[4], void *dst)
>>   }
>>
>>
>> +/* MESA_FORMAT_R8G8B8A8_SRGB */
>> +
>> +static void
>> +pack_ubyte_SABGR8(const GLubyte src[4], void *dst)
>> +{
>> +   GLuint *d = ((GLuint *) dst);
>> +   GLubyte r = linear_ubyte_to_srgb_ubyte(src[RCOMP]);
>> +   GLubyte g = linear_ubyte_to_srgb_ubyte(src[RCOMP]);
>> +   GLubyte b = linear_ubyte_to_srgb_ubyte(src[RCOMP]);
> That should be GCOMP/BCOMP for g/b respectively.
> I bet you copied it from either pack_ubyte_SARGB() or pack_ubyte_SRGB8()
> but not from pack_ubyte_SRGBA8() :-).

D'oh!  Thanks.

I'll fix pack_ubyte_SRGB8() too.

-Brian



More information about the mesa-dev mailing list