[Piglit] [PATCH] Test inlining of notEqual() triggering constant folding.

Ian Romanick idr at freedesktop.org
Thu Oct 27 10:37:23 PDT 2011


On 10/26/2011 06:38 PM, Paul Berry wrote:
> These tests exercise a bug found in Mesa: if function inlining caused
> an execution of notEqual() to be constant-folded, an assertion failure
> would occur.

Is there a bugzilla entry associated with this problem in Mesa?  If 
there is, it is worth calling it out in this commit message.

Otherwise,

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   .../execution/fs-inline-notequal.shader_test       |   25 +++++++++++++++++++
>   .../execution/vs-inline-notequal.shader_test       |   26 ++++++++++++++++++++
>   2 files changed, 51 insertions(+), 0 deletions(-)
>   create mode 100644 tests/spec/glsl-1.10/execution/fs-inline-notequal.shader_test
>   create mode 100644 tests/spec/glsl-1.10/execution/vs-inline-notequal.shader_test
>
> diff --git a/tests/spec/glsl-1.10/execution/fs-inline-notequal.shader_test b/tests/spec/glsl-1.10/execution/fs-inline-notequal.shader_test
> new file mode 100644
> index 0000000..6def318
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/execution/fs-inline-notequal.shader_test
> @@ -0,0 +1,25 @@
> +# This test exercises a bug found in Mesa: if function inlining caused
> +# an execution of notEqual() to be constant-folded, an assertion
> +# failure would occur.
> +
> +[vertex shader]
> +void main()
> +{
> +  gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +bvec4 foo(vec4 x, vec4 y)
> +{
> +  return notEqual(x, y);
> +}
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo(vec4(0.0, 0.0, 1.0, 1.0),
> +                          vec4(0.0, 1.0, 1.0, 0.0)));
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> diff --git a/tests/spec/glsl-1.10/execution/vs-inline-notequal.shader_test b/tests/spec/glsl-1.10/execution/vs-inline-notequal.shader_test
> new file mode 100644
> index 0000000..a2a0923
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/execution/vs-inline-notequal.shader_test
> @@ -0,0 +1,26 @@
> +# This test exercises a bug found in Mesa: if function inlining caused
> +# an execution of notEqual() to be constant-folded, an assertion
> +# failure would occur.
> +
> +[vertex shader]
> +bvec4 foo(vec4 x, vec4 y)
> +{
> +  return notEqual(x, y);
> +}
> +
> +void main()
> +{
> +  gl_Position = gl_Vertex;
> +  gl_FrontColor = vec4(foo(vec4(0.0, 0.0, 1.0, 1.0),
> +                           vec4(0.0, 1.0, 1.0, 0.0)));
> +}
> +
> +[fragment shader]
> +void main()
> +{
> +  gl_FragColor = gl_Color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0



More information about the Piglit mailing list