[Mesa-dev] [PATCH 4/4] mesa: stop aliasing ARB and core shader API functions
Ian Romanick
idr at freedesktop.org
Mon Mar 10 14:57:54 PDT 2014
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);
>>>>
>>>
>
More information about the mesa-dev
mailing list