summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-22 15:46:59 +1000
committerTimothy Arceri <[email protected]>2017-05-30 08:03:32 +1000
commit863b19ae213d2c8b147b436b197918d6e6af7a0e (patch)
treeabb7c0fc42bf385249e19e17470f730f6c913497 /src/mesa
parent21d9376e710912810f0f5d87da12e439d340ec33 (diff)
mesa: create _mesa_bind_buffer_range_xfb() helper
Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/transformfeedback.h20
1 files changed, 20 insertions, 0 deletions
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