texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 27 Dec 2012 20:34:03 +0000 (12:34 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Sat, 12 Jan 2013 09:46:12 +0000 (01:46 -0800)
Choose MESA_FORMAT_ARGB2101010 when storing
GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV or
GL_RGB + GL_UNSIGNED_INT_2_10_10_10_REV.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/texformat.c

index b3ffc6c51bce64e9c50ebe32b792f39f989e2915..4fb4b70f973834dfe49385494d989c542381eb76 100644 (file)
@@ -75,7 +75,9 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
            RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444);
         } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
            RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555);
-        }
+         } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+            RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
+         }
         RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
         RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
         break;
@@ -111,6 +113,10 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
       /* shallow RGB formats */
       case 3:
       case GL_RGB:
+         if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+            RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
+         }
+         /* fallthrough */
       case GL_RGB8:
         RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
         RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);