summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_pixel_copy.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-03-16 13:14:38 -0700
committerEric Anholt <eric@anholt.net>2010-03-16 13:18:54 -0700
commita589da14dee0c2a32e6e529f1a390b01a3ee4001 (patch)
tree9b08afda092c84157e9f44fd8545c7e469f55087 /src/mesa/drivers/dri/intel/intel_pixel_copy.c
parent800a4b202f8b23540dbb128e780ca8b7e90d1f46 (diff)
i965: Fix inversion for glCopyPixels to/from FBOs.
fixes piglit fbo-copypix.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_pixel_copy.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_copy.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index f4f3fd6d88..8efb7a60c2 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -116,6 +116,7 @@ do_blit_copypixels(GLcontext * ctx,
GLint orig_dsty;
GLint orig_srcx;
GLint orig_srcy;
+ GLboolean flip = GL_FALSE;
if (type == GL_DEPTH || type == GL_STENCIL) {
if (INTEL_DEBUG & DEBUG_FALLBACKS)
@@ -140,8 +141,6 @@ do_blit_copypixels(GLcontext * ctx,
intel_prepare_render(intel);
- /* XXX: We fail to handle different inversion between read and draw framebuffer. */
-
/* Clip to destination buffer. */
orig_dstx = dstx;
orig_dsty = dsty;
@@ -164,23 +163,23 @@ do_blit_copypixels(GLcontext * ctx,
dstx += srcx - orig_srcx;
dsty += srcy - orig_srcy;
- /* Convert from GL to hardware coordinates: */
+ /* Flip dest Y if it's a window system framebuffer. */
if (fb->Name == 0) {
- /* copypixels to a system framebuffer */
+ /* copypixels to a window system framebuffer */
dsty = fb->Height - dsty - height;
- } else {
- /* copypixels to a user framebuffer object */
- dsty = dsty;
+ flip = !flip;
}
- /* Flip source Y if it's a system framebuffer. */
- if (read_fb->Name == 0)
- srcy = fb->Height - srcy - height;
+ /* Flip source Y if it's a window system framebuffer. */
+ if (read_fb->Name == 0) {
+ srcy = read_fb->Height - srcy - height;
+ flip = !flip;
+ }
if (!intel_region_copy(intel,
dst, 0, dstx, dsty,
src, 0, srcx, srcy,
- width, height,
+ width, height, flip,
ctx->Color.ColorLogicOpEnabled ?
ctx->Color.LogicOp : GL_COPY)) {
DBG("%s: blit failure\n", __FUNCTION__);