summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r--src/mesa/swrast/s_texture.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index 7e3fc2806d9..14ee0ebc600 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -67,6 +67,7 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx,
gl_format format, GLsizei width,
GLsizei height, GLsizei depth)
{
+ struct swrast_texture_image *swImg = swrast_texture_image(texImage);
GLuint bytes = _mesa_format_image_size(format, width, height, depth);
/* This _should_ be true (revisit if these ever fail) */
@@ -77,6 +78,13 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx,
assert(!texImage->Data);
texImage->Data = _mesa_align_malloc(bytes, 512);
+ if ((width == 1 || _mesa_is_pow_two(texImage->Width2)) &&
+ (height == 1 || _mesa_is_pow_two(texImage->Height2)) &&
+ (depth == 1 || _mesa_is_pow_two(texImage->Depth2)))
+ swImg->_IsPowerOfTwo = GL_TRUE;
+ else
+ swImg->_IsPowerOfTwo = GL_FALSE;
+
return texImage->Data != NULL;
}