[PATCH] glsl-fs-loop-const-{decr, incr}: new glsl tests

Tom Stellard tstellar at gmail.com
Sat Jun 5 20:47:09 PDT 2010


---
 tests/all.tests                                   |    2 +
 tests/shaders/glsl-fs-loop-const-decr.shader_test |   30 +++++++++++++++++++++
 tests/shaders/glsl-fs-loop-const-incr.shader_test |   30 +++++++++++++++++++++
 3 files changed, 62 insertions(+), 0 deletions(-)
 create mode 100644 tests/shaders/glsl-fs-loop-const-decr.shader_test
 create mode 100644 tests/shaders/glsl-fs-loop-const-incr.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index fede37b..44d51d2 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -207,6 +207,8 @@ add_shader_generic(shaders, 'glsl-fs-if-greater')
 add_shader_generic(shaders, 'glsl-fs-if-greater-equal')
 add_shader_generic(shaders, 'glsl-fs-log2')
 add_plain_test(shaders, 'glsl-fs-loop')
+add_shader_generic(shaders, 'glsl-fs-loop-const-decr')
+add_shader_generic(shaders, 'glsl-fs-loop-const-incr')
 add_plain_test(shaders, 'glsl-fs-loop-nested')
 add_plain_test(shaders, 'glsl-fs-mix')
 add_plain_test(shaders, 'glsl-fs-mix-constant')
diff --git a/tests/shaders/glsl-fs-loop-const-decr.shader_test b/tests/shaders/glsl-fs-loop-const-decr.shader_test
new file mode 100644
index 0000000..fe5752a
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-const-decr.shader_test
@@ -0,0 +1,30 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+uniform vec4 color;
+void main()
+{
+	int count = int(color.w);
+	vec3 c = color.xyz;
+	int i;
+
+	for (i = 10.0; i > 0.0; i--) {
+		c.x += 0.1;
+	}
+
+	gl_FragColor = vec4(c, 1.0);
+}
+
+[test]
+ortho
+clear color 0.5 0.5 0.5 0.5
+clear
+draw rect 10 10 10 10
+draw rect 30 10 10 10
+probe rgb 15 15 1.0 0.0 0.0
+probe rgb 35 15 1.0 0.0 0.0
diff --git a/tests/shaders/glsl-fs-loop-const-incr.shader_test b/tests/shaders/glsl-fs-loop-const-incr.shader_test
new file mode 100644
index 0000000..d649f84
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-const-incr.shader_test
@@ -0,0 +1,30 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+uniform vec4 color;
+void main()
+{
+	int count = int(color.w);
+	vec3 c = color.xyz;
+	int i;
+
+	for (i = 0.0; i < 10.0; i++) {
+		c.x += 0.1;
+	}
+
+	gl_FragColor = vec4(c, 1.0);
+}
+
+[test]
+ortho
+clear color 0.5 0.5 0.5 0.5
+clear
+draw rect 10 10 10 10
+draw rect 30 10 10 10
+probe rgb 15 15 1.0 0.0 0.0
+probe rgb 35 15 1.0 0.0 0.0
-- 
1.6.4.4


--OgqxwSJOaUobr8KG--


More information about the Piglit mailing list