[Mesa-dev] [PATCH 2/8] mesa: fill in YCBCR cases in _mesa_format_matches_format_and_type

Marek Olšák maraeo at gmail.com
Tue Jan 29 11:28:43 PST 2013


based on the texstore code
---
 src/mesa/main/formats.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 9dab545..17f9383 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;
-- 
1.7.10.4



More information about the mesa-dev mailing list