Replies: 2 comments
-
All formal requests can be made at https://github.com/iced-rs/rfcs Posting a link to the rfc on the discord under #discussions is probably a good idea too |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
From Hecrj on the Iced discord |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello 👋,
I am developing smithay a wayland compositor framework and I was looking into implementing an adapter for iced, so that it could be used for example for shell-components.
I was thus looking at the UserInterface struct for wiring up iced and was a little surprised to see, that the
build- andupdate-methods require an instance of the usedRenderer.After digging around in the source code the reasoning for this seems to be mostly the layouting-code. E.g. the
Image-widget is using theRendererto query dimensions.The problem with that for me is, that smithay might have multiple instances of renderers. Not necessarily different ones, we are (mostly) not mixing graphic apis, but e.g. on multi-gpu systems, users might want one renderer per GPU. When processing input-events, I cannot just pick any renderer, I don't even know, which one does end up being selected for rendering.
Overall iced seems to be build around the assumption, that there is only one instance of a renderer and that preferably is also constant over the lifetime of the program. This also means, that Widgets are able to store their state as GPU resources, which also doesn't really work for my use-case. I would also personally argue, that the layout/update code should be independent of the renderer in use, that makes a better API imo and will also ease providing fallback renderers at runtime in the future instead of having to select a renderer by feature gates.
I would like to lift this limitation, is there interest in removing the
Rendererargument from the layouting code and getting rid of any gpu resources in the widgets? (Textures should be cached for each renderer instance.) If so, I would be interested in contributing this change. Is there a formal process to do that?Beta Was this translation helpful? Give feedback.
All reactions