[Piglit] [PATCH 2/2] arb_gpu_shader5: add invocation-id-basic.shader_test
Jordan Justen
jordan.l.justen at intel.com
Tue Jan 21 11:47:12 PST 2014
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
.../invocation-id-basic.shader_test | 53 ++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 tests/spec/arb_gpu_shader5/invocation-id-basic.shader_test
diff --git a/tests/spec/arb_gpu_shader5/invocation-id-basic.shader_test b/tests/spec/arb_gpu_shader5/invocation-id-basic.shader_test
new file mode 100644
index 0000000..bd516e5
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/invocation-id-basic.shader_test
@@ -0,0 +1,53 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+
+void main()
+{
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(invocations = 4, points) in;
+layout(triangle_strip, max_vertices = 4) out;
+
+void emit(vec2 v2)
+{
+ gl_Position.xy = v2;
+ gl_Position.zw = vec2(0, 1);
+ EmitVertex();
+}
+
+void main()
+{
+ uint i = gl_InvocationID;
+
+ vec2 v;
+ v.x = -1.0 + float(i & 1u);
+ v.y = -1.0 + float((i & 2u) / 2u);
+
+ emit(v);
+ emit(v + vec2(1, 0));
+ emit(v + vec2(0, 1));
+ emit(v + vec2(1, 1));
+ EndPrimitive();
+}
+
+[fragment shader]
+#version 150
+
+void main()
+{
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw arrays GL_POINTS 0 1
+probe all rgba 0.0 1.0 0.0 1.0
--
1.8.5.3
More information about the Piglit
mailing list