You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
715 B
26 lines
715 B
7 months ago
|
layout(key) in bool shouldLoop; // always equals false
|
||
|
|
||
|
// (This test code was largely borrowed from shared/DoWhileControlFlow.sksl.)
|
||
|
half4 main() {
|
||
|
half4 color = half4(1, 1, 1, 1);
|
||
|
|
||
|
// Simple do-while loop, with no Block.
|
||
|
do color.r -= 0.25; while (shouldLoop);
|
||
|
|
||
|
// Do-while loop with a Block and Break in the middle.
|
||
|
do {
|
||
|
color.r -= 0.25;
|
||
|
if (color.r <= 0) break;
|
||
|
} while (color.a == 1);
|
||
|
|
||
|
// Do-while loop with a Block and Continue in the middle.
|
||
|
do {
|
||
|
color.b -= 0.25;
|
||
|
if (color.a == 1 || sk_Caps.builtinFMASupport) continue; // should always happen
|
||
|
color.g = 0;
|
||
|
} while (color.b > 0);
|
||
|
|
||
|
// color contains green.
|
||
|
return color;
|
||
|
}
|