Mesa (master): mesa: Fix assertions for block size handling in glCompressedTexSubImage2D.

Eric Anholt anholt at kemper.freedesktop.org
Fri Dec 2 23:40:52 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Dec  1 14:52:44 2011 -0800

mesa: Fix assertions for block size handling in glCompressedTexSubImage2D.

Anything of less than (bw, bh) size is possible when you consider
rectangular textures, and this code is (now) safe for those.  Even for
power-of-two textures, width could be 4 for FXT1 while not being
aligned to block size.

Fixes piglit compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX

Reviewed-by: Brian Paul <brianp at vmware.com>

---

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

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 99adf79..37fea21 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -5116,8 +5116,8 @@ _mesa_store_compressed_texsubimage2d(struct gl_context *ctx, GLenum target,
    _mesa_get_format_block_size(texFormat, &bw, &bh);
 
    /* these should have been caught sooner */
-   ASSERT((width % bw) == 0 || width == 2 || width == 1);
-   ASSERT((height % bh) == 0 || height == 2 || height == 1);
+   ASSERT((width % bw) == 0 || width < bw);
+   ASSERT((height % bh) == 0 || height < bh);
    ASSERT((xoffset % bw) == 0);
    ASSERT((yoffset % bh) == 0);
 




More information about the mesa-commit mailing list