1struct FSIn { 2 @builtin(front_facing) sk_Clockwise: bool, 3 @builtin(position) sk_FragCoord: vec4<f32>, 4}; 5struct FSOut { 6 @location(0) sk_FragColor: vec4<f32>, 7}; 8fn getColor_h4h(c: f32) -> vec4<f32> { 9 return vec4<f32>(c); 10} 11fn getFragCoordAugmentedColor_h4h(_stageIn: FSIn, c: f32) -> vec4<f32> { 12 return vec4<f32>(_stageIn.sk_FragCoord.xyxy * vec4<f32>(getColor_h4h(c))); 13} 14fn writeColorToOutput_vh(_stageOut: ptr<function, FSOut>, c: f32) { 15 (*_stageOut).sk_FragColor = getColor_h4h(c); 16} 17fn writeToOutput_v(_stageOut: ptr<function, FSOut>) { 18 writeColorToOutput_vh(_stageOut, 1.0); 19} 20fn modifyOutputColor_v(_stageIn: FSIn, _stageOut: ptr<function, FSOut>) { 21 (*_stageOut).sk_FragColor += getFragCoordAugmentedColor_h4h(_stageIn, 2.0); 22} 23fn main(_stageIn: FSIn, _stageOut: ptr<function, FSOut>) { 24 writeToOutput_v(_stageOut); 25 modifyOutputColor_v(_stageIn, _stageOut); 26} 27@fragment fn fragmentMain(_stageIn: FSIn) -> FSOut { 28 var _stageOut: FSOut; 29 main(_stageIn, &_stageOut); 30 return _stageOut; 31} 32