[Piglit] [PATCH 11/18] arb_geometry_shader4: Test indexing geometry shader input arrays.
Fabian Bieler
fabianbieler at fastmail.fm
Mon Jun 10 15:26:50 PDT 2013
All geometry shader input varyings are arrays.
Array varyings are two-dimensional arrays.
Test indexing of scalar, vector and matrix varyings.
---
.../arb_geometry_shader4/compiler/array-index.geom | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 tests/spec/arb_geometry_shader4/compiler/array-index.geom
diff --git a/tests/spec/arb_geometry_shader4/compiler/array-index.geom b/tests/spec/arb_geometry_shader4/compiler/array-index.geom
new file mode 100644
index 0000000..df38842
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/array-index.geom
@@ -0,0 +1,35 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// require_extensions: GL_ARB_geometry_shader4
+// [end config]
+
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+varying in float scalar[];
+varying in float scalar_array[][2];
+varying in vec4 vector[];
+varying in vec4 vector_array[][2];
+varying in mat4 matrix[];
+varying in mat4 matrix_array[][2];
+
+varying out float var_out;
+
+void main()
+{
+ float x = 0.0;
+
+ x += scalar[0];
+ x += scalar_array[0][1];
+ x += vector[0][3];
+ x += vector_array[0][1][3];
+ x += matrix[0][3][3];
+ x += matrix_array[0][1][3][3];
+
+ for (int i = 0; i < 3; i++) {
+ var_out = x;
+ gl_Position = vec4(0.0);
+ EmitVertex();
+ }
+}
--
1.8.1.2
More information about the Piglit
mailing list