[Piglit] [PATCH v2 29/37] glean/tfragprog1: port swizzle tests to shader_runner

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


This includes the SWZ tests and the swizzled ADD and MOV tests.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 tests/all.py                                                              |  3 ---
 tests/glean/tfragprog1.cpp                                                | 42 ------------------------------------------
 tests/spec/arb_fragment_program/built-in-functions/swz.shader_test        | 17 +++++++++++++++++
 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test | 18 ++++++++++++++++++
 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test | 16 ++++++++++++++++
 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-sub.shader_test | 10 ++--------
 6 files changed, 53 insertions(+), 53 deletions(-)
 create mode 100644 tests/spec/arb_fragment_program/built-in-functions/swz.shader_test
 create mode 100644 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test
 create mode 100644 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test

diff --git a/tests/all.py b/tests/all.py
index c2c3103..c03ef2c 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,9 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
                     'texcoord varying']
 
 glean_fp_tests = [
-                  'SWZ test',
-                  'swizzled move test',
-                  'swizzled add test',
                   'XPD test 1',
                   'Z-write test',
                   'Divide by zero test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 342b17d..23e20bf 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,48 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
 	{
-		"SWZ test",
-		"!!ARBfp1.0\n"
-		"PARAM p = program.local[1]; \n"
-		"SWZ result.color, p, -1,-y,z,0; \n"
-		"END \n",
-		{ CLAMP01(-1.0),
-		  CLAMP01(-Param1[1]),
-		  CLAMP01(Param1[2]),
-		  CLAMP01(0.0)
-		},
-		DONT_CARE_Z
-	},
-	{
-		// this test checks that SOA execution is handled correctly
-		"swizzled move test",
-		"!!ARBfp1.0\n"
-		"TEMP t; \n"
-		"PARAM p = program.local[1]; \n"
-		"MOV t, p; \n"
-		"MOV t, t.yxwz; \n"  // "in-place" swizzle
-		"MOV result.color, t; \n"
-		"END \n",
-		{ Param1[1], Param1[0], Param1[3], Param1[2] },
-		DONT_CARE_Z
-	},
-	{
-		// this test checks that SOA execution is handled correctly
-		"swizzled add test",
-		"!!ARBfp1.0\n"
-		"TEMP t; \n"
-		"PARAM p = program.local[1]; \n"
-		"MOV t, p; \n"
-		"ADD t, t, t.yxwz; \n"  // "in-place" swizzled add
-		"MOV result.color, t; \n"
-		"END \n",
-		{ CLAMP01(Param1[0] + Param1[1]),
-		  CLAMP01(Param1[1] + Param1[0]),
-		  CLAMP01(Param1[2] + Param1[3]),
-		  CLAMP01(Param1[3] + Param1[2]) },
-		DONT_CARE_Z
-	},
-	{
 		"XPD test 1",
 		"!!ARBfp1.0\n"
 		"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/swz.shader_test b/tests/spec/arb_fragment_program/built-in-functions/swz.shader_test
new file mode 100644
index 0000000..3b338fd
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/swz.shader_test
@@ -0,0 +1,17 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+SWZ result.color, p, 0,z,x,y;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (-1.0, 0.0, 1.0, 0.5)
+draw rect -1 -1 2 2
+# z will be clamped
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test
new file mode 100644
index 0000000..152f163
--- /dev/null
+++ b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+ADD result.color, p.yxwz, q.yxwz;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.0, 0.0,  0.5, -1.0)
+parameter local_fp 1 (1.0, 0.0, -0.5,  0.5)
+draw rect -1 -1 2 2 
+probe all rgba 0.0 1.0 0.0 0.0  # x and w will be clampped
diff --git a/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test
new file mode 100644
index 0000000..bce5709
--- /dev/null
+++ b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test
@@ -0,0 +1,16 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+MOV result.color, p.yxzy;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.0, 0.0,  0.0, 0.0)
+draw rect -1 -1 2 2 
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-sub.shader_test b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-sub.shader_test
index c9abfae..d14a26c 100644
--- a/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-sub.shader_test
+++ b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-sub.shader_test
@@ -9,16 +9,10 @@ SUB result.color, p.yxwz, q.yxwz;
 END
 
 [test]
-ortho
 clear color 0.5 0.5 0.5 0.5
 clear
 
 parameter local_fp 0 (1.0, 1.0, 1.0, 0.5)
 parameter local_fp 1 (0.0, 1.0, 1.0, 0.5)
-draw rect 10 10 30 30
-# z will be clamped
-probe rgba 10 10 0.0 1.0 0.0 0.0
-probe rgba 30 10 0.0 1.0 0.0 0.0
-probe rgba 10 30 0.0 1.0 0.0 0.0
-probe rgba 30 30 0.0 1.0 0.0 0.0
-probe rgba 20 20 0.0 1.0 0.0 0.0
+draw rect -1 -1 2 2 
+probe all rgba 0.0 1.0 0.0 0.0  # z will be clamped
-- 
git-series 0.8.10


More information about the Piglit mailing list