mesa: fill in YCBCR cases in _mesa_format_matches_format_and_type
authorMarek Olšák <maraeo@gmail.com>
Mon, 28 Jan 2013 20:06:11 +0000 (21:06 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 11 Feb 2013 18:43:01 +0000 (19:43 +0100)
based on the texstore code

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/mesa/main/formats.c

index 30f13bfd8ccfacc437f946170a0f605d07fbef18..4d1222ae31ae7ac190bc3c1f5ed2a9c755fc5f11 100644 (file)
@@ -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;