summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-07-30 02:48:36 +0100
committerDave Airlie <airlied@redhat.com>2015-09-02 09:26:13 +1000
commit8185a02316cfb7dc3d64b8772af82ad2bb49754e (patch)
tree48c64dae9bc31f4c247ca8a7ccb7cc5e9a28288b /src/mesa/main/formats.c
parent5b6c7da460b8f6c908df7060ec0709a9848ce160 (diff)
downloadexternal_mesa3d-8185a02316cfb7dc3d64b8772af82ad2bb49754e.zip
external_mesa3d-8185a02316cfb7dc3d64b8772af82ad2bb49754e.tar.gz
external_mesa3d-8185a02316cfb7dc3d64b8772af82ad2bb49754e.tar.bz2
mesa/formats: add some formats from GL3.3
GL3.3 added GL_ARB_texture_rgb10_a2ui, which specifies a lot more things than just rgb10/a2ui. While playing with ogl conform one of the tests must attempted all valid formats for GL3.3 and hits the unreachable here. This adds the first chunk of formats that hit the assert. 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.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 587221c..6f4ee0d 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -936,6 +936,8 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
return;
case MESA_FORMAT_B5G6R5_UNORM:
case MESA_FORMAT_R5G6B5_UNORM:
+ case MESA_FORMAT_B5G6R5_UINT:
+ case MESA_FORMAT_R5G6B5_UINT:
*datatype = GL_UNSIGNED_SHORT_5_6_5;
*comps = 3;
return;
@@ -943,6 +945,8 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
case MESA_FORMAT_B4G4R4A4_UNORM:
case MESA_FORMAT_A4R4G4B4_UNORM:
case MESA_FORMAT_B4G4R4X4_UNORM:
+ case MESA_FORMAT_B4G4R4A4_UINT:
+ case MESA_FORMAT_A4R4G4B4_UINT:
*datatype = GL_UNSIGNED_SHORT_4_4_4_4;
*comps = 4;
return;
@@ -950,6 +954,8 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
case MESA_FORMAT_B5G5R5A1_UNORM:
case MESA_FORMAT_A1R5G5B5_UNORM:
case MESA_FORMAT_B5G5R5X1_UNORM:
+ case MESA_FORMAT_B5G5R5A1_UINT:
+ case MESA_FORMAT_A1R5G5B5_UINT:
*datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV;
*comps = 4;
return;
@@ -960,6 +966,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
return;
case MESA_FORMAT_A1B5G5R5_UNORM:
+ case MESA_FORMAT_A1B5G5R5_UINT:
*datatype = GL_UNSIGNED_SHORT_5_5_5_1;
*comps = 4;
return;
@@ -994,19 +1001,23 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
return;
case MESA_FORMAT_R3G3B2_UNORM:
+ case MESA_FORMAT_R3G3B2_UINT:
*datatype = GL_UNSIGNED_BYTE_2_3_3_REV;
*comps = 3;
return;
case MESA_FORMAT_A4B4G4R4_UNORM:
+ case MESA_FORMAT_A4B4G4R4_UINT:
*datatype = GL_UNSIGNED_SHORT_4_4_4_4;
*comps = 4;
return;
case MESA_FORMAT_R4G4B4A4_UNORM:
+ case MESA_FORMAT_R4G4B4A4_UINT:
*datatype = GL_UNSIGNED_SHORT_4_4_4_4;
*comps = 4;
return;
case MESA_FORMAT_R5G5B5A1_UNORM:
+ case MESA_FORMAT_R5G5B5A1_UINT:
*datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV;
*comps = 4;
return;
@@ -1022,6 +1033,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
return;
case MESA_FORMAT_B2G3R3_UNORM:
+ case MESA_FORMAT_B2G3R3_UINT:
*datatype = GL_UNSIGNED_BYTE_3_3_2;
*comps = 3;
return;
@@ -1972,6 +1984,57 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
type == GL_UNSIGNED_INT_2_10_10_10_REV &&
!swapBytes);
+ case MESA_FORMAT_B5G6R5_UINT:
+ return format == GL_RGB_INTEGER && type == GL_UNSIGNED_SHORT_5_6_5;
+
+ case MESA_FORMAT_R5G6B5_UINT:
+ return format == GL_RGB_INTEGER && type == GL_UNSIGNED_SHORT_5_6_5_REV;
+
+ case MESA_FORMAT_B2G3R3_UINT:
+ return format == GL_RGB_INTEGER && type == GL_UNSIGNED_BYTE_3_3_2;
+
+ case MESA_FORMAT_R3G3B2_UINT:
+ return format == GL_RGB_INTEGER && type == GL_UNSIGNED_BYTE_2_3_3_REV;
+
+ case MESA_FORMAT_A4B4G4R4_UINT:
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_4_4_4_4 && !swapBytes)
+ return GL_TRUE;
+
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_4_4_4_4_REV && swapBytes)
+ return GL_TRUE;
+ return GL_FALSE;
+
+ case MESA_FORMAT_R4G4B4A4_UINT:
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_4_4_4_4_REV && !swapBytes)
+ return GL_TRUE;
+
+ if (format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_4_4_4_4 && swapBytes)
+ return GL_TRUE;
+
+ return GL_FALSE;
+
+ case MESA_FORMAT_B4G4R4A4_UINT:
+ return format == GL_BGRA_INTEGER && type == GL_UNSIGNED_SHORT_4_4_4_4_REV &&
+ !swapBytes;
+
+ case MESA_FORMAT_A4R4G4B4_UINT:
+ return GL_FALSE;
+
+ case MESA_FORMAT_A1B5G5R5_UINT:
+ return format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_5_5_5_1 &&
+ !swapBytes;
+
+ case MESA_FORMAT_B5G5R5A1_UINT:
+ return format == GL_BGRA_INTEGER && type == GL_UNSIGNED_SHORT_1_5_5_5_REV &&
+ !swapBytes;
+
+ case MESA_FORMAT_A1R5G5B5_UINT:
+ return format == GL_BGRA_INTEGER && type == GL_UNSIGNED_SHORT_5_5_5_1 &&
+ !swapBytes;
+
+ case MESA_FORMAT_R5G5B5A1_UINT:
+ return format == GL_RGBA_INTEGER && type == GL_UNSIGNED_SHORT_1_5_5_5_REV;
+
case MESA_FORMAT_R9G9B9E5_FLOAT:
return format == GL_RGB && type == GL_UNSIGNED_INT_5_9_9_9_REV &&
!swapBytes;