summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-01-06 10:39:51 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2016-01-18 12:24:55 +1100
commita5bb6efb27b8455376f4f79b3b6b7fb4a94f559e (patch)
tree74e02d3e5d5da9f7a74997511ef3b3258a1063dc
parentfc0ca07cd79ee8dfb744f6f1b8f8a365ead3d58c (diff)
arb_shader_storage_buffer_object: test GL_BUFFER_DATA_SIZE for arrays of arrays
-rw-r--r--tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test36
-rw-r--r--tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test36
2 files changed, 72 insertions, 0 deletions
diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
new file mode 100644
index 000000000..ae5e682cb
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
@@ -0,0 +1,36 @@
+# From ARB_program_interface_query spec:
+#
+# "For the property of BUFFER_DATA_SIZE, then the implementation-dependent
+# minimum total buffer object size, in basic machine units, required to
+# hold all active variables associated with an active uniform block, shader
+# storage block, or atomic counter buffer is written to <params>. If the
+# final member of an active shader storage block is array with no declared
+# size, the minimum buffer size is computed assuming the array was declared
+# as an array with one element."
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+#extension GL_ARB_arrays_of_arrays: require
+
+buffer a {
+ vec4 s;
+ vec4 aoa[2][2];
+} b;
+
+in vec4 piglit_vertex;
+out vec4 c;
+
+void main(void) {
+ c = b.s;
+
+ gl_Position = piglit_vertex;
+}
+
+[test]
+verify program_interface_query GL_SHADER_STORAGE_BLOCK a GL_BUFFER_DATA_SIZE 80
diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test
new file mode 100644
index 000000000..614d30edb
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test
@@ -0,0 +1,36 @@
+# From ARB_program_interface_query spec:
+#
+# "For the property of BUFFER_DATA_SIZE, then the implementation-dependent
+# minimum total buffer object size, in basic machine units, required to
+# hold all active variables associated with an active uniform block, shader
+# storage block, or atomic counter buffer is written to <params>. If the
+# final member of an active shader storage block is array with no declared
+# size, the minimum buffer size is computed assuming the array was declared
+# as an array with one element."
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+#extension GL_ARB_arrays_of_arrays: require
+
+buffer a {
+ vec4 s;
+ vec4 aoa[][2];
+} b;
+
+in vec4 piglit_vertex;
+out vec4 c;
+
+void main(void) {
+ c = b.s;
+
+ gl_Position = piglit_vertex;
+}
+
+[test]
+verify program_interface_query GL_SHADER_STORAGE_BLOCK a GL_BUFFER_DATA_SIZE 48