[Lazarus] TOpenGLControl: multisampling not working (Linux/GLX)

Reimar Grabowski reimgrab at web.de
Mon Feb 25 19:20:57 CET 2013


On Fri, 15 Feb 2013 07:43:27 +0100
Reimar Grabowski <reimgrab at web.de> wrote:

> Does multisampling work under Linux/Gtk for anyone?
As no one answered I take this as a no, making it look like this feature was never working (not even for the one who implemented it) and never tested.

So I have to try to get my head around it. I just use this thread (in the vain hope of getting at least some help) to document my process.

1. Multisampling FBConfigs are non-conformant (see glxinfo) so when requesting a multisampled context I add GLX_CONFIG_CAVEAT followed by GLX_NON_CONFORMANT_CONFIG to the attribute list. This reduces the number of FBConfigs returned by glxChooseFBConfig which is a good thing(tm).

2. The implementation then only keeps the first FBConfig and discards the other ones. So I use glXGetFBConfigAttrib to query this config for GLX_SAMPLES(_ARB) and indeed the FBConfig provides the number of samples specified by TOpenGLControl.MultiSampling. Looks good to me.

3. The FBConfig then gets passed to glxCreateNewContext which returns a GLXContext. I get the ID from this context using glxQueryContext with GLX_FBCONFIG_ID. Looking up the ID in glxinfos list of FBConfigs shows that I get a non-conformant context with the specified number of red, green, blue and alpha bits, multisampling enabled and with the specified number of samples. Everything looks fine.

4. Then the GTK/GDK stuff kicks in (which I have not the slightest clue about) and when all is said and done I end up without multisampling in my GL code.

Currently I don't know what to do or where to look.
Any help or ideas are highly appreciated.

R.




More information about the Lazarus mailing list