[Piglit] [PATCH 03/13] arb_shader_storage_buffer_object: Add linker tests

Samuel Iglesias Gonsalvez siglesias at igalia.com
Wed May 13 23:17:15 PDT 2015


Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
---
 ...hader-storage-block-different-def-2.shader_test | 40 +++++++++++++++++++++
 ...hader-storage-block-different-def-3.shader_test | 40 +++++++++++++++++++++
 .../shader-storage-block-different-def.shader_test | 38 ++++++++++++++++++++
 ...shader-storage-block-different-size.shader_test | 41 ++++++++++++++++++++++
 4 files changed, 159 insertions(+)
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-2.shader_test
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-3.shader_test
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def.shader_test
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-size.shader_test

diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-2.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-2.shader_test
new file mode 100644
index 0000000..093aae9
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-2.shader_test
@@ -0,0 +1,40 @@
+# From the GL_ARB_shader_storage_buffer_object spec:
+#
+#   "The compiler/linker will ensure that multiple programs and
+#    programmable stages containing this definition will share the same memory
+#    layout for this block, as long as all arrays are declared with explicit
+#    sizes and all matrices have matching row_major and/or column_major
+#    qualifications (which may come from a declaration outside the block
+#    definition)"
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+layout(std140) buffer a {
+	float s[3];
+};
+
+void main(void) {
+   s[0] = 0.0;
+}
+
+[fragment shader]
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+layout(std430) buffer a {
+	float s[3];
+};
+
+void main(void) {
+   s[1] = 1.0;
+}
+
+[test]
+link error
\ No newline at end of file
diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-3.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-3.shader_test
new file mode 100644
index 0000000..bf7a230
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-3.shader_test
@@ -0,0 +1,40 @@
+# From the GL_ARB_shader_storage_buffer_object spec:
+#
+#   "The compiler/linker will ensure that multiple programs and
+#    programmable stages containing this definition will share the same memory
+#    layout for this block, as long as all arrays are declared with explicit
+#    sizes and all matrices have matching row_major and/or column_major
+#    qualifications (which may come from a declaration outside the block
+#    definition)"
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+layout(row_major, std430) buffer a {
+	mat4 s;
+};
+
+void main(void) {
+
+}
+
+[fragment shader]
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+layout(column_major, std430) buffer a {
+	mat4 s;
+};
+
+void main(void) {
+
+}
+
+[test]
+link error
\ No newline at end of file
diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def.shader_test
new file mode 100644
index 0000000..6cb2d27
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def.shader_test
@@ -0,0 +1,38 @@
+# From the GL_ARB_shader_storage_buffer_object spec:
+#
+#  "If multiple shaders are linked together, then they will share a single
+#   global buffer variable name space, including within a language as well as
+#   across languages.  Hence, the types of buffer variables with the same name
+#   must match across all shaders that are linked into a single program.
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer a {
+	vec4 s;
+};
+
+void main(void) {
+
+}
+
+[fragment shader]
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer a {
+	vec3 s;
+};
+
+void main(void) {
+
+}
+
+[test]
+link error
\ No newline at end of file
diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-size.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-size.shader_test
new file mode 100644
index 0000000..10d7e92
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-size.shader_test
@@ -0,0 +1,41 @@
+# From the GL_ARB_shader_storage_buffer_object spec:
+#
+#  "When a named shader storage block is declared by multiple shaders in a
+#   program, it must be declared identically in each shader. The buffer
+#   variables within the block must be declared with the same names, types,
+#   qualification, and declaration order.  If a program contains multiple
+#   shaders with different declarations for the same named shader storage
+#   block, the program will fail to link.
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer a {
+	vec4 s;
+} b[2];
+
+void main(void) {
+
+}
+
+[fragment shader]
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer a {
+	vec4 s;
+} b[3];
+
+void main(void) {
+
+}
+
+[test]
+link error
\ No newline at end of file
-- 
2.1.0



More information about the Piglit mailing list