Harbor

branch main
showing the latest snapshot on main
loop_control.wgsl 747 B · Plain text
gpu/shader/tests/golden/loop_control.wgsl 0644 Raw
struct _shade_Input {
	@location(0) value: f32,
}

struct _shade_Output {
	@location(0) _value: vec4<f32>,
}

@fragment
fn shade(input: _shade_Input) -> _shade_Output {
	var __luma_output: _shade_Output;
	let result = 0.0;
	for (var i = 0; i <= 10; i++) {
		if (((i % 2) == 0)) {
			continue;
		}
		result = (result + f32(i));
	}
	let total = 0.0;
	for (var j = 0; j <= 100; j++) {
		if ((j > 5)) {
			break;
		}
		total = (total + 1.0);
	}
	let k = 0;
	while ((k < 100)) {
		if ((k > 10)) {
			break;
		}
		k = (k + 1);
	}
	let sum = 0.0;
	let m = 0;
	while ((m < 10)) {
		m = (m + 1);
		if ((m == 5)) {
			continue;
		}
		sum = (sum + 1.0);
	}
	__luma_output._value = vec4<f32>(((result + total) + sum), 0.0, 0.0, 1.0);
	return __luma_output;
}