mirror of https://github.com/yshui/picom.git
backend: gl: fix opacity not being applied for single pass kernel blur
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
70a703df43
commit
26414ddd38
|
@ -626,14 +626,14 @@ bool gl_create_kernel_blur_context(void *blur_context, GLfloat *projection,
|
|||
auto pass = &ctx->blur_shader[1];
|
||||
pass->prog = gl_create_program_from_strv(
|
||||
(const char *[]){vertex_shader, NULL},
|
||||
(const char *[]){copy_with_mask_frag, masking_glsl, NULL});
|
||||
(const char *[]){blend_with_mask_frag, masking_glsl, NULL});
|
||||
pass->uniform_pixel_norm = -1;
|
||||
pass->uniform_opacity = -1;
|
||||
pass->texorig_loc = glGetUniformLocationChecked(pass->prog, "texorig");
|
||||
bind_uniform(pass, mask_tex);
|
||||
bind_uniform(pass, mask_offset);
|
||||
bind_uniform(pass, mask_inverted);
|
||||
bind_uniform(pass, mask_corner_radius);
|
||||
bind_uniform(pass, opacity);
|
||||
|
||||
// Setup projection matrix
|
||||
glUseProgram(pass->prog);
|
||||
|
|
|
@ -272,7 +272,7 @@ static const GLuint vert_in_texcoord_loc = 1;
|
|||
#define GLSL(version, ...) "#version " #version "\n" #__VA_ARGS__
|
||||
#define QUOTE(...) #__VA_ARGS__
|
||||
|
||||
extern const char vertex_shader[], copy_with_mask_frag[], masking_glsl[], dummy_frag[],
|
||||
extern const char vertex_shader[], blend_with_mask_frag[], masking_glsl[], dummy_frag[],
|
||||
present_frag[], fill_frag[], fill_vert[], interpolating_frag[], interpolating_vert[],
|
||||
win_shader_glsl[], win_shader_default[], present_vertex_shader[], dither_glsl[],
|
||||
shadow_colorization_frag[];
|
||||
|
|
|
@ -18,12 +18,13 @@ const char present_frag[] = GLSL(330,
|
|||
}
|
||||
);
|
||||
|
||||
const char copy_with_mask_frag[] = GLSL(330,
|
||||
const char blend_with_mask_frag[] = GLSL(330,
|
||||
uniform sampler2D tex;
|
||||
uniform float opacity;
|
||||
in vec2 texcoord;
|
||||
float mask_factor();
|
||||
void main() {
|
||||
gl_FragColor = texelFetch(tex, ivec2(texcoord.xy), 0) * mask_factor();
|
||||
gl_FragColor = texelFetch(tex, ivec2(texcoord.xy), 0) * opacity * mask_factor();
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue