From 1627a91c76c6a4443ce355493a4657796a03cca1 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 29 Jan 2019 23:18:44 +0000 Subject: [PATCH] Use glDrawBuffer instead of glDrawBuffers in glx_blur_dst glDrawBuffers doesn't take GL_BACK, which is what we are passing. And we are using only one buffer argument anyway, no need to use glDrawBuffers. Signed-off-by: Yuxuan Shui --- src/opengl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/opengl.c b/src/opengl.c index 3e12639..c83ce34 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -1043,11 +1043,10 @@ glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z, glBindTexture(tex_tgt, tex_scr); if (!last_pass) { - static const GLenum DRAWBUFS[2] = { GL_COLOR_ATTACHMENT0 }; glBindFramebuffer(GL_FRAMEBUFFER, fbo); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex_scr2, 0); - glDrawBuffers(1, DRAWBUFS); + glDrawBuffer(GL_COLOR_ATTACHMENT0); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { log_error("Framebuffer attachment failed."); @@ -1055,9 +1054,8 @@ glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z, } } else { - static const GLenum DRAWBUFS[2] = { GL_BACK }; glBindFramebuffer(GL_FRAMEBUFFER, 0); - glDrawBuffers(1, DRAWBUFS); + glDrawBuffer(GL_BACK); if (have_scissors) glEnable(GL_SCISSOR_TEST); if (have_stencil)