fix: blur not being able to blur edges of damage (#168)

This commit is contained in:
Erik Reider 2023-05-30 06:18:58 +02:00 committed by GitHub
parent 8e6667ddad
commit c95306fcdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 15 deletions

View file

@ -161,8 +161,6 @@ void fx_renderer_fini(struct fx_renderer *renderer);
void fx_renderer_begin(struct fx_renderer *renderer, int width, int height); void fx_renderer_begin(struct fx_renderer *renderer, int width, int height);
void fx_renderer_end(struct fx_renderer *renderer);
void fx_renderer_clear(const float color[static 4]); void fx_renderer_clear(const float color[static 4]);
void fx_renderer_scissor(struct wlr_box *box); void fx_renderer_scissor(struct wlr_box *box);

View file

@ -424,11 +424,6 @@ void fx_renderer_begin(struct fx_renderer *renderer, int width, int height) {
fx_framebuffer_bind(&renderer->main_buffer); fx_framebuffer_bind(&renderer->main_buffer);
} }
void fx_renderer_end(struct fx_renderer *renderer) {
// Release the main buffer
fx_framebuffer_release(&renderer->main_buffer);
}
void fx_renderer_clear(const float color[static 4]) { void fx_renderer_clear(const float color[static 4]) {
glClearColor(color[0], color[1], color[2], color[3]); glClearColor(color[0], color[1], color[2], color[3]);
glClearStencil(0); glClearStencil(0);

View file

@ -248,18 +248,12 @@ struct fx_framebuffer *get_main_buffer_blur(struct fx_renderer *renderer, struct
// damage region will be scaled, make a temp // damage region will be scaled, make a temp
pixman_region32_t tempDamage; pixman_region32_t tempDamage;
pixman_region32_init(&tempDamage); pixman_region32_init(&tempDamage);
// When DOWNscaling, we make the region twice as small because it's the TARGET
wlr_region_scale(&tempDamage, &damage, 0.5f);
int blur_radius = config->blur_params.radius; int blur_radius = config->blur_params.radius;
int blur_passes = config->blur_params.num_passes; int blur_passes = config->blur_params.num_passes;
// First pass
render_blur_segments(renderer, gl_matrix, &tempDamage, &current_buffer,
&renderer->shaders.blur1, box, blur_radius);
// Downscale // Downscale
for (int i = 1; i < blur_passes; ++i) { for (int i = 0; i < blur_passes; ++i) {
wlr_region_scale(&tempDamage, &damage, 1.0f / (1 << (i + 1))); wlr_region_scale(&tempDamage, &damage, 1.0f / (1 << (i + 1)));
render_blur_segments(renderer, gl_matrix, &tempDamage, &current_buffer, render_blur_segments(renderer, gl_matrix, &tempDamage, &current_buffer,
&renderer->shaders.blur1, box, blur_radius); &renderer->shaders.blur1, box, blur_radius);
@ -1975,7 +1969,6 @@ renderer_end:
} }
render_whole_output(renderer, wlr_output, &extended_damage, &renderer->main_buffer.texture); render_whole_output(renderer, wlr_output, &extended_damage, &renderer->main_buffer.texture);
fx_renderer_end(renderer);
fx_renderer_scissor(NULL); fx_renderer_scissor(NULL);