What's the recommended backend for each platform?

8,591 views
Skip to first unread message

Joao da Silva

unread,
Jan 31, 2022, 4:33:38 PM1/31/22
to angleproject
Hi all,

ANGLE supports various backends:


What are the recommended backends for each of the desktop platforms?
Are they all equally stable and tested?

I'm looking into whether to use D3D9 or D3D11 on Windows, and GL or Metal on macOS. Or whether to just use Vulkan instead.

The criteria for my project are
(1) Support GLES 3.0 (to back a WebGL2 implementation)
(2) stable rendering across the platforms,
(3) performance,
(4) smallest binary size (i.e. by excluding unused backends from the build).

Thanks!
- Joao

Geoff Lang

unread,
Feb 2, 2022, 10:32:10 AM2/2/22
to joaodasi...@gmail.com, angleproject
You could mirror what Chrome currently uses for the best stability:
Windows: D3D11 with D3D9 fallback
Linux: GL, Vulkan is in progress
Mac: GL, Metal is in progress
Android: GL, Vulkan is in progress


--
You received this message because you are subscribed to the Google Groups "angleproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angleproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angleproject/35c79186-f907-490b-9bf9-2c6c465995c3n%40googlegroups.com.

Jamie Madill

unread,
Feb 2, 2022, 10:40:56 AM2/2/22
to geof...@google.com, joaodasi...@gmail.com, angleproject
I'd add that the Vulkan backend is likely going to become the most well supported back-end on any platform that supports Vulkan natively, including Windows. It's currently not as tested on a wide range of Windows configs as the D3D11 back-end.

Rafael Cintron

unread,
Feb 7, 2022, 12:19:14 PM2/7/22
to jma...@chromium.org, geof...@google.com, joaodasi...@gmail.com, angleproject

Joao, for Windows, I highly recommend using the D3D11 with a D3D9 fallback like Geoff states.  As Geoff says, these backends are the most tested ones on Windows. 

 

A plus of using DirectX is that on some Windows machines such as Xbox and Qualcomm Windows machines like Surface Pro X, DirectX is the only backend that will work.

 

--Rafael

Joao da Silva

unread,
Feb 7, 2022, 2:01:45 PM2/7/22
to angleproject
Thanks for the input! Using the same backends as Chrome makes a lot of sense.

Everything works fine, and integrating ANGLE was quite straightforward (including with GLFW and Skia).

(FWIW, I've patched libEGL_static to skip the thin_archive config and set complete_static_lib=true, so that windowjs.exe can be distributed as a single binary. GLFW needed some fixes to skip trying to load libEGL.dll as well. Works quite well in the end!)

The bane of my existence is now window resizes :-)

I'm trying really hard to make resizes do contentful paints in sync with the resize event (WM_SIZE). The application is single threaded and just enters Javascript, draws its thing, and swaps buffers. It works almost all of the time, except showing a stretched frame now and then, and I have no idea why or how to sync this properly. The application renders to a texture first, and then copies it to framebuffer 0 (via Skia). AFAICT, Skia is flushing its commands to the GPU as expected.

Would you have any hints of things to try?

I've noticed that the glitch happens very frequently when eglSwapInterval is 1 (i.e. vsync is on), and very rarely when it's 0 (vsync off). Setting the swapinterval to 0 from the resize callback also makes it glitch less often (!). Looking into the D3D11 renderer, this seems to be related with swap chains but I don't know D3D to understand the details.

Also noticed that calling eglWaitClient after resizing the surfaces improves things.

Would you suggest trying some of the extensions, or maybe WS_EX_NOREDIRECTIONBITMAP + DirectComposition?

Maybe there's a way to make Windows wait as long as necessary for the paint? :-)

(I've also checked obvious things like setting glViewport, checking that the context is current, etc.)

Thanks for the help.
Best,
- Joao

Rafael Cintron

unread,
Feb 10, 2022, 8:38:51 PM2/10/22
to joaodasi...@gmail.com, angleproject

Joao, I am not sure what kind of applications you’re building. 

 

In general you should prefer to use flip model swap chains along with WS_EX_NOREDIRECTIONBITMAP.  See DXGI flip model - Win32 apps | Microsoft Docs

 

The stretching you’re seeing is likely because the WM_SIZE messages are coming in but your code is (for some reason) not resizing the swap chain buffers to the new window size.  If you specified DXGI_SCALING_STRETCH, then windows will stretch the contents to fit the window. 

 

--Rafael

Joao da Silva

unread,
Mar 5, 2023, 1:48:34 PM3/5/23
to angleproject
Hi ANGLE team,

coming back to this thread a year later to ask if things have changed regarding the recommended backend for each desktop platform. In particular,

* Does macOS default to Metal now? Is Metal better than CGL as a backend right now?

* And does any platform using Vulkan by default now too? Is it better to just use Vulkan for Windows, macOS and Linux?

Thanks,
- Joao

Geoff Lang

unread,
Mar 6, 2023, 11:19:35 AM3/6/23
to joaodasi...@gmail.com, angleproject
Metal and GL are both actively supported on Mac. I think it's fairly safe to set as your default. Performance and conformance are generally better but it's had less time to "bake" in the wild.

We're in the process of shipping Vulkan as the default on Linux and Android, you can expect it to work well there. Windows will likely not use Vulkan any time soon, it doesn't integrate particularly well with the OS compositor.

Reply all
Reply to author
Forward
0 new messages