summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-11-18 17:31:42 -0700
committerBrian Paul <brianp@vmware.com>2009-11-18 17:38:57 -0700
commitab7c2493555b2c791a280fbf2c02dcfb11c4d9dc (patch)
tree5d2a453890f98e77b4af04cee82d457cba13fb6d
parentf454df0087c03b32dcb6165ac44e650f3835fc85 (diff)
intel: simplify texture image mapping/unmapping code
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.c10
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.h6
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c7
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c20
4 files changed, 21 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 70cd1d9d20..44679aa8be 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -231,7 +231,10 @@ intelMapTextureImage(GLcontext *ctx, struct gl_texture_object *tObj,
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_object *intelObj = intel_texture_object(tObj);
- intel_tex_map_level_image(intel, intelObj, level, face);
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][level]);
+
+ intel_tex_map_level_image(intel, intelImage);
}
@@ -242,7 +245,10 @@ intelUnmapTextureImage(GLcontext *ctx, struct gl_texture_object *tObj,
{
struct intel_context *intel = intel_context(ctx);
struct intel_texture_object *intelObj = intel_texture_object(tObj);
- intel_tex_unmap_level_image(intel, intelObj, level, face);
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][level]);
+
+ intel_tex_unmap_level_image(intel, intelImage);
}
diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h
index a02a1fbd32..ed075a1e68 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.h
+++ b/src/mesa/drivers/dri/intel/intel_tex.h
@@ -57,13 +57,11 @@ GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
void
intel_tex_map_level_image(struct intel_context *intel,
- struct intel_texture_object *intelObj,
- GLuint level, GLuint face);
+ struct intel_texture_image *intelImg);
void
intel_tex_unmap_level_image(struct intel_context *intel,
- struct intel_texture_object *intelObj,
- GLuint level, GLuint face);
+ struct intel_texture_image *intelImg);
void
intel_tex_map_level_images(struct intel_context *intel,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 28579019fa..7860d333a5 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -606,8 +606,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
struct gl_texture_image *texImage, GLboolean compressed)
{
struct intel_context *intel = intel_context(ctx);
- struct intel_texture_object *intelObj = intel_texture_object(texObj);
- const GLuint face = _mesa_tex_target_to_face(target);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
/* If we're reading from a texture that has been rendered to, need to
* make sure rendering is complete.
@@ -615,7 +614,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
*/
intelFlush(ctx);
- intel_tex_map_level_image(intel, intelObj, level, face);
+ intel_tex_map_level_image(intel, intelImage);
if (compressed) {
_mesa_get_compressed_teximage(ctx, target, level, pixels,
@@ -626,7 +625,7 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
texObj, texImage);
}
- intel_tex_unmap_level_image(intel, intelObj, level, face);
+ intel_tex_unmap_level_image(intel, intelImage);
}
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index 209cddc102..f9e2c275fc 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -239,12 +239,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
void
intel_tex_map_level_image(struct intel_context *intel,
- struct intel_texture_object *intelObj,
- GLuint level, GLuint face)
+ struct intel_texture_image *intelImage)
{
- struct intel_texture_image *intelImage =
- intel_texture_image(intelObj->base.Image[face][level]);
-
if (intelImage) {
if (intelImage->mt) {
intelImage->base.Map.Data =
@@ -267,12 +263,8 @@ intel_tex_map_level_image(struct intel_context *intel,
void
intel_tex_unmap_level_image(struct intel_context *intel,
- struct intel_texture_object *intelObj,
- GLuint level, GLuint face)
+ struct intel_texture_image *intelImage)
{
- struct intel_texture_image *intelImage =
- intel_texture_image(intelObj->base.Image[face][level]);
-
if (intelImage && intelImage->mt) {
intel_miptree_image_unmap(intel, intelImage->mt);
intelImage->base.Map.Data = NULL;
@@ -289,7 +281,9 @@ intel_tex_map_level_images(struct intel_context *intel,
GLuint face;
for (face = 0; face < nr_faces; face++) {
- intel_tex_map_level_image(intel, intelObj, level, face);
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][level]);
+ intel_tex_map_level_image(intel, intelImage);
}
}
@@ -303,7 +297,9 @@ intel_tex_unmap_level_images(struct intel_context *intel,
GLuint face;
for (face = 0; face < nr_faces; face++) {
- intel_tex_unmap_level_image(intel, intelObj, level, face);
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][level]);
+ intel_tex_unmap_level_image(intel, intelImage);
}
}