[Piglit] [PATCH 11/25] glean/tfragprog1: port RSQ tests to shader_runner

Dylan Baker dylan at pnwbakers.com
Fri Apr 29 16:50:21 UTC 2016


This single test combines the two tests in glean into one, adding a
negative number.

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

diff --git a/tests/all.py b/tests/all.py
index ad74590..4382a39 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 = [
-                  'RSQ test 1 (reciprocal square root)',
-                  'RSQ test 2 (reciprocal square root of negative value)',
                   'SCS test',
                   'SGE test',
                   'SIN test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 827a818..ab1a8ea 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,34 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
 	{
-		"RSQ test 1 (reciprocal square root)",
-		"!!ARBfp1.0\n"
-		"PARAM values = {1, 4, 9, 100 }; \n"
-		"RSQ result.color.x, values.x; \n"
-		"RSQ result.color.y, values.y; \n"
-		"RSQ result.color.z, values.z; \n"
-		"RSQ result.color.w, values.w; \n"
-		"END \n",
-		{ 1.0, 0.5, 0.3333, 0.1 },
-		DONT_CARE_Z
-	},
-	{
-		"RSQ test 2 (reciprocal square root of negative value)",
-		"!!ARBfp1.0\n"
-		"PARAM values = {0, -100, -5, -1}; \n"
-		"RSQ result.color.x, values.x; \n"
-		"RSQ result.color.y, values.y; \n"
-		"RSQ result.color.z, values.z; \n"
-		"RSQ result.color.w, values.w; \n"
-		"END \n",
-		{ DONT_CARE_COLOR,
-		  0.1,
-		  0.447,
-		  1.0,
-		},
-		DONT_CARE_Z
-	},
-	{
 		"SCS test",
 		"!!ARBfp1.0\n"
 		"PARAM values = { 0.5, 0.5, 0.0, 0.0 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test b/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test
new file mode 100644
index 0000000..2f61261
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test
@@ -0,0 +1,21 @@
+[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;
+RSQ result.color.x, p.x;
+RSQ result.color.y, p.y;
+RSQ result.color.z, p.z;
+RSQ result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 4.0, 9.0, -100.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.5 0.3333 0.1
-- 
2.8.0



More information about the Piglit mailing list