[Piglit] [PATCH 8/8] arb_gpu_shader5: Add fma constant eval execution test.

Paul Berry stereotype441 at gmail.com
Fri Aug 23 07:29:51 PDT 2013


On 22 August 2013 16:07, Matt Turner <mattst88 at gmail.com> wrote:

> ---
>  .../built-in-functions/const-fma.shader_test       | 38
> ++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>  create mode 100644
> tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test
>
> diff --git
> a/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test
> b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test
> new file mode 100644
> index 0000000..f23ffd7
> --- /dev/null
> +++
> b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-fma.shader_test
> @@ -0,0 +1,38 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader5
> +
> +[vertex shader]
> +in vec4 vertex;
> +
> +void main() {
> +       gl_Position = vertex;
> +}
> +
> +[fragment shader]
> +#extension GL_ARB_gpu_shader5 : enable
> +
> +out vec4 color;
> +
> +void main()
> +{
> +       color = vec4(0.0, 1.0, 0.0, 1.0);
> +
> +       if (vec4(0.0, 1.0, 4.0, 7.0) != fma(vec4(0.0, 0.0, 2.0, 2.0),
> vec4(1.0, 1.0, 2.0, 2.0), vec4(0.0, 1.0, 0.0, 3.0))) {
> +               color.r = 1.0;
> +       }
> +       if (vec4(-1.0, 0.0, -4.0, 1.0) != fma(vec4(0.0, -1.0, 2.0, 2.0),
> vec4(1.0, 1.0, -2.0, 2.0), vec4(-1.0, 1.0, 0.0, -3.0))) {
> +               color.r = 1.0;
> +       }
>

This test doesn't verify that fma() is constant-folded.  I'd recommend
doing the array size trick (see my comments on patch 5/8) here as well.

With that changed, the patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>

Patches 1-4 and 6-7 are also:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 1.8.3.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130823/0e022d48/attachment.html>


More information about the Piglit mailing list