[Piglit] [PATCH] arb_arrays_of_arrays: add some simple ubo AoA tests

Timothy Arceri t_arceri at yahoo.com.au
Thu Sep 17 19:17:29 PDT 2015


---
 .../execution/ubo/fs-const.shader_test             | 37 +++++++++++
 .../execution/ubo/fs-nonconst.shader_test          | 76 ++++++++++++++++++++++
 2 files changed, 113 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test

diff --git a/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test
new file mode 100644
index 0000000..7757ad4
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-const.shader_test
@@ -0,0 +1,37 @@
+# This test verifies that uniform indexing of UBO arrays in the
+# fragment shader behaves correctly, when the block member is a
+# const-indexed array.
+
+[require]
+GLSL >= 1.50
+GL_ARB_arrays_of_arrays
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_arrays_of_arrays: require
+
+uniform block {
+	vec4 color[2];
+} arr[4][2];
+
+uniform int n;
+
+out vec4 color;
+
+void main()
+{
+	color = arr[3][0].color[1];
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+ubo array index 0
+uniform vec4 block.color[0] 0.0 0.0 1.0 0.0
+uniform vec4 block.color[1] 1.0 0.0 0.0 0.0
+
+draw rect -1 -1 1 1
+relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0)
diff --git a/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test
new file mode 100644
index 0000000..be90ee7
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/ubo/fs-nonconst.shader_test
@@ -0,0 +1,76 @@
+# This test verifies that dynamically uniform indexing of UBO arrays
+# in the fragment shader behaves correctly, when the block member is a
+# nonconst-indexed array.
+
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+GL_ARB_arrays_of_arrays
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: require
+#extension GL_ARB_arrays_of_arrays: require
+
+uniform block {
+	vec4 color[2];
+} arr[3][2];
+
+uniform int n;
+uniform int m;
+
+out vec4 color;
+
+void main()
+{
+	color = arr[n][m].color[m];
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+ubo array index 0
+uniform vec4 block.color[0] 1.0 0.0 0.0 0.0
+uniform vec4 block.color[1] 0.0 1.0 1.0 0.0
+ubo array index 1
+uniform vec4 block.color[0] 0.0 1.0 1.0 0.0
+uniform vec4 block.color[1] 0.0 1.0 0.0 0.0
+ubo array index 2
+uniform vec4 block.color[0] 0.0 0.0 1.0 0.0
+uniform vec4 block.color[1] 0.0 1.0 1.0 0.0
+ubo array index 3
+uniform vec4 block.color[0] 0.0 1.0 1.0 0.0
+uniform vec4 block.color[1] 0.0 1.0 1.0 0.0
+ubo array index 4
+uniform vec4 block.color[0] 0.0 1.0 1.0 0.0
+uniform vec4 block.color[1] 0.0 1.0 1.0 0.0
+ubo array index 5
+uniform vec4 block.color[0] 0.0 1.0 1.0 0.0
+uniform vec4 block.color[1] 1.0 1.0 1.0 0.0
+
+uniform int n 0
+uniform int m 0
+draw rect -1 -1 1 1
+
+relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0)
+
+uniform int n 0
+uniform int m 1
+draw rect 0 -1 1 1
+
+relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0)
+
+uniform int n 1
+uniform int m 0
+draw rect -1 0 1 1
+
+relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0)
+
+uniform int n 2
+uniform int m 1
+draw rect 0 0 1 1
+
+relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0)
-- 
2.4.3



More information about the Piglit mailing list