aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndri Yngvason <andri@yngvason.is>2020-06-28 13:48:59 +0000
committerSimon Ser <contact@emersion.fr>2020-07-01 11:43:02 +0200
commite05a85327ff17d00d30b8e03c9f7f5f6d2e4c441 (patch)
tree8bc5f3024ee39b87cc13c5246752bc5b5631dd71
parentb1a47245a12356b048bd6c8841ebbdd2ae0b145f (diff)
render: gles2: Fix y-inversion in gles2_blit_dmabuf()
-rw-r--r--render/gles2/renderer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 511b7f8b..914f5b77 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -384,7 +384,9 @@ static bool gles2_blit_dmabuf(struct wlr_renderer *wlr_renderer,
bool dst_inverted_y =
!!(dst_attr->flags & WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT);
struct wlr_gles2_texture *gles2_src_tex = gles2_get_texture(src_tex);
- gles2_src_tex->inverted_y = src_inverted_y ^ dst_inverted_y;
+ // The result is negated because wlr_matrix_projection y-inverts the
+ // texture.
+ gles2_src_tex->inverted_y = !(src_inverted_y ^ dst_inverted_y);
struct wlr_egl *egl = wlr_gles2_renderer_get_egl(wlr_renderer);
if (!wlr_egl_make_current(egl, EGL_NO_SURFACE, NULL)) {