diff options
author | Zou Nan hai <nanhai.zou@intel.com> | 2008-02-25 15:27:47 +0800 |
---|---|---|
committer | Zou Nan hai <nanhai.zou@intel.com> | 2008-02-25 15:27:47 +0800 |
commit | 1d14da9a89e8d7f49b754ca1f24cb062a261a7e7 (patch) | |
tree | 199f4640adb6df5f712b44ae3683a6eb077945a7 | |
parent | 5b6ca237ee63fb85cff3bb942f5136f96f2c81ec (diff) |
[intel] fix random ut2004 crash on some machine, for cubemap textures,
image offset is already considered when map, add it again in
StoreImage may lead to wrong result and crash.
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index d446b2b392a..941f7a697c3 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -375,9 +375,13 @@ intel_miptree_image_map(struct intel_context * intel, if (row_stride) *row_stride = mt->pitch * mt->cpp; - if (image_offsets) - memcpy(image_offsets, mt->level[level].image_offset, - mt->level[level].depth * sizeof(GLuint)); + if (image_offsets) { + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) + memset(image_offsets, 0, mt->level[level].depth * sizeof(GLuint)); + else + memcpy(image_offsets, mt->level[level].image_offset, + mt->level[level].depth * sizeof(GLuint)); + } return (intel_region_map(intel, mt->region) + intel_miptree_image_offset(mt, face, level)); |