summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2012-12-27 12:34:03 -0800
committerJordan Justen <jordan.l.justen@intel.com>2013-01-04 17:26:02 -0800
commitae0120f247e62d9bae6620e70bbc24bcd1c1b5e3 (patch)
tree791c9dc98966839e04a3230714e5ca16705a19c8
parent787bbe65fffdad786e4af760fbd5612db97041a7 (diff)
texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REVgles3-fmt-v1
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>
-rw-r--r--src/mesa/main/texformat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index b3ffc6c51b..4fb4b70f97 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -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);