summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-05-09 00:00:46 +0000
committerBrian Paul <[email protected]>2006-05-09 00:00:46 +0000
commit5e4c39dc0e0fd6bc4324aa9030430822348aa3b4 (patch)
tree12e2d40ba2cc883de92dfb352178dd2b31f8bb8e /src/mesa
parenta5467697336f201abee19cba1521be80e5c87d3b (diff)
use _mesa_compressed_texture_size() for GL_TEXTURE_COMPRESSED_IMAGE_SIZE query
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texstate.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 4bd9895cd5c..7e762edd256 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -34,6 +34,7 @@
#include "context.h"
#include "enums.h"
#include "macros.h"
+#include "texcompress.h"
#include "texobj.h"
#include "teximage.h"
#include "texstate.h"
@@ -1831,11 +1832,18 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
if (ctx->Extensions.ARB_texture_compression) {
- if (img->IsCompressed && !isProxy)
- *params = img->CompressedSize;
- else
+ if (img->IsCompressed && !isProxy) {
+ /* Don't use ctx->Driver.CompressedTextureSize() since that
+ * may returned a padded hardware size.
+ */
+ *params = _mesa_compressed_texture_size(ctx, img->Width,
+ img->Height, img->Depth,
+ img->TexFormat->MesaFormat);
+ }
+ else {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetTexLevelParameter[if]v(pname)");
+ }
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,