diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/shaders/glsl-fs-main-return-conditional.shader_test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/shaders/glsl-fs-main-return-conditional.shader_test b/tests/shaders/glsl-fs-main-return-conditional.shader_test new file mode 100644 index 000000000..173ae03ba --- /dev/null +++ b/tests/shaders/glsl-fs-main-return-conditional.shader_test @@ -0,0 +1,28 @@ +[require] +GLSL >= 1.10 + +[vertex shader] +void main() +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +const vec4 v = vec4(0., 1., 0., 1.); + +void main() +{ + gl_FragColor = v; + if (mod(gl_FragCoord.x, 2.0) >= 1.0) + return; // return for every second pixel + + gl_FragColor = vec4(1.0) - v; +} + +[test] +draw rect -1 -1 2 2 +probe rgb 0 0 1 0 1 +probe rgb 1 0 0 1 0 +probe rgb 2 0 1 0 1 +probe rgb 3 0 0 1 0 + |