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

Submitted by Brian Paul on March 9, 2014, 1:10 a.m.

Details

Message ID 1394327446-30329-4-git-send-email-brianp@vmware.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Brian Paul March 9, 2014, 1:10 a.m.
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://bugs.freedesktop.org/show_bug.cgi?id=66346
---
 src/mapi/glapi/gen/gl_API.xml |   28 +++++++++++++++-------------
 src/mesa/main/dlist.c         |    2 +-
 2 files changed, 16 insertions(+), 14 deletions(-)

Patch hide | download patch | download mbox

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

Comments

On 09/03/14 01:10, 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).
> 
Hi Brian,

Wondering if with the drop of the aliases one would need to update the
gl function tables in dispatch_sanity.cpp. AFAICS it currently checks
the non ARB functions but does not list the ARB ones (unlike other
aliased functions).

Are they any special (apart from the ifdef APPLE piece in the spec) ?

Thanks
-Emil
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66346
> ---
>  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);
>
On 03/09/2014 02:30 PM, Emil Velikov wrote:
> On 09/03/14 01:10, 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).
>>
> Hi Brian,
>
> Wondering if with the drop of the aliases one would need to update the
> gl function tables in dispatch_sanity.cpp. AFAICS it currently checks
> the non ARB functions but does not list the ARB ones (unlike other
> aliased functions).

I missed dispatch_sanity.cpp.  I've added the new ARB entrypoints but 
AFAICT, dispatch_sanity.cpp isn't even getting compiled.  The other 
'make check' tests seem to get built and run, but not that one.  I don't 
know whats up with that.


> Are they any special (apart from the ifdef APPLE piece in the spec) ?

Can you clarify that?

-Brian
On 03/10/2014 08:50 AM, Brian Paul wrote:
> On 03/09/2014 02:30 PM, Emil Velikov wrote:
>> On 09/03/14 01:10, 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).
>>>
>> Hi Brian,
>>
>> Wondering if with the drop of the aliases one would need to update the
>> gl function tables in dispatch_sanity.cpp. AFAICS it currently checks
>> the non ARB functions but does not list the ARB ones (unlike other
>> aliased functions).
>
> I missed dispatch_sanity.cpp.  I've added the new ARB entrypoints but
> AFAICT, dispatch_sanity.cpp isn't even getting compiled.  The other
> 'make check' tests seem to get built and run, but not that one.  I don't
> know whats up with that.

In any case, I'm posting a patch which updates dispatch_sanity.cpp

-Brian
On 10/03/14 14:50, Brian Paul wrote:
> On 03/09/2014 02:30 PM, Emil Velikov wrote:
>> On 09/03/14 01:10, 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).
>>>
>> Hi Brian,
>>
>> Wondering if with the drop of the aliases one would need to update the
>> gl function tables in dispatch_sanity.cpp. AFAICS it currently checks
>> the non ARB functions but does not list the ARB ones (unlike other
>> aliased functions).
>
> I missed dispatch_sanity.cpp.  I've added the new ARB entrypoints but
> AFAICT, dispatch_sanity.cpp isn't even getting compiled.  The other
> 'make check' tests seem to get built and run, but not that one.  I don't
> know whats up with that.
>
Quite possible, dispatch_sanity.cpp is only build if you have shared glapi.

With that said the make check nicely catches the problem, and 
unfortunately it still complains with your follow up patch :'(

>
>> Are they any special (apart from the ifdef APPLE piece in the spec) ?
>
> Can you clarify that?
>
Feel free to ignore that, I've checked through the spec and answered by 
half complete question.

-Emil
> -Brian
>
>
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://bugs.freedesktop.org/show_bug.cgi?id=66346
> ---
>  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);
>
On 03/10/2014 02:06 PM, Ian Romanick wrote:
> No way.  This will break existing applications on Linux.

This also breaks the libGL <-> DRI driver ABI.  These function entry
points have been aliased for... a decade?  I can't understand why we'd
break our own ABI because of something silly that Apple did.  This feels
like madness.

> 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://bugs.freedesktop.org/show_bug.cgi?id=66346
>> ---
>>  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);
>>
>
On 03/10/2014 03:09 PM, Ian Romanick wrote:
> On 03/10/2014 02:06 PM, Ian Romanick wrote:
>> No way.  This will break existing applications on Linux.

How so?  Before, for example, we had glCompileShaderARB(GLhandleARB) and 
glCompileShader(GLuint) libGL entrypoints and GLhandleARB=GLuint.  After 
these changes it's the same story.  No change.


> This also breaks the libGL <-> DRI driver ABI.  These function entry
> points have been aliased for... a decade?  I can't understand why we'd
> break our own ABI because of something silly that Apple did.  This feels
> like madness.

Hmm, I forgot about the libGL / DRI ABI.  Crap.  I guess it's the case 
of using a new libGL with an old DRI driver that would break.  Have we 
even been testing ABI interoperability lately?  I'm not sure how 
libglapi factors into this either.

-Brian



>
>> 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=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=NyRHLDQ9XXRXOlj0yttIEHC63yEthyZwjJtNe73pLek%3D%0A&s=e6ecc573de2698ab60e5e674c626b101c0b2b190a5902ace55ef5368b597daf7
>>> ---
>>>   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);
>>>
>>
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@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
>
----- Original Message -----
> On 03/10/2014 03:09 PM, Ian Romanick wrote:
> > On 03/10/2014 02:06 PM, Ian Romanick wrote:
> >> No way.  This will break existing applications on Linux.
> 
> How so?  Before, for example, we had glCompileShaderARB(GLhandleARB) and
> glCompileShader(GLuint) libGL entrypoints and GLhandleARB=GLuint.  After
> these changes it's the same story.  No change.
> 
> 
> > This also breaks the libGL <-> DRI driver ABI.  These function entry
> > points have been aliased for... a decade?  I can't understand why we'd
> > break our own ABI because of something silly that Apple did.  This feels
> > like madness.
> 
> Hmm, I forgot about the libGL / DRI ABI.  Crap.  I guess it's the case
> of using a new libGL with an old DRI driver that would break.  Have we
> even been testing ABI interoperability lately?  I'm not sure how
> libglapi factors into this either.

I'm not sure how the libGL<->DRI ABI is preserved with src/mapi/glapi/gen/gl_API.xml edits.  If it's a matter of not touching earlier entrypoints, then the solution should be to move the new entrypoints (e.g., ShaderSourceARB) to the bottom of the gl_API.xml with a high offset, so that it gets added to the end of the table.

Jose

> -Brian
> 
> 
> 
> >
> >> 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=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=NyRHLDQ9XXRXOlj0yttIEHC63yEthyZwjJtNe73pLek%3D%0A&s=e6ecc573de2698ab60e5e674c626b101c0b2b190a5902ace55ef5368b597daf7
> >>> ---
> >>>   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@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=Cmd1M5jmBG957ozIyhbvwekI6CfOgYQf6JlqnlGu5Hs%3D%0A&s=f76a98319d0aa5db5a6e88c404a70761d1270a25eeed9879ac48788ac41973fe
>
On 03/10/2014 02:39 PM, Brian Paul wrote:
> On 03/10/2014 03:09 PM, Ian Romanick wrote:
>> On 03/10/2014 02:06 PM, Ian Romanick wrote:
>>> No way.  This will break existing applications on Linux.
> 
> How so?  Before, for example, we had glCompileShaderARB(GLhandleARB) and
> glCompileShader(GLuint) libGL entrypoints and GLhandleARB=GLuint.  After
> these changes it's the same story.  No change.
> 
> 
>> This also breaks the libGL <-> DRI driver ABI.  These function entry
>> points have been aliased for... a decade?  I can't understand why we'd
>> break our own ABI because of something silly that Apple did.  This feels
>> like madness.
> 
> Hmm, I forgot about the libGL / DRI ABI.  Crap.  I guess it's the case
> of using a new libGL with an old DRI driver that would break.  Have we
> even been testing ABI interoperability lately?  I'm not sure how
> libglapi factors into this either.

Can we just hack around this for MacOS?  For that platform, we could
have stub ARB functions that call the GL 2.0 functions.  What glapi
modes are used on MacOS?

> -Brian
> 
>>> 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=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=NyRHLDQ9XXRXOlj0yttIEHC63yEthyZwjJtNe73pLek%3D%0A&s=e6ecc573de2698ab60e5e674c626b101c0b2b190a5902ace55ef5368b597daf7
>>>>
>>>> ---
>>>>   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);
>>>>
>>>
>
On 03/10/2014 02:52 PM, Jose Fonseca wrote:
> 
> 
> ----- Original Message -----
>> On 03/10/2014 03:09 PM, Ian Romanick wrote:
>>> On 03/10/2014 02:06 PM, Ian Romanick wrote:
>>>> No way.  This will break existing applications on Linux.
>>
>> How so?  Before, for example, we had glCompileShaderARB(GLhandleARB) and
>> glCompileShader(GLuint) libGL entrypoints and GLhandleARB=GLuint.  After
>> these changes it's the same story.  No change.
>>
>>
>>> This also breaks the libGL <-> DRI driver ABI.  These function entry
>>> points have been aliased for... a decade?  I can't understand why we'd
>>> break our own ABI because of something silly that Apple did.  This feels
>>> like madness.
>>
>> Hmm, I forgot about the libGL / DRI ABI.  Crap.  I guess it's the case
>> of using a new libGL with an old DRI driver that would break.  Have we
>> even been testing ABI interoperability lately?  I'm not sure how
>> libglapi factors into this either.
> 
> I'm not sure how the libGL<->DRI ABI is preserved with src/mapi/glapi/gen/gl_API.xml edits.  If it's a matter of not touching earlier entrypoints, then the solution should be to move the new entrypoints (e.g., ShaderSourceARB) to the bottom of the gl_API.xml with a high offset, so that it gets added to the end of the table.

The problem is that drivers are built expecting that glCompileShader and
glCompileShaerARB are the same function.  As a result, the driver only
asks libGL the offset of one of those functions in the dispatch table,
and it only sets one pointer in the dispatch table.  Then an application
tries to call the "other" function, gets a NULL dispatch pointer, and
explodes.

The inverse problem exists with an old libGL and a new built driver.  In
that case the driver will ask for two different offsets, but libGL will
only give it one.

> Jose
> 
>> -Brian
----- Original Message -----
> On 03/10/2014 02:52 PM, Jose Fonseca wrote:
> > 
> > 
> > ----- Original Message -----
> >> On 03/10/2014 03:09 PM, Ian Romanick wrote:
> >>> On 03/10/2014 02:06 PM, Ian Romanick wrote:
> >>>> No way.  This will break existing applications on Linux.
> >>
> >> How so?  Before, for example, we had glCompileShaderARB(GLhandleARB) and
> >> glCompileShader(GLuint) libGL entrypoints and GLhandleARB=GLuint.  After
> >> these changes it's the same story.  No change.
> >>
> >>
> >>> This also breaks the libGL <-> DRI driver ABI.  These function entry
> >>> points have been aliased for... a decade?  I can't understand why we'd
> >>> break our own ABI because of something silly that Apple did.  This feels
> >>> like madness.
> >>
> >> Hmm, I forgot about the libGL / DRI ABI.  Crap.  I guess it's the case
> >> of using a new libGL with an old DRI driver that would break.  Have we
> >> even been testing ABI interoperability lately?  I'm not sure how
> >> libglapi factors into this either.
> > 
> > I'm not sure how the libGL<->DRI ABI is preserved with
> > src/mapi/glapi/gen/gl_API.xml edits.  If it's a matter of not touching
> > earlier entrypoints, then the solution should be to move the new
> > entrypoints (e.g., ShaderSourceARB) to the bottom of the gl_API.xml with a
> > high offset, so that it gets added to the end of the table.
> 
> The problem is that drivers are built expecting that glCompileShader and
> glCompileShaerARB are the same function.  As a result, the driver only
> asks libGL the offset of one of those functions in the dispatch table,
> and it only sets one pointer in the dispatch table.  Then an application
> tries to call the "other" function, gets a NULL dispatch pointer, and
> explodes.
>
> The inverse problem exists with an old libGL and a new built driver.  In
> that case the driver will ask for two different offsets, but libGL will
> only give it one.

I see.

BTW, this means that aliasing in the dispatch API was a design mistake, as it is irreversible in face of this bi-directional backward compatibility requirement -- once two functions are aliased, they need to be aliased for eternity.  Even if turns out there was a bad interpretation of the spec, or a new extension comes along and adds conflicting semantics to one of the aliased functions.  It would had been better for entrypoint to have a separate entry in the dispatch table, even if two entries end up pointing to the same function. And we should consider correcting that if/when we need to break compatability for some other reason.

And this happened precisely with ARB_framebuffer_object and EXT_framebuffer_object, change 9f07ca11c1797ac12de1e1c6aef13cf58824b5f5.

Jose