[Mesa-dev] [PATCH 4/4] mesa: stop aliasing ARB and core shader API functions

Jose Fonseca jfonseca at vmware.com
Mon Mar 10 14:41:25 PDT 2014


How come? GLhandleARB is still a GLuint on Linux.  And calling one vs the other works just as well.

How does merely un-aliasing the entrypoints break anything?

Jose

----- Original Message -----
> No way.  This will break existing applications on Linux.
> 
> On 03/08/2014 05:10 PM, Brian Paul wrote:
> > For example, we now we have separate dispatch functions for
> > glCompileShader(GLuint) and glCompileShaderARB(GLhandleARB).
> > 
> > With this change and the previous ones we should be able to build/run
> > on MacOS again (where GLhandleARB is a void pointer, not a GLuint).
> > 
> > Bugzilla:
> > https://urldefense.proofpoint.com/v1/url?u=https://bugs.freedesktop.org/show_bug.cgi?id%3D66346&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=c5R2aOhYAljfcIthqoSFrxh6qNtSQ9ZX6Blbh4oPFb8%3D%0A&s=8b77f92509075a796a1e1d0533e61de310886c7c7c078e2c9b50a6af0a585101
> > ---
> >  src/mapi/glapi/gen/gl_API.xml |   28 +++++++++++++++-------------
> >  src/mesa/main/dlist.c         |    2 +-
> >  2 files changed, 16 insertions(+), 14 deletions(-)
> > 
> > diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
> > index 7e1946e..76f56c4 100644
> > --- a/src/mapi/glapi/gen/gl_API.xml
> > +++ b/src/mapi/glapi/gen/gl_API.xml
> > @@ -7829,14 +7829,14 @@
> >          <glx ignore="true"/>
> >      </function>
> >  
> > -    <function name="ShaderSourceARB" alias="ShaderSource">
> > +    <function name="ShaderSourceARB" offset="assign">
> >          <param name="shader" type="GLhandleARB"/>
> >          <param name="count" type="GLsizei"/>
> >          <param name="string" type="const GLcharARB **"/>
> >          <param name="length" type="const GLint *"/>
> >      </function>
> >  
> > -    <function name="CompileShaderARB" alias="CompileShader">
> > +    <function name="CompileShaderARB" offset="assign">
> >          <param name="shader" type="GLhandleARB"/>
> >      </function>
> >  
> > @@ -7851,15 +7851,17 @@
> >          <glx ignore="true"/>
> >      </function>
> >  
> > -    <function name="LinkProgramARB" alias="LinkProgram">
> > +    <function name="LinkProgramARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >      </function>
> >  
> > -    <function name="UseProgramObjectARB" alias="UseProgram">
> > +    <function name="UseProgramObjectARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> > +        <glx ignore="true"/>
> > +        <glx ignore="true"/>
> >      </function>
> >  
> > -    <function name="ValidateProgramARB" alias="ValidateProgram">
> > +    <function name="ValidateProgramARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >      </function>
> >  
> > @@ -8014,13 +8016,13 @@
> >          <glx ignore="true"/>
> >      </function>
> >  
> > -    <function name="GetUniformLocationARB" alias="GetUniformLocation">
> > +    <function name="GetUniformLocationARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="name" type="const GLcharARB *"/>
> >          <return type="GLint"/>
> >      </function>
> >  
> > -    <function name="GetActiveUniformARB" alias="GetActiveUniform">
> > +    <function name="GetActiveUniformARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="index" type="GLuint"/>
> >          <param name="bufSize" type="GLsizei"/>
> > @@ -8030,19 +8032,19 @@
> >          <param name="name" type="GLcharARB *"/>
> >      </function>
> >  
> > -    <function name="GetUniformfvARB" alias="GetUniformfv">
> > +    <function name="GetUniformfvARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="location" type="GLint"/>
> >          <param name="params" type="GLfloat *"/>
> >      </function>
> >  
> > -    <function name="GetUniformivARB" alias="GetUniformiv">
> > +    <function name="GetUniformivARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="location" type="GLint"/>
> >          <param name="params" type="GLint *"/>
> >      </function>
> >  
> > -    <function name="GetShaderSourceARB" alias="GetShaderSource">
> > +    <function name="GetShaderSourceARB" offset="assign">
> >          <param name="shader" type="GLhandleARB"/>
> >          <param name="bufSize" type="GLsizei"/>
> >          <param name="length" type="GLsizei *"/>
> > @@ -8059,13 +8061,13 @@
> >      <enum name="OBJECT_ACTIVE_ATTRIBUTES_ARB"             value="0x8B89"/>
> >      <enum name="OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB"   value="0x8B8A"/>
> >  
> > -    <function name="BindAttribLocationARB" alias="BindAttribLocation">
> > +    <function name="BindAttribLocationARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="index" type="GLuint"/>
> >          <param name="name" type="const GLcharARB *"/>
> >      </function>
> >  
> > -    <function name="GetActiveAttribARB" alias="GetActiveAttrib">
> > +    <function name="GetActiveAttribARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="index" type="GLuint"/>
> >          <param name="bufSize" type="GLsizei"/>
> > @@ -8075,7 +8077,7 @@
> >          <param name="name" type="GLcharARB *"/>
> >      </function>
> >  
> > -    <function name="GetAttribLocationARB" alias="GetAttribLocation">
> > +    <function name="GetAttribLocationARB" offset="assign">
> >          <param name="program" type="GLhandleARB"/>
> >          <param name="name" type="const GLcharARB *"/>
> >          <return type="GLint"/>
> > diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
> > index 6035ec0..b29b440 100644
> > --- a/src/mesa/main/dlist.c
> > +++ b/src/mesa/main/dlist.c
> > @@ -8728,7 +8728,7 @@ _mesa_initialize_save_table(const struct gl_context
> > *ctx)
> >     SET_BlitFramebuffer(table, save_BlitFramebufferEXT);
> >  
> >     SET_UseProgram(table, save_UseProgram);
> > -//   SET_UseProgramObjectARB(table, save_UseProgramObjectARB);
> > +   SET_UseProgramObjectARB(table, save_UseProgramObjectARB);
> >     SET_Uniform1f(table, save_Uniform1fARB);
> >     SET_Uniform2f(table, save_Uniform2fARB);
> >     SET_Uniform3f(table, save_Uniform3fARB);
> > 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=c5R2aOhYAljfcIthqoSFrxh6qNtSQ9ZX6Blbh4oPFb8%3D%0A&s=c61e3067403abcdb0e5c239636217cc332558dba78dab45b998c3786da6c15ae
> 


More information about the mesa-dev mailing list