[Piglit] [PATCH 3/3] ati_fs: Do some column wrapping in the render tests.

Eric Anholt eric at anholt.net
Thu Dec 7 20:08:11 UTC 2017


---
 tests/spec/ati_fragment_shader/render-constants.c  | 25 ++++++++++-----
 tests/spec/ati_fragment_shader/render-default.c    | 24 ++++++++++-----
 tests/spec/ati_fragment_shader/render-fog.c        | 28 ++++++++++++-----
 tests/spec/ati_fragment_shader/render-notexture.c  | 24 ++++++++++-----
 tests/spec/ati_fragment_shader/render-precedence.c | 25 ++++++++++-----
 tests/spec/ati_fragment_shader/render-sources.c    | 36 ++++++++++++++++------
 tests/spec/ati_fragment_shader/render-textargets.c | 29 +++++++++++------
 7 files changed, 136 insertions(+), 55 deletions(-)

diff --git a/tests/spec/ati_fragment_shader/render-constants.c b/tests/spec/ati_fragment_shader/render-constants.c
index fd90a943405a..c5ee2c8d8365 100644
--- a/tests/spec/ati_fragment_shader/render-constants.c
+++ b/tests/spec/ati_fragment_shader/render-constants.c
@@ -64,18 +64,29 @@ piglit_display(void)
 	glBindFragmentShaderATI(s_global);
 	piglit_draw_rect(0, 0, piglit_width / 4, piglit_height); /* 2+3 */
 	glBindFragmentShaderATI(s_local);
-	piglit_draw_rect(piglit_width / 4, 0, piglit_width / 4, piglit_height); /* 1+3 */
+	piglit_draw_rect(piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height); /* 1+3 */
 	glBindFragmentShaderATI(s_global);
 	glSetFragmentShaderConstantATI(GL_CON_7_ATI, color4);
-	piglit_draw_rect(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height); /* 4+3 */
+	piglit_draw_rect(2 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height); /* 4+3 */
 	glBindFragmentShaderATI(s_local);
-	piglit_draw_rect(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height); /*1+3 */
+	piglit_draw_rect(3 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height); /*1+3 */
 	glDisable(GL_FRAGMENT_SHADER_ATI);
 
-	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4, piglit_height, result2p3);
-	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0, piglit_width / 4, piglit_height, result1p3);
-	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height, result4p3);
-	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height, result1p3);
+	pass = pass && piglit_probe_rect_rgb(0, 0,
+					     piglit_width / 4,
+					     piglit_height, result2p3);
+	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, result1p3);
+	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, result4p3);
+	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, result1p3);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ati_fragment_shader/render-default.c b/tests/spec/ati_fragment_shader/render-default.c
index 89e8cb09d13e..e760e065da2d 100644
--- a/tests/spec/ati_fragment_shader/render-default.c
+++ b/tests/spec/ati_fragment_shader/render-default.c
@@ -56,14 +56,24 @@ piglit_display(void)
 	glEnable(GL_FRAGMENT_SHADER_ATI);
 	piglit_draw_rect(piglit_width / 4, 0, piglit_width / 4, piglit_height);
 	glDisable(GL_FRAGMENT_SHADER_ATI);
-	piglit_draw_rect(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(2 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
 	glEnable(GL_FRAGMENT_SHADER_ATI);
-	piglit_draw_rect(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
-
-	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4, piglit_height, color);
-	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0, piglit_width / 4, piglit_height, texcoord);
-	pass = pass && piglit_probe_rect_rgb(2*piglit_width / 4, 0, piglit_width / 4, piglit_height, color);
-	pass = pass && piglit_probe_rect_rgb(3*piglit_width / 4, 0, piglit_width / 4, piglit_height, texcoord);
+	piglit_draw_rect(3 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
+
+	pass = pass && piglit_probe_rect_rgb(0, 0,
+					     piglit_width / 4,
+					     piglit_height, color);
+	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, texcoord);
+	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, color);
+	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, texcoord);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ati_fragment_shader/render-fog.c b/tests/spec/ati_fragment_shader/render-fog.c
index eb1f2450cbea..7d1d17b93685 100644
--- a/tests/spec/ati_fragment_shader/render-fog.c
+++ b/tests/spec/ati_fragment_shader/render-fog.c
@@ -65,19 +65,31 @@ piglit_display(void)
 	glEnable(GL_FRAGMENT_SHADER_ATI);
 	glEnable(GL_FOG);
 	glFogi(GL_FOG_MODE, GL_LINEAR);
-	piglit_draw_rect_z(z, 0, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect_z(z, 0, 0,
+			   piglit_width / 4, piglit_height);
 	glFogi(GL_FOG_MODE, GL_EXP);
-	piglit_draw_rect_z(z, piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect_z(z, piglit_width / 4, 0,
+			   piglit_width / 4, piglit_height);
 	glFogi(GL_FOG_MODE, GL_EXP2);
-	piglit_draw_rect_z(z, 2 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect_z(z, 2 * piglit_width / 4, 0,
+			   piglit_width / 4, piglit_height);
 	glDisable(GL_FOG);
-	piglit_draw_rect_z(z, 3 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect_z(z, 3 * piglit_width / 4, 0,
+			   piglit_width / 4, piglit_height);
 	glDisable(GL_FRAGMENT_SHADER_ATI);
 
-	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4, piglit_height, resultLin);
-	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0, piglit_width / 4, piglit_height, resultExp);
-	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height, resultEx2);
-	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height, color2);
+	pass = pass && piglit_probe_rect_rgb(0, 0,
+					     piglit_width / 4,
+					     piglit_height, resultLin);
+	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, resultExp);
+	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, resultEx2);
+	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, color2);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ati_fragment_shader/render-notexture.c b/tests/spec/ati_fragment_shader/render-notexture.c
index d85d030dee81..86a5a04c21b2 100644
--- a/tests/spec/ati_fragment_shader/render-notexture.c
+++ b/tests/spec/ati_fragment_shader/render-notexture.c
@@ -65,22 +65,32 @@ piglit_display(void)
 	piglit_draw_rect(piglit_width / 4, 0, piglit_width / 4, piglit_height);
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D, tex);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color1);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT,
+		     (void*)color1);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-	piglit_draw_rect(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(2 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
 	glEnable(GL_TEXTURE_2D);
-	piglit_draw_rect(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(3 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
 	glDisable(GL_TEXTURE_2D);
 	glDeleteTextures(1, &tex);
 	glDisable(GL_FRAGMENT_SHADER_ATI);
 
-	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4, piglit_height, texcoord);
-	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0, piglit_width / 4, piglit_height, black);
-	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height, black);
-	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height, color1);
+	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4,
+					     piglit_height, texcoord);
+	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, black);
+	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, black);
+	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, color1);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ati_fragment_shader/render-precedence.c b/tests/spec/ati_fragment_shader/render-precedence.c
index 43ab656803d3..df47db0a9c43 100644
--- a/tests/spec/ati_fragment_shader/render-precedence.c
+++ b/tests/spec/ati_fragment_shader/render-precedence.c
@@ -64,30 +64,41 @@ piglit_display(void)
 	piglit_draw_rect(0, 0, piglit_width / 4, piglit_height);
 	if (have_fp) {
 		glEnable(GL_FRAGMENT_PROGRAM_ARB);
-		piglit_draw_rect(piglit_width / 4, 0, piglit_width / 4, piglit_height);
+		piglit_draw_rect(piglit_width / 4, 0,
+				 piglit_width / 4, piglit_height);
 		glDisable(GL_FRAGMENT_PROGRAM_ARB);
 	}
 	if (have_fs) {
 		glUseProgram(glslprog);
-		piglit_draw_rect(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+		piglit_draw_rect(2 * piglit_width / 4, 0,
+				 piglit_width / 4, piglit_height);
 		glUseProgram(0);
 	}
 	if (have_fp && have_fs) {
 		glUseProgram(glslprog);
 		glEnable(GL_FRAGMENT_PROGRAM_ARB);
-		piglit_draw_rect(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+		piglit_draw_rect(3 * piglit_width / 4, 0,
+				 piglit_width / 4, piglit_height);
 		glUseProgram(0);
 		glDisable(GL_FRAGMENT_PROGRAM_ARB);
 	}
 	glDisable(GL_FRAGMENT_SHADER_ATI);
 
-	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4, piglit_height, color2);
+	pass = pass && piglit_probe_rect_rgb(0, 0,
+					     piglit_width / 4,
+					     piglit_height, color2);
 	if (have_fp)
-		pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0, piglit_width / 4, piglit_height, texcoord);
+		pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0,
+						     piglit_width / 4,
+						     piglit_height, texcoord);
 	if (have_fs)
-		pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height, color1);
+		pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0,
+						     piglit_width / 4,
+						     piglit_height, color1);
 	if (have_fp && have_fs)
-		pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height, color1);
+		pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0,
+						     piglit_width / 4,
+						     piglit_height, color1);
 
 	piglit_present_results();
 
diff --git a/tests/spec/ati_fragment_shader/render-sources.c b/tests/spec/ati_fragment_shader/render-sources.c
index ccc4247c70c8..9b4f5af3360c 100644
--- a/tests/spec/ati_fragment_shader/render-sources.c
+++ b/tests/spec/ati_fragment_shader/render-sources.c
@@ -78,21 +78,36 @@ piglit_display(void)
 
 	glEnable(GL_FRAGMENT_SHADER_ATI);
 	glBindFragmentShaderATI(0);
-	piglit_draw_rect(0, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(0, 0,
+			 piglit_width / 4, piglit_height);
 	glBindFragmentShaderATI(SHADER_CONST);
-	piglit_draw_rect(piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
 	glBindFragmentShaderATI(SHADER_COLOR);
-	piglit_draw_rect(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(2 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
 	glBindFragmentShaderATI(SHADER_TEX);
-	piglit_draw_rect(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height);
+	piglit_draw_rect(3 * piglit_width / 4, 0,
+			 piglit_width / 4, piglit_height);
 	glDisable(GL_FRAGMENT_SHADER_ATI);
 
+#if 0
 	/* Mesa uses fixed-function when the shader is invalid, but
-	 * it's undefined */
-	/*pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 4, piglit_height, color1*texcolor);*/
-	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0, piglit_width / 4, piglit_height, result_const);
-	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0, piglit_width / 4, piglit_height, result_color);
-	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0, piglit_width / 4, piglit_height, result_tex);
+	 * it's undefined
+	 */
+	pass = pass && piglit_probe_rect_rgb(0, 0,
+					     piglit_width / 4,
+					     piglit_height, color1 * texcolor);
+#endif
+	pass = pass && piglit_probe_rect_rgb(piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, result_const);
+	pass = pass && piglit_probe_rect_rgb(2 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, result_color);
+	pass = pass && piglit_probe_rect_rgb(3 * piglit_width / 4, 0,
+					     piglit_width / 4,
+					     piglit_height, result_tex);
 
 	piglit_present_results();
 
@@ -141,7 +156,8 @@ piglit_init(int argc, char **argv)
 
 	glGenTextures(1, &tex);
 	glBindTexture(GL_TEXTURE_2D, tex);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)texcolor);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT,
+		     (void*)texcolor);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
diff --git a/tests/spec/ati_fragment_shader/render-textargets.c b/tests/spec/ati_fragment_shader/render-textargets.c
index 82cfd7a4d181..c3dfe5f5148b 100644
--- a/tests/spec/ati_fragment_shader/render-textargets.c
+++ b/tests/spec/ati_fragment_shader/render-textargets.c
@@ -65,8 +65,12 @@ piglit_display(void)
 	glDisable(GL_TEXTURE_CUBE_MAP);
 	glDisable(GL_FRAGMENT_SHADER_ATI);
 
-	pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width / 2, piglit_height, color1);
-	pass = pass && piglit_probe_rect_rgb(piglit_width / 2, 0, piglit_width / 2, piglit_height, color2);
+	pass = pass && piglit_probe_rect_rgb(0, 0,
+					     piglit_width / 2,
+					     piglit_height, color1);
+	pass = pass && piglit_probe_rect_rgb(piglit_width / 2, 0,
+					     piglit_width / 2,
+					     piglit_height, color2);
 
 	piglit_present_results();
 
@@ -88,7 +92,8 @@ piglit_init(int argc, char **argv)
 
 	glGenTextures(1, &tex2D);
 	glBindTexture(GL_TEXTURE_2D, tex2D);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color1);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT,
+		     (void*)color1);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
@@ -96,12 +101,18 @@ piglit_init(int argc, char **argv)
 
 	glGenTextures(1, &texCUBE);
 	glBindTexture(GL_TEXTURE_CUBE_MAP, texCUBE);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color2);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color2);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color2);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color2);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color2);
-	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_FLOAT, (void*)color2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, 1, 1, 0,
+		     GL_RGB, GL_FLOAT, (void*)color2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGB, 1, 1, 0,
+		     GL_RGB, GL_FLOAT, (void*)color2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGB, 1, 1, 0,
+		     GL_RGB, GL_FLOAT, (void*)color2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGB, 1, 1, 0,
+		     GL_RGB, GL_FLOAT, (void*)color2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGB, 1, 1, 0,
+		     GL_RGB, GL_FLOAT, (void*)color2);
+	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGB, 1, 1, 0,
+		     GL_RGB, GL_FLOAT, (void*)color2);
 	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 	glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
-- 
2.15.0



More information about the Piglit mailing list