summaryrefslogtreecommitdiff
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-05-08 19:14:38 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-05-08 19:14:38 +0000
commit5999c5b620236fb6a996cf56759aec31f01c126b (patch)
tree393189b44ba4734119159d7a172c4f77eb0097c6 /src/mesa/main/teximage.c
parentc93c18abf1950e1494f11166e3f52973efbd6b75 (diff)
Fix a number of texture compression issues.
Pass the MESA_FORMAT_* token to the _mesa_compressed_row_stride(), _mesa_compressed_texture_size() and _mesa_compressed_image_address() functions since we want to use the driver-chosen format, not the user's internalFormat hint. Consolidate code related to choosing the texture format in texstoree.c
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index ff1d51d7d0..4b9b1b8728 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1113,12 +1113,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
else
img->DepthLog2 = logbase2(img->Depth2);
img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);
- img->IsCompressed = is_compressed_format(ctx, internalFormat);
- if (img->IsCompressed)
- img->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, width,
- height, depth, internalFormat);
- else
- img->CompressedSize = 0;
+ img->IsCompressed = GL_FALSE;
+ img->CompressedSize = 0;
if ((width == 1 || _mesa_bitcount(img->Width2) == 1) &&
(height == 1 || _mesa_bitcount(img->Height2) == 1) &&
@@ -2844,7 +2840,7 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
GLsizei height, GLsizei depth, GLint border,
GLsizei imageSize)
{
- GLint expectedSize, maxLevels = 0, maxTextureSize;
+ GLint /**expectedSize,**/ maxLevels = 0, maxTextureSize;
if (dimensions == 1) {
/* 1D compressed textures not allowed */
@@ -2913,10 +2909,13 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions,
if (level < 0 || level >= maxLevels)
return GL_INVALID_VALUE;
+#if 0
+ /* XXX need to renable this code someday! */
expectedSize = ctx->Driver.CompressedTextureSize(ctx, width, height, depth,
internalFormat);
if (expectedSize != imageSize)
return GL_INVALID_VALUE;
+#endif
return GL_NO_ERROR;
}