Mesa (9.0): mesa: remove bogus compressed texture size checks
Ian Romanick
idr at kemper.freedesktop.org
Fri Oct 5 22:56:06 UTC 2012
Module: Mesa
Branch: 9.0
Commit: 19a15cd5ba320b71295c4afbe73c5d656f829ad8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=19a15cd5ba320b71295c4afbe73c5d656f829ad8
Author: Brian Paul <brianp at vmware.com>
Date: Tue Oct 2 09:52:55 2012 -0600
mesa: remove bogus compressed texture size checks
A compressed texture image size doesn't have to be a multiple of the
compressed block size (only sub-images do). Fixes issues when building
compressed mipmaps because we often wind up with non-block-size images
for the higher mipmap levels.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=55445
Note: This is a candidate for the stable branches.
Reviewed-by: Eric Anholt <eric at anholt.net>
Tested-by: Sven Arvidsson <sa at whiz.se>
(cherry picked from commit df4a88ac4398ec4c152eb57a7129c07bb623edd7)
---
src/mesa/main/teximage.c | 21 ---------------------
src/mesa/main/texstore.c | 6 ------
2 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4b7fd1c..21646cc 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2041,27 +2041,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
goto error;
}
- /* check image size against compression block size */
- {
- gl_format texFormat =
- ctx->Driver.ChooseTextureFormat(ctx, target, proxy_format,
- choose_format, choose_type);
- GLuint bw, bh;
-
- _mesa_get_format_block_size(texFormat, &bw, &bh);
- if ((width > bw && width % bw > 0) ||
- (height > bh && height % bh > 0)) {
- /*
- * Per GL_ARB_texture_compression: GL_INVALID_OPERATION is
- * generated [...] if any parameter combinations are not
- * supported by the specific compressed internal format.
- */
- reason = "invalid width or height for compression format";
- error = GL_INVALID_OPERATION;
- goto error;
- }
- }
-
/* check image sizes */
if (!ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
proxy_format, choose_format,
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 18429f5..f4cfa16 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -4490,12 +4490,6 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
_mesa_get_format_block_size(texFormat, &bw, &bh);
- /* these should have been caught sooner */
- ASSERT((width % bw) == 0 || width < bw);
- ASSERT((height % bh) == 0 || height < bh);
- ASSERT((xoffset % bw) == 0);
- ASSERT((yoffset % bh) == 0);
-
/* get pointer to src pixels (may be in a pbo which we'll map here) */
data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data,
&ctx->Unpack,
More information about the mesa-commit
mailing list