moved fx_framebuffer binds to fx_renderer
This commit is contained in:
parent
da8c83d803
commit
51fde22616
2 changed files with 12 additions and 12 deletions
|
@ -849,9 +849,8 @@ void fx_render_blur_pass(struct fx_renderer *renderer, const float matrix[static
|
|||
glDisableVertexAttribArray(shader->tex_attrib);
|
||||
}
|
||||
|
||||
void fx_render_blur_segments(struct fx_renderer *renderer,
|
||||
const float matrix[static 9], pixman_region32_t *damage,
|
||||
struct fx_framebuffer **buffer, struct blur_shader* shader,
|
||||
void fx_render_blur_segments(struct fx_renderer *renderer, const float matrix[static 9],
|
||||
pixman_region32_t *damage, struct fx_framebuffer **buffer, struct blur_shader* shader,
|
||||
const struct wlr_box *box, int blur_radius) {
|
||||
if (*buffer == &renderer->effects_buffer) {
|
||||
fx_framebuffer_bind(&renderer->effects_buffer_swapped);
|
||||
|
@ -877,7 +876,13 @@ 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) {
|
||||
// Bind to blur framebuffer
|
||||
fx_framebuffer_bind(&renderer->effects_buffer);
|
||||
glBindTexture(renderer->main_buffer.texture.target, renderer->main_buffer.texture.id);
|
||||
|
||||
// damage region will be scaled, make a temp
|
||||
pixman_region32_t tempDamage;
|
||||
pixman_region32_init(&tempDamage);
|
||||
|
@ -898,4 +903,7 @@ void fx_render_main_buffer_blur(struct fx_renderer *renderer, const float gl_mat
|
|||
}
|
||||
|
||||
pixman_region32_fini(&tempDamage);
|
||||
|
||||
// Bind back to the default buffer
|
||||
fx_framebuffer_bind(&renderer->main_buffer);
|
||||
}
|
||||
|
|
|
@ -202,20 +202,12 @@ struct fx_framebuffer *render_main_buffer_blur(struct sway_output *output,
|
|||
// Initially blur main_buffer content into the effects_buffers
|
||||
struct fx_framebuffer *current_buffer = &renderer->main_buffer;
|
||||
|
||||
// Bind to blur framebuffer
|
||||
fx_framebuffer_bind(&renderer->effects_buffer);
|
||||
glBindTexture(renderer->main_buffer.texture.target, renderer->main_buffer.texture.id);
|
||||
|
||||
int blur_radius = config->blur_params.radius;
|
||||
int blur_passes = config->blur_params.num_passes;
|
||||
|
||||
fx_render_main_buffer_blur(renderer, gl_matrix, &damage, dst_box, ¤t_buffer, blur_radius, blur_passes);
|
||||
|
||||
pixman_region32_fini(&damage);
|
||||
|
||||
// Bind back to the default buffer
|
||||
fx_framebuffer_bind(&renderer->main_buffer);
|
||||
|
||||
return current_buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue