Harbor

branch main
showing the latest snapshot on main
workflow_discard_output.msl 421 B · Plain text
gpu/shader/tests/golden/workflow_discard_output.msl 0644 Raw
#include <metal_stdlib>
using namespace metal;

struct _shade_Input {
	float alpha [[user(locn0)]];
};

struct _shade_Output {
	float4 color [[user(locn0)]];
};

fragment _shade_Output shade(_shade_Input input [[stage_in]]) {
	_shade_Output __luma_output;
	if ((input.alpha < 0.01)) {
		discard_fragment();
	} else {
		__luma_output.color = float4(input.alpha, input.alpha, input.alpha, 1.0);
	}
	return __luma_output;
}