diff options
author | Eric Anholt <eric@anholt.net> | 2011-11-29 16:12:56 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-12-12 15:05:49 -0800 |
commit | ba64eef4063f41228dec243d92416c0c97ccc9b0 (patch) | |
tree | 8a4a104ed09caca7bd1b52455d9d96631a587b8f | |
parent | 4ea8aff242ee6c7e1a9c04dd905a3cacea803069 (diff) |
ARB_fragment_program/dph.fp: Convert old dph.fp to shader_runner.
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.
-rw-r--r-- | tests/all.tests | 7 | ||||
-rw-r--r-- | tests/shaders/generic/dph.fp | 18 | ||||
-rw-r--r-- | tests/spec/arb_fragment_program/dph.shader_test | 23 |
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); |