On 2018-08-07 10:55 PM, Adam Jackson wrote: > GLXCreate{,New}Context, like most X resource creation requests, does not > emit a reply and therefore is emitted into the X stream asynchronously. > However, unlike most resource creation requests, the GLXContext we > return is a handle to library state instead of an XID. So if context > creation fails for any reason - say, the server doesn't support indirect > contexts - then we will fail in strange places for strange reasons. > > We could make every GLX entrypoint robust against half-created contexts, > or we could just verify that context creation worked. Reuse the > __glXIsDirect code to do this, as a cheap way of verifying that the > XID is real. > > glXCreateContextAttribsARB solves this by using the _checked version of > the xcb command, so effectively this change makes the classic context > creation paths as robust as CreateContextAttribs. > > v2: Better use of Bool, check that error != NULL first (Olivier Fourdan) > > Signed-off-by: Adam Jackson <a...@redhat.com>
Reviewed-by: Michel Dänzer <michel.daen...@amd.com> -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev