[Piglit] [PATCH 2/2] Modify tests for error checking on "flat" keyword to match updated specs.

Paul Berry stereotype441 at gmail.com
Mon Feb 11 16:16:19 PST 2013


All of the GLSL specs from GLSL 1.30 (and GLSL ES 3.00) onward contain
language requiring certain integer variables to be declared with the
"flat" keyword, but they differ in exactly *when* the rule is
enforced:

(a) GLSL 1.30 and 1.40 say that vertex shader outputs having integral
type must be declared as "flat".  There is no restriction on fragment
shader inputs.

(b) GLSL 1.50 through 4.30 say that fragment shader inputs having
integral type must be declared as "flat".  There is no restriction on
vertex shader outputs.

(c) GLSL ES 3.00 says that both vertex shader outputs and fragment
shader inputs having integral type must be declared as "flat".

Previously, Piglit simply checked for behaviour (a).  This patch makes
it check for behaviour (b) in desktop GL and behaviour (c) in GLES.

Rationale: once geometry shader support is included, (b) is the only
sensible choice, because it requires "flat" in just the situations
where it matters.  Since many implementations extend geometry shader
support back before GLSL 1.50 (via ARB_geometry_shader4), it seems
sensible to regard the difference between (a) and (b) as a bug fix
rather than a deliberate behavioural difference, and therefore test
for behaviour (b) even in GLSL 1.30.

Some discussion about this has already happened on the Mesa-dev list.
See:

http://lists.freedesktop.org/archives/mesa-dev/2013-February/034199.html
---
 .../nonflat-int-array.frag                         | 31 ++++++++++++++++++++++
 .../interpolation-qualifiers/nonflat-int.frag      | 26 ++++++++++++++++++
 .../interpolation-qualifiers/nonflat-ivec4.frag    | 26 ++++++++++++++++++
 .../interpolation-qualifiers/nonflat-uint.frag     | 26 ++++++++++++++++++
 .../interpolation-qualifiers/nonflat-uvec4.frag    | 26 ++++++++++++++++++
 .../interpolation-qualifiers/vs-flat-int-02.vert   | 10 ++++++-
 .../interpolation-qualifiers/vs-flat-int-03.vert   | 10 ++++++-
 .../interpolation-qualifiers/vs-flat-int-04.vert   | 10 ++++++-
 .../interpolation-qualifiers/vs-flat-int-05.vert   | 10 ++++++-
 .../nonflat-int-array.frag                         | 22 +++++++++++++++
 .../nonflat-int-array.vert                         | 23 ++++++++++++++++
 .../interpolation-qualifiers/nonflat-int.frag      | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-int.vert      | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-ivec4.frag    | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-ivec4.vert    | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-uint.frag     | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-uint.vert     | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-uvec4.frag    | 22 +++++++++++++++
 .../interpolation-qualifiers/nonflat-uvec4.vert    | 22 +++++++++++++++
 19 files changed, 392 insertions(+), 4 deletions(-)
 create mode 100644 tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int-array.frag
 create mode 100644 tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int.frag
 create mode 100644 tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-ivec4.frag
 create mode 100644 tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uint.frag
 create mode 100644 tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uvec4.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.frag
 create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.vert

diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int-array.frag b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int-array.frag
new file mode 100644
index 0000000..4a610e9
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int-array.frag
@@ -0,0 +1,31 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
+//    "Fragment shader inputs that are signed or unsigned integers or
+//    integer vectors must be qualified with the interpolation qualifier
+//    flat."
+//
+// Note that prior to GLSL 1.50, this requirement is applied to vertex
+// outputs rather than fragment inputs.  That creates problems in the
+// presence of geometry shaders, so we assume the implementation
+// should adopt the GLSL 1.50 rule for all desktop GL shaders.
+//
+// Note also that the text above makes no provision about arrays of
+// integers; this is presumably an oversight, since there is no
+// reasonable way to interpolate a fragment shader input that contains
+// an integer.
+
+#version 130
+
+in int[2] x;
+
+void main()
+{
+	gl_FragColor = vec4(float(x[0]), float(x[1]), 0.0, 0.0);
+}
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int.frag b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int.frag
new file mode 100644
index 0000000..9cfc82e
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-int.frag
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
+//    "Fragment shader inputs that are signed or unsigned integers or
+//    integer vectors must be qualified with the interpolation qualifier
+//    flat."
+//
+// Note that prior to GLSL 1.50, this requirement is applied to vertex
+// outputs rather than fragment inputs.  That creates problems in the
+// presence of geometry shaders, so we assume the implementation
+// should adopt the GLSL 1.50 rule for all desktop GL shaders.
+
+#version 130
+
+in int x;
+
+void main()
+{
+	gl_FragColor = vec4(float(x));
+}
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-ivec4.frag b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-ivec4.frag
new file mode 100644
index 0000000..9fbf4e4
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-ivec4.frag
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
+//    "Fragment shader inputs that are signed or unsigned integers or
+//    integer vectors must be qualified with the interpolation qualifier
+//    flat."
+//
+// Note that prior to GLSL 1.50, this requirement is applied to vertex
+// outputs rather than fragment inputs.  That creates problems in the
+// presence of geometry shaders, so we assume the implementation
+// should adopt the GLSL 1.50 rule for all desktop GL shaders.
+
+#version 130
+
+in ivec4 x;
+
+void main()
+{
+	gl_FragColor = vec4(x);
+}
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uint.frag b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uint.frag
new file mode 100644
index 0000000..e5e114a
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uint.frag
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
+//    "Fragment shader inputs that are signed or unsigned integers or
+//    integer vectors must be qualified with the interpolation qualifier
+//    flat."
+//
+// Note that prior to GLSL 1.50, this requirement is applied to vertex
+// outputs rather than fragment inputs.  That creates problems in the
+// presence of geometry shaders, so we assume the implementation
+// should adopt the GLSL 1.50 rule for all desktop GL shaders.
+
+#version 130
+
+in uint x;
+
+void main()
+{
+	gl_FragColor = vec4(float(x));
+}
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uvec4.frag b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uvec4.frag
new file mode 100644
index 0000000..b8dd7e2
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/nonflat-uvec4.frag
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Inputs") of the GLSL 1.50 spec:
+//    "Fragment shader inputs that are signed or unsigned integers or
+//    integer vectors must be qualified with the interpolation qualifier
+//    flat."
+//
+// Note that prior to GLSL 1.50, this requirement is applied to vertex
+// outputs rather than fragment inputs.  That creates problems in the
+// presence of geometry shaders, so we assume the implementation
+// should adopt the GLSL 1.50 rule for all desktop GL shaders.
+
+#version 130
+
+in uvec4 x;
+
+void main()
+{
+	gl_FragColor = vec4(x);
+}
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-02.vert b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-02.vert
index 4c1cd5c..76e727c 100644
--- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-02.vert
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-02.vert
@@ -1,5 +1,5 @@
 // [config]
-// expect_result: fail
+// expect_result: pass
 // glsl_version: 1.30
 // [end config]
 //
@@ -8,6 +8,14 @@
 // From section 4.3.6 of the GLSL 1.30 spec:
 //     "If a vertex output is a signed or unsigned integer or integer vector,
 //     then it must be qualified with the interpolation qualifier flat."
+//
+// However, in GLSL 1.50, this requirement is shifted to fragment
+// inputs rather than vertex outputs, to accommodate the possibility
+// of geometry shaders.  Since many implementations extend geometry
+// shader support back before GLSL 1.50 (via ARB_geometry_shader4), it
+// seems sensible to regard this change as a bug fix rather than a
+// deliberate behavioural difference, and therefore test for the GLSL
+// 1.50 behaviour even in GLSL 1.30.
 
 #version 130
 
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-03.vert b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-03.vert
index 0dfa696..9fb8566 100644
--- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-03.vert
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-03.vert
@@ -1,5 +1,5 @@
 // [config]
-// expect_result: fail
+// expect_result: pass
 // glsl_version: 1.30
 // [end config]
 //
@@ -8,6 +8,14 @@
 // From section 4.3.6 of the GLSL 1.30 spec:
 //     "If a vertex output is a signed or unsigned integer or integer vector,
 //     then it must be qualified with the interpolation qualifier flat."
+//
+// However, in GLSL 1.50, this requirement is shifted to fragment
+// inputs rather than vertex outputs, to accommodate the possibility
+// of geometry shaders.  Since many implementations extend geometry
+// shader support back before GLSL 1.50 (via ARB_geometry_shader4), it
+// seems sensible to regard this change as a bug fix rather than a
+// deliberate behavioural difference, and therefore test for the GLSL
+// 1.50 behaviour even in GLSL 1.30.
 
 #version 130
 
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-04.vert b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-04.vert
index 3df71de..5337d78 100644
--- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-04.vert
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-04.vert
@@ -1,5 +1,5 @@
 // [config]
-// expect_result: fail
+// expect_result: pass
 // glsl_version: 1.30
 // [end config]
 //
@@ -8,6 +8,14 @@
 // From section 4.3.6 of the GLSL 1.30 spec:
 //     "If a vertex output is a signed or unsigned integer or integer vector,
 //     then it must be qualified with the interpolation qualifier flat."
+//
+// However, in GLSL 1.50, this requirement is shifted to fragment
+// inputs rather than vertex outputs, to accommodate the possibility
+// of geometry shaders.  Since many implementations extend geometry
+// shader support back before GLSL 1.50 (via ARB_geometry_shader4), it
+// seems sensible to regard this change as a bug fix rather than a
+// deliberate behavioural difference, and therefore test for the GLSL
+// 1.50 behaviour even in GLSL 1.30.
 
 #version 130
 
diff --git a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-05.vert b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-05.vert
index 13c0ce1..a096335 100644
--- a/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-05.vert
+++ b/tests/spec/glsl-1.30/compiler/interpolation-qualifiers/vs-flat-int-05.vert
@@ -1,5 +1,5 @@
 // [config]
-// expect_result: fail
+// expect_result: pass
 // glsl_version: 1.30
 // [end config]
 //
@@ -8,6 +8,14 @@
 // From section 4.3.6 of the GLSL 1.30 spec:
 //     "If a vertex output is a signed or unsigned integer or integer vector,
 //     then it must be qualified with the interpolation qualifier flat."
+//
+// However, in GLSL 1.50, this requirement is shifted to fragment
+// inputs rather than vertex outputs, to accommodate the possibility
+// of geometry shaders.  Since many implementations extend geometry
+// shader support back before GLSL 1.50 (via ARB_geometry_shader4), it
+// seems sensible to regard this change as a bug fix rather than a
+// deliberate behavioural difference, and therefore test for the GLSL
+// 1.50 behaviour even in GLSL 1.30.
 
 #version 130
 
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.frag
new file mode 100644
index 0000000..a36ea73
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
+//    "Fragment shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+in int[2] x;
+out highp vec4 color;
+
+void main()
+{
+	color = vec4(float(x[0]), float(x[1]), 0.0, 0.0);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
new file mode 100644
index 0000000..6a5aa17
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral vertex output.
+//
+// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
+//    "Vertex shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+out int[2] x;
+
+void main()
+{
+	gl_Position = vec4(0.0);
+	x[0] = 1;
+	x[1] = 2;
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.frag
new file mode 100644
index 0000000..470ebbf
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
+//    "Fragment shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+in int x;
+out highp vec4 color;
+
+void main()
+{
+	color = vec4(x);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert
new file mode 100644
index 0000000..2e3dde0
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral vertex output.
+//
+// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
+//    "Vertex shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+out int x;
+
+void main()
+{
+	gl_Position = vec4(0.0);
+	x = 1;
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.frag
new file mode 100644
index 0000000..ffdec89
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
+//    "Fragment shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+in ivec4 x;
+out highp vec4 color;
+
+void main()
+{
+	color = vec4(x);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert
new file mode 100644
index 0000000..d28b885
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral vertex output.
+//
+// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
+//    "Vertex shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+out ivec4 x;
+
+void main()
+{
+	gl_Position = vec4(0.0);
+	x = ivec4(1, 2, 3, 4);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.frag
new file mode 100644
index 0000000..52bb49d
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
+//    "Fragment shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+in uint x;
+out highp vec4 color;
+
+void main()
+{
+	color = vec4(x);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert
new file mode 100644
index 0000000..6361db5
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral vertex output.
+//
+// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
+//    "Vertex shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+out uint x;
+
+void main()
+{
+	gl_Position = vec4(0.0);
+	x = 1u;
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.frag
new file mode 100644
index 0000000..86e5702
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral fragment input.
+//
+// From section 4.3.4 ("Input Variables") of the GLSL ES 3.00 spec:
+//    "Fragment shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+in uvec4 x;
+out highp vec4 color;
+
+void main()
+{
+	color = vec4(x);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.vert
new file mode 100644
index 0000000..9425d0b
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.00 es
+// check_link: true
+// [end config]
+//
+// Declare a non-flat integral vertex output.
+//
+// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
+//    "Vertex shader inputs that are, or contain, signed or unsigned
+//    integers or integer vectors must be qualified with the
+//    interpolation qualifier flat."
+
+#version 300 es
+
+out uvec4 x;
+
+void main()
+{
+	gl_Position = vec4(0.0);
+	x = uvec4(1, 2, 3, 4);
+}
-- 
1.8.1.3



More information about the Piglit mailing list