[Piglit] [PATCH v2 22/37] glean/tfragprog1: port RCP tests to shader_runner

Dylan Baker dylan at pnwbakers.com
Tue Sep 6 19:21:00 UTC 2016


Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 tests/all.py                                                                  |  2 --
 tests/glean/tfragprog1.cpp                                                    | 23 -----------------------
 tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test | 19 +++++++++++++++++++
 tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test            | 22 ++++++++++++++++++++++
 4 files changed, 41 insertions(+), 25 deletions(-)
 create mode 100644 tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
 create mode 100644 tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3c857d9..8b76c48 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
                     'texcoord varying']
 
 glean_fp_tests = [
-                  'RCP test (reciprocal)',
-                  'RCP test 2 (reciprocal)',
                   'RSQ test 1 (reciprocal square root)',
                   'RSQ test 2 (reciprocal square root of negative value)',
                   'SCS test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 37c70c1..827a818 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,29 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
 	{
-		"RCP test (reciprocal)",
-		"!!ARBfp1.0\n"
-		"PARAM values = {8, -10, 1, 12 }; \n"
-		"RCP result.color.x, values.x; \n"
-		"RCP result.color.y, values.y; \n"
-		"RCP result.color.z, values.z; \n"
-		"RCP result.color.w, values.w; \n"
-		"END \n",
-		{ 1.0 / 8.0, CLAMP01(1.0 / -10.0), 1, 1.0 / 12.0 },
-		DONT_CARE_Z
-	},
-	{
-		/* check that RCP result is replicated across XYZW */
-		"RCP test 2 (reciprocal)",
-		"!!ARBfp1.0\n"
-		"PARAM values = {8, -10, 1, 12 }; \n"
-		"MOV result.color, values; \n"
-		"RCP result.color, values.x; \n"
-		"END \n",
-		{ 1.0 / 8.0, 1.0 / 8.0, 1.0 / 8.0, 1.0 / 8.0 },
-		DONT_CARE_Z
-	},
-	{
 		"RSQ test 1 (reciprocal square root)",
 		"!!ARBfp1.0\n"
 		"PARAM values = {1, 4, 9, 100 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test b/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
new file mode 100644
index 0000000..382a556
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RCP result.color, p.x;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (8.0, -10.0, 1.0, 12.0)
+draw rect -1 -1 2 2
+# The y value will be clamped from -0.1
+probe all rgba 0.125 0.125 0.125 0.125
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test b/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
new file mode 100644
index 0000000..80f155e
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
@@ -0,0 +1,22 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RCP result.color.x, p.x;
+RCP result.color.y, p.y;
+RCP result.color.z, p.z;
+RCP result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (8.0, -10.0, 1.0, 12.0)
+draw rect -1 -1 2 2
+# The y value will be clamped from -0.1
+probe all rgba 0.125 0.0 1.0 0.0833
-- 
git-series 0.8.10


More information about the Piglit mailing list