Skip to content

Commit

Permalink
Remove assertion of output in fx_renderer_begin_buffer_pass (#40)
Browse files Browse the repository at this point in the history
* Remove assertion of output in fx_renderer_begin_buffer_pass

* Tweaked basic_renderer styling
  • Loading branch information
ErikReider authored Apr 17, 2024
1 parent b5e6014 commit 456d2ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 11 additions & 9 deletions render/fx_renderer/fx_pass.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ void fx_render_pass_add_blur(struct fx_gles_render_pass *pass,
if (pass->buffer->renderer->basic_renderer) {
wlr_log(WLR_ERROR, "Please use 'fx_renderer_begin_buffer_pass' instead of "
"'wlr_renderer_begin_buffer_pass' to use advanced effects");
abort();
return;
}
struct fx_renderer *renderer = pass->buffer->renderer;
struct fx_render_texture_options *tex_options = &fx_options->tex_options;
Expand Down Expand Up @@ -827,7 +827,7 @@ void fx_render_pass_add_optimized_blur(struct fx_gles_render_pass *pass,
if (pass->buffer->renderer->basic_renderer) {
wlr_log(WLR_ERROR, "Please use 'fx_renderer_begin_buffer_pass' instead of "
"'wlr_renderer_begin_buffer_pass' to use advanced effects");
abort();
return;
}
struct fx_renderer *renderer = pass->buffer->renderer;
struct wlr_box monitor_box = get_monitor_box(pass->output);
Expand Down Expand Up @@ -963,9 +963,8 @@ struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(
struct wlr_renderer *wlr_renderer, struct wlr_buffer *wlr_buffer,
struct wlr_output *output, const struct wlr_buffer_pass_options *options) {
struct fx_renderer *renderer = fx_get_renderer(wlr_renderer);
assert(output);

renderer->basic_renderer = false;
renderer->basic_renderer = (output == NULL);
if (!wlr_egl_make_current(renderer->egl)) {
return NULL;
}
Expand All @@ -982,13 +981,16 @@ struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(
}

// For per output framebuffers
struct fx_effect_framebuffers *fbos = fx_effect_framebuffers_try_get(output);
struct fx_effect_framebuffers *fbos = NULL;
// Update the buffers if needed
fx_framebuffer_get_or_create_custom(renderer, output, &fbos->blur_saved_pixels_buffer);
fx_framebuffer_get_or_create_custom(renderer, output, &fbos->effects_buffer);
fx_framebuffer_get_or_create_custom(renderer, output, &fbos->effects_buffer_swapped);
if (!renderer->basic_renderer) {
fbos = fx_effect_framebuffers_try_get(output);
fx_framebuffer_get_or_create_custom(renderer, output, &fbos->blur_saved_pixels_buffer);
fx_framebuffer_get_or_create_custom(renderer, output, &fbos->effects_buffer);
fx_framebuffer_get_or_create_custom(renderer, output, &fbos->effects_buffer_swapped);

pixman_region32_init(&fbos->blur_padding_region);
pixman_region32_init(&fbos->blur_padding_region);
}

struct fx_gles_render_pass *pass = begin_buffer_pass(buffer, timer);
if (!pass) {
Expand Down
2 changes: 0 additions & 2 deletions render/fx_renderer/fx_renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@ static void fx_renderer_destroy(struct wlr_renderer *wlr_renderer) {

static struct wlr_render_pass *begin_buffer_pass(struct wlr_renderer *wlr_renderer,
struct wlr_buffer *wlr_buffer, const struct wlr_buffer_pass_options *options) {
struct fx_renderer *renderer = fx_get_renderer(wlr_renderer);
renderer->basic_renderer = true;
struct fx_gles_render_pass *pass =
fx_renderer_begin_buffer_pass(wlr_renderer, wlr_buffer, NULL, options);
if (!pass) {
Expand Down

0 comments on commit 456d2ec

Please sign in to comment.