[Piglit] [PATCH 04/11] mesa_shader_integer_functions: Clone arb_gpu_shader5 interpolation tests
Ian Romanick
idr at freedesktop.org
Wed Jun 29 21:23:04 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
GL_MESA_shader_integer_functions does not add the interpolateAt
functions, so all of these tests should fail.
cd tests/spec/mesa_shader_integer_functions/compiler
cp -a ../../arb_gpu_shader5/compiler/interpolation
cd interpolation
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>
---
.../fs-interpolateAtCentroid-array.frag | 25 ++++++++++++++++++
.../fs-interpolateAtCentroid-bad-swizzle.frag | 27 +++++++++++++++++++
.../fs-interpolateAtCentroid-centroid.frag | 30 ++++++++++++++++++++++
.../fs-interpolateAtCentroid-flat.frag | 30 ++++++++++++++++++++++
.../fs-interpolateAtCentroid-no-output.frag | 21 +++++++++++++++
.../fs-interpolateAtCentroid-no-temp.frag | 22 ++++++++++++++++
.../fs-interpolateAtCentroid-no-uniform.frag | 20 +++++++++++++++
.../fs-interpolateAtCentroid-noperspective.frag | 30 ++++++++++++++++++++++
.../interpolation/fs-interpolateAtCentroid.frag | 25 ++++++++++++++++++
.../fs-interpolateAtOffset-nonconst.frag | 27 +++++++++++++++++++
.../interpolation/fs-interpolateAtOffset.frag | 28 ++++++++++++++++++++
.../interpolation/fs-interpolateAtSample.frag | 25 ++++++++++++++++++
12 files changed, 310 insertions(+)
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-array.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-bad-swizzle.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-centroid.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-flat.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-output.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-temp.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-uniform.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-noperspective.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset-nonconst.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtSample.frag
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-array.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-array.frag
new file mode 100644
index 0000000..5e291ae
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-array.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in float v1[2];
+in vec2 v2[2];
+in vec3 v3[2];
+in vec4 v4[2];
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtCentroid(v1[1]), 1, 1, 1);
+ res += vec4(interpolateAtCentroid(v2[1]), 1, 1);
+ res += vec4(interpolateAtCentroid(v3[1]), 1);
+ res += interpolateAtCentroid(v4[1]);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-bad-swizzle.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-bad-swizzle.frag
new file mode 100644
index 0000000..237dbe2
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-bad-swizzle.frag
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// The MESA_shader_integer_functions spec says:
+// "Component selection operators (e.g., ".xy") may not be used when
+// specifying <interpolant>."
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in vec2 v2;
+in vec3 v3;
+in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtCentroid(v2.xy), 1, 1);
+ res += vec4(interpolateAtCentroid(v3.xyz), 1);
+ res += interpolateAtCentroid(v4.xyzw);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-centroid.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-centroid.frag
new file mode 100644
index 0000000..7a47a80
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-centroid.frag
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// From the MESA_shader_integer_functions spec:
+// "If <interpolant> is declared with a "flat" or
+// "centroid" qualifier, the qualifier will have no effect on the
+// interpolated value."
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+centroid in float v1;
+centroid in vec2 v2;
+centroid in vec3 v3;
+centroid in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtCentroid(v1), 1, 1, 1);
+ res += vec4(interpolateAtCentroid(v2), 1, 1);
+ res += vec4(interpolateAtCentroid(v3), 1);
+ res += interpolateAtCentroid(v4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-flat.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-flat.frag
new file mode 100644
index 0000000..a262c0f
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-flat.frag
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// From the MESA_shader_integer_functions spec:
+// "If <interpolant> is declared with a "flat" or
+// "centroid" qualifier, the qualifier will have no effect on the
+// interpolated value."
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+flat in float v1;
+flat in vec2 v2;
+flat in vec3 v3;
+flat in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtCentroid(v1), 1, 1, 1);
+ res += vec4(interpolateAtCentroid(v2), 1, 1);
+ res += vec4(interpolateAtCentroid(v3), 1);
+ res += interpolateAtCentroid(v4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-output.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-output.frag
new file mode 100644
index 0000000..485c1a8
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-output.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+out vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ // <interpolant> must be a shader input.
+
+ res += interpolateAtCentroid(v4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-temp.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-temp.frag
new file mode 100644
index 0000000..f54e304
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-temp.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ // <interpolant> must be a shader input.
+ vec4 t4 = v4;
+
+ res += interpolateAtCentroid(t4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-uniform.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-uniform.frag
new file mode 100644
index 0000000..b3dc724
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-no-uniform.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ // <interpolant> must be a shader input.
+ res += interpolateAtCentroid(v4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-noperspective.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-noperspective.frag
new file mode 100644
index 0000000..4eedb7b
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid-noperspective.frag
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// From the MESA_shader_integer_functions spec:
+// If <interpolant> is declared with the "noperspective"
+// qualifier, the interpolated value will be computed without perspective
+// correction.
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+noperspective in float v1;
+noperspective in vec2 v2;
+noperspective in vec3 v3;
+noperspective in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtCentroid(v1), 1, 1, 1);
+ res += vec4(interpolateAtCentroid(v2), 1, 1);
+ res += vec4(interpolateAtCentroid(v3), 1);
+ res += interpolateAtCentroid(v4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid.frag
new file mode 100644
index 0000000..633aeef
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtCentroid.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in float v1;
+in vec2 v2;
+in vec3 v3;
+in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtCentroid(v1), 1, 1, 1);
+ res += vec4(interpolateAtCentroid(v2), 1, 1);
+ res += vec4(interpolateAtCentroid(v3), 1);
+ res += interpolateAtCentroid(v4);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset-nonconst.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset-nonconst.frag
new file mode 100644
index 0000000..f1526f5
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset-nonconst.frag
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in float v1;
+in vec2 v2;
+in vec3 v3;
+in vec4 v4;
+
+in vec2 offset; // MESA_shader_integer_functions spec says nothing about the offset having to be constant.
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtOffset(v1, offset), 1, 1, 1);
+ res += vec4(interpolateAtOffset(v2, offset), 1, 1);
+ res += vec4(interpolateAtOffset(v3, offset), 1);
+ res += interpolateAtOffset(v4, offset);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset.frag
new file mode 100644
index 0000000..e7942ef
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtOffset.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in float v1;
+in vec2 v2;
+in vec3 v3;
+in vec4 v4;
+
+// MESA_shader_integer_functions requires at least -0.5 .. 0.5 to be supported.
+const vec2 offset = vec2(-0.5, 0.5);
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtOffset(v1, offset), 1, 1, 1);
+ res += vec4(interpolateAtOffset(v2, offset), 1, 1);
+ res += vec4(interpolateAtOffset(v3, offset), 1);
+ res += interpolateAtOffset(v4, offset);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtSample.frag b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtSample.frag
new file mode 100644
index 0000000..c9cf921
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/interpolation/fs-interpolateAtSample.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in float v1;
+in vec2 v2;
+in vec3 v3;
+in vec4 v4;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += vec4(interpolateAtSample(v1, 0), 1, 1, 1);
+ res += vec4(interpolateAtSample(v2, 1), 1, 1);
+ res += vec4(interpolateAtSample(v3, 2), 1);
+ res += interpolateAtSample(v4, 3);
+
+ gl_FragColor = res;
+}
--
2.5.5
More information about the Piglit
mailing list