Mesa (mesa_7_7_branch): i915: Clean up some unnecessary x/y miptree code.

Eric Anholt anholt at kemper.freedesktop.org
Fri Dec 18 20:36:04 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: b51e0fafdf6a39df1b0d1208595c92d5fa9ceba6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b51e0fafdf6a39df1b0d1208595c92d5fa9ceba6

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Dec 18 16:49:32 2009 -0800

i915: Clean up some unnecessary x/y miptree code.

The base of the texture is always the base of the miptree.  If it wasn't,
we'd have issues with this code due to miptrees not walking the same
direction for all LODs.

---

 src/mesa/drivers/dri/i915/i915_texstate.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index f52ff2b..bcab043 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -175,18 +175,9 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
 
       pitch = intelObj->pitchOverride;
    } else {
-      GLuint dst_x, dst_y;
-
-      intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0,
-				     &dst_x, &dst_y);
-
       dri_bo_reference(intelObj->mt->region->buffer);
       i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
-      /* XXX: This calculation is probably broken for tiled images with
-       * a non-page-aligned offset.
-       */
-      i915->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
-	 intelObj->mt->cpp;
+      i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */
 
       format = translate_texture_format(firstImage->TexFormat,
 					firstImage->InternalFormat,



More information about the mesa-commit mailing list