1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-22 15:28:56 +00:00
CLK/OSBindings/Mac/Clock Signal/ScanTarget/ScanTarget.metal

35 lines
797 B
Metal
Raw Normal View History

//
// ScanTarget.metal
// Clock Signal
//
// Created by Thomas Harte on 04/08/2020.
// Copyright © 2020 Thomas Harte. All rights reserved.
//
#include <metal_stdlib>
using namespace metal;
// These two structs are the same, but defined separately as an artefact
// of my learning process, and the fact that they soon won't be.
struct InputVertex {
2020-08-06 01:33:25 +00:00
float2 position [[attribute(0)]];
float3 colour [[attribute(1)]];
};
struct ColouredVertex {
float4 position [[position]];
float4 colour;
};
2020-08-06 01:33:25 +00:00
vertex ColouredVertex vertex_main(InputVertex vert [[stage_in]]) {
ColouredVertex output;
2020-08-06 01:33:25 +00:00
output.position = float4(vert.position, 0.0, 1.0);
output.colour = float4(vert.colour, 1.0);
return output;
}
fragment float4 fragment_main(ColouredVertex vert [[stage_in]]) {
return vert.colour;
}