From 63ec2dc01bd7771400896b5a4b015b9275d8371a Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 21 Feb 2021 01:43:37 -0500 Subject: [PATCH] [client] egl: destroy cached EGLImages when changing format Reusing cached EGLImages while the frame format has changed will result in visual artifacts. We should instead destroy the EGLImages and let them be recreated. --- client/renderers/EGL/texture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/renderers/EGL/texture.c b/client/renderers/EGL/texture.c index d3ece535..c7cbef91 100644 --- a/client/renderers/EGL/texture.c +++ b/client/renderers/EGL/texture.c @@ -269,6 +269,10 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_ glDeleteTextures(1, &texture->dmaTex); glGenFramebuffers(1, &texture->dmaFBO); glGenTextures(1, &texture->dmaTex); + + for (size_t i = 0; i < texture->dmaImageUsed; ++i) + eglDestroyImage(texture->display, texture->dmaImages[i].image); + texture->dmaImageUsed = 0; return true; }