[Piglit] [PATCH 1/2] Add a "slow_cc" option to EXT_framebuffer_multisample/alpha-blending.

Paul Berry stereotype441 at gmail.com
Mon Nov 4 18:27:11 PST 2013


When fast color clears are added to i965, there is a danger that they
may cause this test to stop reproducing bug 53077.  To avoid that, add
a command-line option which causes the test to use a clear color that
isn't fast color clearable.

As a result of this patch, a new piglit test is added:
"spec/EXT_framebuffer_multisample/alpha-blending slow_cc".  As of Mesa
commit fd05ede, this test is known to fail on Ivy Bridge and Haswell.
These failures are already covered by bug 53077.
---
 tests/all.tests                                         |  1 +
 tests/spec/ext_framebuffer_multisample/alpha-blending.c | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index 550729d..43394a2 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1774,6 +1774,7 @@ ext_framebuffer_multisample['renderbufferstorage-samples'] = concurrent_test('ex
 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')
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for test_type in ('color', 'srgb', 'stencil_draw', 'stencil_resolve',
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-blending.c b/tests/spec/ext_framebuffer_multisample/alpha-blending.c
index add169c..e43091e 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-blending.c
+++ b/tests/spec/ext_framebuffer_multisample/alpha-blending.c
@@ -32,6 +32,11 @@
  * incorrectly while drawing the first triangle of the fan.
  *
  * See also https://bugs.freedesktop.org/show_bug.cgi?id=53077
+ *
+ * Note: when fast color clears are implemented for MSAA buffers, it's
+ * possible that they will cover up this bug.  To avoid that, the test
+ * can be supplied a command-line option of "slow_cc", which causes it
+ * to use a clear color that cannot be fast cleared.
  */
 
 #include "piglit-util-gl-common.h"
@@ -40,6 +45,7 @@ GLuint framebuffer, renderbuffer;
 #define WIDTH 300
 #define HEIGHT 350
 int numSamples;
+static bool slow_color_clear = false;
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
@@ -48,6 +54,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.window_width = WIDTH;
 	config.window_height = HEIGHT;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	slow_color_clear = PIGLIT_STRIP_ARG("slow_cc");
 
 PIGLIT_GL_TEST_CONFIG_END
 
@@ -84,14 +91,20 @@ piglit_display()
 
 	glBindFramebufferEXT(GL_FRAMEBUFFER,framebuffer);
 
-	glClearColor(0.0, 0.0, 0.0, 1.0);
+	if (slow_color_clear) {
+		glColor4f (0.0, 1.0, 0.5, 0.7);
+		glClearColor(0.0, 0.0, 0.5, 1.0);
+		expected_color[2] = 0.5;
+	} else {
+		glColor4f (0.0, 1.0, 0.0, 0.7);
+		glClearColor(0.0, 0.0, 0.0, 1.0);
+	}
 	glClear(GL_COLOR_BUFFER_BIT);
 
 	glEnable(GL_BLEND);
 	src_factor = GL_SRC_ALPHA;
 	dst_factor = GL_ONE_MINUS_SRC_ALPHA;
 	glBlendFunc (src_factor, dst_factor);
-	glColor4f (0.0, 1.0, 0.0, 0.7);
 	glVertexPointer(2, GL_FLOAT, 0, vertex_data);
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-- 
1.8.4.2



More information about the Piglit mailing list