If I understand correctly, the glow feature makes the OpenGL support totally override the default WebGPU support. Would it be feasible to have some way of trying both in a single build? As in, try WebGPU first, but if Vulkan/etc isn't available on the user's system, then try OpenGL as a fallback. Right now, I'm producing two separate builds (a main version with WebGPU and a secondary version with OpenGL in case people need it), but I was thinking it might be nice to have an all-inclusive build so users don't have to worry about which one to use.
I think that would be great, but only if the glow feature is enabled, just like how wgpu is also optional. I guess Hector would want to finish the glow backend first before adding it a fallback though, so that the fallback is seamless.
Is there any particular reason you are interested in having iced_wgpu as the default?
If you do not need image or SVG support, why not ship iced_glow by default as it should run on older hardware?
I guess the question here is: if we change iced_glow to be the default renderer once it is feature complete, what will the fallback buy us?
I have a few reasons, roughly in order of importance:
On Mac, OpenGL is deprecated in favor of Metal.
I prefer the default font for WebGPU more than the default font for OpenGL. Is there a way to make them the same?
WebGPU:
OpenGL:
Philosophically, I like the idea of using/supporting newer technologies by default to keep the ecosystem moving forward.
On Mac, OpenGL is deprecated in favor of Metal.
I know, "OpenGL is dead". This is the main reason iced_wgpu exists. However, this doesn't change the fact that OpenGL is the most supported graphics API. If I am not mistaken, Catalina still supports OpenGL 4.1.
I prefer the default font for WebGPU more than the default font for OpenGL. Is there a way to make them the same?
You need to enable the glow_default_system_font feature separately.
Philosophically, I like the idea of using/supporting newer technologies by default to keep the ecosystem moving forward.
Fair enough! However, keep in mind these newer technologies may not be able to satisfy all your needs right away.
Just to be clear, I do believe we should eventually offer rendering fallbacks. Specifically:
Metal/Vulkan/DX12 -> DX11/OpenGL -> Software
We may be able to simply rely on wgpu (https://github.com/gfx-rs/wgpu/issues/450) for the first fallback. When it comes to the second one, we will need to implement a software renderer.
However, I feel it is a bit early to work on this as our rendering model still needs to improve a lot and tackling this could pin the current design.
That's good to know about glow_default_system_font! Unfortunately, I probably can't use it by default until the next Iced release - right now, I'm using publishing fallbacks and conditional compilation to detect whether I'm using Iced from GitHub or crates.io, but I don't think there's an equivalent fallback for crate features that only exist in one or the other. But I'll keep it in mind and probably go ahead and switch to OpenGL by default when the next release comes out, until it's the right time to tackle an OpenGL fallback.
Most helpful comment
I know, "OpenGL is dead". This is the main reason
iced_wgpuexists. However, this doesn't change the fact that OpenGL is the most supported graphics API. If I am not mistaken, Catalina still supports OpenGL 4.1.You need to enable the
glow_default_system_fontfeature separately.Fair enough! However, keep in mind these newer technologies may not be able to satisfy all your needs right away.
Just to be clear, I do believe we should eventually offer rendering fallbacks. Specifically:
We may be able to simply rely on
wgpu(https://github.com/gfx-rs/wgpu/issues/450) for the first fallback. When it comes to the second one, we will need to implement a software renderer.However, I feel it is a bit early to work on this as our rendering model still needs to improve a lot and tackling this could pin the current design.