mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-13 10:18:30 +12:00
present
This commit is contained in:
parent
35eea12950
commit
7ae29a74cd
4 changed files with 168 additions and 33 deletions
23
src/Cafe/HW/Latte/Renderer/Metal/ShaderSourcePresent.h
Normal file
23
src/Cafe/HW/Latte/Renderer/Metal/ShaderSourcePresent.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <cmath>
|
||||
const char* presentLibrarySource = \
|
||||
"#include <metal_stdlib>\n" \
|
||||
"using namespace metal;\n" \
|
||||
"\n" \
|
||||
"constant float2 positions[] = {float2(-1.0, -3.0), float2(-1.0, 1.0), float2(3.0, 1.0)};\n"
|
||||
"\n" \
|
||||
"struct VertexOut {\n" \
|
||||
" float4 position [[position]];\n" \
|
||||
" float2 texCoord;\n" \
|
||||
"};\n" \
|
||||
"\n" \
|
||||
"vertex VertexOut presentVertex(ushort vid [[vertex_id]]) {\n" \
|
||||
" VertexOut out;\n" \
|
||||
" out.position = float4(positions[vid], 0.0, 1.0);\n" \
|
||||
" out.texCoord = positions[vid] * 0.5 + 0.5;\n" \
|
||||
"\n" \
|
||||
" return out;\n" \
|
||||
"}\n" \
|
||||
"\n" \
|
||||
"fragment float4 presentFragment(VertexOut in [[stage_in]], texture2d<float> tex [[texture(0)]], sampler samplr [[sampler(0)]]) {\n" \
|
||||
" return tex.sample(samplr, in.texCoord);\n" \
|
||||
"}\n";
|
Loading…
Add table
Add a link
Reference in a new issue