summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex_image.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-12-19 14:26:14 -0800
committerEric Anholt <eric@anholt.net>2007-12-20 11:26:34 -0800
commit101abee6c4fc2c9284ff2ba6f9f9138327d6963d (patch)
tree3e5f900202359ed4ffcf36b872bbff1b6719352b /src/mesa/drivers/dri/intel/intel_tex_image.c
parentb2f62609d02b91cc42c786200fa0c123e1fd2dcb (diff)
[intel] Fix and reenable (software) SGIS_generate_mipmap
The core problem was that _mesa_generate_mipmap was not respecting RowStride of the source image. Additionally, the intel private data associated with the images (level and face) was not being initialized for the _mesa_generate_mipmap-generated images.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_image.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index c2af74095c..4f5f75d049 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -466,6 +466,7 @@ intelTexImage(GLcontext * ctx,
intelImage->level,
&dstRowStride,
intelImage->base.ImageOffsets);
+ texImage->RowStride = dstRowStride / intelImage->mt->cpp;
}
else {
/* Allocate regular memory and store the image there temporarily. */
@@ -483,8 +484,8 @@ intelTexImage(GLcontext * ctx,
texImage->Data = malloc(sizeInBytes);
}
- DBG("Upload image %dx%dx%d row_len %x "
- "pitch %x\n",
+ DBG("Upload image %dx%dx%d row_len %d "
+ "pitch %d\n",
width, height, depth, width * texelBytes, dstRowStride);
/* Copy data. Would like to know when it's ok for us to eg. use
@@ -504,6 +505,13 @@ intelTexImage(GLcontext * ctx,
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
}
+ /* GL_SGIS_generate_mipmap */
+ if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
+ intel_generate_mipmap(ctx, target,
+ &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
+ texObj);
+ }
+
_mesa_unmap_teximage_pbo(ctx, unpack);
if (intelImage->mt) {
@@ -512,16 +520,6 @@ intelTexImage(GLcontext * ctx,
}
UNLOCK_HARDWARE(intel);
-
-#if 0
- /* GL_SGIS_generate_mipmap -- this can be accelerated now.
- */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- intel_generate_mipmap(ctx, target,
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
- texObj);
- }
-#endif
}
void