Mesa (7.9): mesa: add missing formats in _mesa_format_to_type_and_comps()
Brian Paul
brianp at kemper.freedesktop.org
Mon Nov 15 15:53:44 UTC 2010
Module: Mesa
Branch: 7.9
Commit: 97805cfedd6fbf344f70f187021c337665135466
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=97805cfedd6fbf344f70f187021c337665135466
Author: Brian Paul <brianp at vmware.com>
Date: Mon Nov 15 08:49:26 2010 -0700
mesa: add missing formats in _mesa_format_to_type_and_comps()
NOTE: this is a candidate for the 7.9 branch
(cherry picked from commit 79c65410c132c22b67b7635cee740dea9a736f80)
Conflicts:
src/mesa/main/formats.c
---
src/mesa/main/formats.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 9db9f1c..c3fe8a3 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1109,6 +1109,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;
@@ -1135,6 +1136,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:
*datatype = GL_UNSIGNED_BYTE;
@@ -1156,6 +1162,7 @@ _mesa_format_to_type_and_comps(gl_format format,
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
case MESA_FORMAT_CI8:
+ case MESA_FORMAT_S8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 1;
return;
@@ -1201,12 +1208,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;
@@ -1331,9 +1352,14 @@ _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:
- _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps");
+#endif
+ _mesa_problem(NULL, "bad format %s in _mesa_format_to_type_and_comps",
+ _mesa_get_format_name(format));
*datatype = 0;
*comps = 1;
}
More information about the mesa-commit
mailing list