1
0
Fork 0
mutter-performance-source/cogl
Neil Roberts ad071c64f9 cogl: Rebind the EGL image when handling damage
When Cogl gained support for importing pixmaps, I think there was a
misunderstanding that there is a difference in how it works in GLX and
EGL where GLX needs to rebind the pixmap in order to guarantee that
changes are reflected in the texture after it detects damage, whereas
with EGL it doesn’t. The GLX spec makes it pretty clear that it does
need to rebind whereas the EGL spec is a bit harder to follow. As a
fallout from Mesa MR 12869, it seems like the compositor really does
need to rebind the image to comply with the spec. Notably, in
OES_EGL_image_external there is:

"Binding (or re-binding if already bound) an external texture by calling
 BindTexture after all modifications are complete guarantees that
 sampling done in future draw calls will return values corresponding to
 the values in the buffer at or after the time that BindTexture is
 called."

So this commit changes the x11_damage_notify handler for EGL to lazily
queue a rebind like GLX does. The code that binds the image while
allocating the texture has been moved into a reusable helper function.

It seems like there is a bit of a layering violation when accessing the
GL driver internals from the EGL winsys code, but I noticed that the GLX
code also includes the driver GL headers and otherwise it seems pretty
tricky to do properly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2062>
2021-12-13 16:09:56 +00:00
..
cogl cogl: Rebind the EGL image when handling damage 2021-12-13 16:09:56 +00:00
cogl-pango cogl: Remove usages of framebuffer_draw_primitive 2021-12-07 15:32:21 +00:00
test-fixtures cogl/test-utils: Skip "showing" the onscreen 2021-01-30 09:11:46 +00:00
tests tests: Rename 'material' variables to 'pipeline' 2021-12-07 15:32:21 +00:00
.gitignore cogl: Remove CoglPath and the tesselator 2020-04-08 11:38:48 +02:00
cogl-config.h.meson *: Fix spelling mistakes found by codespell 2020-08-29 09:10:31 +00:00
cogl-mutter-config.h.in cogl: Make cogl-config.h include check explicit 2018-11-06 17:17:36 +01:00
config-custom.h move everything into a cogl/ directory 2016-04-22 16:44:31 +02:00
meson.build cogl/dma-buf: Add API to synchronize reading 2020-05-26 13:54:28 +00:00