diff options
author | Ian Romanick <[email protected]> | 2012-08-13 10:23:22 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-14 14:39:33 -0700 |
commit | e2370bcc1ddde84d5d1ff676c29638645cb21731 (patch) | |
tree | 61e447e453232bdaf9d3c77951b11d86a7a49f93 /src/mesa/main | |
parent | 342be8aa88819446220bba680d8e0b628078156f (diff) |
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 <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/api_exec.c | 2 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.c | 9 | ||||
-rw-r--r-- | 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 |