1// (This test code was largely borrowed from shared/WhileLoopControlFlow.sksl.) 2half4 main() { 3 half4 color = half4(1); 4 5 // Basic while loop without a block. 6 while (color.r > 0.5) color.r -= 0.25; 7 8 // While loop with a block and a break statement. 9 while (color.a == 1) { 10 color.r -= 0.25; 11 if (color.r <= 0) break; 12 } 13 14 // While loop with a block and a continue statement. 15 while (color.b > 0) { 16 color.b -= 0.25; 17 if (color.a == 1) continue; // should always happen 18 color.g = 0; 19 } 20 21 // color contains green. 22 return color; 23} 24