Skip to content

Use the wlroots gles2 renderer instead of our own renderer - #179

Open
ErikReider wants to merge 34 commits into
mainfrom
renderer-overhaul
Open

ErikReider wants to merge 34 commits into
mainfrom
renderer-overhaul

Conversation

@ErikReider

@ErikReider ErikReider commented Mar 20, 2026

Copy link
Copy Markdown
Member

Replaces our renderer with the generic wlroots gles2 renderer while only keeping what we need.

This will allow us to add additional renderers in the future (like vulkan) without soft-forking the entire wlroots rendering logic.

There's one breaking change which is the addition of scenefx_init() which replaces fx_renderer_create()

To test with SwayFX, use this PR

We could go a step further and make the fx_renderer generic like the base wlr_renderer struct, creating a fx_gles2_renderer struct. This would "simplify" the process of adding a new renderer even further.

@ErikReider ErikReider self-assigned this Mar 20, 2026
@ErikReider ErikReider added the enhancement New feature or request label Mar 20, 2026
@WillPower3309

Copy link
Copy Markdown
Member

I'll review what we have so far, but what's pending?

@ErikReider
ErikReider marked this pull request as ready for review June 30, 2026 10:11
@ErikReider
ErikReider requested a review from WillPower3309 June 30, 2026 10:11
@ErikReider ErikReider mentioned this pull request Jul 6, 2026
11 tasks
@WillPower3309

Copy link
Copy Markdown
Member

waiting to review this until we get the swayfx release out - since we need to keep the git versions of both packages in sync

Comment thread include/render/gles2/gles2.h Outdated

@WillPower3309 WillPower3309 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of my comments sort of follow the theme of swaywm/sway@9704152 - that is, do what wlroots does!

Comment thread include/render/fx_renderer.h Outdated
Comment thread include/render/fx_renderer.h Outdated
Comment thread include/render/fx_renderer.h Outdated
Comment thread include/scenefx/scenefx.h Outdated
Comment thread include/config.h.in Outdated
Comment thread include/config.h.in Outdated
Comment thread include/meson.build Outdated
Comment thread meson.build
Comment thread render/meson.build Outdated
Comment thread types/scene/wlr_scene.c

// TODO: Use the base wlr_render_pass_add_rect as a fast-path in the future
if (!fx_corner_radii_is_empty(&rect_corners)) {
if (data->fx_pass == NULL) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we assume fx_pass should be non null at all points in this function, we can replace all these checks with an assertion before this line

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As wlroots doesn't allow for us to directly "attach" our renderer onto their renderer, we attach our "renderer-attachment" to the wlr_scene addons list. There are cases where the main wlr_scene that we're attached to isn't used, like with per-application image capture in Sway (https://github.com/swaywm/sway/blob/5bc72dee4771a2d2d2648b8f69d30e0747f263f6/sway/tree/view.c#L89). In that case, fx_pass would be NULL

Comment thread render/gles2/pass.c Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants