[Piglit] [PATCH 2/2] arb_shader_group_vote: Add simple vertex shader tests

Timothy Arceri tarceri at itsqueeze.com
Fri Jul 21 04:27:56 UTC 2017


On 21/07/17 09:54, Matt Turner wrote:
> ---
>   .../arb_shader_group_vote/vs-all-const.shader_test | 33 ++++++++++++++++++++
>   .../vs-all-uniform.shader_test                     | 35 ++++++++++++++++++++++
>   .../arb_shader_group_vote/vs-any-const.shader_test | 33 ++++++++++++++++++++
>   .../vs-any-uniform.shader_test                     | 35 ++++++++++++++++++++++
>   .../arb_shader_group_vote/vs-eq-const.shader_test  | 33 ++++++++++++++++++++
>   .../vs-eq-uniform.shader_test                      | 35 ++++++++++++++++++++++
>   6 files changed, 204 insertions(+)
>   create mode 100644 tests/spec/arb_shader_group_vote/vs-all-const.shader_test
>   create mode 100644 tests/spec/arb_shader_group_vote/vs-all-uniform.shader_test
>   create mode 100644 tests/spec/arb_shader_group_vote/vs-any-const.shader_test
>   create mode 100644 tests/spec/arb_shader_group_vote/vs-any-uniform.shader_test
>   create mode 100644 tests/spec/arb_shader_group_vote/vs-eq-const.shader_test
>   create mode 100644 tests/spec/arb_shader_group_vote/vs-eq-uniform.shader_test
> 
> diff --git a/tests/spec/arb_shader_group_vote/vs-all-const.shader_test b/tests/spec/arb_shader_group_vote/vs-all-const.shader_test
> new file mode 100644
> index 000000000..b7020144f
> --- /dev/null
> +++ b/tests/spec/arb_shader_group_vote/vs-all-const.shader_test
> @@ -0,0 +1,33 @@

# From the ARB_shader_group_vote spec:
#
#    "... allInvocationsARB() is guaranteed to return false if
#     <value> is false."
#

> +[require]
> +GL >= 3.2
> +GLSL >= 1.50
> +GL_ARB_shader_group_vote
> +
> +[vertex shader]
> +#extension GL_ARB_shader_group_vote: enable
> +
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  if (!allInvocationsARB(false))
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +  else
> +    color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +out vec4 frag_color;
> +
> +void main()
> +{
> +  frag_color = color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_shader_group_vote/vs-all-uniform.shader_test b/tests/spec/arb_shader_group_vote/vs-all-uniform.shader_test
> new file mode 100644
> index 000000000..75ecd6f05
> --- /dev/null
> +++ b/tests/spec/arb_shader_group_vote/vs-all-uniform.shader_test
> @@ -0,0 +1,35 @@

# From the ARB_shader_group_vote spec:
#
#    "... allInvocationsARB() is guaranteed to return false if
#     <value> is false."
#

> +[require]
> +GL >= 3.2
> +GLSL >= 1.50
> +GL_ARB_shader_group_vote
> +
> +[vertex shader]
> +#extension GL_ARB_shader_group_vote: enable
> +
> +uniform bool val;
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  if (!allInvocationsARB(val))
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +  else
> +    color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +out vec4 frag_color;
> +
> +void main()
> +{
> +  frag_color = color;
> +}
> +
> +[test]
> +uniform int val 0
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_shader_group_vote/vs-any-const.shader_test b/tests/spec/arb_shader_group_vote/vs-any-const.shader_test
> new file mode 100644
> index 000000000..c173b3e15
> --- /dev/null
> +++ b/tests/spec/arb_shader_group_vote/vs-any-const.shader_test
> @@ -0,0 +1,33 @@

# From the ARB_shader_group_vote spec:
#
#    "... anyInvocationARB() is guaranteed to return true if
#     <value> is true ..."
#

> +[require]
> +GL >= 3.2
> +GLSL >= 1.50
> +GL_ARB_shader_group_vote
> +
> +[vertex shader]
> +#extension GL_ARB_shader_group_vote: enable
> +
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  if (anyInvocationARB(true))
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +  else
> +    color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +out vec4 frag_color;
> +
> +void main()
> +{
> +  frag_color = color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_shader_group_vote/vs-any-uniform.shader_test b/tests/spec/arb_shader_group_vote/vs-any-uniform.shader_test
> new file mode 100644
> index 000000000..e52bcc998
> --- /dev/null
> +++ b/tests/spec/arb_shader_group_vote/vs-any-uniform.shader_test
> @@ -0,0 +1,35 @@

# From the ARB_shader_group_vote spec:
#
#    "... anyInvocationARB() is guaranteed to return true if
#     <value> is true ..."
#

> +[require]
> +GL >= 3.2
> +GLSL >= 1.50
> +GL_ARB_shader_group_vote
> +
> +[vertex shader]
> +#extension GL_ARB_shader_group_vote: enable
> +
> +uniform bool val;
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  if (anyInvocationARB(val))
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +  else
> +    color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +out vec4 frag_color;
> +
> +void main()
> +{
> +  frag_color = color;
> +}
> +
> +[test]
> +uniform int val 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_shader_group_vote/vs-eq-const.shader_test b/tests/spec/arb_shader_group_vote/vs-eq-const.shader_test
> new file mode 100644
> index 000000000..549b158a8
> --- /dev/null
> +++ b/tests/spec/arb_shader_group_vote/vs-eq-const.shader_test
> @@ -0,0 +1,33 @@

# From the ARB_shader_group_vote spec:
#
#    "The function allInvocationsEqualARB() returns true if <value> is
#     the same for all active invocations in the group."
#

> +[require]
> +GL >= 3.2
> +GLSL >= 1.50
> +GL_ARB_shader_group_vote
> +
> +[vertex shader]
> +#extension GL_ARB_shader_group_vote: enable
> +
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  if (allInvocationsEqualARB(true) && allInvocationsEqualARB(false))
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +  else
> +    color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +out vec4 frag_color;
> +
> +void main()
> +{
> +  frag_color = color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/arb_shader_group_vote/vs-eq-uniform.shader_test b/tests/spec/arb_shader_group_vote/vs-eq-uniform.shader_test
> new file mode 100644
> index 000000000..f1b8d6de8
> --- /dev/null
> +++ b/tests/spec/arb_shader_group_vote/vs-eq-uniform.shader_test
> @@ -0,0 +1,35 @@

# From the ARB_shader_group_vote spec:
#
#    "The function allInvocationsEqualARB() returns true if <value> is
#     the same for all active invocations in the group."
#

> +[require]
> +GL >= 3.2
> +GLSL >= 1.50
> +GL_ARB_shader_group_vote
> +
> +[vertex shader]
> +#extension GL_ARB_shader_group_vote: enable
> +
> +uniform bool val;
> +in vec4 piglit_vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  if (allInvocationsEqualARB(val) && allInvocationsEqualARB(!val))
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +  else
> +    color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +out vec4 frag_color;
> +
> +void main()
> +{
> +  frag_color = color;
> +}
> +
> +[test]
> +uniform int val 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> 

With the spec quotes above added this patch is:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>


More information about the Piglit mailing list