aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/all.tests7
-rw-r--r--tests/shaders/generic/dph.fp18
-rw-r--r--tests/spec/arb_fragment_program/dph.shader_test23
3 files changed, 30 insertions, 18 deletions
diff --git a/tests/all.tests b/tests/all.tests
index f1139828..2ef025be 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -979,6 +979,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 a7abbffc..00000000
--- 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 00000000..cb53df58
--- /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);