[Piglit] [PATCH 4/4] arb-enhanced-layout: explicit-offset: offset wrt (self) alignment

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


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

As per the spec hunk:
    "The *offset* qualifier can only be used on block members of blocks
    declared with *std140* or *std430* layouts.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 .../offset-multiple-of-base-member-align.vert      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layout/compiler/explicit-offsets/offset-multiple-of-base-member-align.vert

diff --git a/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/offset-multiple-of-base-member-align.vert b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/offset-multiple-of-base-member-align.vert
new file mode 100644
index 0000000..b3ce2e2
--- /dev/null
+++ b/tests/spec/arb_enhanced_layout/compiler/explicit-offsets/offset-multiple-of-base-member-align.vert
@@ -0,0 +1,26 @@
+// [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 specified offset must be a 
+//    multiple of the base alignment of the type of the block member it 
+//    qualifies, or a compile-time error results."
+//
+// 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) float f1;
+       layout(offset = 2) float f2; // Wrong: offset must be aligned to multiple of sizeof(float)
+};
+
+void main()
+{
+}
-- 
2.6.1



More information about the Piglit mailing list