[Piglit] [PATCH 05/11] mesa_shader_integer_functions: Clone arb_gpu_shader5 precise qualifier tests
Ian Romanick
idr at freedesktop.org
Wed Jun 29 21:23:05 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
GL_MESA_shader_integer_functions does not add the precise qualifier, so
all of these tests should fail.
cd tests/spec/mesa_shader_integer_functions/compiler
cp -a ../../arb_gpu_shader5/compiler/precise-qualifier .
cd precise-qualifier
for i in *; do
sed --in-place -e 's/1[.]50/1.30/g;s/150/130/g' \
-e 's/ARB_gpu_shader5/MESA_shader_integer_functions/g' \
-e 's/expect_result: pass/expect_result: fail/' \
$i
done
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
.../compiler/precise-qualifier/precise-01.vert | 12 +++++++++++
.../compiler/precise-qualifier/precise-02.vert | 12 +++++++++++
.../compiler/precise-qualifier/precise-03.vert | 14 +++++++++++++
.../compiler/precise-qualifier/precise-04.vert | 14 +++++++++++++
.../compiler/precise-qualifier/precise-05.vert | 12 +++++++++++
.../compiler/precise-qualifier/precise-06.vert | 14 +++++++++++++
.../compiler/precise-qualifier/precise-07.vert | 16 +++++++++++++++
.../compiler/precise-qualifier/precise-08.vert | 14 +++++++++++++
.../compiler/precise-qualifier/precise-09.vert | 15 ++++++++++++++
.../compiler/precise-qualifier/precise-10.vert | 14 +++++++++++++
.../compiler/precise-qualifier/precise-11.vert | 15 ++++++++++++++
.../compiler/precise-qualifier/precise-12.vert | 23 ++++++++++++++++++++++
.../compiler/precise-qualifier/precise-13.vert | 16 +++++++++++++++
13 files changed, 191 insertions(+)
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-01.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-02.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-03.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-04.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-05.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-06.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-07.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-08.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-09.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-10.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-11.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-12.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-13.vert
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-01.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-01.vert
new file mode 100644
index 0000000..db5934e
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-01.vert
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that `precise` is allowed on globals.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+precise vec4 x;
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-02.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-02.vert
new file mode 100644
index 0000000..54b0ca8
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-02.vert
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that `precise` is allowed on shader outputs.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+precise out vec4 x;
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-03.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-03.vert
new file mode 100644
index 0000000..a07cde7
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-03.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that `precise` is allowed on local variables.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+void foo() {
+ precise float x;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-04.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-04.vert
new file mode 100644
index 0000000..5e2a485
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-04.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that `precise` is allowed as a parameter qualifier.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+void foo(precise out float x) {
+ x = 1;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-05.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-05.vert
new file mode 100644
index 0000000..a989770
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-05.vert
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that a redeclaration of a built-in variable at global scope is allowed.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+precise gl_Position;
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-06.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-06.vert
new file mode 100644
index 0000000..0073b9f
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-06.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that a straightforward redeclaration of a user-defined variable
+// at global scope is allowed.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+vec4 x;
+precise x;
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-07.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-07.vert
new file mode 100644
index 0000000..16cdbe5
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-07.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// notable departure from the `invariant` qualifier rules: it seems reasonable
+// to have local precise redeclarations be allowed.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+void foo() {
+ vec4 x;
+ precise x;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-08.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-08.vert
new file mode 100644
index 0000000..4af457d
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-08.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that `precise inout` is allowed on a function parameter
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+void foo(precise inout float x) {
+ x += 1;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-09.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-09.vert
new file mode 100644
index 0000000..f7a2d86
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-09.vert
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that precise redeclarations of function parameters are allowed.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+void foo(out float x) {
+ precise x;
+ x = 1;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-10.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-10.vert
new file mode 100644
index 0000000..28b0b67
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-10.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that precise redeclaration after the first use of a variable is not allowed.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+float x;
+x = 1;
+precise x; /* redeclaration after use */
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-11.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-11.vert
new file mode 100644
index 0000000..1139346
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-11.vert
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that a precise redeclaration of a parameter after use is not allowed.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+void foo(out x) {
+ x = 1;
+ precise x; /* redeclaration after use */
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-12.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-12.vert
new file mode 100644
index 0000000..6c78493
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-12.vert
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that a precise redeclaration of a variable from an enclosing scope is not
+// allowed. this seems unreasonable.
+
+// if we were to support this, it seems there would be two options for the semantics
+// to impose:
+// - have `precise` only apply to uses of x within the function.
+// - have x globally marked precise from this point on, and apply the usual
+// no-redeclaration-after-first-use rules, in program order.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+float x;
+
+void foo() {
+ precise x; /* seems unreasonable */
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-13.vert b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-13.vert
new file mode 100644
index 0000000..af4530c
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/precise-qualifier/precise-13.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// test that the precise qualifier must appear first with multiple qualifications,
+// without ARB_shading_language_420pack.
+
+// the spec says the order of qualification must be:
+// precise-qualifier invariant-qualifier interpolation-qualifier ...
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+invariant precise vec4 x;
--
2.5.5
More information about the Piglit
mailing list