i915: Clean up some unnecessary x/y miptree code.
authorEric Anholt <eric@anholt.net>
Sat, 19 Dec 2009 00:49:32 +0000 (16:49 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 19 Dec 2009 04:35:57 +0000 (20:35 -0800)
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

index f52ff2bcc4ab61ee3a611726f59c13d24e0f55f0..bcab043e97f6a0b48bf6187052571223c60b649e 100644 (file)
@@ -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,