[Piglit] [PATCH 3/4] ARB_draw_instanced: Add basic test for availability of gl_InstanceIDARB
Ian Romanick
idr at freedesktop.org
Fri Apr 8 19:49:31 PDT 2011
From: Ian Romanick <ian.d.romanick at intel.com>
---
.../compiler/instanceidarb-disabled.frag | 25 ++++++++++++++++++++
.../compiler/instanceidarb-disabled.vert | 25 ++++++++++++++++++++
.../compiler/instanceidarb-enabled.frag | 24 +++++++++++++++++++
.../compiler/instanceidarb-enabled.vert | 24 +++++++++++++++++++
4 files changed, 98 insertions(+), 0 deletions(-)
create mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.frag
create mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.vert
create mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.frag
create mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.vert
diff --git a/tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.frag b/tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.frag
new file mode 100644
index 0000000..3484003
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.frag
@@ -0,0 +1,25 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ *
+ * From the GL_ARB_draw_instanced spec:
+ *
+ * "Change Section 7.1 "Vertex Shader Special Variables"
+ *
+ * Add the following definition to the list of built-in variable
+ * definitions:
+ *
+ * int gl_InstanceIDARB // read-only"
+ *
+ * There is no mention of gl_InstanceIDARB in fragment shaders or
+ * geometry shaders.
+ *
+ * This test does not enable the extension before using gl_InstanceIDARB.
+ */
+
+int function()
+{
+ return gl_InstanceIDARB;
+}
diff --git a/tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.vert b/tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.vert
new file mode 100644
index 0000000..3484003
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.vert
@@ -0,0 +1,25 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ *
+ * From the GL_ARB_draw_instanced spec:
+ *
+ * "Change Section 7.1 "Vertex Shader Special Variables"
+ *
+ * Add the following definition to the list of built-in variable
+ * definitions:
+ *
+ * int gl_InstanceIDARB // read-only"
+ *
+ * There is no mention of gl_InstanceIDARB in fragment shaders or
+ * geometry shaders.
+ *
+ * This test does not enable the extension before using gl_InstanceIDARB.
+ */
+
+int function()
+{
+ return gl_InstanceIDARB;
+}
diff --git a/tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.frag b/tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.frag
new file mode 100644
index 0000000..781c8bd
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.frag
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ *
+ * From the GL_ARB_draw_instanced spec:
+ *
+ * "Change Section 7.1 "Vertex Shader Special Variables"
+ *
+ * Add the following definition to the list of built-in variable
+ * definitions:
+ *
+ * int gl_InstanceIDARB // read-only"
+ *
+ * There is no mention of gl_InstanceIDARB in fragment shaders or
+ * geometry shaders.
+ */
+#extension GL_ARB_draw_instanced: require
+
+int function()
+{
+ return gl_InstanceIDARB;
+}
diff --git a/tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.vert b/tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.vert
new file mode 100644
index 0000000..faebe77
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.vert
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ *
+ * From the GL_ARB_draw_instanced spec:
+ *
+ * "Change Section 7.1 "Vertex Shader Special Variables"
+ *
+ * Add the following definition to the list of built-in variable
+ * definitions:
+ *
+ * int gl_InstanceIDARB // read-only"
+ *
+ * There is no mention of gl_InstanceIDARB in fragment shaders or
+ * geometry shaders.
+ */
+#extension GL_ARB_draw_instanced: require
+
+int function()
+{
+ return gl_InstanceIDARB;
+}
--
1.7.4
More information about the Piglit
mailing list