Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feasible to enable OpenGL as a fallback instead of an override? #457

Closed
mtkennerly opened this issue Jul 22, 2020 · 6 comments
Closed

Feasible to enable OpenGL as a fallback instead of an override? #457

mtkennerly opened this issue Jul 22, 2020 · 6 comments
Assignees
Labels
feature New feature or request question Further information is requested rendering shell

Comments

@mtkennerly
Copy link
Contributor

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.

@manokara
Copy link

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.

@hecrj
Copy link
Member

hecrj commented Jul 24, 2020

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?

@hecrj hecrj added the question Further information is requested label Jul 24, 2020
@mtkennerly
Copy link
Contributor Author

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:

    image

    OpenGL:

    image

  • Philosophically, I like the idea of using/supporting newer technologies by default to keep the ecosystem moving forward.

@hecrj
Copy link
Member

hecrj commented Jul 24, 2020

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 (gfx-rs/wgpu#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.

@mtkennerly
Copy link
Contributor Author

mtkennerly commented Jul 24, 2020

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.

@hecrj hecrj added the feature New feature or request label Jul 24, 2020
@hecrj hecrj self-assigned this Jan 19, 2022
@hecrj
Copy link
Member

hecrj commented May 23, 2023

Fixed by #1748.

@hecrj hecrj closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request question Further information is requested rendering shell
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants