diff options
author | Eric Anholt <[email protected]> | 2009-07-09 09:32:21 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2009-10-23 14:12:24 -0700 |
commit | 2d17dbfb5346b6d75e87c839148cbe125bf5cd6d (patch) | |
tree | 0d73944611c8c97a37c8e580179505f9fcda0ae1 /src/mesa/drivers/dri/intel/intel_fbo.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_fbo.c')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 804c0348401..cf007d5b62b 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -571,7 +571,7 @@ intel_render_texture(GLcontext * ctx, = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); struct intel_texture_image *intel_image; - GLuint imageOffset; + GLuint dst_x, dst_y; (void) fb; @@ -618,18 +618,16 @@ intel_render_texture(GLcontext * ctx, } /* compute offset of the particular 2D image within the texture region */ - imageOffset = intel_miptree_image_offset(intel_image->mt, - att->CubeMapFace, - att->TextureLevel); - - if (att->Texture->Target == GL_TEXTURE_3D) { - const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt, - att->TextureLevel); - imageOffset += offsets[att->Zoffset]; - } - - /* store that offset in the region */ - intel_image->mt->region->draw_offset = imageOffset; + intel_miptree_get_image_offset(intel_image->mt, + att->TextureLevel, + att->CubeMapFace, + att->Zoffset, + &dst_x, &dst_y); + + intel_image->mt->region->draw_offset = (dst_y * intel_image->mt->pitch + + dst_x) * intel_image->mt->cpp; + intel_image->mt->region->draw_x = dst_x; + intel_image->mt->region->draw_y = dst_y; /* update drawing region, etc */ intel_draw_buffer(ctx, fb); |