[Piglit] [PATCH 13/16] all.tests: make MSAA FBO tests concurrent

Marek Olšák maraeo at gmail.com
Sun Nov 24 15:52:32 PST 2013


From: Marek Olšák <marek.olsak at amd.com>

---
 tests/all.tests                                    | 109 ++++++++++-----------
 .../ext_framebuffer_multisample/alpha-blending.c   |   4 +-
 .../alpha-to-coverage-dual-src-blend.cpp           |   2 +-
 .../alpha-to-coverage-no-draw-buffer-zero.cpp      |   2 +-
 .../alpha-to-one-dual-src-blend.cpp                |   4 +-
 .../alpha-to-one-msaa-disabled.cpp                 |   4 +-
 .../alpha-to-one-single-sample-buffer.cpp          |   4 +-
 tests/spec/ext_framebuffer_multisample/bitmap.cpp  |   8 +-
 tests/spec/ext_framebuffer_multisample/clear.cpp   |   4 +-
 .../clip-and-scissor-blit.cpp                      |   6 +-
 .../draw-buffers-alpha-to-coverage.cpp             |   2 +-
 .../draw-buffers-alpha-to-one.cpp                  |   4 +-
 .../int-draw-buffers-alpha-to-coverage.cpp         |   4 +-
 .../int-draw-buffers-alpha-to-one.cpp              |   4 +-
 .../ext_framebuffer_multisample/interpolation.cpp  |   6 +-
 .../ext_framebuffer_multisample/line-smooth.cpp    |   6 +-
 .../multisample-blit.cpp                           |   6 +-
 .../spec/ext_framebuffer_multisample/no-color.cpp  |   6 +-
 .../ext_framebuffer_multisample/point-smooth.cpp   |   6 +-
 .../ext_framebuffer_multisample/polygon-smooth.cpp |   6 +-
 .../polygon-stipple.cpp                            |   8 +-
 .../sample-alpha-to-coverage.cpp                   |   2 +-
 .../sample-alpha-to-one.cpp                        |   4 +-
 .../sample-coverage.cpp                            |   8 +-
 .../ext_framebuffer_multisample/unaligned-blit.cpp |   6 +-
 .../spec/ext_framebuffer_multisample/upsample.cpp  |  10 +-
 tests/util/piglit-fbo.cpp                          |   2 +-
 27 files changed, 118 insertions(+), 119 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index 8cee978..144755a 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1796,8 +1796,8 @@ ext_framebuffer_multisample['negative-readpixels'] = concurrent_test('ext_frameb
 ext_framebuffer_multisample['renderbufferstorage-samples'] = concurrent_test('ext_framebuffer_multisample-renderbufferstorage-samples')
 ext_framebuffer_multisample['renderbuffer-samples'] = concurrent_test('ext_framebuffer_multisample-renderbuffer-samples')
 ext_framebuffer_multisample['samples'] = concurrent_test('ext_framebuffer_multisample-samples')
-ext_framebuffer_multisample['alpha-blending'] = PlainExecTest('ext_framebuffer_multisample-alpha-blending -auto')
-ext_framebuffer_multisample['alpha-blending slow_cc'] = PlainExecTest('ext_framebuffer_multisample-alpha-blending slow_cc -auto')
+ext_framebuffer_multisample['alpha-blending'] = concurrent_test('ext_framebuffer_multisample-alpha-blending')
+ext_framebuffer_multisample['alpha-blending slow_cc'] = concurrent_test('ext_framebuffer_multisample-alpha-blending slow_cc')
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     if num_samples % 2 != 0:
@@ -1832,9 +1832,9 @@ for num_samples in MSAA_SAMPLE_COUNTS:
         for options in power_set(sensible_options):
             test_name = ' '.join(['upsample', str(num_samples), buffer_type]
                                  + options)
-            executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+            executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-            ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+            ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for buffer_type in ('color', 'depth', 'stencil'):
@@ -1844,144 +1844,144 @@ for num_samples in MSAA_SAMPLE_COUNTS:
         for options in power_set(sensible_options):
             test_name = ' ' .join(['multisample-blit', str(num_samples),
                                    buffer_type] + options)
-            executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+            executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-            ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+            ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for buffer_type in ('color', 'depth', 'stencil'):
         for blit_type in ('msaa', 'upsample', 'downsample'):
             test_name = ' '.join(['unaligned-blit', str(num_samples), buffer_type, blit_type])
-            executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+            executable = 'ext_framebuffer_multisample-{0}'.format(
                     test_name)
-            ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+            ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' ' .join(['line-smooth', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' ' .join(['point-smooth', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' ' .join(['polygon-smooth', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['formats', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for test_mode in ('inverted', 'non-inverted'):
         test_name = ' '.join(['sample-coverage', str(num_samples), test_mode])
-        executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+        executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-        ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+        ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for buffer_type in ('color', 'depth'):
         test_name = ' '.join(['sample-alpha-to-coverage', str(num_samples), buffer_type])
-        executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+        executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-        ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+        ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['sample-alpha-to-one', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['draw-buffers-alpha-to-one', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['draw-buffers-alpha-to-coverage', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['alpha-to-coverage-no-draw-buffer-zero', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['alpha-to-coverage-dual-src-blend', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['alpha-to-one-dual-src-blend', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['int-draw-buffers-alpha-to-one', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['int-draw-buffers-alpha-to-coverage', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['alpha-to-one-msaa-disabled', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['alpha-to-one-single-sample-buffer', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['bitmap', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['polygon-stipple', str(num_samples)])
-    executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+    executable = 'ext_framebuffer_multisample-{0}'.format(
             test_name)
-    ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+    ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for blit_type in ('msaa', 'upsample', 'downsample', 'normal'):
         test_name = ' '.join(['clip-and-scissor-blit',
                               str(num_samples), blit_type])
-        executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+        executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-        ext_framebuffer_multisample[test_name] = PlainExecTest(
+        ext_framebuffer_multisample[test_name] = concurrent_test(
                 executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for flip_direction in ('x', 'y'):
         test_name = ' '.join(['blit-flipped', str(num_samples),
                               flip_direction])
-        executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+        executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-        ext_framebuffer_multisample[test_name] = PlainExecTest(
+        ext_framebuffer_multisample[test_name] = concurrent_test(
                 executable)
 
 # Note: the interpolation tests also check for sensible behaviour with
@@ -1994,17 +1994,16 @@ for num_samples in (0,) + MSAA_SAMPLE_COUNTS:
                       'centroid-deriv-disabled'):
         test_name = ' '.join(['interpolation', str(num_samples),
                               test_type])
-        executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+        executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-        ext_framebuffer_multisample[test_name] = PlainExecTest(
-                executable)
+        ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for buffer_type in ('color', 'depth', 'stencil'):
         test_name = ' '.join(['clear', str(num_samples), buffer_type])
-        executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+        executable = 'ext_framebuffer_multisample-{0}'.format(
                 test_name)
-        ext_framebuffer_multisample[test_name] = PlainExecTest(
+        ext_framebuffer_multisample[test_name] = concurrent_test(
                 executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
@@ -2012,9 +2011,9 @@ for num_samples in MSAA_SAMPLE_COUNTS:
         for buffer_config in ('combined', 'separate', 'single'):
             test_name = ' '.join(['no-color', str(num_samples),
                                   test_type, buffer_config])
-            executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+            executable = 'ext_framebuffer_multisample-{0}'.format(
                     test_name)
-            ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+            ext_framebuffer_multisample[test_name] = concurrent_test(executable)
 
 ext_framebuffer_object = Group()
 spec['EXT_framebuffer_object'] = ext_framebuffer_object
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-blending.c b/tests/spec/ext_framebuffer_multisample/alpha-blending.c
index e43091e..f7c6c0f 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-blending.c
+++ b/tests/spec/ext_framebuffer_multisample/alpha-blending.c
@@ -110,9 +110,9 @@ piglit_display()
 	glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 
 	glBindFramebufferEXT(GL_READ_FRAMEBUFFER, framebuffer);
-	glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, WIDTH, HEIGHT, 0, 0, WIDTH, HEIGHT, GL_COLOR_BUFFER_BIT, GL_NEAREST);
-	glBindFramebuffer(GL_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo);
 
 	pass = piglit_probe_rect_rgba(x0, y0, x1 - x0, y1 - y0, expected_color)
 		&& pass;
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
index 03e4444..7770a6b 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
@@ -100,7 +100,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero.cpp
index 8bdb72a..ed9b6f0 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-no-draw-buffer-zero.cpp
@@ -113,7 +113,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
index 9bfe748..9734333 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
@@ -100,7 +100,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -120,7 +120,7 @@ piglit_display()
 	glDisable(GL_BLEND);
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp
index f5e5611..b7b4e9e 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-msaa-disabled.cpp
@@ -103,7 +103,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -123,7 +123,7 @@ piglit_display()
 
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp
index 41ca37a..262f41a 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp
@@ -88,7 +88,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -102,7 +102,7 @@ piglit_display()
 
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/bitmap.cpp b/tests/spec/ext_framebuffer_multisample/bitmap.cpp
index f5c9451..ef9309d 100644
--- a/tests/spec/ext_framebuffer_multisample/bitmap.cpp
+++ b/tests/spec/ext_framebuffer_multisample/bitmap.cpp
@@ -122,19 +122,19 @@ test_multisample_bitmap()
 	 * This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
 
 	/* Check that the left and right halves of the screen match */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	result = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						     piglit_height)
 		 && result;
 
 	result = piglit_check_gl_error(GL_NO_ERROR) && result;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	return result;
 }
 
@@ -183,7 +183,7 @@ piglit_display()
 	 * is a reference image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2 * pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
diff --git a/tests/spec/ext_framebuffer_multisample/clear.cpp b/tests/spec/ext_framebuffer_multisample/clear.cpp
index 2505e10..c5cf31e 100644
--- a/tests/spec/ext_framebuffer_multisample/clear.cpp
+++ b/tests/spec/ext_framebuffer_multisample/clear.cpp
@@ -195,7 +195,7 @@ piglit_display()
 	 * screen, forcing a resolve.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, multisampled_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -239,7 +239,7 @@ piglit_display()
 	 * corresponding to each pixel, this effectively verifies that
 	 * all samples of every pixel were correctly cleared.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
 				      expected) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp b/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp
index 0ce3ac5..a9a9304 100644
--- a/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp
@@ -278,7 +278,7 @@ do_test(int coord, bool clip_low, test_type_enum test_type,
 
 	/* Transfer the test image to the screen */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, dst_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, dst_size[0], dst_size[1],
 			  display_x, display_y,
 			  display_x + dst_size[0], display_y + dst_size[1],
@@ -299,14 +299,14 @@ do_test(int coord, bool clip_low, test_type_enum test_type,
 
 	/* Transfer the reference image to the screen */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, dst_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, dst_size[0], dst_size[1],
 			  display_x + dst_size[0], display_y,
 			  display_x + 2 * dst_size[0], display_y + dst_size[1],
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
 
 	/* Compare the test and reference images */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	return piglit_probe_rect_halves_equal_rgba(display_x, display_y,
 						   2 * dst_size[0],
 						   dst_size[1]);
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp
index acf859a..907d421 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-coverage.cpp
@@ -111,7 +111,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp
index 7ac8fba..d48e311 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-alpha-to-one.cpp
@@ -132,7 +132,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -145,7 +145,7 @@ piglit_display()
 
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp
index dbaa689..25585c2 100644
--- a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp
@@ -110,7 +110,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -123,7 +123,7 @@ piglit_display()
 
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-        glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+        glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp
index 56c1062..26c6ffa 100644
--- a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp
+++ b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp
@@ -107,7 +107,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -120,7 +120,7 @@ piglit_display()
 
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-        glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+        glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
         pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/interpolation.cpp b/tests/spec/ext_framebuffer_multisample/interpolation.cpp
index 72b9a25..a814724 100644
--- a/tests/spec/ext_framebuffer_multisample/interpolation.cpp
+++ b/tests/spec/ext_framebuffer_multisample/interpolation.cpp
@@ -413,7 +413,7 @@ piglit_display()
 
 	/* Blit the test pattern to the left half of the piglit window. */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, singlesampled_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -446,13 +446,13 @@ piglit_display()
 
 	/* Blit the reference image to the right half of the piglit window. */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, singlesampled_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2*pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
 
 	/* Compare the test pattern to the reference image. */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, 2*pattern_width,
 						   pattern_height) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/line-smooth.cpp b/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
index 4dd9133..c013d55 100644
--- a/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
@@ -127,7 +127,7 @@ piglit_display()
 	 * This is the reference image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, test_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2*pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -154,7 +154,7 @@ piglit_display()
 	 * This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, test_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -163,7 +163,7 @@ piglit_display()
 	 * don't, then GL_LINE_SMOOTH is not ignored with multisample
 	 * rendering.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
index e601fee..40cd16b 100644
--- a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
@@ -154,7 +154,7 @@ piglit_display()
 	 * framebuffer.  This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, dst_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -168,7 +168,7 @@ piglit_display()
 	if (manifest_program)
 		manifest_program->run();
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, src_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2*pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -177,7 +177,7 @@ piglit_display()
 	 * If they don't, then there must have been a problem blitting
 	 * from src_fbo to dst_fbo.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/no-color.cpp b/tests/spec/ext_framebuffer_multisample/no-color.cpp
index 712f8e2..144c058 100644
--- a/tests/spec/ext_framebuffer_multisample/no-color.cpp
+++ b/tests/spec/ext_framebuffer_multisample/no-color.cpp
@@ -204,7 +204,7 @@ piglit_display()
 	 * This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, manifest_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -223,13 +223,13 @@ piglit_display()
 	 * This is the reference image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, manifest_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2*pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
 
 	/* Compare the test and reference images */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, 2*pattern_width,
 						   pattern_height) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/point-smooth.cpp b/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
index cc7c04a..9f1d6dd 100644
--- a/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
@@ -128,7 +128,7 @@ piglit_display()
 	 * This is the reference image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, test_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2*pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -150,7 +150,7 @@ piglit_display()
 	 * This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, test_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -159,7 +159,7 @@ piglit_display()
 	 * don't, then GL_POINT_SMOOTH is not ignored with multisample
 	 * rendering.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp b/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
index f22651c..d4271ac 100644
--- a/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
@@ -127,7 +127,7 @@ piglit_display()
 	 * is a reference image to test MSAA with polygon smooth.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, ms_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2 * pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -151,7 +151,7 @@ piglit_display()
 	 * is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, ms_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -160,7 +160,7 @@ piglit_display()
 	 * don't, then GL_POLYGON_SMOOTH is not ignored with multisample
 	 * rendering.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
index fe78c1d..eb615da 100644
--- a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
+++ b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
@@ -190,18 +190,18 @@ test_polygon_stipple()
 	 * This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  buffer_to_test, GL_NEAREST);
 
 	/* Check that the left and right halves of the screen match */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	result = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						     piglit_height)
 		 && result;
 
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	result = piglit_check_gl_error(GL_NO_ERROR) && result;
 	return result;
 }
@@ -265,7 +265,7 @@ piglit_display()
 	 * is a reference image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  pattern_width, 0, 2 * pattern_width, pattern_height,
 			  buffer_to_test, GL_NEAREST);
diff --git a/tests/spec/ext_framebuffer_multisample/sample-alpha-to-coverage.cpp b/tests/spec/ext_framebuffer_multisample/sample-alpha-to-coverage.cpp
index c2e1f6e..46bf6f0 100644
--- a/tests/spec/ext_framebuffer_multisample/sample-alpha-to-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/sample-alpha-to-coverage.cpp
@@ -121,7 +121,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
diff --git a/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp b/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp
index a435537..3f2dc3a 100644
--- a/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp
+++ b/tests/spec/ext_framebuffer_multisample/sample-alpha-to-one.cpp
@@ -103,7 +103,7 @@ enum piglit_result
 piglit_display()
 {
 	bool pass = true;
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	allocate_data_arrays();
@@ -117,7 +117,7 @@ piglit_display()
 
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0,
 						   piglit_width,
 						   piglit_height)
diff --git a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
index 001bf07..2209619 100644
--- a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
@@ -251,7 +251,7 @@ probe_framebuffer_color(void)
 		for (int i = 0; i < num_rects; i++)
 			coverage[i] = cov[i];
 
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 
 	for (int i = 0; i < num_rects; i++) {
 		float samples_used = coverage[i] * num_samples;
@@ -298,7 +298,7 @@ test_sample_coverage(void)
 	 * This is the test image.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  buffer_to_test, GL_NEAREST);
@@ -412,7 +412,7 @@ piglit_display()
 	bool pass = true;
 	allocate_data_arrays();
 
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 	glClear(buffer_to_test);
 
@@ -428,7 +428,7 @@ piglit_display()
 	 * sample coverage.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, ms_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0,
 			  pattern_width, pattern_height,
 			  0, pattern_height,
diff --git a/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp b/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
index 5f7a4bb..d18f3dd 100644
--- a/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
@@ -191,7 +191,7 @@ piglit_display()
 	 * framebuffer, unscrambling as we go.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, dst_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	scrambling_blit(inverse_permutation);
 
 	/* Blit from src_fbo to dst_fbo with no scrambling. */
@@ -205,7 +205,7 @@ piglit_display()
 	 * framebuffer, with no scrambling.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, dst_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_size, pattern_size,
 			  pattern_size, 0, pattern_size*2, pattern_size,
 			  buffer_to_test, GL_NEAREST);
@@ -218,7 +218,7 @@ piglit_display()
 		manifest_program->run();
 
 	/* Check that the left and right halves of the screen match. */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 
diff --git a/tests/spec/ext_framebuffer_multisample/upsample.cpp b/tests/spec/ext_framebuffer_multisample/upsample.cpp
index 67854bf..53d6234 100644
--- a/tests/spec/ext_framebuffer_multisample/upsample.cpp
+++ b/tests/spec/ext_framebuffer_multisample/upsample.cpp
@@ -158,14 +158,14 @@ piglit_display()
 		{ 0,   0, 1, 0   },
 		{ 0,   0, 0, 1   }
 	};
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glViewport(0, 0, piglit_width, piglit_height);
 	test_pattern->draw(proj);
 
 	/* Blit the test pattern to multisample_fbo, forcing the
 	 * implementation to upsample it.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, multisample_fbo.handle);
 	glBlitFramebuffer(pattern_width, 0, pattern_width*2, pattern_height,
 			  0, 0, pattern_width, pattern_height,
@@ -173,7 +173,7 @@ piglit_display()
 
 	if (manifest_program) {
 		/* Manifest the test pattern in the main framebuffer. */
-		glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+		glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 		manifest_program->run();
 
 		/* Manifest the test pattern in the multisample
@@ -189,7 +189,7 @@ piglit_display()
 	 * it.
 	 */
 	glBindFramebuffer(GL_READ_FRAMEBUFFER, multisample_fbo.handle);
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 	glBlitFramebuffer(0, 0, pattern_width, pattern_height,
 			  0, 0, pattern_width, pattern_height,
 			  GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -200,7 +200,7 @@ piglit_display()
 	 * tested by accuracy.cpp, we'll assume that any problem we
 	 * see here is due to upsampling.
 	 */
-	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 
diff --git a/tests/util/piglit-fbo.cpp b/tests/util/piglit-fbo.cpp
index 9e1379e..138b5d3 100644
--- a/tests/util/piglit-fbo.cpp
+++ b/tests/util/piglit-fbo.cpp
@@ -193,7 +193,7 @@ Fbo::try_setup(const FboConfig &new_config)
 	bool success = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER)
 		== GL_FRAMEBUFFER_COMPLETE;
 
-	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
 
 	return success;
 }
-- 
1.8.3.2



More information about the Piglit mailing list