diff options
author | Eric Anholt <eric@anholt.net> | 2009-10-27 10:26:09 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-10-27 10:27:15 -0700 |
commit | 70b17db918a2784296434877a43b4c4036be792a (patch) | |
tree | c99aee025f2c44ecd8bbceebb128d3b9e2c5a488 /src/mesa/drivers/dri/i915/i915_texstate.c | |
parent | 43dc91f8bbb69499a6a0326a78e434b313f73c2c (diff) |
i915: Fix driver for the miptree x/y offset changes.
Bug #24734.
Diffstat (limited to 'src/mesa/drivers/dri/i915/i915_texstate.c')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_texstate.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 32d4b30cf9..998a04f794 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -171,11 +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); + /* 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, |