diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-09-01 09:09:56 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-09-01 09:09:56 -0700 |
commit | 31632f326994387dd08931d13963a459812e32e1 (patch) | |
tree | cbc55a9e02422668e6e8d360147e3e40feb3c5c5 | |
parent | 71de680bb9f838afa9a2a249cca3bd8ae6e82824 (diff) |
Add execution tests for the all function
-rw-r--r-- | tests/all.tests | 4 | ||||
-rw-r--r-- | tests/shaders/glsl-fs-all-01.shader_test | 36 | ||||
-rw-r--r-- | tests/shaders/glsl-fs-all-02.shader_test | 40 | ||||
-rw-r--r-- | tests/shaders/glsl-vs-all-01.shader_test | 36 | ||||
-rw-r--r-- | tests/shaders/glsl-vs-all-02.shader_test | 40 |
5 files changed, 156 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index ae1fde084..232de894a 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -267,6 +267,8 @@ add_shader_generic(shaders, 'glsl-fs-abs-02') add_shader_generic(shaders, 'glsl-fs-abs-03') add_shader_generic(shaders, 'glsl-fs-abs-04') add_shader_generic(shaders, 'glsl-fs-add-masked') +add_shader_generic(shaders, 'glsl-fs-all-01') +add_shader_generic(shaders, 'glsl-fs-all-02') add_shader_generic(shaders, 'glsl-fs-any') add_shader_generic(shaders, 'glsl-fs-asin') add_shader_generic(shaders, 'glsl-fs-atan-1') @@ -376,6 +378,8 @@ add_shader_generic(shaders, 'glsl-varying-mat3x2') add_shader_generic(shaders, 'glsl-version-define') add_shader_generic(shaders, 'glsl-version-define-110') add_shader_generic(shaders, 'glsl-version-define-120') +add_shader_generic(shaders, 'glsl-vs-all-01') +add_shader_generic(shaders, 'glsl-vs-all-02') add_plain_test(shaders, 'glsl-vs-arrays') add_shader_generic(shaders, 'glsl-vs-dot-vec2') add_shader_generic(shaders, 'glsl-vs-main-return') diff --git a/tests/shaders/glsl-fs-all-01.shader_test b/tests/shaders/glsl-fs-all-01.shader_test new file mode 100644 index 000000000..49882cd52 --- /dev/null +++ b/tests/shaders/glsl-fs-all-01.shader_test @@ -0,0 +1,36 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +varying vec2 pos; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + pos = gl_Vertex.xy; +} + +[fragment shader] +varying vec2 pos; + +void main() +{ + bvec4 t1 = bvec4(true, 42.0, pos.x > -20000.0, 111); + + float r = ( float(all(bvec4(!t1.x, t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, !t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, !t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, t1.z, !t1.w)))); + + float g = float(all(t1)); + + gl_FragColor = vec4(r, g, 0.0, 1.0); +} + +[test] +ortho +clear color 0.5 0.5 0.5 0.5 +clear +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/shaders/glsl-fs-all-02.shader_test b/tests/shaders/glsl-fs-all-02.shader_test new file mode 100644 index 000000000..8205a33b2 --- /dev/null +++ b/tests/shaders/glsl-fs-all-02.shader_test @@ -0,0 +1,40 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +varying vec2 pos; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + pos = gl_Vertex.xy; +} + +[fragment shader] +varying vec2 pos; + +struct s { + bool x, y, z, w; +}; + +void main() +{ + s t1 = s(true, bool(42.0), pos.x > -20000.0, bool(111)); + + float r = ( float(all(bvec4(!t1.x, t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, !t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, !t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, t1.z, !t1.w)))); + + float g = float(all(bvec4(t1.x, t1.y, t1.z, t1.w))); + + gl_FragColor = vec4(r, g, 0.0, 1.0); +} + +[test] +ortho +clear color 0.5 0.5 0.5 0.5 +clear +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/shaders/glsl-vs-all-01.shader_test b/tests/shaders/glsl-vs-all-01.shader_test new file mode 100644 index 000000000..3b9e8af88 --- /dev/null +++ b/tests/shaders/glsl-vs-all-01.shader_test @@ -0,0 +1,36 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +varying vec4 color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + bvec4 t1 = bvec4(true, 42.0, gl_Vertex.x > -20000.0, 111); + + float r = ( float(all(bvec4(!t1.x, t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, !t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, !t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, t1.z, !t1.w)))); + + float g = float(all(t1)); + + color = vec4(r, g, 0.0, 1.0); +} + +[fragment shader] +varying vec4 color; +void main() +{ + gl_FragColor = color; +} + +[test] +ortho +clear color 0.5 0.5 0.5 0.5 +clear +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 diff --git a/tests/shaders/glsl-vs-all-02.shader_test b/tests/shaders/glsl-vs-all-02.shader_test new file mode 100644 index 000000000..28c4f6a9b --- /dev/null +++ b/tests/shaders/glsl-vs-all-02.shader_test @@ -0,0 +1,40 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +varying vec4 color; + +struct s { + bool x, y, z, w; +}; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + + s t1 = s(true, bool(42.0), gl_Vertex.x > -20000.0, bool(111)); + + float r = ( float(all(bvec4(!t1.x, t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, !t1.y, t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, !t1.z, t1.w))) + + float(all(bvec4( t1.x, t1.y, t1.z, !t1.w)))); + + float g = float(all(bvec4(t1.x, t1.y, t1.z, t1.w))); + + color = vec4(r, g, 0.0, 1.0); +} + +[fragment shader] +varying vec4 color; +void main() +{ + gl_FragColor = color; +} + +[test] +ortho +clear color 0.5 0.5 0.5 0.5 +clear +draw rect 10 10 10 10 +probe rgb 15 15 0.0 1.0 0.0 |