mesa: Add _mesa_set_transform_feedback_binding()
authorFredrik Höglund <fredrik@kde.org>
Fri, 15 Nov 2013 18:53:29 +0000 (19:53 +0100)
committerFredrik Höglund <fredrik@kde.org>
Fri, 2 May 2014 01:00:41 +0000 (03:00 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/transformfeedback.c
src/mesa/main/transformfeedback.h

index abeb25e87340e3e109a4354505e9e3ddb3b6769b..a73746335fe50d402a8c3edc6bb925a0aabddb33 100644 (file)
@@ -32,7 +32,6 @@
 
 
 #include "buffers.h"
-#include "bufferobj.h"
 #include "context.h"
 #include "hash.h"
 #include "macros.h"
@@ -533,14 +532,7 @@ bind_buffer_range(struct gl_context *ctx, GLuint index,
                                  bufObj);
 
    /* The per-attribute binding point */
-   _mesa_reference_buffer_object(ctx,
-                                 &obj->Buffers[index],
-                                 bufObj);
-
-   obj->BufferNames[index] = bufObj->Name;
-
-   obj->Offset[index] = offset;
-   obj->RequestedSize[index] = size;
+   _mesa_set_transform_feedback_binding(ctx, obj, index, bufObj, offset, size);
 }
 
 
index 7aecd66a75a531fbd6149c7c7359c2977b1bb183..87f4080e022d2ab1c17667e748c8af75e7a979b8 100644 (file)
@@ -27,6 +27,7 @@
 #define TRANSFORM_FEEDBACK_H
 
 #include <stdbool.h>
+#include "bufferobj.h"
 #include "compiler.h"
 #include "glheader.h"
 #include "mtypes.h"
@@ -127,4 +128,17 @@ extern bool
 _mesa_transform_feedback_is_using_program(struct gl_context *ctx,
                                           struct gl_shader_program *shProg);
 
+static inline void
+_mesa_set_transform_feedback_binding(struct gl_context *ctx,
+                                     struct gl_transform_feedback_object *tfObj, GLuint index,
+                                     struct gl_buffer_object *bufObj,
+                                     GLintptr offset, GLsizeiptr size)
+{
+   _mesa_reference_buffer_object(ctx, &tfObj->Buffers[index], bufObj);
+
+   tfObj->BufferNames[index]   = bufObj->Name;
+   tfObj->Offset[index]        = offset;
+   tfObj->RequestedSize[index] = size;
+}
+
 #endif /* TRANSFORM_FEEDBACK_H */