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
GLX : glXCreatePbuffer() - pbuffer allocation fails #264
Comments
Is this a recent regression? If so, do you know what changed to introduce it? |
This behavior coincided with an upgrade to Mac OS X 10.15. Now that I have upgraded to MacOS 11.1 and XQuartz 2.8.0, I expected the problem to resolve itself, but it persists with the X Error : BadMatch. The pbuf_render test application that I pushed to github should make reproducing the problem easy for the XQuartz team. |
Ah right, I think I recall something about this from a few years ago. I'll see if I can dig that up. |
Jeremy, pbuffer (pixel buffer) support for Mac OS seems tenuous for OpenGL 2.1 going forward. pbuffer has been deprecated and is not supported in OpenGL 3.0. From the Apple OpenGL | Drawing Offscreen guide:
I found another citation in OpenGL on the Mac Platform:
Will XQuartz continue to support pbuffer for OpenGL 2.1 or follow Mac OS? It is possible to rewrite offscreen rendering code to use frame buffers, but I would like the XQuartz team to be aware of a pbuffer allocation issue. |
To be calear, @ajgallant, there isn't really an XQuartz team. XQuartz hasn't had much development for about a decade now. I still jump in periodically to cut new releases by pulling in updated upstream sources and will try to fix simple quality of life bugs here and there, but there is nobody looking at the core architecture and driving the project forward. I've commented in many places about where I think the project should go if someone was interested, but there doesn't seem to be anyone wanting to pick it up. If you'd be interested in helping out, GLX support is a great place to jump in. |
Does this mean that I get to fly in and interview? Open-source is awesome! I am bringing my surfboard this time. 🏄🏽♂️ |
No need to fly in or interview... just send pull requests. ;) |
I debugged the xorg-server 1.20.14 using lldb while running the pbuf_render test case. I did not find the server making a call to dispatch_CreatePbuffer() from glx/vndcmds.c:GlxDispatchRequest() through the dispatchFuncs table as I anticipated. Instead, the OpenGL client library made a call to the vendor GLX directly and logged the following errors in lldb:
The output from pbuf_render and OpenGL are mixed in the above, but I believe some additional insights can be inferred from the debug messages. Development SupportThe config and build for XQuartz were easy with the developer notes on the XQuartz github site. I also found the following useful in my understanding of the X.org Server architecture:
|
You could use a FBO.. but a pixel buffer is pretty simple, if your interested in a fix I could take a look. I wrote the PBuffer interface to OpenGL at Apple 20 years ago. |
I have been content with the FBO alternative to the deprecated pixel buffer. I prefer the additional control of render buffer and depth buffer attributes that FBO provides. I would not be interested in using pixel buffers in the future now that my project has been refactored. |
PBuffer seems to be deprecated and not available as of OpenGL 3.0 on macOS. glXCreatePbuffer fails on MacOS with this error: ``` X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 149 (GLX) Minor opcode of failed request: 27 (X_GLXCreatePbuffer) Serial number of failed request: 35 Current serial number in output stream: 35 ``` So the GL 2D implementation still needs a fix, but this patch allows 3D graphics to work again at least. see: XQuartz/XQuartz#264 Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
Summary
Off-screen, direct rendering using the pbuffer fails. Calls to glXCreatePbuffer() return the following error:
The call sequence in the test case provided was functioning prior to an upgrade to Mac OS X 10.15.
All FBConfigs returned by glXChooseFBConfig() for pbuffer rendering support:
Environment
OS: MacOS 11.1 (Big Sur)
Hardware: AMD Radeon Pro 575
X11: XQuartz 2.8.0 (xorg-server 1.19.7)
Test Case
https://github.com/ajgallant/pbuf_render
The text was updated successfully, but these errors were encountered: