Mesa (master): mesa: fill in YCBCR cases in _mesa_format_matches_format_and_type

Marek Olšák mareko at kemper.freedesktop.org
Mon Feb 11 18:46:17 UTC 2013


Module: Mesa
Branch: master
Commit: 43395da55ab43cf508d6211c8af4a84453af0146
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=43395da55ab43cf508d6211c8af4a84453af0146

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Jan 28 21:06:11 2013 +0100

mesa: fill in YCBCR cases in _mesa_format_matches_format_and_type

based on the texstore code

Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/mesa/main/formats.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 30f13bf..4d1222a 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -3021,8 +3021,13 @@ _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) ||
+              (type == GL_UNSIGNED_SHORT_8_8_REV_MESA && littleEndian == swapBytes));
    case MESA_FORMAT_YCBCR_REV:
-      return GL_FALSE;
+      return format == GL_YCBCR_MESA &&
+             ((type == GL_UNSIGNED_SHORT_8_8_MESA && littleEndian == swapBytes) ||
+              (type == GL_UNSIGNED_SHORT_8_8_REV_MESA && littleEndian != swapBytes));
 
    case MESA_FORMAT_R8:
       return format == GL_RED && type == GL_UNSIGNED_BYTE;




More information about the mesa-commit mailing list