From 863b19ae213d2c8b147b436b197918d6e6af7a0e Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 22 May 2017 15:46:59 +1000 Subject: [PATCH] mesa: create _mesa_bind_buffer_range_xfb() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Iago Toral Quiroga Tested-by: Dieter Nützel --- src/mesa/main/transformfeedback.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h index c83f917a532..475f5f14944 100644 --- a/src/mesa/main/transformfeedback.h +++ b/src/mesa/main/transformfeedback.h @@ -150,6 +150,26 @@ _mesa_set_transform_feedback_binding(struct gl_context *ctx, bufObj->UsageHistory |= USAGE_TRANSFORM_FEEDBACK_BUFFER; } +static inline void +_mesa_bind_buffer_range_xfb(struct gl_context *ctx, + struct gl_transform_feedback_object *obj, + GLuint index, struct gl_buffer_object *bufObj, + GLintptr offset, GLsizeiptr size) +{ + /* Note: no need to FLUSH_VERTICES or flag NewTransformFeedback, because + * transform feedback buffers can't be changed while transform feedback is + * active. + */ + + /* The general binding point */ + _mesa_reference_buffer_object(ctx, + &ctx->TransformFeedback.CurrentBuffer, + bufObj); + + /* The per-attribute binding point */ + _mesa_set_transform_feedback_binding(ctx, obj, index, bufObj, offset, size); +} + /*** GL_ARB_direct_state_access ***/ extern void GLAPIENTRY -- 2.30.2