aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/format_pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/format_pack.c')
-rw-r--r--mesalib/src/mesa/main/format_pack.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/format_pack.c b/mesalib/src/mesa/main/format_pack.c
index 7f0bda127..be6c026e8 100644
--- a/mesalib/src/mesa/main/format_pack.c
+++ b/mesalib/src/mesa/main/format_pack.c
@@ -1005,6 +1005,32 @@ pack_float_ARGB2101010(const GLfloat src[4], void *dst)
}
+/* MESA_FORMAT_ABGR2101010_UINT */
+
+static void
+pack_ubyte_ABGR2101010_UINT(const GLubyte src[4], void *dst)
+{
+ GLuint *d = ((GLuint *) dst);
+ GLushort r = UBYTE_TO_USHORT(src[RCOMP]);
+ GLushort g = UBYTE_TO_USHORT(src[GCOMP]);
+ GLushort b = UBYTE_TO_USHORT(src[BCOMP]);
+ GLushort a = UBYTE_TO_USHORT(src[ACOMP]);
+ *d = PACK_COLOR_2101010_US(a, b, g, r);
+}
+
+static void
+pack_float_ABGR2101010_UINT(const GLfloat src[4], void *dst)
+{
+ GLuint *d = ((GLuint *) dst);
+ GLushort r, g, b, a;
+ UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]);
+ UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]);
+ *d = PACK_COLOR_2101010_US(a, b, g, r);
+}
+
+
/* MESA_FORMAT_SRGB8 */
static void
@@ -1696,6 +1722,7 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format)
table[MESA_FORMAT_RG1616] = pack_ubyte_RG1616;
table[MESA_FORMAT_RG1616_REV] = pack_ubyte_RG1616_REV;
table[MESA_FORMAT_ARGB2101010] = pack_ubyte_ARGB2101010;
+ table[MESA_FORMAT_ABGR2101010_UINT] = pack_ubyte_ABGR2101010_UINT;
/* should never convert RGBA to these formats */
table[MESA_FORMAT_Z24_S8] = NULL;
@@ -1841,6 +1868,7 @@ _mesa_get_pack_float_rgba_function(gl_format format)
table[MESA_FORMAT_RG1616] = pack_float_RG1616;
table[MESA_FORMAT_RG1616_REV] = pack_float_RG1616_REV;
table[MESA_FORMAT_ARGB2101010] = pack_float_ARGB2101010;
+ table[MESA_FORMAT_ABGR2101010_UINT] = pack_float_ABGR2101010_UINT;
/* should never convert RGBA to these formats */
table[MESA_FORMAT_Z24_S8] = NULL;