[Piglit] [PATCH 16/37] glean/tfragprog1: port MAD test to shader_runner

Dylan Baker dylan at pnwbakers.com
Mon May 2 21:59:18 UTC 2016


This isn't an exact port, some of the values were changed to be simpler,
easier for humans to calculate values, but it shouldn't affect the
viability of the test.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 tests/all.py                                         |  1 -
 tests/glean/tfragprog1.cpp                           | 14 --------------
 .../built-in-functions/mad.shader_test               | 20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100644 tests/spec/arb_fragment_program/built-in-functions/mad.shader_test

diff --git a/tests/all.py b/tests/all.py
index 9bcb17b..42d7220 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
                     'texcoord varying']
 
 glean_fp_tests = [
-                  'MAD test',
                   'MAX test',
                   'MIN test',
                   'MOV test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index bb79963..9254e11 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
 	{
-		"MAD test",
-		"!!ARBfp1.0\n"
-		"PARAM p1 = program.local[1]; \n"
-		"PARAM p2 = program.local[2]; \n"
-		"MAD result.color, fragment.color, p1, p2; \n"
-		"END \n",
-		{ CLAMP01(FragColor[0] * Param1[0] + Param2[0]),
-		  CLAMP01(FragColor[1] * Param1[1] + Param2[1]),
-		  CLAMP01(FragColor[2] * Param1[2] + Param2[2]),
-		  CLAMP01(FragColor[3] * Param1[3] + Param2[3])
-		},
-		DONT_CARE_Z
-	},
-	{
 		"MAX test",
 		"!!ARBfp1.0\n"
 		"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test b/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test
new file mode 100644
index 0000000..8895117
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+MAD result.color, p, q, r;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 ( 1.0, 0.5, 0.0, -1.0)
+parameter local_fp 1 ( 0.5, 0.5, 1.0,  1.0)
+parameter local_fp 2 (0.25, 0.0, 0.5, -1.0)
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.25 0.5 0.0
-- 
2.8.2



More information about the Piglit mailing list