From 2c2008c981a6de55fc0c6718c98b302d1d4ee8e2 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 31 Dec 2020 12:58:22 +1100 Subject: [PATCH] [client] egl: improve DMA logic --- client/renderers/EGL/texture.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/client/renderers/EGL/texture.c b/client/renderers/EGL/texture.c index b5af1227..a6a3b6c8 100644 --- a/client/renderers/EGL/texture.c +++ b/client/renderers/EGL/texture.c @@ -151,18 +151,15 @@ static void egl_texture_unmap(EGL_Texture * texture, uint8_t i) bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_t width, size_t height, size_t stride, bool streaming, bool useDMA) { - if (texture->streaming) + if (texture->streaming && !useDMA) { for(int i = 0; i < texture->textureCount; ++i) { - if (!useDMA) + egl_texture_unmap(texture, i); + if (texture->tex[i].hasPBO) { - egl_texture_unmap(texture, i); - if (texture->tex[i].hasPBO) - { - glDeleteBuffers(1, &texture->tex[i].pbo); - texture->tex[i].hasPBO = false; - } + glDeleteBuffers(1, &texture->tex[i].pbo); + texture->tex[i].hasPBO = false; } } }