[Piglit] [PATCH] arb_shader_storage_buffer_object: add compiler test for dynamic indexing

Tapani Pälli tapani.palli at intel.com
Thu Oct 1 04:54:27 PDT 2015


Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 ...hader-storage-block-array-dynamic-indexing.frag | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag

diff --git a/tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag b/tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag
new file mode 100644
index 0000000..a05e7fc
--- /dev/null
+++ b/tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_storage_buffer_object
+// [end config]
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+/* Page 50 in section 4.3.9 of the OpenGL ES 3.10 spec says:
+ *
+ *    "All indices used to index a uniform or shader storage block
+ *    array must be constant integral expressions."
+ */
+
+buffer buf {
+	vec4 v;
+} array[2];
+
+uniform int index;
+
+vec4 foo(void) {
+	return array[index].v;
+}
-- 
2.4.3



More information about the Piglit mailing list