Re: [Piglit] [PATCH] spec/glsl-es-1.00/linker: test pass cases for invariant conditions

2016-05-17 Thread Lars Hamre
Gentle ping, if nobody has any issues I would appreciate a push.
In reference to this mesa patch:
https://lists.freedesktop.org/archives/mesa-dev/2016-May/116073.html

Regards,
Lars Hamre

On Fri, May 6, 2016 at 4:23 PM, Lars Hamre <cheme...@gmail.com> wrote:
> These test the cases where gl_FragCoord and gl_PointCoord are
> allowed to be declared invariant.
>
> Signed-off-by: Lars Hamre <cheme...@gmail.com>
>
> ---
>
> NOTE: someone with access will need to commit this after the
>   review process
>
>  .../linker/glsl-fcoord-invariant-pass.shader_test  | 27 +
>  .../linker/glsl-pcoord-invariant-pass.shader_test  | 28 
> ++
>  2 files changed, 55 insertions(+)
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
>
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test 
> b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> new file mode 100644
> index 000..76348a6
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> @@ -0,0 +1,27 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +#"For the built-in special variables, gl_FragCoord can
> +#only be declared invariant if and only if gl_Position is
> +#declared invariant. Similarly gl_PointCoord can only be
> +#declared invariant if and only if gl_PointSize is declared
> +#invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +invariant gl_Position;
> +void main() {
> +   gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_FragCoord;
> +void main() {
> +   gl_FragColor = vec4(gl_FragCoord.x);
> +}
> +
> +[test]
> +link success
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test 
> b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> new file mode 100644
> index 000..c0e9673
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> @@ -0,0 +1,28 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +#"For the built-in special variables, gl_FragCoord can
> +#only be declared invariant if and only if gl_Position is
> +#declared invariant. Similarly gl_PointCoord can only be
> +#declared invariant if and only if gl_PointSize is declared
> +#invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +invariant gl_PointSize;
> +void main() {
> +   gl_PointSize = 1.0;
> +   gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_PointCoord;
> +void main() {
> +   gl_FragColor = vec4(gl_PointCoord.x);
> +}
> +
> +[test]
> +link success
> --
> 2.5.5
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] spec/glsl-es-1.00/linker: test pass cases for invariant conditions

2016-05-06 Thread Lars Hamre
These test the cases where gl_FragCoord and gl_PointCoord are
allowed to be declared invariant.

Signed-off-by: Lars Hamre <cheme...@gmail.com>

---

NOTE: someone with access will need to commit this after the
  review process

 .../linker/glsl-fcoord-invariant-pass.shader_test  | 27 +
 .../linker/glsl-pcoord-invariant-pass.shader_test  | 28 ++
 2 files changed, 55 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test 
b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
new file mode 100644
index 000..76348a6
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
@@ -0,0 +1,27 @@
+#
+# OpenGL ES 1.00 specification "Invariance and linkage":
+#
+#"For the built-in special variables, gl_FragCoord can
+#only be declared invariant if and only if gl_Position is
+#declared invariant. Similarly gl_PointCoord can only be
+#declared invariant if and only if gl_PointSize is declared
+#invariant. It is an error to declare gl_FrontFacing as invariant."
+#
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+invariant gl_Position;
+void main() {
+   gl_Position = vec4(0.0);
+}
+
+[fragment shader]
+invariant gl_FragCoord;
+void main() {
+   gl_FragColor = vec4(gl_FragCoord.x);
+}
+
+[test]
+link success
diff --git 
a/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test 
b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
new file mode 100644
index 000..c0e9673
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
@@ -0,0 +1,28 @@
+#
+# OpenGL ES 1.00 specification "Invariance and linkage":
+#
+#"For the built-in special variables, gl_FragCoord can
+#only be declared invariant if and only if gl_Position is
+#declared invariant. Similarly gl_PointCoord can only be
+#declared invariant if and only if gl_PointSize is declared
+#invariant. It is an error to declare gl_FrontFacing as invariant."
+#
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+invariant gl_PointSize;
+void main() {
+   gl_PointSize = 1.0;
+   gl_Position = vec4(0.0);
+}
+
+[fragment shader]
+invariant gl_PointCoord;
+void main() {
+   gl_FragColor = vec4(gl_PointCoord.x);
+}
+
+[test]
+link success
--
2.5.5

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


[Piglit] [PATCH] glsl-1.10/execution: Extend tests for early returns

2016-04-26 Thread Lars Hamre
Modifies existing early return tests to test both
code paths (with and without an early return).

Adds an additional test where the early return ends
up being the final instruction.

Per feedback on this mesa patch:
https://lists.freedesktop.org/archives/mesa-dev/2016-April/114706.html

Signed-off-by: Lars Hamre <cheme...@gmail.com>

---

CC: Timothy Arceri <timothy.arc...@collabora.com>

NOTE: someone with access will need to commit this
  after the review process

 .../vs-float-main-return-at-end.shader_test| 31 ++
 .../execution/vs-float-main-return.shader_test |  3 +++
 .../execution/vs-vec2-main-return.shader_test  |  3 +++
 .../execution/vs-vec3-main-return.shader_test  |  3 +++
 .../execution/vs-vec4-main-return.shader_test  |  3 +++
 5 files changed, 43 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test

diff --git 
a/tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test 
b/tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test
new file mode 100644
index 000..a83fa7f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-float-main-return-at-end.shader_test
@@ -0,0 +1,31 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int early_return;
+varying float foo1;
+void main()
+{
+   gl_Position = gl_Vertex;
+   foo1 = 0.5;
+   if (early_return != 0) {
+   foo1 = 0.2;
+   return;
+   }
+}
+
+[fragment shader]
+varying float foo1;
+void main()
+{
+   gl_FragColor = vec4(foo1);
+}
+
+[test]
+
+uniform int early_return 1
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.5 0.5 0.5
diff --git a/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test
index e15e12b..d385571 100644
--- a/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-float-main-return.shader_test
@@ -25,3 +25,6 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2
diff --git a/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test
index ada67ef..df74500 100644
--- a/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-vec2-main-return.shader_test
@@ -26,4 +26,7 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2

diff --git a/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test
index a688934..28c3faa 100644
--- a/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-vec3-main-return.shader_test
@@ -25,4 +25,7 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2

diff --git a/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test 
b/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test
index b5b02dc..fc22c4b 100644
--- a/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test
+++ b/tests/spec/glsl-1.10/execution/vs-vec4-main-return.shader_test
@@ -25,4 +25,7 @@ void main()
 uniform int early_return 1
 draw rect -1 -1 2 2
 probe all rgba 0.5 0.5 0.5 0.5
+uniform int early_return 0
+draw rect -1 -1 2 2
+probe all rgba 0.2 0.2 0.2 0.2

--
2.5.5

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


Re: [Piglit] [PATCH] Drop floating point suffix from a GLSL 1.10 shader.

2016-03-29 Thread Lars Hamre
Looks good!
Reviewed-by: Lars Hamre <cheme...@gmail.com>
On Mar 29, 2016 01:30, "Kenneth Graunke" <kenn...@whitecape.org> wrote:

> The 'f' suffix isn't required, and in fact it isn't technically allowed
> in GLSL 1.10 either.
>
> Cc: Lars Hamre <cheme...@gmail.com>
> ---
>  tests/spec/arb_texture_cube_map_array/cubemap-lod.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Hi Lars,
>
> I noticed this Piglit test regressed when applying your Mesa patch.
> It turns out the test was broken :)
>
>  --Ken
>
> diff --git a/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
> b/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
> index ceb347b..2816f9e 100644
> --- a/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
> +++ b/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
> @@ -80,7 +80,7 @@ static const char *frag_shader_biased =
>   "uniform samplerCubeArray tex; \n"
>   "void main()\n"
>   "{\n"
> - " gl_FragColor = texture(tex, gl_TexCoord[0], 3.0f);\n"
> + " gl_FragColor = texture(tex, gl_TexCoord[0], 3.0);\n"
>   "}\n";
>
>  static const char *frag_shader_explicit =
> @@ -88,7 +88,7 @@ static const char *frag_shader_explicit =
>   "uniform samplerCubeArray tex; \n"
>   "void main()\n"
>   "{\n"
> - " gl_FragColor = textureLod(tex, gl_TexCoord[0], 3.0f);\n"
> + " gl_FragColor = textureLod(tex, gl_TexCoord[0], 3.0);\n"
>   "}\n";
>
>  static GLuint frag_shader_cube_array_biased;
> --
> 2.7.4
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] tests/spec/glsl-1.20: added #version 120 to tests

2016-03-24 Thread Lars Hamre
From: Lars <cheme...@gmail.com>

Adds the #version directive to glsl 1.20 tests so they don't
default to being glsl 1.10.

NOTE: this is my first time contributing to piglit, so someone will
  need to commit these changes after the review process.

Signed-off-by: Lars Hamre <cheme...@gmail.com>

---
 .../glsl-1.20/compiler/literals/valid-float-exponent-with-suffix.vert   | 2 ++
 .../spec/glsl-1.20/compiler/literals/valid-float-suffix-capital-f.vert  | 2 ++
 tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-f.vert| 2 ++
 3 files changed, 6 insertions(+)

diff --git 
a/tests/spec/glsl-1.20/compiler/literals/valid-float-exponent-with-suffix.vert 
b/tests/spec/glsl-1.20/compiler/literals/valid-float-exponent-with-suffix.vert
index d303036..577f739 100644
--- 
a/tests/spec/glsl-1.20/compiler/literals/valid-float-exponent-with-suffix.vert
+++ 
b/tests/spec/glsl-1.20/compiler/literals/valid-float-exponent-with-suffix.vert
@@ -3,6 +3,8 @@
 // glsl_version: 1.20
 // [end config]

+#version 120
+
 void main() {
vec4 f = vec4(1e5f, -1e5f, 1e-5f, -1e-5f);
vec4 g = vec4(1e5F, -1e5F, 1e-5F, -1e-5F);
diff --git 
a/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-capital-f.vert 
b/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-capital-f.vert
index 1173e3e..594a73d 100644
--- a/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-capital-f.vert
+++ b/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-capital-f.vert
@@ -3,6 +3,8 @@
 // glsl_version: 1.20
 // [end config]

+#version 120
+
 void main() {
float f = 1.0F;
gl_Position = vec4(1.0);
diff --git a/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-f.vert 
b/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-f.vert
index 8c910b2..ed518a4 100644
--- a/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-f.vert
+++ b/tests/spec/glsl-1.20/compiler/literals/valid-float-suffix-f.vert
@@ -3,6 +3,8 @@
 // glsl_version: 1.20
 // [end config]

+#version 120
+
 void main() {
float f = 1.0f;
gl_Position = vec4(1.0);
--
2.5.5

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