[PATCH] glsl-fs-loop-{ge, gt, le, lt}: new glsl tests

Tom Stellard tstellar at gmail.com
Wed Jun 30 17:00:53 PDT 2010


---
 tests/all.tests                           |    4 ++++
 tests/shaders/glsl-fs-loop-ge.shader_test |   27 +++++++++++++++++++++++++++
 tests/shaders/glsl-fs-loop-gt.shader_test |   27 +++++++++++++++++++++++++++
 tests/shaders/glsl-fs-loop-le.shader_test |   27 +++++++++++++++++++++++++++
 tests/shaders/glsl-fs-loop-lt.shader_test |   27 +++++++++++++++++++++++++++
 5 files changed, 112 insertions(+), 0 deletions(-)
 create mode 100644 tests/shaders/glsl-fs-loop-ge.shader_test
 create mode 100644 tests/shaders/glsl-fs-loop-gt.shader_test
 create mode 100644 tests/shaders/glsl-fs-loop-le.shader_test
 create mode 100644 tests/shaders/glsl-fs-loop-lt.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index 976a6a1..fea403d 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -219,6 +219,10 @@ 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_shader_generic(shaders, 'glsl-fs-loop-ge')
+add_shader_generic(shaders, 'glsl-fs-loop-gt')
+add_shader_generic(shaders, 'glsl-fs-loop-le')
+add_shader_generic(shaders, 'glsl-fs-loop-lt')
 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-ge.shader_test b/tests/shaders/glsl-fs-loop-ge.shader_test
new file mode 100644
index 0000000..80e8319
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-ge.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+void main()
+{
+	float sum;
+	vec3 c = vec3(0.0);
+	for(sum = 10.0; sum >= 4.5; sum -= 1.0){
+		c.x += 0.1;
+	}
+	for(sum = 10.0; sum >= 5.0; sum -= 1.0){
+		c.y += 0.1;
+	}
+	for(sum = 10.0; sum >= 5.5; sum -= 1.0){
+		c.z += 0.1;
+	}
+	gl_FragColor = vec4(c, 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgb 1 1 0.6 0.6 0.5
diff --git a/tests/shaders/glsl-fs-loop-gt.shader_test b/tests/shaders/glsl-fs-loop-gt.shader_test
new file mode 100644
index 0000000..7a7818a
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-gt.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+void main()
+{
+	float sum;
+	vec3 c = vec3(0.0);
+	for(sum = 10.0; sum > 4.5; sum -= 1.0){
+		c.x += 0.1;
+	}
+	for(sum = 10.0; sum > 5.0; sum -= 1.0){
+		c.y += 0.1;
+	}
+	for(sum = 10.0; sum > 5.5; sum -= 1.0){
+		c.z += 0.1;
+	}
+	gl_FragColor = vec4(c, 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgb 1 1 0.6 0.5 0.5
diff --git a/tests/shaders/glsl-fs-loop-le.shader_test b/tests/shaders/glsl-fs-loop-le.shader_test
new file mode 100644
index 0000000..6c168b2
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-le.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+void main()
+{
+	float sum;
+	vec3 c = vec3(0.0);
+	for(sum = 0.0; sum <= 4.5; sum += 1.0){
+		c.x += 0.1;
+	}
+	for(sum = 0.0; sum <= 5.0; sum += 1.0){
+		c.y += 0.1;
+	}
+	for(sum = 0.0; sum <= 5.5; sum += 1.0){
+		c.z += 0.1;
+	}
+	gl_FragColor = vec4(c, 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgb 1 1 0.5 0.6 0.6
diff --git a/tests/shaders/glsl-fs-loop-lt.shader_test b/tests/shaders/glsl-fs-loop-lt.shader_test
new file mode 100644
index 0000000..24c5567
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-lt.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-mvp.vert
+
+[fragment shader]
+void main()
+{
+	float sum;
+	vec3 c = vec3(0.0);
+	for(sum = 0.0; sum < 4.5; sum += 1.0){
+		c.x += 0.1;
+	}
+	for(sum = 0.0; sum < 5.0; sum += 1.0){
+		c.y += 0.1;
+	}
+	for(sum = 0.0; sum < 5.5; sum += 1.0){
+		c.z += 0.1;
+	}
+	gl_FragColor = vec4(c, 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgb 1 1 0.5 0.5 0.6
-- 
1.6.4.4


--JYK4vJDZwFMowpUq--


More information about the Piglit mailing list