On 10/01/2015 07:08 PM, Ilia Mirkin wrote:
From GL_ARB_shader_storage_buffer_object spec:
(3) Do we allow arrays of shader storage blocks?
RESOLVED: Yes; we already allow arrays of uniform blocks, where each
block instance has an identical layout but is backed by a separate
buffer object. It seems like we should do this here for consistency.
If we had overloaded the existing uniform block APIs (e.g., by applying
a "readwrite" layout qualifier to uniform blocks), it would be really
weird if we disallowed arrays of writeable uniform blocks since we
already allow it for regular (read-only) uniform blocks.
If they're trying to be identical to UBO's, then dynamic indexing is
allowed. I guess this is just an ES 3.10 restriction.
Ah true, this should be ES 3.10 only, I'll do v2 on ES.
On Thu, Oct 1, 2015 at 7:54 AM, Tapani Pälli <tapani.pa...@intel.com> wrote:
Signed-off-by: Tapani Pälli <tapani.pa...@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
_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit
_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit