From 3890c7215943178bc19596963185578b366a4825 Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Mon, 7 Feb 2022 19:00:57 -0500 Subject: [PATCH] [client] egl: use texture sampler for desktop The desktop doesn't need its own sampler, there is already an identically configured one in the `desktop->texture`. For some reason, using the texture sampler fixes a black screen issue with my GTX 660 using the 470.86 driver. Maybe hitting some limit for how many samplers can be allocated? --- client/renderers/EGL/desktop.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/client/renderers/EGL/desktop.c b/client/renderers/EGL/desktop.c index e1a8f411..b50425fe 100644 --- a/client/renderers/EGL/desktop.c +++ b/client/renderers/EGL/desktop.c @@ -57,7 +57,6 @@ struct EGL_Desktop EGLDisplay * display; EGL_Texture * texture; - GLuint sampler; struct DesktopShader shader; EGL_DesktopRects * mesh; CountedBuffer * matrix; @@ -296,12 +295,6 @@ bool egl_desktopSetup(EGL_Desktop * desktop, const LG_RendererFormat format) return false; } - glGenSamplers(1, &desktop->sampler); - glSamplerParameteri(desktop->sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glSamplerParameteri(desktop->sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glSamplerParameteri(desktop->sampler, GL_TEXTURE_WRAP_S , GL_CLAMP_TO_EDGE); - glSamplerParameteri(desktop->sampler, GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE); - return true; } @@ -396,7 +389,7 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth, glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture); - glBindSampler(0, desktop->sampler); + glBindSampler(0, desktop->texture->sampler); if (finalSizeX > desktop->width || finalSizeY > desktop->height) scaleType = EGL_DESKTOP_DOWNSCALE;