[Mesa-dev] [PATCH 2/8] mesa: fill in YCBCR cases in _mesa_format_matches_format_and_type
Michel Dänzer
michel at daenzer.net
Tue Jan 29 07:18:17 PST 2013
On Die, 2013-01-29 at 14:43 +0100, Marek Olšák wrote:
> based on the texstore code
> ---
> src/mesa/main/formats.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
> index 9dab545..d39831c 100644
> --- a/src/mesa/main/formats.c
> +++ b/src/mesa/main/formats.c
> @@ -3021,8 +3021,12 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
> littleEndian && !swapBytes;
>
> case MESA_FORMAT_YCBCR:
> + return format == GL_YCBCR_MESA && type == GL_UNSIGNED_SHORT_8_8_MESA &&
> + littleEndian && !swapBytes;
Instead of 'littleEndian && !swapBytes', something like 'littleEndian !=
swapBytes' should also cover big endian hosts with byte swapping
enabled.
> case MESA_FORMAT_YCBCR_REV:
> - return GL_FALSE;
> + return format == GL_YCBCR_MESA &&
> + type == GL_UNSIGNED_SHORT_8_8_REV_MESA && littleEndian &&
> + !swapBytes;
Also, something like 'type == GL_UNSIGNED_SHORT_8_8_MESA && littleEndian
== swapBytes' (reversed type with byte swapping on little endian or none
on big endian) should work here as well, shouldn't it? And
correspondingly for the MESA_FORMAT_YCBCR case.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer
More information about the mesa-dev
mailing list