[Piglit] [PATCH] glsl-1.50: Add tests for GL_core_profile define

Ian Romanick idr at freedesktop.org
Wed Jun 26 08:24:38 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

We won't support compatibility profiles, so I didn't add any tests for
the GL_compatibility_profile define.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../glsl-1.50/compiler/core-profile-define.frag    | 29 +++++++++++++++++++
 .../glsl-1.50/compiler/core-profile-define.geom    | 33 ++++++++++++++++++++++
 .../glsl-1.50/compiler/core-profile-define.vert    | 29 +++++++++++++++++++
 3 files changed, 91 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/core-profile-define.frag
 create mode 100644 tests/spec/glsl-1.50/compiler/core-profile-define.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/core-profile-define.vert

diff --git a/tests/spec/glsl-1.50/compiler/core-profile-define.frag b/tests/spec/glsl-1.50/compiler/core-profile-define.frag
new file mode 100644
index 0000000..3c25dba
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/core-profile-define.frag
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * [end config]
+ *
+ * Page 11 (page 17 of the PDF) of the GLSL 1.50 spec says:
+ *
+ *     "There is a built-in macro definition for each profile the
+ *     implementation supports. All implementations provide the following
+ *     macro:
+ *
+ *         #define GL_core_profile 1"
+ */
+#version 150 core
+
+#ifndef GL_core_profile
+#error GL_core_profile not defined
+#endif
+
+#if GL_core_profile != 1
+#error GL_core_profile not 1
+#endif
+
+out vec4 o;
+
+void main()
+{
+	o = vec4(0);
+}
diff --git a/tests/spec/glsl-1.50/compiler/core-profile-define.geom b/tests/spec/glsl-1.50/compiler/core-profile-define.geom
new file mode 100644
index 0000000..5204550
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/core-profile-define.geom
@@ -0,0 +1,33 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * [end config]
+ *
+ * Page 11 (page 17 of the PDF) of the GLSL 1.50 spec says:
+ *
+ *     "There is a built-in macro definition for each profile the
+ *     implementation supports. All implementations provide the following
+ *     macro:
+ *
+ *         #define GL_core_profile 1"
+ */
+#version 150 core
+
+#ifndef GL_core_profile
+#error GL_core_profile not defined
+#endif
+
+#if GL_core_profile != 1
+#error GL_core_profile not 1
+#endif
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = vec4(0.0);
+    EmitVertex();
+  }
+}
diff --git a/tests/spec/glsl-1.50/compiler/core-profile-define.vert b/tests/spec/glsl-1.50/compiler/core-profile-define.vert
new file mode 100644
index 0000000..9b8ffe2
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/core-profile-define.vert
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * [end config]
+ *
+ * Page 11 (page 17 of the PDF) of the GLSL 1.50 spec says:
+ *
+ *     "There is a built-in macro definition for each profile the
+ *     implementation supports. All implementations provide the following
+ *     macro:
+ *
+ *         #define GL_core_profile 1"
+ */
+#version 150 core
+
+#ifndef GL_core_profile
+#error GL_core_profile not defined
+#endif
+
+#if GL_core_profile != 1
+#error GL_core_profile not 1
+#endif
+
+in vec4 v;
+
+void main()
+{
+	gl_Position = v;
+}
-- 
1.8.1.4



More information about the Piglit mailing list