From 87942749a327725014b0d160b3e48d6d83723ac2 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 22 Nov 2013 19:49:29 -0800 Subject: mesa: Add MESA_FORMAT_ABGR2101010. Including pack/unpack and texstore code. This texture format is a requirement for ARB_shader_image_load_store. Acked-by: Chris Forbes Reviewed-by: Paul Berry --- src/mesa/main/formats.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/mesa/main/formats.c') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 7e0ec23198c..0da0dfa8ce9 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1763,6 +1763,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 16 }, + { + MESA_FORMAT_ABGR2101010, + "MESA_FORMAT_ABGR2101010", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 10, 10, 10, 2, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, }; @@ -2841,6 +2850,11 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; + case MESA_FORMAT_ABGR2101010: + *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; + *comps = 4; + return; + case MESA_FORMAT_COUNT: assert(0); return; @@ -3382,6 +3396,11 @@ _mesa_format_matches_format_and_type(gl_format gl_format, case MESA_FORMAT_XBGR32323232_UINT: case MESA_FORMAT_XBGR32323232_SINT: return GL_FALSE; + + case MESA_FORMAT_ABGR2101010: + return format == GL_RGBA && type == GL_UNSIGNED_INT_2_10_10_10_REV && + !swapBytes; + } return GL_FALSE; -- cgit v1.2.3