[Mesa-dev] [PATCH] mesa: Remove GL_APPLE_vertex_array_object stubs

Timothy Arceri tarceri at itsqueeze.com
Mon May 22 21:28:15 UTC 2017


On 23/05/17 05:26, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Mark the functions 'exec="skip"' in the XML instead.  libGL will still
> have the functions, but the driver won't try to use them.  I verified
> that this commit works with piglit's 'object-namespace-pollution glClear
> vertex-array' on x64 with a driver built from mesa-12.0.3 tag.
> 
> In fairness, this test also works with a libGL built from 7927d03.  I
> believe it continues to work because on non-Windows platforms we
> generate some extra, dummy dispatch functions that can be used when a
> driver requests a function unknown to libGL.  This was done to provide
> some "forward" compatibility with drivers that need more functions.
> This doesn't work on Windows because the Windows calling convention is
> for the callee to clean up the stack.  That's the theory anyway.

Thanks. I also couldn't get the old drivers to fail which is why I just 
pushed the patch with the stubs. If this will work it looks good to me.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>


> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>   src/mapi/glapi/gen/APPLE_vertex_array_object.xml |  8 ++++----
>   src/mesa/main/arrayobj.c                         | 16 ----------------
>   src/mesa/main/arrayobj.h                         |  4 ----
>   src/mesa/main/tests/dispatch_sanity.cpp          |  2 --
>   4 files changed, 4 insertions(+), 26 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/APPLE_vertex_array_object.xml b/src/mapi/glapi/gen/APPLE_vertex_array_object.xml
> index 7312f9b..daf6990 100644
> --- a/src/mapi/glapi/gen/APPLE_vertex_array_object.xml
> +++ b/src/mapi/glapi/gen/APPLE_vertex_array_object.xml
> @@ -5,21 +5,21 @@
>   <category name="GL_APPLE_vertex_array_object" number="273">
>       <enum name="VERTEX_ARRAY_BINDING_APPLE"               value="0x85B5"/>
>   
> -    <function name="BindVertexArrayAPPLE" deprecated="3.1">
> +    <function name="BindVertexArrayAPPLE" deprecated="3.1" exec="skip">
>           <param name="array" type="GLuint"/>
>       </function>
>   
> -    <function name="DeleteVertexArraysAPPLE" alias="DeleteVertexArrays">
> +    <function name="DeleteVertexArraysAPPLE" exec="skip">
>           <param name="n" type="GLsizei"/>
>   	<param name="arrays" type="const GLuint *"/>
>       </function>
>   
> -    <function name="GenVertexArraysAPPLE" deprecated="3.1">
> +    <function name="GenVertexArraysAPPLE" deprecated="3.1" exec="skip">
>           <param name="n" type="GLsizei"/>
>   	<param name="arrays" type="GLuint *" count="n" output="true"/>
>       </function>
>   
> -    <function name="IsVertexArrayAPPLE" alias="IsVertexArray">
> +    <function name="IsVertexArrayAPPLE" exec="skip">
>           <param name="array" type="GLuint"/>
>   	<return type="GLboolean"/>
>       </function>
> diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
> index b986229..82c00fb 100644
> --- a/src/mesa/main/arrayobj.c
> +++ b/src/mesa/main/arrayobj.c
> @@ -473,14 +473,6 @@ _mesa_BindVertexArray( GLuint id )
>   }
>   
>   
> -void GLAPIENTRY
> -_mesa_BindVertexArrayAPPLE(GLuint id)
> -{
> -   GET_CURRENT_CONTEXT(ctx);
> -   _mesa_problem(ctx, "APPLE_vertex_array_object is not supported!");
> -}
> -
> -
>   /**
>    * Delete a set of array objects.
>    *
> @@ -587,14 +579,6 @@ _mesa_GenVertexArrays(GLsizei n, GLuint *arrays)
>   }
>   
>   
> -void GLAPIENTRY
> -_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays)
> -{
> -   GET_CURRENT_CONTEXT(ctx);
> -   _mesa_problem(ctx, "APPLE_vertex_array_object is not supported!");
> -}
> -
> -
>   /**
>    * ARB_direct_state_access
>    * Generates ID's and creates the array objects.
> diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h
> index 097027b..1794968 100644
> --- a/src/mesa/main/arrayobj.h
> +++ b/src/mesa/main/arrayobj.h
> @@ -96,14 +96,10 @@ _mesa_all_buffers_are_unmapped(const struct gl_vertex_array_object *vao);
>   
>   void GLAPIENTRY _mesa_BindVertexArray( GLuint id );
>   
> -void GLAPIENTRY _mesa_BindVertexArrayAPPLE(GLuint id);
> -
>   void GLAPIENTRY _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids);
>   
>   void GLAPIENTRY _mesa_GenVertexArrays(GLsizei n, GLuint *arrays);
>   
> -void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer);
> -
>   void GLAPIENTRY _mesa_CreateVertexArrays(GLsizei n, GLuint *arrays);
>   
>   GLboolean GLAPIENTRY _mesa_IsVertexArray( GLuint id );
> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
> index 12a9ee7..b33043e 100644
> --- a/src/mesa/main/tests/dispatch_sanity.cpp
> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
> @@ -969,8 +969,6 @@ const struct function common_desktop_functions_possible[] = {
>   };
>   
>   const struct function gl_compatibility_functions_possible[] = {
> -   { "glBindVertexArrayAPPLE", 10, -1 },
> -   { "glGenVertexArraysAPPLE", 10, -1 },
>      { "glBindRenderbufferEXT", 10, -1 },
>      { "glBindFramebufferEXT", 10, -1 },
>      { "glNewList", 10, _gloffset_NewList },
> 


More information about the mesa-dev mailing list