shaders: Reproduce a bug in the i965/anv backend compiler

Submitted by Lionel Landwerlin on Feb. 14, 2019, 6:49 p.m.

Details

Message ID 20190214184914.18095-1-lionel.g.landwerlin@intel.com
State Accepted
Commit ffb5627758eb778178fa2bbc0ee348a65a9b292a
Headers show
Series "shaders: Reproduce a bug in the i965/anv backend compiler" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Lionel Landwerlin Feb. 14, 2019, 6:49 p.m.
We were dropping negations/abs while trying to optimize.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109601
---
 tests/shaders/glsl-bug-109601.shader_test | 28 +++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 tests/shaders/glsl-bug-109601.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/shaders/glsl-bug-109601.shader_test b/tests/shaders/glsl-bug-109601.shader_test
new file mode 100644
index 000000000..c060233e9
--- /dev/null
+++ b/tests/shaders/glsl-bug-109601.shader_test
@@ -0,0 +1,28 @@ 
+[require]
+GL >= 3.0
+GLSL >= 3.30
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_storage_buffer_object: require
+
+uniform int v1;
+uniform float v2;
+
+void main()
+{
+	float a = -(v1 >> 16);
+	gl_FragColor = vec4(a * v2,0.0f,0.0f,1.0f);
+}
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+
+uniform int v1 0x10000
+uniform float v2 -1
+
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.0 1.0

Comments

rb

On Thu, Feb 14, 2019 at 12:49 PM Lionel Landwerlin <
lionel.g.landwerlin@intel.com> wrote:

> We were dropping negations/abs while trying to optimize.
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109601
> ---
>  tests/shaders/glsl-bug-109601.shader_test | 28 +++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 tests/shaders/glsl-bug-109601.shader_test
>
> diff --git a/tests/shaders/glsl-bug-109601.shader_test
> b/tests/shaders/glsl-bug-109601.shader_test
> new file mode 100644
> index 000000000..c060233e9
> --- /dev/null
> +++ b/tests/shaders/glsl-bug-109601.shader_test
> @@ -0,0 +1,28 @@
> +[require]
> +GL >= 3.0
> +GLSL >= 3.30
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 330
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +uniform int v1;
> +uniform float v2;
> +
> +void main()
> +{
> +       float a = -(v1 >> 16);
> +       gl_FragColor = vec4(a * v2,0.0f,0.0f,1.0f);
> +}
> +
> +[test]
> +clear color 0.0 0.0 0.0 0.0
> +clear
> +
> +uniform int v1 0x10000
> +uniform float v2 -1
> +
> +draw rect -1 -1 2 2
> +probe all rgba 1.0 0.0 0.0 1.0
> --
> 2.20.1
>
>