2024-10-22 13:29:00 +00:00
|
|
|
// language: metal1.0
|
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using metal::uint;
|
|
|
|
|
|
|
|
struct OurVertexShaderOutput {
|
|
|
|
metal::float4 position;
|
|
|
|
metal::float2 texcoord;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vsInput {
|
|
|
|
metal::float2 xy [[attribute(0)]];
|
|
|
|
};
|
2024-10-22 12:43:32 +00:00
|
|
|
struct vsOutput_1 {
|
2024-10-22 13:29:00 +00:00
|
|
|
metal::float4 position [[position]];
|
|
|
|
metal::float2 texcoord [[user(loc0), center_perspective]];
|
|
|
|
};
|
2024-10-22 12:43:32 +00:00
|
|
|
vertex vsOutput_1 vs(
|
2024-10-22 13:29:00 +00:00
|
|
|
vsInput varyings [[stage_in]]
|
|
|
|
) {
|
|
|
|
const auto xy = varyings.xy;
|
|
|
|
OurVertexShaderOutput vsOutput = {};
|
|
|
|
vsOutput.position = metal::float4(xy, 0.0, 1.0);
|
|
|
|
OurVertexShaderOutput _e6 = vsOutput;
|
|
|
|
const auto _tmp = _e6;
|
2024-10-22 12:43:32 +00:00
|
|
|
return vsOutput_1 { _tmp.position, _tmp.texcoord };
|
2024-10-22 13:29:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct fsOutput {
|
|
|
|
metal::float4 member_1 [[color(0)]];
|
|
|
|
};
|
|
|
|
fragment fsOutput fs(
|
|
|
|
) {
|
|
|
|
return fsOutput { metal::float4(1.0, 0.0, 0.0, 1.0) };
|
|
|
|
}
|