Add a test for mix where the second operand is zero.

Submitted by Kenneth Graunke on March 1, 2014, 9:39 a.m.

Details

Message ID 1393666789-7416-1-git-send-email-kenneth@whitecape.org
State New
Headers show

Not browsing as part of any series.

Commit Message

Kenneth Graunke March 1, 2014, 9:39 a.m.
Reproduces a bug in Mesa's algebraic optimization pass.

See Mesa patch:
"glsl: Fix broken LRP algebraic optimization."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
---
 tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag

Patch hide | download patch | download mbox

diff --git a/tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag b/tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag
new file mode 100644
index 0000000..a0abb46
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag
@@ -0,0 +1,10 @@ 
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// [end config]
+
+uniform vec4 u;
+void main()
+{
+    gl_FragColor = mix(u, vec4(0), u);
+}

Comments

On 1 March 2014 01:39, Kenneth Graunke <kenneth@whitecape.org> wrote:

> Reproduces a bug in Mesa's algebraic optimization pass.
>
> See Mesa patch:
> "glsl: Fix broken LRP algebraic optimization."
>
> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
>

You might want to consider making this a shader_runner test, so that it
confirms that the Mesa fix not only eliminates the crash, but also produces
the correct computation.


> ---
>  tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>  create mode 100644 tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag
>
> diff --git a/tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag
> b/tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag
> new file mode 100644
> index 0000000..a0abb46
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/glsl-fs-mix-y-zero.frag
> @@ -0,0 +1,10 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.10
> +// [end config]
> +
> +uniform vec4 u;
> +void main()
> +{
> +    gl_FragColor = mix(u, vec4(0), u);
> +}
> --
> 1.9.0
>
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>