[Mesa-dev,13/19] mesa: Add _mesa_set_transform_feedback_binding()

Submitted by Fredrik Höglund on April 21, 2014, 9:57 p.m.

Details

Message ID 1398117477-10313-14-git-send-email-fredrik@kde.org
State New
Headers show

Not browsing as part of any series.

Commit Message

Fredrik Höglund April 21, 2014, 9:57 p.m.
---
 src/mesa/main/transformfeedback.c | 10 +---------
 src/mesa/main/transformfeedback.h | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index abeb25e..a737463 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -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);
 }
 
 
diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h
index 7aecd66..87f4080 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -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 */