From e2370bcc1ddde84d5d1ff676c29638645cb21731 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 13 Aug 2012 10:23:22 -0700 Subject: [PATCH] mesa/es: Pass context to _mesa_init_bufferobj_dispatch With this change _mesa_init_bufferobj_dispatch won't set function pointers that don't exist in OpenGL ES. v2: Use _mesa_is_desktop_gl and _mesa_is_gles3 as suggested by Ken. Signed-off-by: Ian Romanick Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- src/mesa/main/api_exec.c | 2 +- src/mesa/main/bufferobj.c | 9 ++++++--- src/mesa/main/bufferobj.h | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index bdef1098373..bb5d17131ca 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -653,7 +653,7 @@ _mesa_create_exec_table(struct gl_context *ctx) #endif /* ARB 28. GL_ARB_vertex_buffer_object */ - _mesa_init_bufferobj_dispatch(exec); + _mesa_init_bufferobj_dispatch(ctx, exec); /* ARB 29. GL_ARB_occlusion_query */ _mesa_init_queryobj_dispatch(exec); diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 22d7927bbcb..c50f7acd705 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2201,7 +2201,7 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) } void -_mesa_init_bufferobj_dispatch(struct _glapi_table *disp) +_mesa_init_bufferobj_dispatch(struct gl_context *ctx, struct _glapi_table *disp) { SET_BindBufferARB(disp, _mesa_BindBufferARB); SET_BufferDataARB(disp, _mesa_BufferDataARB); @@ -2214,6 +2214,9 @@ _mesa_init_bufferobj_dispatch(struct _glapi_table *disp) SET_IsBufferARB(disp, _mesa_IsBufferARB); SET_MapBufferARB(disp, _mesa_MapBufferARB); SET_UnmapBufferARB(disp, _mesa_UnmapBufferARB); - SET_BindBufferRangeEXT(disp, _mesa_BindBufferRange); - SET_BindBufferBaseEXT(disp, _mesa_BindBufferBase); + + if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { + SET_BindBufferRangeEXT(disp, _mesa_BindBufferRange); + SET_BindBufferBaseEXT(disp, _mesa_BindBufferBase); + } } diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index e1d0f7a97e8..15fdb9c305b 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -167,6 +167,7 @@ _mesa_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); extern void -_mesa_init_bufferobj_dispatch(struct _glapi_table *disp); +_mesa_init_bufferobj_dispatch(struct gl_context *ctx, + struct _glapi_table *disp); #endif -- 2.30.2