[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 |   32 +++++++++++++++++++++++++++++
 tests/shaders/glsl-fs-loop-gt.shader_test |   32 +++++++++++++++++++++++++++++
 tests/shaders/glsl-fs-loop-le.shader_test |   32 +++++++++++++++++++++++++++++
 tests/shaders/glsl-fs-loop-lt.shader_test |   32 +++++++++++++++++++++++++++++
 5 files changed, 132 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..1af29b0
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-ge.shader_test
@@ -0,0 +1,32 @@
+[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]
+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 0.6 0.6 0.5
+probe rgb 35 15 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..5f50591
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-gt.shader_test
@@ -0,0 +1,32 @@
+[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]
+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 0.6 0.5 0.5
+probe rgb 35 15 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..bc3985e
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-le.shader_test
@@ -0,0 +1,32 @@
+[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]
+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 0.5 0.6 0.6
+probe rgb 35 15 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..d756cd5
--- /dev/null
+++ b/tests/shaders/glsl-fs-loop-lt.shader_test
@@ -0,0 +1,32 @@
+[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]
+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 0.5 0.5 0.6
+probe rgb 35 15 0.5 0.5 0.6
-- 
1.7.1


--T4sUOijqQbZv57TR--


More information about the Piglit mailing list