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

Dylan Baker dylan at pnwbakers.com
Mon Nov 6 19:45:33 UTC 2017


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 <dylanx.c.baker at intel.com>
---
 ...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 000000000..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 000000000..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 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(f);
+}
+
+[fragment shader]
+precision mediump float;
+uniform float f;
+uniform mat4 M;
+
+void main(void) {
+    gl_FragColor = vec4(f);
+}
+
+[test]
+link error
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 000000000..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
diff --git a/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test b/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test
new file mode 100644
index 000000000..dbd9f8752
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.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(f);
+}
+
+[fragment shader]
+precision mediump float;
+uniform float f;
+uniform mat4 M;
+out vec4 fragcolor;
+
+void main(void) {
+    fragcolor = vec4(f);
+}
+
+[test]
+link error
-- 
2.15.0



More information about the Piglit mailing list