diff options
author | Eric Anholt <eric@anholt.net> | 2010-01-09 02:08:47 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-01-09 11:39:45 -0800 |
commit | 915f5117920aad8eaaf051a2d8a9c6139828352b (patch) | |
tree | 488f81d8d4f7014698ea6c61b9a7c1584acb8af5 | |
parent | 9201af8382927ed492d0a306d23c6dfe2b43ac42 (diff) |
vp-arl-constant-array*.c: New tests for more ways to screw up VP constants.
-rw-r--r-- | tests/all.tests | 2 | ||||
-rw-r--r-- | tests/shaders/generic/vp-arl-constant-array-huge-offset-neg.vpfp | 148 | ||||
-rw-r--r-- | tests/shaders/generic/vp-arl-constant-array-huge-offset.vpfp | 147 |
3 files changed, 297 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index 33c6d104..60391566 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -189,6 +189,8 @@ add_vpfpgeneric('nv-init-zero-reg') add_vpfpgeneric('nv-init-zero-addr') add_vpfpgeneric('vp-arl-constant-array') add_vpfpgeneric('vp-arl-constant-array-huge') +add_vpfpgeneric('vp-arl-constant-array-huge-offset') +add_vpfpgeneric('vp-arl-constant-array-huge-offset-neg') add_vpfpgeneric('vp-arl-env-array') add_vpfpgeneric('vp-arl-local-array') add_vpfpgeneric('vp-arl-neg-array') diff --git a/tests/shaders/generic/vp-arl-constant-array-huge-offset-neg.vpfp b/tests/shaders/generic/vp-arl-constant-array-huge-offset-neg.vpfp new file mode 100644 index 00000000..90651e39 --- /dev/null +++ b/tests/shaders/generic/vp-arl-constant-array-huge-offset-neg.vpfp @@ -0,0 +1,148 @@ +; Tests loading of a variable entry in a large constant array with a negative +; offset. + +!!ARBvp1.0 +OPTION ARB_position_invariant; +PARAM vals[] = { + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0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 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0} + }; +ADDRESS A0; + +ARL A0.x, program.local[0].x; +MOV result.color, vals[A0.x-1]; +END + +!!ARBfp1.0 +MOV result.color, fragment.color; +END + +!!test +vertex.local[0] 1.0 0.0 0.0 0.0 +expected 0.5 1.0 1.0 0.0 +!!test +vertex.local[0] 2.0 0.0 0.0 0.0 +expected 1.0 0.0 0.8 0.0 +!!test +vertex.local[0] 3.0 0.0 0.0 0.0 +expected 1.0 0.0 0.5 0.0 +!!test +vertex.local[0] 4.0 0.0 0.0 0.0 +expected 0.8 1.0 0.0 0.0 + diff --git a/tests/shaders/generic/vp-arl-constant-array-huge-offset.vpfp b/tests/shaders/generic/vp-arl-constant-array-huge-offset.vpfp new file mode 100644 index 00000000..f7255e20 --- /dev/null +++ b/tests/shaders/generic/vp-arl-constant-array-huge-offset.vpfp @@ -0,0 +1,147 @@ +; Tests loading of a variable entry in a large constant array with an offset. + +!!ARBvp1.0 +OPTION ARB_position_invariant; +PARAM vals[] = { + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0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0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0}, + {0.5, 1.0, 2.0, 0.0}, + {1.0, 0.0, 0.8, 0.0}, + {1.0, 0.0, 0.5, 0.0}, + {0.8, 1.0, 0.0, 0.0} + }; +ADDRESS A0; + +ARL A0.x, program.local[0].x; +MOV result.color, vals[A0.x+1]; +END + +!!ARBfp1.0 +MOV result.color, fragment.color; +END + +!!test +vertex.local[0] -1.0 0.0 0.0 0.0 +expected 0.5 1.0 1.0 0.0 +!!test +vertex.local[0] 0.0 0.0 0.0 0.0 +expected 1.0 0.0 0.8 0.0 +!!test +vertex.local[0] 1.0 0.0 0.0 0.0 +expected 1.0 0.0 0.5 0.0 +!!test +vertex.local[0] 2.0 0.0 0.0 0.0 +expected 0.8 1.0 0.0 0.0 + |