Harbor

branch main
showing the latest snapshot on main
discard_select.wgsl 580 B · Plain text
gpu/shader/tests/golden/discard_select.wgsl 0644 Raw
struct _fs_main_Input {
	@location(0) uv: vec2<f32>,
}

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

@group(0) @binding(0) var albedo_tex_tex: texture_2d<f32>;
@group(0) @binding(1) var albedo_tex_samp: sampler;

@fragment
fn fs_main(input: _fs_main_Input) -> _fs_main_Output {
	var __luma_output: _fs_main_Output;
	let color = textureSample(albedo_tex_tex, albedo_tex_samp, input.uv);
	if ((color.a < 0.1)) {
		discard;
	}
	let bright = select(0.0, 1.0, (color.r > 0.5));
	__luma_output._value = vec4<f32>((color.rgb * bright), color.a);
	return __luma_output;
}