gl_common: apply alpha to the right target

In gl_image_apply_alpha, the call to _gl_fill uses 0 as the target
framebuffer, so the alpha is not applied to the target texture.

Fix that by using the correct framebuffer.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-03-15 20:08:27 +00:00
parent b3590f934f
commit 7de9494766
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 1 additions and 1 deletions

View File

@ -1366,7 +1366,7 @@ static void gl_image_apply_alpha(backend_t *base, struct gl_image *img,
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
img->inner->texture, 0);
glDrawBuffer(GL_COLOR_ATTACHMENT0);
_gl_fill(base, (struct color){0, 0, 0, 0}, reg_op, 0, 0, false);
_gl_fill(base, (struct color){0, 0, 0, 0}, reg_op, fbo, 0, false);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glDeleteFramebuffers(1, &fbo);