1layout(key) in bool shouldLoop; // always equals false 2 3// (This test code was largely borrowed from shared/DoWhileControlFlow.sksl.) 4half4 main() { 5 half4 color = half4(1, 1, 1, 1); 6 7 // Simple do-while loop, with no Block. 8 do color.r -= 0.25; while (shouldLoop); 9 10 // Do-while loop with a Block and Break in the middle. 11 do { 12 color.r -= 0.25; 13 if (color.r <= 0) break; 14 } while (color.a == 1); 15 16 // Do-while loop with a Block and Continue in the middle. 17 do { 18 color.b -= 0.25; 19 if (color.a == 1 || sk_Caps.builtinFMASupport) continue; // should always happen 20 color.g = 0; 21 } while (color.b > 0); 22 23 // color contains green. 24 return color; 25} 26