[Piglit] [PATCH 2/5] glsl-1.40: Add tests for minimum maximum constants.
Eric Anholt
eric at anholt.net
Fri Mar 9 12:58:46 PST 2012
---
.../glsl-1.40/compiler/gl_MaxTextureUnits.vert | 17 +++++++++
.../maximums/gl_MaxClipDistances.shader_test | 38 ++++++++++++++++++++
.../gl_MaxCombinedTextureImageUnits.shader_test | 38 ++++++++++++++++++++
.../maximums/gl_MaxDrawBuffers.shader_test | 38 ++++++++++++++++++++
.../gl_MaxFragmentUniformComponents.shader_test | 38 ++++++++++++++++++++
.../maximums/gl_MaxTextureImageUnits.shader_test | 38 ++++++++++++++++++++
.../maximums/gl_MaxVaryingComponents.shader_test | 38 ++++++++++++++++++++
.../maximums/gl_MaxVaryingFloats.shader_test | 38 ++++++++++++++++++++
.../maximums/gl_MaxVertexAttribs.shader_test | 38 ++++++++++++++++++++
.../gl_MaxVertexTextureImageUnits.shader_test | 38 ++++++++++++++++++++
.../gl_MaxVertexUniformComponents.shader_test | 38 ++++++++++++++++++++
11 files changed, 397 insertions(+), 0 deletions(-)
create mode 100644 tests/spec/glsl-1.40/compiler/gl_MaxTextureUnits.vert
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxClipDistances.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxDrawBuffers.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxFragmentUniformComponents.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxTextureImageUnits.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingComponents.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingFloats.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexAttribs.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
create mode 100644 tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexUniformComponents.shader_test
diff --git a/tests/spec/glsl-1.40/compiler/gl_MaxTextureUnits.vert b/tests/spec/glsl-1.40/compiler/gl_MaxTextureUnits.vert
new file mode 100644
index 0000000..5051bef
--- /dev/null
+++ b/tests/spec/glsl-1.40/compiler/gl_MaxTextureUnits.vert
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// [end config]
+#version 140
+
+int func()
+{
+ /* This value (number of fixed function texture environment
+ * units) was erroneously left in the core profile on release
+ * of GLSL 1.40, similar to the typo of increasing the minimum
+ * from 2 to 16 in GLSL 1.30. In GLSL 1.50, a later
+ * clarification moved it to to the compatibility profile, but
+ * that was never backported to 1.40.
+ */
+ return gl_MaxTextureUnits;
+}
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxClipDistances.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxClipDistances.shader_test
new file mode 100644
index 0000000..077f954
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxClipDistances.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxClipDistances >= 8)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
new file mode 100644
index 0000000..4808673
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxCombinedTextureImageUnits >= 16)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxDrawBuffers.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxDrawBuffers.shader_test
new file mode 100644
index 0000000..a9ef906
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxDrawBuffers.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxDrawBuffers >= 8)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxFragmentUniformComponents.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxFragmentUniformComponents.shader_test
new file mode 100644
index 0000000..8369d12
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxFragmentUniformComponents.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxFragmentUniformComponents >= 1024)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxTextureImageUnits.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxTextureImageUnits.shader_test
new file mode 100644
index 0000000..6c48f7c
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxTextureImageUnits.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxTextureImageUnits >= 16)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingComponents.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingComponents.shader_test
new file mode 100644
index 0000000..f24a4c0
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingComponents.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxVaryingComponents >= 64)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingFloats.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingFloats.shader_test
new file mode 100644
index 0000000..7375209
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVaryingFloats.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxVaryingFloats >= 64)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexAttribs.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexAttribs.shader_test
new file mode 100644
index 0000000..ad354f7
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexAttribs.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxVertexAttribs >= 16)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
new file mode 100644
index 0000000..2fb73bc
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxVertexTextureImageUnits >= 16)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexUniformComponents.shader_test b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexUniformComponents.shader_test
new file mode 100644
index 0000000..22c8c8b
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/maximums/gl_MaxVertexUniformComponents.shader_test
@@ -0,0 +1,38 @@
+# [description]
+# Tests for GLSL 1.40 minimum maximums for the builtin constants.
+#
+# See the GLSL 1.40.08 specification, section 7.4, page 64.
+
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main(void)
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+void main(void)
+{
+ if (gl_MaxVertexUniformComponents >= 1024)
+ gl_FragColor = vec4(0, 1, 0, 0);
+ else
+ gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
--
1.7.9.1
More information about the Piglit
mailing list