diff options
author | Zack Rusin <[email protected]> | 2010-03-10 16:31:18 -0500 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2010-03-10 16:32:07 -0500 |
commit | a44f362567f6ed4054e88d8afc94d38f19ed6269 (patch) | |
tree | 12643a0103bae89788157d55455a1454c0799a12 | |
parent | a75519cb43c85b99cd54bc46dd83accda0cbd6cd (diff) |
fpglsl: a few more useful glsl tests
-rw-r--r-- | progs/fpglsl/dowhile.glsl | 8 | ||||
-rw-r--r-- | progs/fpglsl/dowhile2.glsl | 10 | ||||
-rw-r--r-- | progs/fpglsl/forbreak.glsl | 13 | ||||
-rw-r--r-- | progs/fpglsl/simpleif.glsl | 6 | ||||
-rw-r--r-- | progs/fpglsl/while2.glsl | 9 |
5 files changed, 46 insertions, 0 deletions
diff --git a/progs/fpglsl/dowhile.glsl b/progs/fpglsl/dowhile.glsl new file mode 100644 index 00000000000..ed9d7296753 --- /dev/null +++ b/progs/fpglsl/dowhile.glsl @@ -0,0 +1,8 @@ +void main() { + float sum = 0.0; + do { + sum += 0.1; + break; + } while (true); + gl_FragColor = vec4(sum); +} diff --git a/progs/fpglsl/dowhile2.glsl b/progs/fpglsl/dowhile2.glsl new file mode 100644 index 00000000000..f3e00b8e865 --- /dev/null +++ b/progs/fpglsl/dowhile2.glsl @@ -0,0 +1,10 @@ +void main() { + float sum = 0.0; + do { + sum += 0.1; + if (sum < 0.499999) + continue; + break; + } while (true); + gl_FragColor = vec4(sum); +} diff --git a/progs/fpglsl/forbreak.glsl b/progs/fpglsl/forbreak.glsl new file mode 100644 index 00000000000..87669c65758 --- /dev/null +++ b/progs/fpglsl/forbreak.glsl @@ -0,0 +1,13 @@ +uniform int KernelSizeInt; + +void main() { + int i; + vec4 sum = vec4(0.0); + for (i = 0; i < KernelSizeInt; ++i) { + sum.g += 0.25; + if (i > 0) + break; + } + sum.a = 1; + gl_FragColor = sum; +} diff --git a/progs/fpglsl/simpleif.glsl b/progs/fpglsl/simpleif.glsl new file mode 100644 index 00000000000..922421b4108 --- /dev/null +++ b/progs/fpglsl/simpleif.glsl @@ -0,0 +1,6 @@ +void main() { + // this should always be true + if (gl_FragCoord.x >= 0.0) { + gl_FragColor = vec4(0.5, 0.0, 0.5, 1.0); + } +} diff --git a/progs/fpglsl/while2.glsl b/progs/fpglsl/while2.glsl new file mode 100644 index 00000000000..19c8904e283 --- /dev/null +++ b/progs/fpglsl/while2.glsl @@ -0,0 +1,9 @@ +void main() { + float sum = 0.0; + while (true) { + sum += 0.1; + if (sum > 0.8) + break; + } + gl_FragColor = vec4(sum); +} |