summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-07-30 02:48:37 +0100
committerDave Airlie <airlied@redhat.com>2015-09-02 09:26:34 +1000
commitc3c242070e868225a81e1afe5fb424c33eb94c2f (patch)
tree702295029e226347b07f36777b5311e0a7bde576 /src/mesa/main/formats.c
parent8185a02316cfb7dc3d64b8772af82ad2bb49754e (diff)
downloadexternal_mesa3d-c3c242070e868225a81e1afe5fb424c33eb94c2f.zip
external_mesa3d-c3c242070e868225a81e1afe5fb424c33eb94c2f.tar.gz
external_mesa3d-c3c242070e868225a81e1afe5fb424c33eb94c2f.tar.bz2
mesa/formats: 8-bit channel integer formats addition
Add enough 8-bit channel formats to handle all the different things CTS throws at us. Cc: "11.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 6f4ee0d..982103f 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -926,6 +926,10 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
case MESA_FORMAT_R8G8B8X8_UNORM:
case MESA_FORMAT_B8G8R8X8_UNORM:
case MESA_FORMAT_X8R8G8B8_UNORM:
+ case MESA_FORMAT_A8B8G8R8_UINT:
+ case MESA_FORMAT_R8G8B8A8_UINT:
+ case MESA_FORMAT_B8G8R8A8_UINT:
+ case MESA_FORMAT_A8R8G8B8_UINT:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
@@ -2035,6 +2039,45 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
case MESA_FORMAT_R5G5B5A1_UINT:
return format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_1_5_5_5_REV;
+ case MESA_FORMAT_A8B8G8R8_UINT:
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
+ return GL_TRUE;
+
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8_REV && swapBytes)
+ return GL_TRUE;
+ return GL_FALSE;
+
+ case MESA_FORMAT_A8R8G8B8_UINT:
+ if (format == GL_BGRA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8 &&
+ !swapBytes)
+ return GL_TRUE;
+
+ if (format == GL_BGRA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
+ swapBytes)
+ return GL_TRUE;
+
+ return GL_FALSE;
+
+ case MESA_FORMAT_R8G8B8A8_UINT:
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
+ !swapBytes)
+ return GL_TRUE;
+
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8 && swapBytes)
+ return GL_TRUE;
+
+ return GL_FALSE;
+
+ case MESA_FORMAT_B8G8R8A8_UINT:
+ if (format == GL_BGRA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
+ !swapBytes)
+ return GL_TRUE;
+
+ if (format == GL_BGRA_INTEGER && type == GL_UNSIGNED_INT_8_8_8_8 && swapBytes)
+ return GL_TRUE;
+
+ return GL_FALSE;
+
case MESA_FORMAT_R9G9B9E5_FLOAT:
return format == GL_RGB && type == GL_UNSIGNED_INT_5_9_9_9_REV &&
!swapBytes;