1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

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 <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-01-29 23:18:44 +00:00
parent 635e66dcd1
commit f18e862845
No known key found for this signature in database
GPG key ID: 37C999F617EA1A47

View file

@ -1102,11 +1102,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.");
@ -1114,9 +1113,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)