[Piglit] [PATCH 7/9] ARB_fragment_program/kil-swizzle: Convert kil-swizzle.fp to shader_runner.
Eric Anholt
eric at anholt.net
Tue Nov 29 16:43:57 PST 2011
I almost faithfully copied the old test, except for adding some
comments, and changing the last test where there appeared to be an
extra copy-and-pasted -1 instead of a 1 in the series of "make sure
that a single -1 in each possible component that could cause a kill
does kill" tests, and making the didn't-kill color green instead of
red.
---
tests/shaders/generic/kil-swizzle.fp | 48 ----------------
.../arb_fragment_program/kil-swizzle.shader_test | 60 ++++++++++++++++++++
2 files changed, 60 insertions(+), 48 deletions(-)
delete mode 100644 tests/shaders/generic/kil-swizzle.fp
create mode 100644 tests/spec/arb_fragment_program/kil-swizzle.shader_test
diff --git a/tests/shaders/generic/kil-swizzle.fp b/tests/shaders/generic/kil-swizzle.fp
deleted file mode 100644
index 916dbcd..0000000
--- a/tests/shaders/generic/kil-swizzle.fp
+++ /dev/null
@@ -1,48 +0,0 @@
-6 2 0
-tc
- -1 -1 -1 -1
- -1 -1 -1 -1
-tex
-expected
- 0 0 1 0
-
-tc
- 1 1 -1 -1
- -1 -1 1 1
-tex
-expected
- 1 0 0 0
-
-tc
- 1 1 -1 -1
- -1 -1 -1 1
-tex
-expected
- 0 0 1 0
-
-tc
- 1 1 -1 -1
- -1 -1 1 -1
-tex
-expected
- 0 0 1 0
-
-tc
- 1 -1 -1 -1
- -1 -1 1 1
-tex
-expected
- 0 0 1 0
-
-tc
- -1 1 -1 -1
- -1 -1 -1 1
-tex
-expected
- 0 0 1 0
-
-!!ARBfp1.0
-KIL fragment.texcoord[0].xxyy;
-KIL fragment.texcoord[1].zwwz;
-MOV result.color, { 1.0, 0.0, 0.0, 0.0 };
-END
diff --git a/tests/spec/arb_fragment_program/kil-swizzle.shader_test b/tests/spec/arb_fragment_program/kil-swizzle.shader_test
new file mode 100644
index 0000000..4a873d8
--- /dev/null
+++ b/tests/spec/arb_fragment_program/kil-swizzle.shader_test
@@ -0,0 +1,60 @@
+[vertex program]
+!!ARBvp1.0
+MOV result.position, vertex.position;
+MOV result.texcoord[0], program.env[0];
+MOV result.texcoord[1], program.env[1];
+END
+
+[fragment program]
+!!ARBfp1.0
+KIL fragment.texcoord[0].xxyy;
+KIL fragment.texcoord[1].zwwz;
+
+# green will be neither of the kills occurring, otherwise
+# we'll get the blue clear color.
+MOV result.color, { 0.0, 1.0, 0.0, 0.0 };
+END
+
+[test]
+clear color 0 0 1 0
+# both kill
+parameter env_vp 0 (-1.0, -1.0, -1.0, -1.0)
+parameter env_vp 1 (-1.0, -1.0, -1.0, -1.0)
+clear
+draw rect -1 -1 2 2
+probe all rgba 0 0 1 0
+
+# neither kill
+parameter env_vp 0 ( 1.0, 1.0, -1.0, -1.0)
+parameter env_vp 1 (-1.0, -1.0, 1.0, 1.0)
+clear
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 0
+
+# second kills
+parameter env_vp 0 ( 1.0, 1.0, -1.0, -1.0)
+parameter env_vp 1 (-1.0, -1.0, -1.0, 1.0)
+clear
+draw rect -1 -1 2 2
+probe all rgba 0 0 1 0
+
+# second kills
+parameter env_vp 0 ( 1.0, 1.0, -1.0, -1.0)
+parameter env_vp 1 (-1.0, -1.0, 1.0, -1.0)
+clear
+draw rect -1 -1 2 2
+probe all rgba 0 0 1 0
+
+# first kills
+parameter env_vp 0 ( 1.0, -1.0, -1.0, -1.0)
+parameter env_vp 1 (-1.0, -1.0, 1.0, 1.0)
+clear
+draw rect -1 -1 2 2
+probe all rgba 0 0 1 0
+
+# first kills
+parameter env_vp 0 (-1.0, 1.0, -1.0, -1.0)
+parameter env_vp 1 (-1.0, -1.0, 1.0, 1.0)
+clear
+draw rect -1 -1 2 2
+probe all rgba 0 0 1 0
--
1.7.7.3
More information about the Piglit
mailing list