Re: [Piglit] [PATCH] Add tests for GLSL ES 1.00 mismatched uniform precision

2017-11-06 Thread Kenneth Graunke
On Monday, November 6, 2017 11:45:33 AM PST Dylan Baker wrote:
> For ES 1.00 a number of real world android apps depend on uniforms with
> mismatched precision linking as long as those uniforms are used in 1 or
> 0 shader stages. This patch adds a test for both the 0 or 1 test that is
> expected to pass (bug currently fails), and a test for the > 1 case that
> is expected to fail (and does).
> 
> Because GLSL ES 3.00 is more specific (declared uniforms precision must
> match) this also adds similar tests for ES 3.00 that test for failure in
> both cases.
> 
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532

Bugzilla:

> Signed-off-by: Dylan Baker 
> ---
>  ...mismatched-uniform-percision-unused.shader_test | 50 +
>  ...l-mismatched-uniform-percision-used.shader_test | 50 +
>  ...mismatched-uniform-percision-unused.shader_test | 52 
> ++
>  ...l-mismatched-uniform-percision-used.shader_test | 52 
> ++

filenames have a typo, should be 'precision' not 'percision'

>  4 files changed, 204 insertions(+)
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
>  create mode 100644 
> tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  create mode 100644 
> tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test
> 
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  
> b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> new file mode 100644
> index 0..7efca4d79
> --- /dev/null
> +++ 
> b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> @@ -0,0 +1,50 @@
> +# Copyright © 2017 Intel Corporation
> +
> +# Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> +# of this software and associated documentation files (the "Software"), to 
> deal
> +# in the Software without restriction, including without limitation the 
> rights
> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +# copies of the Software, and to permit persons to whom the Software is
> +# furnished to do so, subject to the following conditions:
> +
> +# The above copyright notice and this permission notice shall be included in
> +# all copies or substantial portions of the Software.
> +
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> +# SOFTWARE.
> +
> +# Test for https://bugs.freedesktop.org/show_bug.cgi?id=97532
> +#
> +# for GLSL ES 1.00 a number of apps depend on having different precision in
> +# uniforms in different shader stages, but this is only valid uniforms that 
> are
> +# used in one shader or are unused.
> +
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +precision highp float;
> +uniform float f;
> +uniform mat4 M;

Please delete 'mat4 M' from these tests - it isn't used at all.

With that dropped, and the filename typos fixed,
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


Re: [Piglit] [PATCH] Add tests for GLSL ES 1.00 mismatched uniform precision

2017-11-06 Thread Dylan Baker
Quoting Ilia Mirkin (2017-11-06 11:56:54)
> On Mon, Nov 6, 2017 at 2:52 PM, Dylan Baker  wrote:
> > Quoting Ilia Mirkin (2017-11-06 11:49:05)
> >> On Mon, Nov 6, 2017 at 2:45 PM, Dylan Baker  wrote:
> >>
> >> This test should pass, when written as-is. I think you meant to add
> >> "#version 300 es" at the top? Or is this really meant to be based on
> >> the context? If so, can't you get a ES 3.0 context when requesting an
> >> ES 2.0 one?
> >>
> >>   -ilia
> >
> > I thought that shader_runner added the appropriate #version based on the
> > [require] section, is that incorrect?
> 
> Oh. It might. That sounds familiar.

I found ES 3.00+ tests that do, and others that don't. I'll go ahead and add the
#version just in case.

Dylan


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


Re: [Piglit] [PATCH] Add tests for GLSL ES 1.00 mismatched uniform precision

2017-11-06 Thread Dylan Baker
Quoting Ilia Mirkin (2017-11-06 11:49:05)
> On Mon, Nov 6, 2017 at 2:45 PM, Dylan Baker  wrote:
> > For ES 1.00 a number of real world android apps depend on uniforms with
> > mismatched precision linking as long as those uniforms are used in 1 or
> > 0 shader stages. This patch adds a test for both the 0 or 1 test that is
> > expected to pass (bug currently fails), and a test for the > 1 case that
> > is expected to fail (and does).
> >
> > Because GLSL ES 3.00 is more specific (declared uniforms precision must
> > match) this also adds similar tests for ES 3.00 that test for failure in
> > both cases.
> >
> > bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532
> > Signed-off-by: Dylan Baker 
> > ---
> >  ...mismatched-uniform-percision-unused.shader_test | 50 
> > +
> >  ...l-mismatched-uniform-percision-used.shader_test | 50 
> > +
> >  ...mismatched-uniform-percision-unused.shader_test | 52 
> > ++
> >  ...l-mismatched-uniform-percision-used.shader_test | 52 
> > ++
> >  4 files changed, 204 insertions(+)
> >  create mode 100644 
> > tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> >  create mode 100644 
> > tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
> >  create mode 100644 
> > tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> >  create mode 100644 
> > tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test
> >
> > diff --git 
> > a/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> >  
> > b/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> > new file mode 100644
> > index 0..2440e50d8
> > --- /dev/null
> > +++ 
> > b/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> > @@ -0,0 +1,52 @@
> > +# Copyright © 2017 Intel Corporation
> > +
> > +# Permission is hereby granted, free of charge, to any person obtaining a 
> > copy
> > +# of this software and associated documentation files (the "Software"), to 
> > deal
> > +# in the Software without restriction, including without limitation the 
> > rights
> > +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> > +# copies of the Software, and to permit persons to whom the Software is
> > +# furnished to do so, subject to the following conditions:
> > +
> > +# The above copyright notice and this permission notice shall be included 
> > in
> > +# all copies or substantial portions of the Software.
> > +
> > +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
> > OR
> > +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
> > THE
> > +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> > FROM,
> > +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
> > IN THE
> > +# SOFTWARE.
> > +
> > +# Test for https://bugs.freedesktop.org/show_bug.cgi?id=97532
> > +#
> > +# for GLSL ES 1.00 a number of apps depend on having different precision in
> > +# uniforms in different shader stages, but this is only valid uniforms 
> > that are
> > +# used in one shader or are unused. ES 3.0 is much more specific that 
> > declared
> > +# uniforms must match, so this should fail.
> > +
> > +[require]
> > +GL ES >= 3.0
> > +GLSL ES >= 3.00
> > +
> > +[vertex shader]
> > +precision highp float;
> > +uniform float f;
> > +uniform mat4 M;
> > +
> > +void main(void) {
> > +gl_Position = vec4(1.0);
> > +}
> > +
> > +[fragment shader]
> > +precision mediump float;
> > +uniform float f;
> > +uniform mat4 M;
> > +out vec4 fragcolor;
> > +
> > +void main(void) {
> > +fragcolor = vec4(f);
> > +}
> > +
> > +[test]
> > +link error
> 
> This test should pass, when written as-is. I think you meant to add
> "#version 300 es" at the top? Or is this really meant to be based on
> the context? If so, can't you get a ES 3.0 context when requesting an
> ES 2.0 one?
> 
>   -ilia

I thought that shader_runner added the appropriate #version based on the
[require] section, is that incorrect?

Dylan


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


Re: [Piglit] [PATCH] Add tests for GLSL ES 1.00 mismatched uniform precision

2017-11-06 Thread Ilia Mirkin
On Mon, Nov 6, 2017 at 2:45 PM, Dylan Baker  wrote:
> For ES 1.00 a number of real world android apps depend on uniforms with
> mismatched precision linking as long as those uniforms are used in 1 or
> 0 shader stages. This patch adds a test for both the 0 or 1 test that is
> expected to pass (bug currently fails), and a test for the > 1 case that
> is expected to fail (and does).
>
> Because GLSL ES 3.00 is more specific (declared uniforms precision must
> match) this also adds similar tests for ES 3.00 that test for failure in
> both cases.
>
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532
> Signed-off-by: Dylan Baker 
> ---
>  ...mismatched-uniform-percision-unused.shader_test | 50 +
>  ...l-mismatched-uniform-percision-used.shader_test | 50 +
>  ...mismatched-uniform-percision-unused.shader_test | 52 
> ++
>  ...l-mismatched-uniform-percision-used.shader_test | 52 
> ++
>  4 files changed, 204 insertions(+)
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
>  create mode 100644 
> tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  create mode 100644 
> tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test
>
> diff --git 
> a/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  
> b/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> new file mode 100644
> index 0..2440e50d8
> --- /dev/null
> +++ 
> b/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> @@ -0,0 +1,52 @@
> +# Copyright © 2017 Intel Corporation
> +
> +# Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> +# of this software and associated documentation files (the "Software"), to 
> deal
> +# in the Software without restriction, including without limitation the 
> rights
> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +# copies of the Software, and to permit persons to whom the Software is
> +# furnished to do so, subject to the following conditions:
> +
> +# The above copyright notice and this permission notice shall be included in
> +# all copies or substantial portions of the Software.
> +
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> +# SOFTWARE.
> +
> +# Test for https://bugs.freedesktop.org/show_bug.cgi?id=97532
> +#
> +# for GLSL ES 1.00 a number of apps depend on having different precision in
> +# uniforms in different shader stages, but this is only valid uniforms that 
> are
> +# used in one shader or are unused. ES 3.0 is much more specific that 
> declared
> +# uniforms must match, so this should fail.
> +
> +[require]
> +GL ES >= 3.0
> +GLSL ES >= 3.00
> +
> +[vertex shader]
> +precision highp float;
> +uniform float f;
> +uniform mat4 M;
> +
> +void main(void) {
> +gl_Position = vec4(1.0);
> +}
> +
> +[fragment shader]
> +precision mediump float;
> +uniform float f;
> +uniform mat4 M;
> +out vec4 fragcolor;
> +
> +void main(void) {
> +fragcolor = vec4(f);
> +}
> +
> +[test]
> +link error

This test should pass, when written as-is. I think you meant to add
"#version 300 es" at the top? Or is this really meant to be based on
the context? If so, can't you get a ES 3.0 context when requesting an
ES 2.0 one?

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


[Piglit] [PATCH] Add tests for GLSL ES 1.00 mismatched uniform precision

2017-11-06 Thread Dylan Baker
For ES 1.00 a number of real world android apps depend on uniforms with
mismatched precision linking as long as those uniforms are used in 1 or
0 shader stages. This patch adds a test for both the 0 or 1 test that is
expected to pass (bug currently fails), and a test for the > 1 case that
is expected to fail (and does).

Because GLSL ES 3.00 is more specific (declared uniforms precision must
match) this also adds similar tests for ES 3.00 that test for failure in
both cases.

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532
Signed-off-by: Dylan Baker 
---
 ...mismatched-uniform-percision-unused.shader_test | 50 +
 ...l-mismatched-uniform-percision-used.shader_test | 50 +
 ...mismatched-uniform-percision-unused.shader_test | 52 ++
 ...l-mismatched-uniform-percision-used.shader_test | 52 ++
 4 files changed, 204 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
 create mode 100644 
tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
 create mode 100644 
tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
 
b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
new file mode 100644
index 0..7efca4d79
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
@@ -0,0 +1,50 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# Test for https://bugs.freedesktop.org/show_bug.cgi?id=97532
+#
+# for GLSL ES 1.00 a number of apps depend on having different precision in
+# uniforms in different shader stages, but this is only valid uniforms that are
+# used in one shader or are unused.
+
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+precision highp float;
+uniform float f;
+uniform mat4 M;
+
+void main(void) {
+gl_Position = vec4(1.0);
+}
+
+[fragment shader]
+precision mediump float;
+uniform float f;
+uniform mat4 M;
+
+void main(void) {
+gl_FragColor = vec4(f);
+}
+
+[test]
+link success
diff --git 
a/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
 
b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
new file mode 100644
index 0..560f25242
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
@@ -0,0 +1,50 @@
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# Test for https://bugs.freedesktop.org/show_bug.cgi?id=97532
+#
+# for GLSL ES 1.00 a number of