[Piglit] [PATCH 1/4] arb-enhanced-layout: explicit-offset: add block layout tests

Emil Velikov emil.l.velikov at gmail.com
Sun Oct 25 09:47:19 PDT 2015


From: Emil Velikov <emil.velikov at collabora.com>

As per the spec the block must be of std140 (or std430 if using ssbo)
layout.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 .../compiler/explicit-offsets/packed-layout.vert   | 25 ++++++++++++++++++++++
 .../compiler/explicit-offsets/shared-layout.vert   | 25 ++++++++++++++++++++++
 .../compiler/explicit-offsets/std140-layout.vert   | 25 ++++++++++++++++++++++
 3 files changed, 75 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layout/compiler/explicit-offsets/packed-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layout/compiler/explicit-offsets/shared-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layout/compiler/explicit-offsets/std140-layout.vert

diff --git a/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/packed-layout.vert b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/packed-layout.vert
new file mode 100644
index 0000000..f55852a
--- /dev/null
+++ b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/packed-layout.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//    "The *offset* qualifier can only be used on block members of blocks 
+//    declared with *std140* or *std430* layouts.
+//
+// Tests for compiler error, when the block is of packed layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(packed) uniform block {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/shared-layout.vert b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/shared-layout.vert
new file mode 100644
index 0000000..f837794
--- /dev/null
+++ b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/shared-layout.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//    "The *offset* qualifier can only be used on block members of blocks 
+//    declared with *std140* or *std430* layouts.
+//
+// Tests for compiler error, when the block is of shared layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(shared) uniform block {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/std140-layout.vert b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/std140-layout.vert
new file mode 100644
index 0000000..b89c7ab
--- /dev/null
+++ b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/std140-layout.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// ARB_enhanced_layouts spec says:
+//    "The *offset* qualifier can only be used on block members of blocks 
+//    declared with *std140* or *std430* layouts.
+//
+// Tests for successful compilation, when the block is of std140 layout.
+//
+
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140) uniform block {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
-- 
2.6.1



More information about the Piglit mailing list