[Piglit] [PATCH 1/2] util: Add piglit_set_default_fbo to restore system FBO

Ian Romanick idr at freedesktop.org
Thu Jan 19 08:42:44 PST 2012


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

When running framework tests with the -fbo option, this restores the
default non-window FBO instead.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/util/piglit-framework.c |   12 ++++++++++++
 tests/util/piglit-framework.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/tests/util/piglit-framework.c b/tests/util/piglit-framework.c
index 262d1e8..0517273 100644
--- a/tests/util/piglit-framework.c
+++ b/tests/util/piglit-framework.c
@@ -112,6 +112,18 @@ piglit_framework_glut_init(int argc, char *argv[])
 #endif
 }
 
+/**
+ * Use either the window system FBO or the default off-screen render target
+ */
+void
+piglit_set_default_fbo(unsigned int target)
+{
+#ifdef USE_GLX
+	glBindFramebuffer((GLenum) target,
+			  (piglit_use_fbo) ? piglit_fbo : 0);
+#endif
+}
+
 #ifdef USE_GLX
 static void
 piglit_framework_fbo_glx_init()
diff --git a/tests/util/piglit-framework.h b/tests/util/piglit-framework.h
index 41565be..73755d2 100644
--- a/tests/util/piglit-framework.h
+++ b/tests/util/piglit-framework.h
@@ -32,3 +32,4 @@ extern int piglit_height;
 extern enum piglit_result piglit_display(void);
 extern void piglit_init(int argc, char **argv);
 extern void piglit_present_results();
+extern void piglit_set_default_fbo(unsigned int target);
-- 
1.7.6.4



More information about the Piglit mailing list