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

Emil Velikov emil.l.velikov at gmail.com
Tue Oct 27 08:34:41 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.

v2:
 - Fix typo - enhanced-layout > enhanced-layouts
 - Prefix uniform tests with ubo
 - Add ssbo equivalent tests

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 .../explicit-offsets/ssbo-packed-layout.vert       | 26 ++++++++++++++++++++++
 .../explicit-offsets/ssbo-shared-layout.vert       | 26 ++++++++++++++++++++++
 .../explicit-offsets/ssbo-std140-layout.vert       | 26 ++++++++++++++++++++++
 .../explicit-offsets/ssbo-std430-layout.vert       | 26 ++++++++++++++++++++++
 .../explicit-offsets/ubo-packed-layout.vert        | 25 +++++++++++++++++++++
 .../explicit-offsets/ubo-shared-layout.vert        | 25 +++++++++++++++++++++
 .../explicit-offsets/ubo-std140-layout.vert        | 25 +++++++++++++++++++++
 7 files changed, 179 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-packed-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-shared-layout.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-std140-layout.vert

diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert
new file mode 100644
index 0000000..7a98744
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-packed-layout.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 4.30
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_shader_storage_buffer_object
+// 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 430
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(packed) buffer b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert
new file mode 100644
index 0000000..9e44742
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-shared-layout.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 4.30
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_shader_storage_buffer_object
+// 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 430
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(shared) buffer b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
new file mode 100644
index 0000000..d586b81
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std140-layout.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: pass
+// glsl_version: 4.30
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_shader_storage_buffer_object
+// 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 430
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std140) buffer b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert
new file mode 100644
index 0000000..80d97fd
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ssbo-std430-layout.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: pass
+// glsl_version: 4.30
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_shader_storage_buffer_object
+// 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 430
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std430) buffer b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-packed-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-packed-layout.vert
new file mode 100644
index 0000000..f55852a
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-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_layouts/compiler/explicit-offsets/ubo-shared-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-shared-layout.vert
new file mode 100644
index 0000000..f837794
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-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_layouts/compiler/explicit-offsets/ubo-std140-layout.vert b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-std140-layout.vert
new file mode 100644
index 0000000..b89c7ab
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/explicit-offsets/ubo-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