diff options
author | Eric Anholt <eric@anholt.net> | 2009-07-09 09:32:21 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-10-23 14:12:24 -0700 |
commit | 2d17dbfb5346b6d75e87c839148cbe125bf5cd6d (patch) | |
tree | 0d73944611c8c97a37c8e580179505f9fcda0ae1 /src/mesa/drivers/dri/intel/intel_tex_copy.c | |
parent | b01937a3c967ed23315c7543f97228be06942b7d (diff) |
intel: Keep track of x,y offsets in miptrees and use them for blitting.
By just using offsets, we confused the hardware's tiling calculations,
resulting in failures in miptree validation and blit clears.
Fixes piglit fbo-clearmipmap.
Bug #23552. (automatic mipmap generation)
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_copy.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_copy.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index b241c11625..9d58b11b14 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -115,20 +115,22 @@ do_copy_texsubimage(struct intel_context *intel, drm_intel_bo *dst_bo = intel_region_buffer(intel, intelImage->mt->region, INTEL_WRITE_PART); - GLuint image_offset = intel_miptree_image_offset(intelImage->mt, - intelImage->face, - intelImage->level); const GLint orig_x = x; const GLint orig_y = y; + GLuint image_x, image_y; GLshort src_pitch; + intel_miptree_get_image_offset(intelImage->mt, + intelImage->level, + intelImage->face, + 0, + &image_x, &image_y); /* Update dst for clipped src. Need to also clip the source rect. */ dstx += x - orig_x; dsty += y - orig_y; /* Can't blit to tiled buffers with non-tile-aligned offset. */ - if (intelImage->mt->region->tiling != I915_TILING_NONE && - (image_offset & 4095) != 0) { + if (intelImage->mt->region->tiling == I915_TILING_Y) { UNLOCK_HARDWARE(intel); return GL_FALSE; } @@ -160,9 +162,10 @@ do_copy_texsubimage(struct intel_context *intel, src->tiling, intelImage->mt->pitch, dst_bo, - image_offset, + 0, intelImage->mt->region->tiling, - x, y, dstx, dsty, width, height, + x, y, image_x + dstx, image_y + dsty, + width, height, GL_COPY)) { UNLOCK_HARDWARE(intel); return GL_FALSE; |