[Mesa-dev] [PATCH 01/13] mesa : move bindbuffer{base,range} from transformfeedback.c BindBuffer* functions are part of tfb extension. They are however used by others extensions such as uniform buffer object. This patch moves the BindBuffer* definition to to bufferobj.c where it acts as a dispatcher calling original tfb function ; BindBuffer* functions can be used by others extensions, even if FEATURE_EXT_transform_feedback is not defined.
Brian Paul
brianp at vmware.com
Mon Nov 14 08:19:54 PST 2011
On 11/12/2011 02:11 PM, vlj wrote:
> ---
> 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(-)
I think it would be cleaner if you simply relocated the functions from
transformfeedback.c to bufferobj.c
Then, I'd do some minor re-org in those functions to put the transform
feedback-specific checks in one place. For example, in
_mesa_BindBufferRange():
switch (target) {
case GL_TRANSFORM_FEEDBACK_BUFFER:
if (!ctx->Extensions.EXT_transform_feedback) {
_mesa_error(GL_INVALID_ENUM);
return;
}
if (ctx->TransformFeedback.CurrentObject->Active) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBindBufferRange(transform feedback active)");
return;
}
break;
/* XXX someday add:
case GL_UNIFORM_BUFFER:
do UBO error checks here.
break;
*/
default:
_mesa_error(GL_INVALID_ENUM);
return;
}
-Brian
More information about the mesa-dev
mailing list