summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2007-07-15 20:15:19 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2007-07-15 20:15:19 +0200
commit8172f50419b370c4608d1bbc6cac4d77e3e45804 (patch)
treea40287d079628e089e113c61bffe24cf80e21895
parentcd3afa2a952a9ec05fb9fa959dfe90d620bd2d88 (diff)
fix the texture copypixels path
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_copy.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
index 77d0e24f001..57e746ae22f 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_copy.c
@@ -119,6 +119,7 @@ do_texture_copypixels(GLcontext * ctx,
struct intel_context *intel = intel_context(ctx);
struct intel_region *dst = intel_drawbuf_region(intel);
struct intel_region *src = copypix_src_region(intel, type);
+ struct intel_region *depthreg = NULL;
GLenum src_format;
GLenum src_type;
@@ -171,8 +172,11 @@ do_texture_copypixels(GLcontext * ctx,
/* Set the 3d engine to draw into the destination region:
*/
- intel->vtbl.meta_draw_region(intel, dst,
- (intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped))->region);
+ if (ctx->DrawBuffer->_DepthBuffer &&
+ ctx->DrawBuffer->_DepthBuffer->Wrapped)
+ depthreg = (intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped))->region;
+
+ intel->vtbl.meta_draw_region(intel, dst, depthreg);
intel->vtbl.meta_import_pixel_state(intel);
@@ -200,8 +204,9 @@ do_texture_copypixels(GLcontext * ctx,
LOCK_HARDWARE(intel);
{
- int bufHeight = ctx->DrawBuffer->Height;
- srcy = bufHeight - srcy - height; /* convert from gl to hardware coords */
+ int dstbufHeight = ctx->DrawBuffer->Height;
+ /* convert from gl to hardware coords */
+ srcy = ctx->ReadBuffer->Height - srcy - height;
/* Clip against the source region. This is the only source
* clipping we do. XXX: Just set the texcord wrap mode to clamp
@@ -224,11 +229,11 @@ do_texture_copypixels(GLcontext * ctx,
/* Just use the regular cliprect mechanism... Does this need to
* even hold the lock???
*/
- intel_meta_draw_quad(intel,
- dstx,
- dstx + width * ctx->Pixel.ZoomX,
- bufHeight - (dsty + height * ctx->Pixel.ZoomY),
- bufHeight - (dsty), 0, /* XXX: what z value? */
+ intel_meta_draw_quad(intel,
+ dstx,
+ dstx + width * ctx->Pixel.ZoomX,
+ dstbufHeight - (dsty + height * ctx->Pixel.ZoomY),
+ dstbufHeight - (dsty), 0, /* XXX: what z value? */
0x00ff00ff,
srcx, srcx + width, srcy, srcy + height);