[Piglit] [PATCH 6/9] ARB_fragment_program/dph.fp: Convert old dph.fp to shader_runner.

Eric Anholt eric at anholt.net
Tue Nov 29 16:43:56 PST 2011


As much of the previous test's behavior is maintained as possible
(such as using fragment.texcoord[] for input arguments as opposed to
fp env parameters), except that now both results are displayed at the
same time.
---
 tests/all.tests                                 |    7 +++++++
 tests/shaders/generic/dph.fp                    |   18 ------------------
 tests/spec/arb_fragment_program/dph.shader_test |   23 +++++++++++++++++++++++
 3 files changed, 30 insertions(+), 18 deletions(-)
 delete mode 100644 tests/shaders/generic/dph.fp
 create mode 100644 tests/spec/arb_fragment_program/dph.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index bbee40a..99a5d26 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -959,6 +959,13 @@ add_shader_test_dir(arb_draw_instanced,
                     os.path.dirname(__file__) + '/spec/arb_draw_instanced/execution',
                     recursive=True)
 
+# Group ARB_fragment_program
+arb_fragment_program = Group()
+spec['ARB_fragment_program'] = arb_fragment_program
+add_shader_test_dir(spec['ARB_fragment_program'],
+	            os.path.join(os.path.dirname(__file__), 'spec', 'arb_fragment_program'),
+		    recursive=True)
+
 # Group ARB_fragment_program_shadow
 arb_fragment_program_shadow = Group()
 spec['ARB_fragment_program_shadow'] = arb_fragment_program_shadow
diff --git a/tests/shaders/generic/dph.fp b/tests/shaders/generic/dph.fp
deleted file mode 100644
index a7abbff..0000000
--- a/tests/shaders/generic/dph.fp
+++ /dev/null
@@ -1,18 +0,0 @@
-2 2 0
-tc
- -1.0 0.0 0.0 -0.5
- 0.2 0.0 0.0 0.0
-tex
-expected
- 0.2 0.2 0.2 1.0
-
-tc
- -1.0 0.0 0.0 -0.5
- 0.2 0.0 0.0 0.5
-tex
-expected
- 0.7 0.7 0.7 1.0
-!!ARBfp1.0
-DPH result.color, -fragment.texcoord[0], fragment.texcoord[1];
-MOV result.color.w, 1;
-END
diff --git a/tests/spec/arb_fragment_program/dph.shader_test b/tests/spec/arb_fragment_program/dph.shader_test
new file mode 100644
index 0000000..cb53df5
--- /dev/null
+++ b/tests/spec/arb_fragment_program/dph.shader_test
@@ -0,0 +1,23 @@
+[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
+DPH result.color, -fragment.texcoord[0], fragment.texcoord[1];
+MOV result.color.w, 1;
+END
+
+[test]
+parameter env_vp 0 (-1.0, 0.0, 0.0, -0.5)
+parameter env_vp 1 (0.2, 0.0, 0.0, 0.0)
+draw rect -1 -1 1 2
+relative probe rgba (0.25, 0.5) (0.2, 0.2, 0.2, 1.0);
+
+parameter env_vp 0 (-1.0, 0.0, 0.0, -0.5)
+parameter env_vp 1 (0.2, 0.0, 0.0, 0.5)
+draw rect 0 -1 1 2
+relative probe rgba (0.75, 0.5) (0.7, 0.7, 0.7, 1.0);
-- 
1.7.7.3



More information about the Piglit mailing list