[Piglit] [PATCH 2/2] OES_shader_io_blocks: Test the redactions relative to GLSL 4.4
Ian Romanick
idr at freedesktop.org
Thu May 12 01:27:01 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
This covers most of the differences enumerated by issue #1. The
following items are not tested:
* double-precision scalars and vectors
* matching across shader stages with different qualifiers (other
than precision and "in"/"out").
* References allowing or assuming more than one shader object per
pipeline stage.
I don't think it's particuarly necessary to test the first or third
items, and I'm not really sure what the second item means.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
.../compiler/layout-component.vert | 42 +++++++++++++++
.../compiler/layout-depth_any.frag | 39 ++++++++++++++
.../compiler/layout-depth_greater.frag | 39 ++++++++++++++
.../compiler/layout-depth_less.frag | 39 ++++++++++++++
.../compiler/layout-depth_unchanged.frag | 39 ++++++++++++++
.../compiler/layout-gl_ClipDistance.frag | 43 ++++++++++++++++
.../compiler/layout-gl_ClipDistance.vert | 44 ++++++++++++++++
.../compiler/layout-gl_PerFragment.frag | 43 ++++++++++++++++
.../compiler/layout-location-aliasing.vert | 60 ++++++++++++++++++++++
.../compiler/layout-output-index.frag | 39 ++++++++++++++
10 files changed, 427 insertions(+)
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-component.vert
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-depth_any.frag
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-depth_greater.frag
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-depth_less.frag
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-depth_unchanged.frag
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.frag
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.vert
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-gl_PerFragment.frag
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-location-aliasing.vert
create mode 100644 tests/spec/oes_shader_io_blocks/compiler/layout-output-index.frag
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-component.vert b/tests/spec/oes_shader_io_blocks/compiler/layout-component.vert
new file mode 100644
index 0000000..d85f724
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-component.vert
@@ -0,0 +1,42 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+out vertex {
+ layout(location=0, component=3) float x;
+};
+
+void main(void)
+{
+ gl_Position = vec4(0);
+ x = 3.14;
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-depth_any.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_any.frag
new file mode 100644
index 0000000..5c846d4
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_any.frag
@@ -0,0 +1,39 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+layout(depth_any) out float gl_FragDepth;
+
+void main(void)
+{
+ c = vec4(0);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-depth_greater.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_greater.frag
new file mode 100644
index 0000000..fca2cc4
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_greater.frag
@@ -0,0 +1,39 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+layout(depth_greater) out float gl_FragDepth;
+
+void main(void)
+{
+ c = vec4(0);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-depth_less.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_less.frag
new file mode 100644
index 0000000..004b812
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_less.frag
@@ -0,0 +1,39 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+layout(depth_less) out float gl_FragDepth;
+
+void main(void)
+{
+ c = vec4(0);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-depth_unchanged.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_unchanged.frag
new file mode 100644
index 0000000..078218e
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-depth_unchanged.frag
@@ -0,0 +1,39 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+layout(depth_unchanged) out float gl_FragDepth;
+
+void main(void)
+{
+ c = vec4(0);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.frag
new file mode 100644
index 0000000..a6683b6
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.frag
@@ -0,0 +1,43 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+in float gl_ClipDistance[2];
+
+out vec4 c;
+
+void main(void)
+{
+ c = vec4(gl_ClipDistance[0],
+ gl_ClipDistance[1],
+ 0.0, 1.0);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.vert b/tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.vert
new file mode 100644
index 0000000..ada8b10
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-gl_ClipDistance.vert
@@ -0,0 +1,44 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+out gl_PerVertex {
+ vec4 gl_Position;
+ float gl_ClipDistance[2];
+};
+
+void main(void)
+{
+ gl_Position = vec4(0);
+ gl_ClipDistance[0] = 0.5;
+ gl_ClipDistance[1] = 0.5;
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-gl_PerFragment.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-gl_PerFragment.frag
new file mode 100644
index 0000000..c9033cc
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-gl_PerFragment.frag
@@ -0,0 +1,43 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile).
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+in gl_PerFragment {
+ vec4 gl_Color;
+};
+
+out vec4 c;
+
+void main(void)
+{
+ c = vec4(0);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-location-aliasing.vert b/tests/spec/oes_shader_io_blocks/compiler/layout-location-aliasing.vert
new file mode 100644
index 0000000..02f7d44
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-location-aliasing.vert
@@ -0,0 +1,60 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+layout(location=4) out vertex {
+ vec4 a;
+ vec4 b;
+ vec4 c;
+ layout(location=0) vec4 d;
+ vec4 e;
+ vec4 f;
+ vec4 g; // error - location 4 already occupied
+};
+
+uniform bool flag;
+
+void main(void)
+{
+ gl_Position = vec4(0);
+
+ if (flag)
+ g = vec4(1);
+ else
+ a = vec4(2);
+
+ b = vec4(3);
+ c = vec4(4);
+ d = vec4(5);
+ e = vec4(6);
+ f = vec4(7);
+}
diff --git a/tests/spec/oes_shader_io_blocks/compiler/layout-output-index.frag b/tests/spec/oes_shader_io_blocks/compiler/layout-output-index.frag
new file mode 100644
index 0000000..b0906fd
--- /dev/null
+++ b/tests/spec/oes_shader_io_blocks/compiler/layout-output-index.frag
@@ -0,0 +1,39 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.10 es
+ * require_extensions: GL_OES_shader_io_blocks
+ * [end config]
+ *
+ * The GL_OES_shader_io_blocks spec says:
+ *
+ * "Issues
+ *
+ * (1) What functionality was removed from interface blocks relative to
+ * GL 4.4?
+ *
+ * - Interactions with features not supported by the underlying
+ * ES 3.1 API and Shading Language, including:
+ * * gl_ClipDistance shader inputs and outputs.
+ * * "component" layout
+ * * location aliasing
+ * * fragment shader output "index" layout
+ * * fragment shader gl_FragDepth layout "depth*" qualifiers
+ * * double-precision scalars and vectors
+ * * matching across shader stages with different qualifiers (other
+ * than precision and "in"/"out").
+ * * References allowing or assuming more than one shader object per
+ * pipeline stage.
+ * * gl_PerFragment is not added (only exists in compatibility
+ * profile)."
+ */
+
+#version 310 es
+#extension GL_OES_shader_io_blocks: require
+precision highp float;
+
+layout(location=0, index=0) vec4 c;
+
+void main(void)
+{
+ c = vec4(0);
+}
--
2.5.5
More information about the Piglit
mailing list