Use the wlroots gles2 renderer instead of our own renderer - #179
ErikReider wants to merge 34 commits into
Conversation
|
I'll review what we have so far, but what's pending? |
We don't use stencils with our offscreen_buffers, and each attachment consumes ~22MB VRAM (on my system). So we save ~100MB in VRAM
… on render destruction
a7038e1 to
29ed50c
Compare
…bled Checks if gles2 is enabled in SceneFX and in wlroots
202891b to
0f05ab7
Compare
0f05ab7 to
6ddeb57
Compare
If a fast clear is desired (doesn't support any effect anyway), use wlr_render_pass_add_rect instead
|
waiting to review this until we get the swayfx release out - since we need to keep the git versions of both packages in sync |
WillPower3309
left a comment
There was a problem hiding this comment.
A lot of my comments sort of follow the theme of swaywm/sway@9704152 - that is, do what wlroots does!
|
|
||
| // 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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
cc6ac9c to
108f730
Compare
108f730 to
7800d67
Compare
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 replacesfx_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_rendererstruct. This would "simplify" the process of adding a new renderer even further.