Mesa (7.9): mesa: fix a few format table mistakes, assertions
Brian Paul
brianp at kemper.freedesktop.org
Tue Feb 22 01:20:21 UTC 2011
Module: Mesa
Branch: 7.9
Commit: 7e43495053fe4d9ba577aee15b83786dddf8384b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e43495053fe4d9ba577aee15b83786dddf8384b
Author: Brian Paul <brianp at vmware.com>
Date: Tue Jan 11 09:23:45 2011 -0700
mesa: fix a few format table mistakes, assertions
The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 0073f50cd47c48c706b4524364b9c0594804febf)
---
src/mesa/main/formats.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index c3fe8a3..14e5dde 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -702,7 +702,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
{
MESA_FORMAT_SIGNED_R8, /* Name */
"MESA_FORMAT_SIGNED_R8", /* StrName */
- GL_RGBA, /* BaseFormat */
+ GL_RED, /* BaseFormat */
GL_SIGNED_NORMALIZED, /* DataType */
8, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */
@@ -711,7 +711,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
{
MESA_FORMAT_SIGNED_RG88,
"MESA_FORMAT_SIGNED_RG88",
- GL_RGBA,
+ GL_RG,
GL_SIGNED_NORMALIZED,
8, 8, 0, 0,
0, 0, 0, 0, 0,
@@ -720,7 +720,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
{
MESA_FORMAT_SIGNED_RGBX8888,
"MESA_FORMAT_SIGNED_RGBX8888",
- GL_RGBA,
+ GL_RGB,
GL_SIGNED_NORMALIZED,
8, 8, 8, 0,
0, 0, 0, 0, 0,
@@ -749,7 +749,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
{
MESA_FORMAT_SIGNED_R_16,
"MESA_FORMAT_SIGNED_R_16",
- GL_RGBA,
+ GL_RED,
GL_SIGNED_NORMALIZED,
16, 0, 0, 0,
0, 0, 0, 0, 0,
@@ -758,7 +758,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
{
MESA_FORMAT_SIGNED_RG_16,
"MESA_FORMAT_SIGNED_RG_16",
- GL_RGBA,
+ GL_RG,
GL_SIGNED_NORMALIZED,
16, 16, 0, 0,
0, 0, 0, 0, 0,
@@ -767,7 +767,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
{
MESA_FORMAT_SIGNED_RGB_16,
"MESA_FORMAT_SIGNED_RGB_16",
- GL_RGBA,
+ GL_RGB,
GL_SIGNED_NORMALIZED,
16, 16, 16, 0,
0, 0, 0, 0, 0,
@@ -1047,7 +1047,7 @@ _mesa_test_formats(void)
if (info->RedBits > 0) {
GLuint t = info->RedBits + info->GreenBits
+ info->BlueBits + info->AlphaBits;
- assert(t / 8 == info->BytesPerBlock);
+ assert(t / 8 <= info->BytesPerBlock);
(void) t;
}
}
@@ -1055,6 +1055,7 @@ _mesa_test_formats(void)
assert(info->DataType == GL_UNSIGNED_NORMALIZED ||
info->DataType == GL_SIGNED_NORMALIZED ||
info->DataType == GL_UNSIGNED_INT ||
+ info->DataType == GL_INT ||
info->DataType == GL_FLOAT);
if (info->BaseFormat == GL_RGB) {
More information about the mesa-commit
mailing list