[05/15] ext_framebuffer_multisample-interpolation: fix single-sample centroid-edges

Submitted by Marek Olšák on March 26, 2018, 11:32 p.m.

Details

Message ID 20180326233255.18529-5-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák March 26, 2018, 11:32 p.m.
From: Nicolai Hähnle <nicolai.haehnle@amd.com>

When num_samples == 0, the centroid qualifier is ignored.
---
 tests/spec/ext_framebuffer_multisample/interpolation.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/ext_framebuffer_multisample/interpolation.cpp b/tests/spec/ext_framebuffer_multisample/interpolation.cpp
index 3f18307c1..e57113ea5 100644
--- a/tests/spec/ext_framebuffer_multisample/interpolation.cpp
+++ b/tests/spec/ext_framebuffer_multisample/interpolation.cpp
@@ -65,21 +65,22 @@ 
  *   that sets the red, green, and blue channels to the barycentric
  *   coordinates within each triangle.
  *
  * - centroid-edges: verify that centroid interpolation occurs at
  *   points that lie within the extents of the triangle, even for
  *   pixels on triangle edges, where the center of the pixel might lie
  *   outside the extents of the triangle.  The test uses a fragment
  *   shader that sets the blue channel to 1.0 (so that the triangles
  *   can be seen) and the red and green channels to 1.0 if any of the
  *   centroid-interpolated barycentric coordinates is outside the
- *   range [0, 1].
+ *   range [0, 1]; except when num_samples == 0, in which case
+ *   it behaves like centroid-disabled.
  *
  * - non-centroid-deriv: verify that the numeric derivative of a
  *   varying using non-centroid interpolation is correct, even at
  *   triangle edges.  This ensures that the implementation properly
  *   handles a subtle corner case: since numeric derivatives are
  *   usually computed using finite differences between adjacent
  *   pixels, it's possible that the value of a varying at a completely
  *   uncovered pixel might be used.  In effect, this tests that the
  *   values of varyings are correct on completely uncovered pixels, if
  *   those values are needed for derivatives.  This test may also be
@@ -331,22 +332,27 @@  piglit_init(int argc, char **argv)
 	const char *ref_frag; /* Fragment shader for the reference image */
 	if (strcmp(argv[2], "non-centroid-disabled") == 0) {
 		frag = frag_non_centroid_barycentric;
 		ref_frag = frag_non_centroid_barycentric;
 		disable_msaa_during_test_image = true;
 	} else if (strcmp(argv[2], "centroid-disabled") == 0) {
 		frag = frag_centroid_barycentric;
 		ref_frag = frag_non_centroid_barycentric;
 		disable_msaa_during_test_image = true;
 	} else if (strcmp(argv[2], "centroid-edges") == 0) {
-		frag = frag_centroid_range_check;
-		ref_frag = frag_blue;
+		if (num_samples == 0) {
+			frag = frag_centroid_barycentric;
+			ref_frag = frag_non_centroid_barycentric;
+		} else {
+			frag = frag_centroid_range_check;
+			ref_frag = frag_blue;
+		}
 	} else if (strcmp(argv[2], "non-centroid-deriv") == 0) {
 		frag = frag_non_centroid_deriv;
 	        ref_frag = frag_rg_0_5;
 	} else if (strcmp(argv[2], "non-centroid-deriv-disabled") == 0) {
 		frag = frag_non_centroid_deriv;
 	        ref_frag = frag_rg_0_5;
 		disable_msaa_during_test_image = true;
 	} else if (strcmp(argv[2], "centroid-deriv") == 0) {
 		if (num_samples == 0) {
 			frag = frag_centroid_deriv;