summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-10-27 10:26:09 -0700
committerBrian Paul <[email protected]>2009-10-27 17:00:30 -0600
commit4f9f5a78408dbd86b2f9c25ee8a15581b9122fcc (patch)
treec7ca1d1039ac2295d5fbb0925cfa9bc956735a75 /src/mesa
parente9b17d6477f99838fc7f261ea1b8d47eea12f42f (diff)
i915: Fix driver for the miptree x/y offset changes.
Bug #24734.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915/i830_texstate.c12
-rw-r--r--src/mesa/drivers/dri/i915/i915_texstate.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index f270a137812..20ff46b0b0c 100644
--- a/src/mesa/drivers/dri/i915/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915/i830_texstate.c
@@ -160,10 +160,18 @@ i830_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);
i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
- i830->state.tex_offset[unit] =
- intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0);
+ /* XXX: This calculation is probably broken for tiled images with
+ * a non-page-aligned offset.
+ */
+ i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
+ intelObj->mt->cpp;
format = translate_texture_format(firstImage->TexFormat->MesaFormat,
firstImage->InternalFormat);
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index b2f82f56551..998a04f7949 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -171,10 +171,18 @@ 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;
- i915->state.tex_offset[unit] =
- intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0);
+ /* 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;
format = translate_texture_format(firstImage->TexFormat->MesaFormat,
firstImage->InternalFormat,