[Piglit] [PATCH] arb_gpu_shader5: test member stream qualifiers match a named blocks qualifier

Timothy Arceri t_arceri at yahoo.com.au
Sat Oct 17 02:21:06 PDT 2015


Named and unnamed interfaces have different code paths in Mesa this
uncovers a bug with named instances.
---
 ...ltiple-named-block-layout-qualifier-stream.geom | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom

diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
new file mode 100644
index 0000000..83a4ff3
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
@@ -0,0 +1,32 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// check_link: false
+// [end config]
+//
+// ARB_gpu_shader5 spec says:
+//   "A block member may be declared with a stream
+//    qualifier, but the specified stream must match the stream
+//    associated with the containing block."
+//
+// Tests for multiple declarations of layout qualifier 'stream' for
+// block's fields.
+//
+
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(points) in;
+layout(triangle_strip, max_vertices=3) out;
+
+out Block1 { // By default, it uses stream = 0
+	layout(stream=1) vec4 var1; // Wrong: different than block's stream value
+	layout(stream=3) vec4 var2; // Wrong: different than block's stream value
+	layout(stream=0) vec4 var3; // Valid
+	vec4 var4; // Valid
+} block_name;
+
+void main()
+{
+}
-- 
2.4.3



More information about the Piglit mailing list