[Piglit] [PATCH 07/10] sso: Add a utility function to configure a transform feedback object

Ian Romanick idr at freedesktop.org
Sun Apr 27 14:12:10 PDT 2014


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/spec/arb_separate_shader_objects/sso-common.c | 21 +++++++++++++++++++++
 tests/spec/arb_separate_shader_objects/sso-common.h |  2 ++
 2 files changed, 23 insertions(+)

diff --git a/tests/spec/arb_separate_shader_objects/sso-common.c b/tests/spec/arb_separate_shader_objects/sso-common.c
index fc43ce9..c73c741 100644
--- a/tests/spec/arb_separate_shader_objects/sso-common.c
+++ b/tests/spec/arb_separate_shader_objects/sso-common.c
@@ -54,3 +54,24 @@ pick_a_glsl_version(void)
 
 	return glsl_version;
 }
+
+/**
+ * Create a transform feedback object and some storage for the data
+ *
+ * \note
+ * The XFB object will be bound on exit.  The buffer object for the XFB data
+ * will be bound to the XFB object and the \c GL_TRANSFORM_FEEDBACK_BUFFER
+ * binding on exit.
+ */
+void
+configure_transform_feedback_object(GLuint *xfb, GLuint *buf)
+{
+	glGenBuffers(1, buf);
+	glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, *buf);
+	glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 1024, NULL, GL_STREAM_READ);
+
+	glGenTransformFeedbacks(1, xfb);
+
+	glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, *xfb);
+	glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, *buf);
+}
diff --git a/tests/spec/arb_separate_shader_objects/sso-common.h b/tests/spec/arb_separate_shader_objects/sso-common.h
index 23e962c..627df4c 100644
--- a/tests/spec/arb_separate_shader_objects/sso-common.h
+++ b/tests/spec/arb_separate_shader_objects/sso-common.h
@@ -26,4 +26,6 @@
 
 unsigned pick_a_glsl_version(void);
 
+void configure_transform_feedback_object(GLuint *xfb, GLuint *buf);
+
 #endif /* SSO_COMMON_H */
-- 
1.8.1.4



More information about the Piglit mailing list