[Piglit] [PATCH v2 10/13] piglit-dispatch: Switch to using piglit-dispatch instead of GLEW.

Jose Fonseca jfonseca at vmware.com
Fri Mar 16 16:51:19 PDT 2012


----- Original Message ----- 

> On 16 March 2012 12:04, Jose Fonseca < jfonseca at vmware.com > wrote:

> > ----- Original Message -----
> 
> > > On 03/12/2012 02:41 PM, Paul Berry wrote:
> 
> > > > Previous patches set up the piglit-dispatch infrastructure but
> > > > did
> 
> > > > not
> 
> > > > use it. This patch enables piglit-dispatch and uses it instead
> > > > of
> 
> > > > GLEW.
> 
> > > >
> 
> > > > No piglit regressions on Intel SandyBridge (Linux) or Mac OSX.
> 
> > >
> 
> > > Nice. Only one more platform to conquer.
> 
> > >
> 
> > > > #if defined(USE_OPENGL)
> 
> > > > -# include "glew.h"
> 
> > > > - /* Include the real headers too, in case GLEW misses
> > > > something.
> 
> > > > */
> 
> > > > +# include "piglit-dispatch.h"
> 
> > > > + /* Include the real headers too, in case piglit-dispatch
> > > > misses
> 
> > > > something. */
> 
> > > > # ifdef __APPLE__
> 
> > > > # include <OpenGL/gl.h>
> 
> > > > # include <OpenGL/glu.h>
> 
> > >
> 
> > > Shouldn't Apple's <OpenGL/gl.h> be removed too?
> 
> > > I think we discussed this before, but I don't remember the
> 
> > > conclusion.
> 

> > It's probably pointless if all GL defitions are done before.
> 

> > But note that Apple's glext.h is non standard:
> 

> > https://github.com/apitrace/apitrace/blob/master/thirdparty/khronos/GL/glext.patch
> 

> > It's probably better to replicate this on piglit-dispatch too.
> 

> > Jose
> 

> Interesting: on my mac, GLhandleARB is defined as a void *. Your
> patch defines it as an unsigned long (which is equivalent to void *
> from an ABI perspective).

This was deliberate. As handling both "void *" would make the apitrace code generation unnecessarily complex.

> GL defines it as an unsigned int, which is certainly *not* equivalent
> on 64-bit systems.

> This throws a bit of a monkey wrench into things, since it breaks
> some of the aliases defined in the official gl.spec file. for
> example GetAttachedObjectsARB is marked as an alias for
> GetAttachedShaders, but this can't possibly work on mac if one of
> them takes a GLhandleARB * as its 4th argument, and the other takes
> a GLuint * as its 4th argument (since the two types have different
> sizes).

Never noticed that gl.spec had aliases.  I don't think that information is very reliable.

For example, gl.spec also marks ARB_framebuffer_object as aliases of EXT_framebuffer_object functions, but semantics are different, and I heard reports of segfaults on NVIDIA drivers due to inadvertedly mixing up ARB_framebuffer_object and EXT_framebuffer_object functions.

I think handling aliases under the hood causes more harm than good. It's better that apps are well aware of what extensions they are using.

Jose


More information about the Piglit mailing list