[Piglit] [PATCH 2/4] ARB_draw_instanced: Add basic GLSL feature macro tests
Ian Romanick
idr at freedesktop.org
Sun Apr 10 17:04:54 PDT 2011
From: Ian Romanick <ian.d.romanick at intel.com>
---
tests/all.tests | 8 ++++++++
.../preprocessor/feature-macro-disabled.frag | 12 ++++++++++++
.../preprocessor/feature-macro-disabled.vert | 12 ++++++++++++
.../preprocessor/feature-macro-enabled.frag | 15 +++++++++++++++
.../preprocessor/feature-macro-enabled.vert | 15 +++++++++++++++
5 files changed, 62 insertions(+), 0 deletions(-)
create mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.frag
create mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.vert
create mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.frag
create mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.vert
diff --git a/tests/all.tests b/tests/all.tests
index 17d1270..42e2eee 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -687,6 +687,14 @@ add_plain_test(arb_es2_compatibility, 'arb_es2_compatibility-maxvectors')
add_plain_test(arb_es2_compatibility, 'arb_es2_compatibility-shadercompiler')
add_plain_test(arb_es2_compatibility, 'arb_es2_compatibility-releaseshadercompiler')
+# Group ARB_draw_instanced
+arb_draw_instanced = Group()
+spec['ARB_draw_instanced'] = arb_draw_instanced
+import_glsl_parser_tests(arb_draw_instanced,
+ os.path.dirname(__file__) + '/spec/arb_draw_instanced',
+ [''])
+
+
# Group ARB_shader_texture_lod
arb_shader_texture_lod = Group()
spec['ARB_shader_texture_lod'] = arb_shader_texture_lod
diff --git a/tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.frag b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.frag
new file mode 100644
index 0000000..78f5ebd
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.frag
@@ -0,0 +1,12 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ */
+
+#if defined GL_ARB_draw_instanced
+# error GL_ARB_draw_instanced is defined, but should not be
+#endif
+
+float foo() { return 0.0; }
diff --git a/tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.vert b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.vert
new file mode 100644
index 0000000..78f5ebd
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.vert
@@ -0,0 +1,12 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ */
+
+#if defined GL_ARB_draw_instanced
+# error GL_ARB_draw_instanced is defined, but should not be
+#endif
+
+float foo() { return 0.0; }
diff --git a/tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.frag b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.frag
new file mode 100644
index 0000000..2ec493b
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.frag
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ */
+#extension GL_ARB_draw_instanced: require
+
+#if !defined GL_ARB_draw_instanced
+# error GL_ARB_draw_instanced is not defined
+#elif GL_ARB_draw_instanced != 1
+# error GL_ARB_draw_instanced != 1
+#endif
+
+float foo() { return 0.0; }
diff --git a/tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.vert b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.vert
new file mode 100644
index 0000000..2ec493b
--- /dev/null
+++ b/tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.vert
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extension: GL_ARB_draw_instanced
+ * [end config]
+ */
+#extension GL_ARB_draw_instanced: require
+
+#if !defined GL_ARB_draw_instanced
+# error GL_ARB_draw_instanced is not defined
+#elif GL_ARB_draw_instanced != 1
+# error GL_ARB_draw_instanced != 1
+#endif
+
+float foo() { return 0.0; }
--
1.7.4
More information about the Piglit
mailing list