Fixed blur not switching FB

This commit is contained in:
Erik Reider 2023-07-26 00:25:46 +02:00
parent a5a38efc00
commit da8c83d803
3 changed files with 5 additions and 6 deletions

View file

@ -189,6 +189,5 @@ void fx_render_box_shadow(struct fx_renderer *renderer, const struct wlr_box *bo
const float color[static 4], const float matrix[static 9], int radius, const float color[static 4], const float matrix[static 9], int radius,
float blur_sigma); float blur_sigma);
void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_matrix[static 9], pixman_region32_t *damage, const struct wlr_box *dst_box, struct fx_framebuffer *current_buffer, int blur_radius, int blur_passes); void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_matrix[static 9], pixman_region32_t *damage, const struct wlr_box *dst_box, struct fx_framebuffer **current_buffer, int blur_radius, int blur_passes);
#endif #endif

View file

@ -877,7 +877,7 @@ void fx_render_blur_segments(struct fx_renderer *renderer,
} }
} }
void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_matrix[static 9], pixman_region32_t *damage, const struct wlr_box *dst_box, struct fx_framebuffer *current_buffer, int blur_radius, int blur_passes) { void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_matrix[static 9], pixman_region32_t *damage, const struct wlr_box *dst_box, struct fx_framebuffer **current_buffer, int blur_radius, int blur_passes) {
// 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);
@ -885,7 +885,7 @@ void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_mat
// Downscale // Downscale
for (int i = 0; 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)));
fx_render_blur_segments(renderer, gl_matrix, &tempDamage, &current_buffer, fx_render_blur_segments(renderer, gl_matrix, &tempDamage, current_buffer,
&renderer->shaders.blur1, dst_box, blur_radius); &renderer->shaders.blur1, dst_box, blur_radius);
} }
@ -893,7 +893,7 @@ void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_mat
for (int i = blur_passes - 1; i >= 0; --i) { for (int i = blur_passes - 1; i >= 0; --i) {
// when upsampling we make the region twice as big // when upsampling we make the region twice as big
wlr_region_scale(&tempDamage, damage, 1.0f / (1 << i)); wlr_region_scale(&tempDamage, damage, 1.0f / (1 << i));
fx_render_blur_segments(renderer, gl_matrix, &tempDamage, &current_buffer, fx_render_blur_segments(renderer, gl_matrix, &tempDamage, current_buffer,
&renderer->shaders.blur2, dst_box, blur_radius); &renderer->shaders.blur2, dst_box, blur_radius);
} }

View file

@ -209,7 +209,7 @@ struct fx_framebuffer *render_main_buffer_blur(struct sway_output *output,
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;
fx_render_main_buffer_blur(renderer, gl_matrix, &damage, dst_box, current_buffer, blur_radius, blur_passes); fx_render_main_buffer_blur(renderer, gl_matrix, &damage, dst_box, &current_buffer, blur_radius, blur_passes);
pixman_region32_fini(&damage); pixman_region32_fini(&damage);