Re: [Piglit] [PATCH] glsl-1.10: return lowering tests

2016-12-19 Thread Kenneth Graunke
On Tuesday, December 20, 2016 2:32:43 PM PST Timothy Arceri wrote:
> ---
>  .../vs-nested-return-sibling-if.shader_test| 53 
> ++
>  .../vs-nested-return-sibling-if2.shader_test   | 53 
> ++
>  .../vs-nested-return-sibling-loop.shader_test  | 53 
> ++
>  .../vs-nested-return-sibling-loop2.shader_test | 53 
> ++
>  4 files changed, 212 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if.shader_test
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if2.shader_test
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test

These look great.

Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] glsl-1.10: return lowering tests

2016-12-19 Thread Timothy Arceri
---
 .../vs-nested-return-sibling-if.shader_test| 53 ++
 .../vs-nested-return-sibling-if2.shader_test   | 53 ++
 .../vs-nested-return-sibling-loop.shader_test  | 53 ++
 .../vs-nested-return-sibling-loop2.shader_test | 53 ++
 4 files changed, 212 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if2.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test

diff --git 
a/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if.shader_test 
b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if.shader_test
new file mode 100644
index 000..067db42
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if.shader_test
@@ -0,0 +1,53 @@
+# This is designed to test return lowering and check if we handle
+# things correctly when an if contains a nested return as well as a sibling
+# if without a return.
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int a;
+uniform int b;
+uniform int c;
+
+void main()
+{
+  gl_Position = gl_Vertex;
+
+  vec4 colour = vec4(1.0, 0.0, 0.0, 1.0);
+
+  if (a == 1) {
+if (b == 1) {
+   colour = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+if (c == 1) {
+  gl_FrontColor = vec4(1.0, 1.0, 0.0, 1.0);
+  return;
+}
+  }
+
+  gl_FrontColor = colour;
+}
+
+[fragment shader]
+void main()
+{
+  gl_FragColor = gl_Color;
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+
+uniform int a 1
+uniform int b 1
+uniform int c 1
+
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 0.0 1.0
+
+uniform int a 1
+uniform int b 1
+uniform int c 0
+
+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-nested-return-sibling-if2.shader_test 
b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if2.shader_test
new file mode 100644
index 000..b3d45f6
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if2.shader_test
@@ -0,0 +1,53 @@
+# This is designed to test return lowering and check if we handle
+# things correctly when an if contains a nested return as well as a sibling
+# if without a return.
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int a;
+uniform int b;
+uniform int c;
+
+void main()
+{
+  gl_Position = gl_Vertex;
+
+  vec4 colour = vec4(1.0, 0.0, 0.0, 1.0);
+
+  if (a == 1) {
+if (c == 1) {
+  gl_FrontColor = vec4(1.0, 1.0, 0.0, 1.0);
+  return;
+}
+
+if (b == 1) {
+   colour = vec4(0.0, 1.0, 0.0, 1.0);
+}
+  }
+
+  gl_FrontColor = colour;
+}
+
+[fragment shader]
+void main()
+{
+  gl_FragColor = gl_Color;
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+
+uniform int a 1
+uniform int b 1
+uniform int c 1
+
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 0.0 1.0
+
+uniform int a 1
+uniform int b 1
+uniform int c 0
+
+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-nested-return-sibling-loop.shader_test 
b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
new file mode 100644
index 000..8ab24af
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
@@ -0,0 +1,53 @@
+# This is designed to test return lowering and check if we handle
+# things correctly when an if contains a nested return as well as a sibling
+# loop without a return.
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int a;
+uniform int b;
+uniform int c;
+
+void main()
+{
+  gl_Position = gl_Vertex;
+
+  vec4 colour = vec4(1.0, 0.0, 0.0, 1.0);
+
+  if (a == 1) {
+do {
+   colour = vec4(0.0, 1.0, 0.0, 1.0);
+} while (b == 2);
+
+while (c == 1) {
+  gl_FrontColor = vec4(1.0, 1.0, 0.0, 1.0);
+  return;
+}
+  }
+
+  gl_FrontColor = colour;
+}
+
+[fragment shader]
+void main()
+{
+  gl_FragColor = gl_Color;
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+
+uniform int a 1
+uniform int b 1
+uniform int c 1
+
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 0.0 1.0
+
+uniform int a 1
+uniform int b 1
+uniform int c 0
+
+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-nested-return-sibling-loop2.shader_test 
b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test
new file mode 100644
index 000..2ca786b
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test
@@ -0,0 +1,53 @@
+# This is designed to test return lowering and check if we handle
+# things correctly when an if contains a nested return as well as a sibling
+# loop without a return.
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int a;
+uniform int b;
+uniform int c;
+
+void main()
+{
+  gl_Position = gl_Vertex;
+
+  

Re: [Piglit] [PATCH] Add a test for FDO bug #99154

2016-12-19 Thread Kenneth Graunke
On Monday, December 19, 2016 11:57:01 PM PST Niels Ole Salscheider wrote:
> builtin_builder::binop creates variables named x and y. Because of
> a bug these variables had mode ir_var_auto instead of
> ir_var_temporary. In this case, the variable names can collide when
> the function is inlined later on.
> Linking will fail in this test if this is the case.
> 
> Signed-off-by: Niels Ole Salscheider 

Reviewed-by: Kenneth Graunke 

and pushed:

To ssh://git.freedesktop.org/git/piglit
   706de0e..b53a7c6  master -> master



signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add a test for FDO bug #99154

2016-12-19 Thread Niels Ole Salscheider
builtin_builder::binop creates variables named x and y. Because of
a bug these variables had mode ir_var_auto instead of
ir_var_temporary. In this case, the variable names can collide when
the function is inlined later on.
Linking will fail in this test if this is the case.

Signed-off-by: Niels Ole Salscheider 
---
 .../shaders/glsl-fs-multiple-builtins.shader_test  | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-multiple-builtins.shader_test

diff --git a/tests/shaders/glsl-fs-multiple-builtins.shader_test 
b/tests/shaders/glsl-fs-multiple-builtins.shader_test
new file mode 100644
index 0..8dbf650f3
--- /dev/null
+++ b/tests/shaders/glsl-fs-multiple-builtins.shader_test
@@ -0,0 +1,22 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+/* Test for FDO bug 99154. builtin_builder::binop creates variables
+ * named x and y. Because of a bug these variables had mode ir_var_auto
+ * instead of ir_var_temporary. In this case, the variable names can
+ * collide when the function is inlined later on.
+ * Linking will fail in this test if this is the case.
+ */
+uniform float t;
+uniform vec3 v1;
+uniform vec3 v2;
+float tc = clamp(t, 1.0, 2.0);
+float d = dot(v1, v2);
+
+void main() {
+}
+
+[test]
+link success
+
-- 
2.11.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit