From 0073f50cd47c48c706b4524364b9c0594804febf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 11 Jan 2011 09:23:45 -0700 Subject: [PATCH] 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. --- src/mesa/main/formats.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 4eb2c35..514fe7a 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -802,7 +802,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 */ @@ -811,7 +811,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, @@ -820,7 +820,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, @@ -849,7 +849,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, @@ -858,7 +858,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, @@ -867,7 +867,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, @@ -1192,7 +1192,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; } } @@ -1200,6 +1200,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) { -- 2.7.4