[Piglit] [PATCH 2/2] arb_gpu_shader_fp64: add non-uniform control flow test for indirect addressing
Anuj Phogat
anuj.phogat at gmail.com
Fri Feb 24 19:39:50 UTC 2017
On Tue, Feb 14, 2017 at 2:20 AM, Samuel Iglesias Gonsálvez
<siglesias at igalia.com> wrote:
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
> ...t-indirect-non-uniform-control-flow.shader_test | 52 +++++++++++++++++
> ...t-indirect-non-uniform-control-flow.shader_test | 68 ++++++++++++++++++++++
> 2 files changed, 120 insertions(+)
> create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
> create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
> new file mode 100644
> index 000000000..f2d4ac592
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
> @@ -0,0 +1,52 @@
> +[require]
> +GLSL >= 4.00
> +GL_ARB_gpu_shader_fp64
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#extension GL_ARB_gpu_shader_fp64 : enable
> +
> +uniform double arg0;
> +uniform double tolerance;
> +uniform dvec4 expected;
> +
> +uniform double arg[7];
> +out vec4 color;
> +
> +void main()
> +{
> + int index;
> + double tol = tolerance;
> + vec4 color2 = vec4(0.0, 1.0, 0.0, 1.0);
> + float cx = gl_FragCoord.x;
> + float cy = gl_FragCoord.y;
> + if (cx == cy) {
> + index = int(arg[6]);
> + } else {
> + index = int(arg[5]);
> + tol = 0.35;
tol = 0.1; ?
> + color2 = vec4(0.0, 0.0, 1.0, 1.0);
> + }
> + dvec4 result = dvec4(arg[index] + arg0);
> + color = distance(result, expected) <= tol
> + ? color2 : vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[test]
> +clear color 0.0 0.0 0.0 0.0
> +
> +clear
> +uniform double arg0 0.25
> +uniform double tolerance 0.0
> +uniform dvec4 expected 0.65 0.65 0.65 0.65
> +uniform double arg[0] 0.1
> +uniform double arg[1] 0.2
> +uniform double arg[2] 0.3
> +uniform double arg[3] 0.4
> +uniform double arg[4] 0.5
> +uniform double arg[5] 2.0
> +uniform double arg[6] 3.0
> +draw rect -1 -1 2 2
> +probe rgba 1 1 0.0 1.0 0.0 1.0
> +probe rgba 1 0 0.0 0.0 1.0 1.0
> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
> new file mode 100644
> index 000000000..80bcec7fc
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
> @@ -0,0 +1,68 @@
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +
> +uniform double arg0;
> +uniform dvec4 expected;
> +
> +uniform double arg[7];
> +
> +in vec4 piglit_vertex;
> +flat out vec4 v;
> +
> +void main()
> +{
> + gl_Position = piglit_vertex;
> +
> + int index;
> + vec4 color2;
> + dvec4 result;
> + dvec4 exp;
> + double tol = 0.01;
> + if (gl_VertexID % 2 == 1) {
> + index = int(arg[6]);
> + color2 = vec4(0.0, 1.0, 0.0, 1.0);
> + result = dvec4(arg[index] + arg0);
> + exp = expected;
> + } else {
> + index = int(arg[5]);
> + color2 = vec4(0.0, 0.0, 1.0, 1.0);
> + result = dvec4(arg[index] + arg0);
You can move above statement out of if-else block.
> + exp = dvec4(0.55, 0.55, 0.55, 0.55);
> + tol = 0.01;
Remove above statement.
> + }
> + v = distance(result, exp) <= tol
> + ? color2 : vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +flat in vec4 v;
> +out vec4 color;
> +
> +void main()
> +{
> + color = v;
> +}
> +
> +[test]
> +clear color 0.0 0.0 0.0 0.0
> +
> +clear
> +uniform double arg0 0.25
> +uniform dvec4 expected 0.65 0.65 0.65 0.65
> +uniform double arg[0] 0.1
> +uniform double arg[1] 0.2
> +uniform double arg[2] 0.3
> +uniform double arg[3] 0.4
> +uniform double arg[4] 0.5
> +uniform double arg[5] 2.0
> +uniform double arg[6] 3.0
> +draw rect -1 -1 2 2
> +probe rgba 127 127 0.0 1.0 0.0 1.0
> +probe rgba 1 1 0.0 0.0 1.0 1.0
> --
> 2.11.0
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list