[Mesa-dev] [PATCH 4/8] mesa: fill in signed cases and RGBA16 in _mesa_format_matches_format_and_type
Marek Olšák
maraeo at gmail.com
Tue Jan 29 12:22:43 PST 2013
On Tue, Jan 29, 2013 at 4:31 PM, Michel Dänzer <michel at daenzer.net> wrote:
> On Die, 2013-01-29 at 14:43 +0100, Marek Olšák wrote:
>> ---
>> src/mesa/main/formats.c | 30 ++++++++++++++++++++++++++----
>> 1 file changed, 26 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
>> index 0273425..b86fb9e 100644
>> --- a/src/mesa/main/formats.c
>> +++ b/src/mesa/main/formats.c
>> @@ -3240,8 +3240,14 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
>> return format == GL_RGBA_INTEGER && type == GL_UNSIGNED_INT && !swapBytes;
>>
>> case MESA_FORMAT_DUDV8:
>> + return (format == GL_DU8DV8_ATI || format == GL_DUDV_ATI) &&
>> + type == GL_BYTE && littleEndian && !swapBytes;
>> +
>> case MESA_FORMAT_SIGNED_R8:
>> + return format == GL_RED && type == GL_BYTE && !swapBytes;
>> case MESA_FORMAT_SIGNED_RG88_REV:
>> + return format == GL_RG && type == GL_BYTE && littleEndian &&
>> + !swapBytes;
>
> The comments from my previous posts apply to these cases.
>
>
>> @@ -3264,12 +3270,17 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
>> return GL_FALSE;
>>
>> case MESA_FORMAT_SIGNED_R16:
>> + return format == GL_RED && type == GL_SHORT && littleEndian &&
>> + !swapBytes;
>> case MESA_FORMAT_SIGNED_GR1616:
>> + return format == GL_RG && type == GL_SHORT && littleEndian && !swapBytes;
>
> GL_SHORT is in host byte order, so checking for littleEndian here
> incorrectly excludes big endian hosts.
Does that apply only to X16, or even to X16Y16, or even to X16Y16Z16W16?
Marek
>
>
> The last hunk has more examples of all of the above.
>
>
> --
> Earthling Michel Dänzer | http://www.amd.com
> Libre software enthusiast | Debian, X and DRI developer
More information about the mesa-dev
mailing list