[Piglit] [PATCH] arb_shader_storage_buffer_object: test GL_BUFFER_DATA_SIZE for arrays of arrays

Timothy Arceri timothy.arceri at collabora.com
Tue Jan 5 17:11:11 PST 2016


---
 .../sized_arrays_of_arrays_member.shader_test      | 36 ++++++++++++++++++++++
 .../unsized_arrays_of_arrays_member.shader_test    | 36 ++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test

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 0000000..29d130a
--- /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 0000000..7b72703
--- /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
-- 
2.4.3



More information about the Piglit mailing list