[Mesa-dev] [Bug 66346] shader_query.cpp:49: error: invalid conversion from 'void*' to 'GLuint'

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun May 25 02:30:59 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=66346

--- Comment #11 from Jeremy Huddleston <jeremyhu at freedesktop.org> ---
(In reply to comment #7)
> > Thanks, Apple!

You should thank the lack of standards regarding what GLhandleARB should've
been defined as back in 2005.  It's no more Apple's fault than it is Mesa's.

Furthermore, we had been dealing with this in src/glx/apple without major
issues through 8.0.5 (which was the last version before src/glx/apple stopped
building in mesa due to the transition to autotools-only builds).  GLhandleARB
was always 'void *' in mesa on OS X.

> > I think Mesa is just broken on Apple, probably forever, because of this.  We
> > assume *everywhere* that GLhandleARB == GLuint... 

Well, that's certainly incorrect and worthy of being fixed.  You can't make
that assumption and should fix any code which does.

> > to the point that
> > glGetActiveAttrib and glGetActiveAttribARB (and many, many others) are the
> > same function.

An obvious bug that should be straight forward to address.

> Although Apple's GLhandleARB are void *, I recall reading that only 32bits
> are used.

I don't think you should not assume anything about the implementation.

> (Unfortunately Apple can't go back in time and replace GLhandleARB
> with uints, as that would break binary compatibility.)

Yes, but fixing this doesn't really have any binary compatibility impact in
mesa since GLhandleARB has always been void * on darwin anyways.  Most of this
is about fixing build failures and fixing correctness for other architectures
to make mesa more robust in genera.

> Furthermore what Apple does is irrelevant, as Mesa is free to do what it
> wants (ie, it's free to assume using GLhandleARB are always 32bits).

Except for the fact that all the OpenGL functions in OpenGL.framework need to
match the signature of the corresponding functions in mesa, since they're
passed straight through.  That's why GLhandleARB has always been void * in mesa
on darwin.

> In short, all we have to do we fix the compiler errors, either:
> 
> 1) typedefing GLhandleARB as uintptr_t internally when
> 
>   #ifdef __APPLE__
>   #  ifdef BUILDING_MESA
>   typedef uintptr_t GLhandleARB;
>   #  else
>   typedef void *GLhandleARB;
>   #  endif
>   #else
>   typedef unsigned int GLhandleARB;
>   #endif

Ugly, and this just continues to mask underlying bugs.

> 2) add intermediate casts to (uintptr_t) between uint<->GLhandleARB
> conversions.

Ugly and also just masks underlying bugs =/

That being said, #2 is possibly the safest option because we are at least
forced to look at every problem point in the API.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140525/1b333b9a/attachment.html>


More information about the mesa-dev mailing list