-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Using Filament with shared context exits with BadMatch on Linux #1453
Comments
Hi @roxlu, this isn't an issue specific to GLFW, it's more of a feature request for our context creation strategy on X to be more flexible. Your tentative modifications to Curious what others on the team will think. Can you make a pull request? That way it will be easier for my colleagues to look over your changes. |
This is tricky because arbitrary user configs may not work. We could document what Filament expects. |
Good point, Filament doesn't really care if they have stencil or depth but we do require an OpenGL 4.1 context. @roxlu, with GLFW you should be able to set up context-related window creation hints to create a compatible context. Check it out: https://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx Try setting GLFW_CONTEXT_VERSION_MAJOR to 4 and GLFW_CONTEXT_VERSION_MINOR to 1. |
Note that GLFW_SAMPLES should be 1, (Filament does AA in an offscreen buffer.) |
Thanks for your feedback. I created this pull request, please let me know if I'm doing this correctly.
Yes I was using those indeed: glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_SAMPLES, 1); When I use these glfwWindowHints I'm getting the same issue. @romainguy and @prideout thanks, I indeed think that having a list with the required context attributes would be very useful. Also having some super tiny examples would probably make it a lot easier to get a general idea how Filament works. The current documentation is amazing, but I'm talking more about guides/styles that speed up the process of learning how to use Filament. |
Describe the bug
I'm embedding Filament into an GLFW based application on Linux (Linux arch680 5.2.1-arch1-1-ARCH #1 SMP PREEMPT Sun Jul 14 14:52:52 UTC 2019 x86_64 GNU/Linux). When sharing the GL context that's created by GLFW the application exists with a BadMatch error, see this output.
To Reproduce
I should create a test repository... hopefully I've got time to do that, but for now:
Expected behavior
A GLFW app that renders a triangle via Filament. I'm still diving into the code / documentation on how to correctly initialize and use filament in GLFW. I based my code on this example.
Desktop (please complete the following information):
Additional Info
I think the BadMatch is caused because the GL context is created with a GLXFBConfig that doesn't match with the GLXFBConfig of the shared GL context. I've updated PlatformGLX.cpp in such a way that it uses the GLXFBConfig from the shared GL context when it was given by the user.
The text was updated successfully, but these errors were encountered: