Harbor

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

struct _shade_Input {
	float4 __luma_frag_coord [[position]];
	bool __luma_frag_front_facing [[front_facing]];
};

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

fragment _shade_Output shade(_shade_Input input [[stage_in]]) {
	_shade_Output __luma_output;
	float2 coord = input.__luma_frag_coord.xy;
	bool facing = input.__luma_frag_front_facing;
	float face = select(0.25, 1.0, facing);
	__luma_output.color = float4((coord.x * 0.0), (coord.y * 0.0), face, 1.0);
	return __luma_output;
}