Am 2014-03-20 23:07, schrieb Keith Packard:
+                    glCopyPixels (dx1 + dx - src_box->x1,
+                                  dy1 + dy - src_box->y1,
+                                  dx2 - dx1, dy2 - dy1, GL_COLOR);

This functions are deprecated fortunately. Please don't use them at all.
Glamor shall be used as hardware accelerated fallback, so we shouldn't
rely on uncommon features which may be implemented in software (eg on
nvidia) or not implemented at all (core, gles).

There isn't anything else I *can* use. GL doesn't otherwise define the
results for operations using the same object for source and
destination.

There isn't anything you can use. There is no point in using the deprecated function in an undefined way.
No GL copy function is defined for overlapping rects.
btw, you only check if the src and the dst are the same, you don't check for overlapping src+dst.


I guess GPUs have some special HW for this, but we can't use them on
OpenGL. memmove isn't parallelizable.

Yes, Intel GPUs have the 'blt' engine which performs overlapped copies
correctly, and glCopyPixels is how we get to that. I imagine the same is
true for other GPUs.

As this operation is critical for many existing X applications for
scrolling data around, we really have to make sure that we hit the
special hardware.

But we can't know if the driver will use this hardware. Maybe with some special GL extension? But also in this way, I'd suggest to use a modified glCopyImageSubData and/or glBlitFramebuffer to allow overlapping copys.
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to