From: Jordan Justen Date: Thu, 27 Dec 2012 20:34:03 +0000 (-0800) Subject: texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c3a2b51b85a90cfe670e1ca81ce86c8fa0d448d;p=mesa.git texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV 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 Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index b3ffc6c51bc..4fb4b70f973 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);