[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
Fri Mar 7 12:38:16 PST 2014


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

--- Comment #7 from José Fonseca <jfonseca at vmware.com> ---
(In reply to comment #4)
> This is in glext.h:
> 
> #ifdef __APPLE__
> typedef void *GLhandleARB;
> #else
> typedef unsigned int GLhandleARB;
> #endif
> 
> Thanks, Apple!
> 
> I think Mesa is just broken on Apple, probably forever, because of this.  We
> assume *everywhere* that GLhandleARB == GLuint... to the point that
> glGetActiveAttrib and glGetActiveAttribARB (and many, many others) are the
> same function.

Although Apple's GLhandleARB are void *, I recall reading that only 32bits are
used. (Unfortunately Apple can't go back in time and replace GLhandleARB with
uints, as that would break binary compatibility.)

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).

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

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

> This occurs in shader_query.cpp, uniforms.c, uniform_query.cpp, shaderapi.c,
> and dlist.c.
> 
> I'm honestly inclined to close this as WONTFIX...

Jeez, it seems nobody has patient for non-Linux platform these days.  Yes,
cross-platform its often a pain, but not really the end of the world.


(In reply to comment #5)
> Looks like there's about 20 functions which would have be split into ARB
> (GLhandleARB) and non-ARB (GLuint) flavors.
> 
> I might take a crack at it someday...
> 
> I'd like to see Mesa compile on MacOS even if it's not a common thing.

Mesa and MacOS in general no, but compatibility with Gallium and MacOS is
important for VMware down the road.

-- 
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/20140307/01ef5078/attachment.html>


More information about the mesa-dev mailing list