WIP Fallback to software renderer if wgpu uses CPU renderer #3011
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The implementation here is a proof of concept, but doesn't quite fit with how the fallback compositor is designed. So it's not suitable to be merged as is.
Anyway: the issue here is that if the
wgpu
renderer successfully initializes, but uses a software renderer like llvmpipe on Linux (for instance on a VM with no accelerated graphics, or for some reason I'm seeing wgpu fail to initialize an accelerated EGL context on the Pinebook Pro), this will be used for renderering, even though thetiny_skia
renderer should perform better.So we probably want to fallback to tiny Skia if wgpu selects a
wgpu::Adapter
withDeviceType::Cpu
.Questions with this:
ICED_BACKEND
?ICED_BACKEND
is not set?fallback::Compositor
should recognize this is a non-preferred CPU renderer, and continue iterating and see if there is a better backend to usefallback::Compositor
is designed to be very generic. We should probably handle the possibility that the primaryCompositor
backend produces a software renderer, but the secondary backend fails.is_cpu()
method to thegraphics::Compositor
trait sofallback::Compositor
can prioritize this way? Or some other indication of preference.