summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-11-05 02:12:44 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-11-05 02:12:44 +0000
commit4d0b7618cb3ada3b13e9e9b650ace34f5131e318 (patch)
treedc920a02be961a0635035ddbded1c6d62c3f057a /src/mesa/main
parent95ebb5f4856d1299591edc9f943d4faa3f1826c5 (diff)
minor improvements in _mesa_init_teximage_fields()
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/teximage.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 9731185f44..91fee9001f 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1089,18 +1089,18 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
img->Height = height;
img->Depth = depth;
img->RowStride = width;
- img->WidthLog2 = logbase2(width - 2 * border);
+ img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
+ img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
+ img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
+ img->WidthLog2 = logbase2(img->Width2);
if (height == 1) /* 1-D texture */
img->HeightLog2 = 0;
else
- img->HeightLog2 = logbase2(height - 2 * border);
+ img->HeightLog2 = logbase2(img->Height2);
if (depth == 1) /* 2-D texture */
img->DepthLog2 = 0;
else
- img->DepthLog2 = logbase2(depth - 2 * border);
- img->Width2 = width - 2 * border; /*1 << img->WidthLog2;*/
- img->Height2 = height - 2 * border; /*1 << img->HeightLog2;*/
- img->Depth2 = depth - 2 * border; /*1 << img->DepthLog2;*/
+ img->DepthLog2 = logbase2(img->Depth2);
img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2);
img->IsCompressed = is_compressed_format(ctx, internalFormat);
if (img->IsCompressed)
@@ -1109,9 +1109,9 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
else
img->CompressedSize = 0;
- if ((width == 1 || _mesa_bitcount(width - 2 * border) == 1) &&
- (height == 1 || _mesa_bitcount(height - 2 * border) == 1) &&
- (depth == 1 || _mesa_bitcount(depth - 2 * border) == 1))
+ if ((width == 1 || _mesa_bitcount(img->Width2) == 1) &&
+ (height == 1 || _mesa_bitcount(img->Height2) == 1) &&
+ (depth == 1 || _mesa_bitcount(img->Depth2) == 1))
img->_IsPowerOfTwo = GL_TRUE;
else
img->_IsPowerOfTwo = GL_FALSE;