GLFW + ANGLE + Vulkan renderer?

this will be a tall ask:
I’ve managed to make my application run satisfactorily on GLFW + ANGLE using the Linux-default openGLES rendering backend.
Now, I’m trying to use Vulkan to render, but still through GLFW and ANGLE.
Before if (!glfwInit()) { ... } I’m calling glfwInitHint(GLFW_ANGLE_PLATFORM_TYPE, GLFW_ANGLE_PLATFORM_TYPE_VULKAN);, which builds fine but results in [65544] EGL: Failed to create window surface: A NativeWindowType argument does not refer to a valid native window.
I know vulkan with glfw already exists but I want to use ANGLE to let my code mostly stay in openGLES land.

My Makefile links against ANGLE by means of with -L specifying the path.
I’m having glfw load in ANGLE:

#include <GLFW/glfw3.h>

To initialize my window&context I’m doing this:

	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, gles_major);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, gles_minor);

	GLFWmonitor *monitor = NULL;
	if (fullscreen) {
		monitor = glfwGetPrimaryMonitor();
		const GLFWvidmode *mode = glfwGetVideoMode(monitor);
		width = mode->width;
		height = mode->height;

	if (!(window = glfwCreateWindow(width, height, "esshader", monitor, NULL))) {
		die("Unable to create GLFW window.\n");

The strange thing is that even when I try to do glfwInitHint(GLFW_ANGLE_PLATFORM_TYPE, GLFW_ANGLE_PLATFORM_TYPE_OPENGL);, I get the same error, so apparently only ANGLEs default native openGLES rendering backend seems to work.

What should I be doing here?
I’ve looked around and couldn’t find any resources on this.

I tried using gdb to debug, I set break glfwCreateWindow and then wanted to step through with next and step.
gdb complained: Single stepping until exit from function glfwCreateWindow, which has no line number information.
I’ve since compiled glfw with debug symbols by deleting everything in the build dir, then running cmake -DCMAKE_BUILD_TYPE=Debug .. followed by make VERBOSE=1.
Using next and step again revealed the error inside createWindow, which calls _glfwCreateWindowX11, which runs fine until _glfwCreateContextEGL is called, which calls _glfwInitEGL, which apparently fails because the context has no surface.
Why though is way beyond me.

It might be worth checking the extension strings returned by eglQueryString in the _glfwInitEGL function to see if your Angle library has support for Vulkan on your platform.

I think you’re onto something here…
I’ve managed to run the code you linked and it’s fascinating:
set print elements 0 to disable string print truncation, then print extensions gives this list (line breaks added for readability)


Compared to the code you linked, this list is missing, EGL_ANGLE_platform_angle_d3d and EGL_ANGLE_platform_angle_metal as expected but not EGL_ANGLE_platform_angle_vulkan or EGL_ANGLE_platform_angle_opengl, which also fails the same way when I try to use it!
But what amazes me is that EGL_EXT_platform_x11 is missing!!!
HOW am I getting an EGL window with GLFW + ANGLE + openGLES then??
Running the code further the x11 test then returns false as expected.
I’ve also run the default openGLES backend through gdb, extensions returns the exact same list.

It seems that angle does not expose EGL_EXT_platform_x11 extension - see getStrings method here: src/libANGLE/Caps.cpp - angle/angle - Git at Google (

It looks like they expect to pass EGL_PLATFORM_X11_EXT for EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE enum - as long as EGL_ANGLE_platform_angle extension is supported. That happens here: src/libANGLE/Display.cpp - angle/angle - Git at Google ( where platformType is passed from src/libANGLE/Display.cpp - angle/angle - Git at Google (

@mmozeiko thank you for looking into this aswell!
sorry, but I don’t know what I can do here.

#        if defined(ANGLE_USE_X11)
                if (platformType == EGL_PLATFORM_X11_EXT)
                    impl = new rx::DisplayGLX(state);
#        endif

#        if defined(ANGLE_USE_X11)
            if (platformType == EGL_PLATFORM_X11_EXT)
                impl = new rx::DisplayGLX(state);
#        endif

#        if defined(ANGLE_USE_X11)
            if (platformType == EGL_PLATFORM_X11_EXT && rx::IsVulkanXcbDisplayAvailable())
                impl = rx::CreateVulkanXcbDisplay(state);
#        endif

The three variants (shortened for clarity) seem fine to me, in fact openglES and openGL are identical and that one fails the same way.
Does anyone know what to do about this?
I compiled ANGLE myself from their chromium source server as per their instructions, nothing special.

An update:
I’ve started to ask in the google angleproject group but so far no response.

Any help would be appreciated, even if only for a local temporary fix!