brought back functionality from previous builds but now cross-platform

This commit is contained in:
2025-07-07 15:34:34 +03:00
parent 99eafb9443
commit 83bc9b7f16
61 changed files with 1210 additions and 581 deletions

View File

@@ -0,0 +1,34 @@
#include <metal_stdlib>
using namespace metal;
struct VertexOut {
float4 position [[position]];
float2 texCoord;
};
vertex VertexOut vertex_main(uint vertexID [[vertex_id]]) {
float2 pos[] = {
{-1.0, -1.0},
{ 1.0, -1.0},
{-1.0, 1.0},
{ 1.0, 1.0},
};
float2 uv[] = {
{0.0, 1.0},
{1.0, 1.0},
{0.0, 0.0},
{1.0, 0.0},
};
VertexOut out;
out.position = float4(pos[vertexID], 0.0, 1.0);
out.texCoord = uv[vertexID];
return out;
}
fragment float4 fragment_main(VertexOut in [[stage_in]],
texture2d<float> tex [[texture(0)]]) {
constexpr sampler s(filter::linear);
return pow(tex.sample(s, in.texCoord), 0.45f);
}