[PATCH] glsl-vs-if-nested: New GLSL test.
Tom Stellard
tstellar at gmail.com
Tue Aug 10 09:22:50 PDT 2010
---
tests/all.tests | 1 +
tests/shaders/glsl-vs-if-nested.shader_test | 40 +++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
create mode 100644 tests/shaders/glsl-vs-if-nested.shader_test
diff --git a/tests/all.tests b/tests/all.tests
index 6143fb7..a044016 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -315,6 +315,7 @@ add_shader_generic(shaders, 'glsl-vs-functions-2')
add_shader_generic(shaders, 'glsl-vs-functions-3')
add_shader_generic(shaders, 'glsl-vs-if-less')
add_shader_generic(shaders, 'glsl-vs-if-less-equal')
+add_shader_generic(shaders, 'glsl-vs-if-nested')
add_shader_generic(shaders, 'glsl-vs-if-greater')
add_shader_generic(shaders, 'glsl-vs-if-greater-equal')
add_shader_generic(shaders, 'glsl-vs-mat-add-1')
diff --git a/tests/shaders/glsl-vs-if-nested.shader_test b/tests/shaders/glsl-vs-if-nested.shader_test
new file mode 100644
index 0000000..ba40c99
--- /dev/null
+++ b/tests/shaders/glsl-vs-if-nested.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+ if (gl_Vertex.x >= 50.0){
+ if (gl_Vertex.x >= 70 ) {
+ gl_FrontColor = vec4(0.0, 0.0, 1.0, 0.0);
+ }
+ else {
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 0.0);
+ }
+ } else {
+ gl_FrontColor = vec4(0.0, 1.0, 0.0, 0.0);
+ }
+
+ if (gl_Vertex.x <= 20) {
+ gl_FrontColor = vec4(0.0, 0.0, 0.0, 1.0);
+ }
+
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
+
+[fragment shader file]
+glsl-color.frag
+
+[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
+draw rect 50 10 10 10
+draw rect 70 10 10 10
+probe rgba 15 15 0.0 0.0 0.0 1.0
+probe rgba 35 15 0.0 1.0 0.0 0.0
+probe rgba 55 15 1.0 0.0 0.0 0.0
+probe rgba 75 15 0.0 0.0 1.0 0.0
--
1.7.1
--RnlQjJ0d97Da+TV1--
More information about the Piglit
mailing list