[Piglit] [PATCH 1/2] arb_bindless_texture: add arrays-of-struct.frag compiler tests

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Apr 28 09:48:11 UTC 2017


The spec doesn't clearly state this, but the spec authors say
it's allowed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../compiler/images/arrays-of-struct.frag          | 21 +++++++++++++++++++++
 .../compiler/samplers/arrays-of-struct.frag        | 22 ++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 tests/spec/arb_bindless_texture/compiler/images/arrays-of-struct.frag
 create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/arrays-of-struct.frag

diff --git a/tests/spec/arb_bindless_texture/compiler/images/arrays-of-struct.frag b/tests/spec/arb_bindless_texture/compiler/images/arrays-of-struct.frag
new file mode 100644
index 000000000..24ed68543
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/compiler/images/arrays-of-struct.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: pass
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+#extension GL_ARB_arrays_of_arrays: enable
+
+struct s {
+	writeonly image2D img[3][2];
+	int y;
+};
+
+void main()
+{
+	s a[2][4];
+	imageStore(a[0][0].img[0][0], ivec2(0, 0), vec4(1, 2, 3, 4));
+}
diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/arrays-of-struct.frag b/tests/spec/arb_bindless_texture/compiler/samplers/arrays-of-struct.frag
new file mode 100644
index 000000000..5e44479e3
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/compiler/samplers/arrays-of-struct.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_arrays_of_arrays: enable
+
+struct s {
+	sampler2D tex[3][2];
+	int y;
+};
+
+out vec4 color;
+
+void main()
+{
+	s a[2][4];
+	color = texture2D(a[0][0].tex[0][0], vec2(0, 0));
+}
-- 
2.12.2



More information about the Piglit mailing list