OpenGL attrib_list support
Alexander Monakov
amonakov at ispras.ru
Mon Jul 8 06:30:27 PDT 2013
On Mon, 8 Jul 2013, Alexander Monakov wrote:
> Looks awesome. Quick question -- is handling Xlib-style attrib-lists where
> some keys stand alone without a corresponding value possible/easy? This
> should not block the patch, I'm just asking the question while the code is
> hot (and I'm interested to have this functionality work for glXChooseVisual).
Ah, sorry, I spoke too soon. My concern is addressed by the pull request
itself, to quote:
> Note that the current code assumes no value for unknown keys when
> determining attrib_list length, but int value when iterating over
> attrib_list later. This has the effect that a null value after an unknown
> key terminates the attrib_list as currently interpreted.
You seem to explain a bug in your implementation? :)
For GLX-style attrib-lists, you have a guarantee that a key is followed by a
(possibly zero-bit-pattern) value. Thus the attrib list is terminated by a
zero-bit-pattern Int at an even position (thus, a key). All values are at odd
positions.
For Xlib-style attrib-lists, you don't have that guarantee: keys for Boolean
arguments do not have a value (it is implicitely 'True').
Initially I thought your patch does not handle Xlib-style lists at all, but
now it seems the ground work is in place?
Alexander
More information about the apitrace
mailing list