--- src/mesa/main/api_exec.c | 2 + src/mesa/main/bufferobj.c | 48 +++++++++++++++++++++++++++++++++++++ src/mesa/main/bufferobj.h | 12 +++++++++ src/mesa/main/transformfeedback.c | 22 ++++------------ src/mesa/main/transformfeedback.h | 8 +++--- 5 files changed, 72 insertions(+), 20 deletions(-)
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 93214dd..0bbfa8b 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -590,6 +590,8 @@ _mesa_create_exec_table(void) SET_IsBufferARB(exec, _mesa_IsBufferARB); SET_MapBufferARB(exec, _mesa_MapBufferARB); SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); + SET_BindBufferRangeEXT(exec, _mesa_BindBufferRange); + SET_BindBufferBaseEXT(exec, _mesa_BindBufferBase); #endif /* ARB 29. GL_ARB_occlusion_query */ diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 431eafd..142ca2b 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -703,6 +703,54 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer) bind_buffer_object(ctx, target, buffer); } +extern void +BindBufferBase_TFB(GLenum target, GLuint index, GLuint buffer); + +/** + * Several extensions declare a BindBufferBase API function, + * this one dispatchs call according to target + */ +void GLAPIENTRY +_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) +{ + GET_CURRENT_CONTEXT(ctx); + switch (target) { +#if FEATURE_EXT_transform_feedback + case GL_TRANSFORM_FEEDBACK_BUFFER: + BindBufferBase_TFB(target,index,buffer); + break; +#endif + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferBase(target)"); + break; + } + return; +} + +extern void +BindBufferRange_TFB(GLenum target, GLuint index, + GLuint buffer, GLintptr offset, GLsizeiptr size); + +/** + * Several extensions declare a BindBufferRange API function, + * this one dispatchs call according to target + */ +void GLAPIENTRY +_mesa_BindBufferRange(GLenum target, GLuint index, + GLuint buffer, GLintptr offset, GLsizeiptr size) +{ + GET_CURRENT_CONTEXT(ctx); + switch (target) { +#if FEATURE_EXT_transform_feedback + case GL_TRANSFORM_FEEDBACK_BUFFER: + BindBufferRange_TFB(target,index,buffer,offset,size); + break; +#endif + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferRange(target)"); + } + return; +} /** * Delete a set of buffer objects. diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index b4e70f2..1b3c70c 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -154,6 +154,18 @@ _mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); extern void GLAPIENTRY _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params); + + +/** + * These functions dont fit anywhere else, declare them here as they are related to buffers + */ +extern void GLAPIENTRY +_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer); + +extern void GLAPIENTRY +_mesa_BindBufferRange(GLenum target, GLuint index, + GLuint buffer, GLintptr offset, GLsizeiptr size); + #endif #endif diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 47efad1..d88c021 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -329,8 +329,6 @@ _mesa_init_transform_feedback_dispatch(struct _glapi_table *disp) { SET_BeginTransformFeedbackEXT(disp, _mesa_BeginTransformFeedback); SET_EndTransformFeedbackEXT(disp, _mesa_EndTransformFeedback); - SET_BindBufferRangeEXT(disp, _mesa_BindBufferRange); - SET_BindBufferBaseEXT(disp, _mesa_BindBufferBase); SET_BindBufferOffsetEXT(disp, _mesa_BindBufferOffsetEXT); SET_TransformFeedbackVaryingsEXT(disp, _mesa_TransformFeedbackVaryings); SET_GetTransformFeedbackVaryingEXT(disp, _mesa_GetTransformFeedbackVarying); @@ -428,19 +426,14 @@ bind_buffer_range(struct gl_context *ctx, GLuint index, * Specify a buffer object to receive vertex shader results. Plus, * specify the starting offset to place the results, and max size. */ -void GLAPIENTRY -_mesa_BindBufferRange(GLenum target, GLuint index, +void +BindBufferRange_TFB(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) { struct gl_transform_feedback_object *obj; struct gl_buffer_object *bufObj; GET_CURRENT_CONTEXT(ctx); - if (target != GL_TRANSFORM_FEEDBACK_BUFFER) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferRange(target)"); - return; - } - obj = ctx->TransformFeedback.CurrentObject; if (obj->Active) { @@ -484,24 +477,21 @@ _mesa_BindBufferRange(GLenum target, GLuint index, bind_buffer_range(ctx, index, bufObj, offset, size); } +extern +void GLAPIENTRY +_mesa_BindBufferBase_UBO(GLenum target, GLuint index, GLuint buffer); /** * Specify a buffer object to receive vertex shader results. * As above, but start at offset = 0. */ -void GLAPIENTRY -_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) +void BindBufferBase_TFB(GLenum target, GLuint index, GLuint buffer) { struct gl_transform_feedback_object *obj; struct gl_buffer_object *bufObj; GLsizeiptr size; GET_CURRENT_CONTEXT(ctx); - if (target != GL_TRANSFORM_FEEDBACK_BUFFER) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferBase(target)"); - return; - } - obj = ctx->TransformFeedback.CurrentObject; if (obj->Active) { diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h index 9447eff..e1f396d 100644 --- a/src/mesa/main/transformfeedback.h +++ b/src/mesa/main/transformfeedback.h @@ -63,12 +63,12 @@ _mesa_BeginTransformFeedback(GLenum mode); extern void GLAPIENTRY _mesa_EndTransformFeedback(void); -extern void GLAPIENTRY -_mesa_BindBufferRange(GLenum target, GLuint index, +extern void +BindBufferRange_TFB(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -extern void GLAPIENTRY -_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer); +extern void +BindBufferBase_TFB(GLenum target, GLuint index, GLuint buffer); extern void GLAPIENTRY _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, -- 1.7.7 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev