[Piglit] [PATCH 5/7] GL_ARB_draw_instanced/negative-instanceidarb-write: New error test.

Eric Anholt eric at anholt.net
Tue Feb 28 13:32:39 PST 2012


---
 .../compiler/negative-instanceidarb-write.vert     |   25 ++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/arb_draw_instanced/compiler/negative-instanceidarb-write.vert

diff --git a/tests/spec/arb_draw_instanced/compiler/negative-instanceidarb-write.vert b/tests/spec/arb_draw_instanced/compiler/negative-instanceidarb-write.vert
new file mode 100644
index 0000000..1c04d78
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/compiler/negative-instanceidarb-write.vert
@@ -0,0 +1,25 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * require_extensions: GL_ARB_draw_instanced
+ * [end config]
+ *
+ * From the GL_ARB_draw_instanced spec:
+ *
+ *     "int gl_InstanceIDARB // read-only
+ *
+ *      Add the following paragraph at the end of the section:
+ *
+ *      The variable gl_InstanceIDARB is available as a read-only
+ *      variable from within vertex shaders and holds holds the
+ *      integer index of the current primitive in an instanced draw
+ *      call (DrawArraysInstancedARB, DrawElementsInstancedARB)."
+ *
+ * So we check that trying to write to it fails to compile.
+ */
+#extension GL_ARB_draw_instanced: require
+
+void function()
+{
+  gl_InstanceIDARB = 0;
+}
-- 
1.7.9.1



More information about the Piglit mailing list