[Piglit] [PATCH] glsl-version-define-130: New test for glsl 1.30 existence and __VERSION__ reflecting glsl 1.30.

jian.j.zhao at intel.com jian.j.zhao at intel.com
Tue Nov 29 01:03:02 PST 2011


From: Jian Zhao <jian.j.zhao at intel.com>

According to the glsl spec page 7:
     "This document specifies only version 1.30 of the OpenGL
     Shading Language. It requires __VERSION__ to substitute
     130, and requires #version to accept only 130. If #version
     is declared with 110 or 120, the language accepted is a
     previous version of the shading language, which will be
     supported depending on the version and type of context in
     the OpenGL API."

v2: use in and out instead of some deprecated variables.
---
 tests/shaders/glsl-version-define-130.shader_test |   22 +++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 tests/shaders/glsl-version-define-130.shader_test

diff --git a/tests/shaders/glsl-version-define-130.shader_test b/tests/shaders/glsl-version-define-130.shader_test
new file mode 100644
index 0000000..e0981a6
--- /dev/null
+++ b/tests/shaders/glsl-version-define-130.shader_test
@@ -0,0 +1,22 @@
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+in vec4 position;
+void main()
+{
+	gl_Position = position;
+}
+
+[fragment shader]
+#version 130
+out vec4 FragColor;
+void main()
+{
+	FragColor = vec4(0.0, float(__VERSION__) / 130.0, 0.0, 0.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgba 1 1 0.0 1.0 0.0 0.0
-- 
1.6.0.6



More information about the Piglit mailing list