Mesa (master): intel: fix small compressed texture upload
Roland Scheidegger
sroland at kemper.freedesktop.org
Thu Apr 16 15:47:35 UTC 2009
Module: Mesa
Branch: master
Commit: 69cbf3c68675915517ae64c81d7a8a42de4e01a3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=69cbf3c68675915517ae64c81d7a8a42de4e01a3
Author: Roland Scheidegger <sroland at vmware.com>
Date: Thu Apr 16 17:39:43 2009 +0200
intel: fix small compressed texture upload
need to round up height for _mesa_copy_rect otherwise
textures with height smaller than 4 won't get copied to the miptree at all
Also fix up the confusing debug output (don't output unitialized values,
and output if data is present and the compressed flag)
---
src/mesa/drivers/dri/intel/intel_tex_image.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index c81f230..1f192da 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -315,7 +315,7 @@ intelTexImage(GLcontext * ctx,
GLint postConvWidth = width;
GLint postConvHeight = height;
GLint texelBytes, sizeInBytes;
- GLuint dstRowStride, srcRowStride = texImage->RowStride;
+ GLuint dstRowStride = 0, srcRowStride = texImage->RowStride;
GLboolean needs_map;
DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__,
@@ -516,8 +516,9 @@ intelTexImage(GLcontext * ctx,
}
DBG("Upload image %dx%dx%d row_len %d "
- "pitch %d\n",
- width, height, depth, width * texelBytes, dstRowStride);
+ "pitch %d pixels %d compressed %d\n",
+ width, height, depth, width * texelBytes, dstRowStride,
+ pixels ? 1 : 0, compressed);
/* Copy data. Would like to know when it's ok for us to eg. use
* the blitter to copy. Or, use the hardware to do the format
@@ -530,7 +531,7 @@ intelTexImage(GLcontext * ctx,
_mesa_copy_rect(texImage->Data, dst->cpp, dst->pitch,
0, 0,
intelImage->mt->level[level].width,
- intelImage->mt->level[level].height/4,
+ (intelImage->mt->level[level].height+3)/4,
pixels,
srcRowStride,
0, 0);
More information about the mesa-commit
mailing list