Re: [Piglit] [PATCH] Add interface blocks that make sure unsized arrays are not allowed.

2013-06-08 Thread Kenneth Graunke

On 06/08/2013 03:21 AM, Fabian Bieler wrote:

On Sat, Jun 8, 2013, at 08:28 AM, Kenneth Graunke wrote:

This is explicitly forbidden: "Geometry shader input blocks [...].  All
other input and output block arrays must specify an array size."

The vertex and fragment shader tests pass on Mesa.  The GS test has not
been tested.

Cc: Jordan Justen 
Signed-off-by: Kenneth Graunke 
---

[...]

a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
new file mode 100644
index 000..f506b72
--- /dev/null
+++
b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: pass

I think this test should fail.
Or the unsized interface block array should be an input block, rather
than an output block.


Oops...too much cut and paste.  Fixed, thanks!

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add interface blocks that make sure unsized arrays are not allowed.

2013-06-08 Thread Fabian Bieler
On Sat, Jun 8, 2013, at 08:28 AM, Kenneth Graunke wrote:
> This is explicitly forbidden: "Geometry shader input blocks [...].  All
> other input and output block arrays must specify an array size."
> 
> The vertex and fragment shader tests pass on Mesa.  The GS test has not
> been tested.
> 
> Cc: Jordan Justen 
> Signed-off-by: Kenneth Graunke 
> ---
[...]
> a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
> b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
> new file mode 100644
> index 000..f506b72
> --- /dev/null
> +++
> b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: pass
I think this test should fail.
Or the unsized interface block array should be an input block, rather
than an output block.
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +
> +#version 150
> +
> +layout(triangles) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +
> +/* From the GLSL 1.50 spefication, section 4.3.7, the second to last
> paragraph:
> + * "Geometry shader input blocks [...].  All other input and output
> block
> + *  arrays must specify an array size."
> + */
> +out block {
> +  vec4 v;
> +} varyings[];
> +
> +void main()
> +{
> +  for (int i = 0; i < 3; i++) {
> +gl_Position = vec4(0.0);
> +varyings[0].v = vec4(1.0);
> +EmitVertex();
> +  }
> +}
[...]
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add interface blocks that make sure unsized arrays are not allowed.

2013-06-07 Thread Kenneth Graunke
This is explicitly forbidden: "Geometry shader input blocks [...].  All
other input and output block arrays must specify an array size."

The vertex and fragment shader tests pass on Mesa.  The GS test has not
been tested.

Cc: Jordan Justen 
Signed-off-by: Kenneth Graunke 
---
 .../interface-blocks-unsized-array-in.frag | 22 ++
 .../interface-blocks-unsized-array-in.vert | 22 ++
 .../interface-blocks-unsized-array-out.geom| 27 ++
 .../interface-blocks-unsized-array-out.vert| 20 
 4 files changed, 91 insertions(+)
 create mode 100644 
tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.frag
 create mode 100644 
tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.vert
 create mode 100644 
tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
 create mode 100644 
tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.vert

diff --git 
a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.frag 
b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.frag
new file mode 100644
index 000..e773b2d
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+
+#version 150
+
+/* From the GLSL 1.50 spefication, section 4.3.7, the second to last paragraph:
+ * "Geometry shader input blocks [...].  All other input and output block
+ *  arrays must specify an array size."
+ */
+in block {
+  vec4 v;
+} inputs[];
+
+out vec4 a;
+
+void main()
+{
+a = inputs[0].v;
+}
diff --git 
a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.vert 
b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.vert
new file mode 100644
index 000..e903402
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-in.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+
+#version 150
+
+/* From the GLSL 1.50 spefication, section 4.3.7, the second to last paragraph:
+ * "Geometry shader input blocks [...].  All other input and output block
+ *  arrays must specify an array size."
+ */
+in block {
+  vec4 v;
+} attribs[];
+
+out vec4 a;
+
+void main()
+{
+vec4 a = attribs[0].v;
+}
diff --git 
a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom 
b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
new file mode 100644
index 000..f506b72
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.geom
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+/* From the GLSL 1.50 spefication, section 4.3.7, the second to last paragraph:
+ * "Geometry shader input blocks [...].  All other input and output block
+ *  arrays must specify an array size."
+ */
+out block {
+  vec4 v;
+} varyings[];
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+gl_Position = vec4(0.0);
+varyings[0].v = vec4(1.0);
+EmitVertex();
+  }
+}
diff --git 
a/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.vert 
b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.vert
new file mode 100644
index 000..c84b390
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-unsized-array-out.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+
+#version 150
+
+/* From the GLSL 1.50 spefication, section 4.3.7, the second to last paragraph:
+ * "Geometry shader input blocks [...].  All other input and output block
+ *  arrays must specify an array size."
+ */
+out block {
+  vec4 v;
+} varyings[];
+
+void main()
+{
+varyings[0].v = vec4(1.0);
+}
-- 
1.8.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit