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

Emil Velikov emil.l.velikov at gmail.com
Wed Nov 11 10:14:53 PST 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

v3:
 - Remove trailing whitespace (Tim)
 - Drop glsl versoin to 1.40 for the ssbo tests (Tim, Ilia)

Test results (Tim):
Nvidia GeForce 840M - NVIDIA 352.41: pass

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..5b7d52c
--- /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: 1.40
+// 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 140
+#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..42966b0
--- /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: 1.40
+// 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 140
+#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..43305f9
--- /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: 1.40
+// 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 140
+#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..7f6bae1
--- /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: 1.40
+// 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 140
+#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..47d2a51
--- /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..8ee3b8d
--- /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..cc00141
--- /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.2



More information about the Piglit mailing list