[Piglit] [PATCH 2/2] color-clamping.vpfp: test that VS output colors are clamped to [0, 1]

Marek Olšák maraeo at gmail.com
Thu Apr 5 12:38:16 PDT 2012


There is the same test in piglit already, which uses shader_runner:

tests/shaders/glsl-clamp-vertex-color.shader_test

Marek

On Thu, Apr 5, 2012 at 8:19 PM, Brian Paul <brianp at vmware.com> wrote:
> ---
>  tests/all.tests                           |    1 +
>  tests/shaders/generic/color-clamping.vpfp |   15 +++++++++++++++
>  2 files changed, 16 insertions(+), 0 deletions(-)
>  create mode 100644 tests/shaders/generic/color-clamping.vpfp
>
> diff --git a/tests/all.tests b/tests/all.tests
> index 1a56b67..2eea411 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -512,6 +512,7 @@ def add_vpfpgeneric(name):
>        vpfpgeneric[name] = PlainExecTest(['vpfp-generic', '-auto', testsDir + '/shaders/generic/' + name + '.vpfp'])
>  add_vpfpgeneric('arl')
>  add_vpfpgeneric('big-param')
> +add_vpfpgeneric('color-clamping')
>  add_vpfpgeneric('dataflow-bug')
>  add_vpfpgeneric('fdo30337a')
>  add_vpfpgeneric('fdo30337b')
> diff --git a/tests/shaders/generic/color-clamping.vpfp b/tests/shaders/generic/color-clamping.vpfp
> new file mode 100644
> index 0000000..10b90e5
> --- /dev/null
> +++ b/tests/shaders/generic/color-clamping.vpfp
> @@ -0,0 +1,15 @@
> +; Check that vertex shader color outputs are clamped to [0,1]
> +
> +!!ARBvp1.0
> +OPTION ARB_position_invariant;
> +# Emit any color larger than (1,1,1,1):
> +MOV result.color, {20.0, 20.0, 20.0, 20.0};
> +END
> +
> +!!ARBfp1.0
> +MUL result.color, fragment.color, {0.5, 0.5, 0.5, 0.5};
> +END
> +
> +!!test
> +expected          0.5     0.5      0.5      0.5
> +
> --
> 1.7.3.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list