OpenGL backend on windows

17 views
Skip to first unread message

Mark Sibly

unread,
Feb 1, 2023, 5:37:00 PMFeb 1
to Dawn Graphics
Hi,

I'm trying to get the OpenGL backend going on windows, but (after working out it needs EGL.dll which I just stole from Chrome) when discovering adapters it gives this message and fails to create an OpenGL adapter:

Error: eglChooseConfig returned zero configs
    at Create (C:\Users\marks\dev\dawn\src\dawn\native\opengl\ContextEGL.cpp:53)

Any ideas?

Bye,
Mark

Corentin Wallez

unread,
Feb 2, 2023, 5:02:03 AMFeb 2
to Mark Sibly, Dawn Graphics
Hey Mark,

I don't think we ever tried this, but you'd at least also need the libGLESv2.dll from Chromium: libEGL and libGLESv2 from ANGLE always come in pairs. After that ... I don't think we'd know exactly how to do it because we only tried the GL backend on Windows inside Chromium and not with Dawn standalone.

Cheers,

Corentin

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dawn-graphics/7c0a46ff-d2a8-41a2-92a3-a0b6f90a595fn%40googlegroups.com.

Stephen White

unread,
Feb 2, 2023, 12:29:56 PMFeb 2
to Mark Sibly, Dawn Graphics
(Ooops, Reply-All fail. Reposting for posterity.)

Hi Mark,

The Dawn OpenGL backend comes in two flavours: (desktop) OpenGL, and OpenGLES. Note that these are not as mature as the other backends, and are "best effort". There are some features which are not available. Currently, Dawn attempts to discover them both at runtime via EGL.

The libEGL.dll in Chrome (along with libGLESv2.dll) is ANGLE. You'll need both files. ANGLE is a translation layer that supports a GLES front-end and a number of backends. The "zero configs" error is actually Dawn attempting to start its (desktop) OpenGL backend on ANGLE's frontend, which it cannot do, since its frontend is GLES. You can ignore the error, or disable the desktop GL backend in the build. Depending on what you're trying to do, GLES with ANGLE's D3D11 backend might be your best bet. This should be the default when building the GN build, but I'm not sure about cmake.

Clear as mud?

Stephen

Stephen White

unread,
Feb 2, 2023, 12:38:47 PMFeb 2
to Mark Sibly, Dawn Graphics
On Wed, Feb 1, 2023 at 7:30 PM Mark Sibly <mark...@gmail.com> wrote:
Thanks for that,

I did only have desktop gl enabled, not gles, but does this therefore imply there is no 'native' OpenGL backend on windows that takes advantage of opengl4.2 etc, ie: there is only the OpenGLES backend which goes through angle?

Here's the thing: there is a desktop GL backend in Dawn, but there is currently no WGL support, which would be necessary to access it "natively" on Windows (we used to do it through GLFW but that was problematic for various reasons). The correct way to implement it now would be to create a ContextWGL subclass of dawn::native::opengl::Device::Context, as is done with ContextEGL.
 
Not a problem really, I was mainly just interested in comparing performance/consistency etc, but native d3d12/vulkan vs. angle doesn't sound fair! 

I'm in the process of resurrecting my linux build so I'll play around with the GL backend on that instead.

You're likely to have more luck there, as long as your Linux machine has an EGL driver that supports creating desktop GL contexts (most NVidia drivers do, for example).

Stephen 

Bye,
Mark

On Thu, Feb 2, 2023 at 11:53 AM Stephen White <senor...@chromium.org> wrote:
Hi Mark,

The Dawn OpenGL backend comes in two flavours: (desktop) OpenGL, and OpenGLES. Note that these are not as mature as the other backends, and are "best effort". There are some features which are not available. Currently, Dawn attempts to discover them both at runtime via EGL.

The libEGL.dll in Chrome (along with libGLESv2.dll) is ANGLE. You'll need both files. ANGLE is a translation layer that supports a GLES front-end and a number of backends. The "zero configs" error is actually Dawn attempting to start its (desktop) OpenGL backend on ANGLE's frontend, which it cannot do, since its frontend is GLES. You can ignore the error, or disable the desktop GL backend in the build. Depending on what you're trying to do, GLES with ANGLE's D3D11 backend might be your best bet. This should be the default when building the GN build, but I'm not sure about cmake.

Clear as mud?

Stephen

On Wed, Feb 1, 2023 at 5:37 PM Mark Sibly <mark...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages