Hi,
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 -l:libEGL.so.1 -l:libGLESv2.so.2 with -L specifying the path.
I’m having glfw load in ANGLE:
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.
@mmozeiko thank you for looking into this aswell!
sorry, but I don’t know what I can do here.
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
# if defined(ANGLE_USE_X11)
if (platformType == EGL_PLATFORM_X11_EXT)
{
impl = new rx::DisplayGLX(state);
break;
}
# endif
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
# if defined(ANGLE_USE_X11)
if (platformType == EGL_PLATFORM_X11_EXT)
{
impl = new rx::DisplayGLX(state);
break;
}
# endif
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
# if defined(ANGLE_USE_X11)
if (platformType == EGL_PLATFORM_X11_EXT && rx::IsVulkanXcbDisplayAvailable())
{
impl = rx::CreateVulkanXcbDisplay(state);
break;
}
# 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.