DepthStencil Blits

This commit is contained in:
Isaac Marovitz
2024-07-24 23:27:59 +01:00
committed by Isaac Marovitz
parent aa6e87e8a6
commit 3a04d72686
9 changed files with 310 additions and 29 deletions
@@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
struct CopyVertexOut {
float4 position [[position]];
float2 uv;
};
struct Textures
{
texture2d<float, access::sample> texture;
sampler sampler;
};
struct FragmentOut {
float depth [[depth(any)]];
};
fragment FragmentOut fragmentMain(CopyVertexOut in [[stage_in]],
constant Textures &textures [[buffer(22)]]) {
FragmentOut out;
out.depth = textures.texture.sample(textures.sampler, in.uv).r;
return out;
}