From 4eb0411ed72cbe13f320b7487c2a333e513becc9 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 19 May 2017 12:31:47 +1000 Subject: [PATCH] mesa: add APPLE_vertex_array_object stubs APPLE_vertex_array_object support was removed in 7927d0378fc7. However it turns out we can't remove the functions because this can cause issues when libglapi is used together with DRI drivers built prior to said commit Fixes: 7927d0378fc ("mesa: drop APPLE_vertex_array_object support") Reviewed-by: Emil Velikov --- .../glapi/gen/APPLE_vertex_array_object.xml | 27 +++++++++++++++++++ src/mapi/glapi/gen/Makefile.am | 1 + src/mapi/glapi/gen/gl_API.xml | 2 +- src/mapi/glapi/tests/check_table.cpp | 2 ++ src/mesa/main/arrayobj.c | 16 +++++++++++ src/mesa/main/arrayobj.h | 4 +++ src/mesa/main/tests/dispatch_sanity.cpp | 2 ++ 7 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/mapi/glapi/gen/APPLE_vertex_array_object.xml diff --git a/src/mapi/glapi/gen/APPLE_vertex_array_object.xml b/src/mapi/glapi/gen/APPLE_vertex_array_object.xml new file mode 100644 index 00000000000..7312f9b35f0 --- /dev/null +++ b/src/mapi/glapi/gen/APPLE_vertex_array_object.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am index ecd1c71175e..33139bdf08f 100644 --- a/src/mapi/glapi/gen/Makefile.am +++ b/src/mapi/glapi/gen/Makefile.am @@ -189,6 +189,7 @@ API_XML = \ AMD_performance_monitor.xml \ ARB_vertex_type_2_10_10_10_rev.xml \ APPLE_object_purgeable.xml \ + APPLE_vertex_array_object.xml \ EXT_draw_buffers2.xml \ EXT_framebuffer_object.xml \ EXT_gpu_shader4.xml \ diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 762fb5a6769..630d6b8a5bb 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -12531,7 +12531,7 @@ - + diff --git a/src/mapi/glapi/tests/check_table.cpp b/src/mapi/glapi/tests/check_table.cpp index a1041bcea22..09bf4f3585c 100644 --- a/src/mapi/glapi/tests/check_table.cpp +++ b/src/mapi/glapi/tests/check_table.cpp @@ -1404,7 +1404,9 @@ const struct name_offset known_dispatch[] = { { "glPointParameteri", _O(PointParameteri) }, { "glPointParameteriv", _O(PointParameteriv) }, { "glActiveStencilFaceEXT", _O(ActiveStencilFaceEXT) }, + { "glBindVertexArrayAPPLE", _O(BindVertexArrayAPPLE) }, { "glDeleteVertexArrays", _O(DeleteVertexArrays) }, + { "glGenVertexArraysAPPLE", _O(GenVertexArraysAPPLE) }, { "glIsVertexArray", _O(IsVertexArray) }, { "glGetProgramNamedParameterdvNV", _O(GetProgramNamedParameterdvNV) }, { "glGetProgramNamedParameterfvNV", _O(GetProgramNamedParameterfvNV) }, diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 82c00fbe826..b98622932c5 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -473,6 +473,14 @@ _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. * @@ -579,6 +587,14 @@ _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 17949685775..097027ba97c 100644 --- a/src/mesa/main/arrayobj.h +++ b/src/mesa/main/arrayobj.h @@ -96,10 +96,14 @@ _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 b33043ed28b..12a9ee7bae1 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -969,6 +969,8 @@ 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 }, -- 2.30.2