summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-11-11 08:31:20 -0700
committerBrian Paul <[email protected]>2010-11-11 08:31:21 -0700
commit79c65410c132c22b67b7635cee740dea9a736f80 (patch)
tree1b2110b509ddc531b9d1676cd546c6c9b060a67b /src/mesa/main
parentc9126d66fa8e535a53d45adda44c3275fa2e229f (diff)
mesa: add missing formats in _mesa_format_to_type_and_comps()
NOTE: this is a candidate for the 7.9 branch
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/formats.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 46a1fe006af..88a04e888e4 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1194,6 +1194,7 @@ _mesa_format_to_type_and_comps(gl_format format,
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_ARGB8888_REV:
case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_XRGB8888_REV:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
@@ -1220,6 +1221,11 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 4;
return;
+ case MESA_FORMAT_RGBA5551:
+ *datatype = GL_UNSIGNED_SHORT_5_5_5_1;
+ *comps = 4;
+ return;
+
case MESA_FORMAT_AL88:
case MESA_FORMAT_AL88_REV:
case MESA_FORMAT_RG88:
@@ -1251,6 +1257,7 @@ _mesa_format_to_type_and_comps(gl_format format,
case MESA_FORMAT_I8:
case MESA_FORMAT_CI8:
case MESA_FORMAT_R8:
+ case MESA_FORMAT_S8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 1;
return;
@@ -1296,12 +1303,26 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 2;
return;
+ case MESA_FORMAT_SIGNED_R8:
+ *datatype = GL_BYTE;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_SIGNED_RG88:
+ *datatype = GL_BYTE;
+ *comps = 2;
+ return;
case MESA_FORMAT_SIGNED_RGBA8888:
case MESA_FORMAT_SIGNED_RGBA8888_REV:
+ case MESA_FORMAT_SIGNED_RGBX8888:
*datatype = GL_BYTE;
*comps = 4;
return;
+ case MESA_FORMAT_RGBA_16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *comps = 4;
+ return;
+
case MESA_FORMAT_SIGNED_R_16:
*datatype = GL_SHORT;
*comps = 1;
@@ -1426,8 +1447,12 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 4;
return;
-
+ case MESA_FORMAT_NONE:
+ case MESA_FORMAT_COUNT:
+ /* For debug builds, warn if any formats are not handled */
+#ifndef DEBUG
default:
+#endif
_mesa_problem(NULL, "bad format %s in _mesa_format_to_type_and_comps",
_mesa_get_format_name(format));
*datatype = 0;