summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_fbo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_fbo.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 2e61371805..a0ceec6f7e 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,11 +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, 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);