mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-26 17:22:25 -05:00
Break everything :D
This commit is contained in:
committed by
Evan Husted
parent
96d884a15b
commit
c7b6e4cf80
39
src/Ryujinx.Graphics.Metal/Shaders/Blit.metal
Normal file
39
src/Ryujinx.Graphics.Metal/Shaders/Blit.metal
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
// ------------------
|
||||
// Simple Blit Shader
|
||||
// ------------------
|
||||
|
||||
constant float2 quadVertices[] = {
|
||||
float2(-1, -1),
|
||||
float2(-1, 1),
|
||||
float2( 1, 1),
|
||||
float2(-1, -1),
|
||||
float2( 1, 1),
|
||||
float2( 1, -1)
|
||||
};
|
||||
|
||||
struct CopyVertexOut {
|
||||
float4 position [[position]];
|
||||
float2 uv;
|
||||
};
|
||||
|
||||
vertex CopyVertexOut vertexMain(unsigned short vid [[vertex_id]]) {
|
||||
float2 position = quadVertices[vid];
|
||||
|
||||
CopyVertexOut out;
|
||||
|
||||
out.position = float4(position, 0, 1);
|
||||
out.position.y = -out.position.y;
|
||||
out.uv = position * 0.5f + 0.5f;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment float4 fragmentMain(CopyVertexOut in [[stage_in]],
|
||||
texture2d<float, access::sample> texture [[texture(0)]],
|
||||
sampler sampler [[sampler(0)]]) {
|
||||
return texture.sample(sampler, in.uv);
|
||||
}
|
||||
Reference in New Issue
Block a user