Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1fn expensive_subfunc(input: f32) -> f32 {
2 return input + 1.5;
3}
5fn subfunc(input: f32) -> f32 {
6 return input + 1.0;
7}
9fn test(input_one: f32, input_two: f32) -> vec2<f32> {
10 var res: vec2<f32> = vec2<f32>(1.0, 1.0);
12 // for(var i=0.0; i < input_two; i += 1.0) {
13 // res.x += input_one;
14 // res.y += input_two;
15 // }
17 // for(var i=0.0; i < input_two; i += 1.0) {
18 // res.y += input_two;
19 // }
21 for(var i=0.0; i < input_two; i += 1.0) {
22 res.y += input_one;
23 }
25 res.y += expensive_subfunc(1.0);
26 res.x += subfunc(3.0);
27 res = res.yx;
29 return res;
Contents