From e11dd6c677aa38753682a9e4f782592780358056 Mon Sep 17 00:00:00 2001 From: Jungi Byun Date: Tue, 2 Feb 2021 11:53:21 +0900 Subject: Clear dirty flag to protect original texture If the dirty flag is kept as true, a texture which is rendered in a thread might be ruined by "glEGLImageTargetTexture2DOES" by another rendering thread. This can cause an undefined behavior like a crash in GPU driver. As same as SharedMemoryBuffer, change the dirty flag into false in WaylandEglClientBuffer and LinuxDmabufClientBuffer. Change-Id: I2deb09703174e6257c13cc0bb542a90f0956c1c2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp | 1 + .../compositor/wayland-egl/waylandeglclientbufferintegration.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src/hardwareintegration') diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp index a4fbc6b5..d3690842 100644 --- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabufclientbufferintegration.cpp @@ -452,6 +452,7 @@ QOpenGLTexture *LinuxDmabufClientBuffer::toOpenGlTexture(int plane) } if (m_textureDirty) { + m_textureDirty = false; texture->bind(); glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); m_integration->gl_egl_image_target_texture_2d(target, d->image(plane)); diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index a826c5fc..7f8cced3 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -569,6 +569,7 @@ QOpenGLTexture *WaylandEglClientBuffer::toOpenGlTexture(int plane) } if (m_textureDirty) { + m_textureDirty = false; texture->bind(); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); p->gl_egl_image_target_texture_2d(target, d->egl_images[plane]); -- cgit v1.2.1