Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Make allocator handle the swapchain managment #3226

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bl4ckb0ne
Copy link
Contributor

@bl4ckb0ne bl4ckb0ne commented Sep 29, 2021

Another attempt to decouple the backend/renderer/output/swapchain

The allocator is now declared by the user, via either a call to wlr_allocator_autocreate or from a custom implementation.

The user has to set the allocator to the output, otherwise nothing will be displayed on screen.

The wlr_output is still using the wlr_renderer, but #3197 has good ideas to get rid of this.

Related to #3222 #3215 and #3197

@bl4ckb0ne bl4ckb0ne force-pushed the allocator_output_swapchain branch 2 times, most recently from ef79230 to 05ed616 Compare September 30, 2021 14:23
@bl4ckb0ne bl4ckb0ne marked this pull request as ready for review September 30, 2021 14:28
@bl4ckb0ne bl4ckb0ne added the breaking Breaking change in public API label Sep 30, 2021
backend/multi/backend.c Outdated Show resolved Hide resolved
backend/multi/backend.c Outdated Show resolved Hide resolved
@emersion
Copy link
Member

Hm, I'm not sure what the upside to make the allocator responsible for creating the swapchain is. Can you elaborate?

It seems to me like doing this is making things more complicated instead of simplifying them. Before:

             renderer
                |
                v
allocator ->  output

After:

             renderer
                |
                v
allocator ->  output
    ^           |
    |           |
    +-----------+

@bl4ckb0ne bl4ckb0ne force-pushed the allocator_output_swapchain branch 2 times, most recently from 9f27e02 to 336fb7a Compare October 22, 2021 20:17
@emersion
Copy link
Member

"backend/multi: implement get_buffer_caps" looks good to me, pushed to master.

@bl4ckb0ne
Copy link
Contributor Author

The motivation behind this little shift of responsability is to prevent the backend to instanciate its own renderer when using an external renderer. The current approache for an output to render is to get the allocator and renderer from its associated backend.

This patchset allows the user to provide its own allocator to the output, to avoid declaring multiple renderers.

There will be another patchset following this one to prevent the backends to create their allocator at creation.

@emersion
Copy link
Member

emersion commented Nov 1, 2021

wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3226

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
allocator breaking Breaking change in public API output
Development

Successfully merging this pull request may close these issues.

2 participants