On Mon, Jul 8, 2013 at 2:30 PM, Alexander Monakov <amona...@ispras.ru>wrote:
> > 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 > I like the direction of the patch. I'd recommend adding a bool option to AttribArray's constructor, so that when true, it would not assume a list of pairs, but that bool attributes have implicit true value. Jose
_______________________________________________ apitrace mailing list apitrace@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/apitrace