Mesa (master): mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Jun 7 07:01:15 UTC 2012


Module: Mesa
Branch: master
Commit: f8d40deea5c4abbbf93c2c572ce668a5a25f95e2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8d40deea5c4abbbf93c2c572ce668a5a25f95e2

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Jun  5 23:51:04 2012 -0700

mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.

>From the issues section of the GL_ARB_texture_compression_rgtc extension:

15) What should glGetTexLevelParameter return for
    GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1
    formats?  What should glGetTexLevelParameter return for
    GL_TEXTURE_BLUE_SIZE for the RGTC2 formats?

    RESOLVED:  Zero bits.

    These formats always return 0.0 for these respective components
    and have no bits devoted to these components.

    Returning 8 bits for red size of RGTC1 and the red and green
    sizes of RGTC2 makes sense because that's the maximum potential
    precision for the uncompressed texels.

Thus, we need to return 8 bits for GL_TEXTURE_RED_SIZE on all RGTC formats
and 8 bits for GL_TEXTURE_GREEN_SIZE on RGTC2 formats.  BLUE should be 0.

Fixes oglconform/rgtc/advanced.texture_fetch.tex_param.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/formats.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index cecb70c..ccc0b17 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1319,7 +1319,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
      "MESA_FORMAT_RED_RGTC1",
      GL_RED,
      GL_UNSIGNED_NORMALIZED,
-     4, 0, 0, 0,
+     8, 0, 0, 0,
      0, 0, 0, 0, 0,
      4, 4, 8                     /* 8 bytes per 4x4 block */
    },
@@ -1328,7 +1328,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
      "MESA_FORMAT_SIGNED_RED_RGTC1",
      GL_RED,
      GL_SIGNED_NORMALIZED,
-     4, 0, 0, 0,
+     8, 0, 0, 0,
      0, 0, 0, 0, 0,
      4, 4, 8                     /* 8 bytes per 4x4 block */
    },
@@ -1337,7 +1337,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
      "MESA_FORMAT_RG_RGTC2",
      GL_RG,
      GL_UNSIGNED_NORMALIZED,
-     4, 4, 0, 0,
+     8, 8, 0, 0,
      0, 0, 0, 0, 0,
      4, 4, 16                     /* 16 bytes per 4x4 block */
    },
@@ -1346,7 +1346,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
      "MESA_FORMAT_SIGNED_RG_RGTC2",
      GL_RG,
      GL_SIGNED_NORMALIZED,
-     4, 4, 0, 0,
+     8, 8, 0, 0,
      0, 0, 0, 0, 0,
      4, 4, 16                     /* 16 bytes per 4x4 block */
    },




More information about the mesa-commit mailing list