diff --git a/src/video_core/renderer_metal/mtl_pipeline_cache.cpp b/src/video_core/renderer_metal/mtl_pipeline_cache.cpp index e80b3eb3e03fe3a7453b0d86a0094b440e53a711..d142ccbf89b36a814a889ec77eee6a3f547dca8a 100644 --- a/src/video_core/renderer_metal/mtl_pipeline_cache.cpp +++ b/src/video_core/renderer_metal/mtl_pipeline_cache.cpp @@ -279,10 +279,10 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline( #include <metal_stdlib> using namespace metal; - constant float2 texCoords[] = { - float2(0.0, -1.0), - float2(0.0, 1.0), - float2(2.0, 1.0), + constant float2 positions[] = { + float2(-1.0, -3.0), + float2(-1.0, 1.0), + float2( 3.0, 1.0), }; struct VertexOut { @@ -292,8 +292,9 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline( vertex VertexOut vertexMain(uint vid [[vertex_id]]) { VertexOut out; - out.position = float4(texCoords[vid] * 2.0 - 1.0, 0.0, 1.0); - out.texCoord = texCoords[vid]; + out.position = float4(positions[vid], 0.0, 1.0); + out.texCoord = positions[vid] * 0.5 + 0.5; + out.texCoord.y = 1.0 - out.texCoord.y; return out; } diff --git a/src/video_core/renderer_metal/renderer_metal.cpp b/src/video_core/renderer_metal/renderer_metal.cpp index e0a0031d08e819b2946ce4b3459585d360d3890d..efb83743c61eaeac2e94bc0d7d69f1b1e40fa50b 100644 --- a/src/video_core/renderer_metal/renderer_metal.cpp +++ b/src/video_core/renderer_metal/renderer_metal.cpp @@ -80,10 +80,10 @@ void RendererMetal::CreateBlitPipelineState() { #include <metal_stdlib> using namespace metal; - constant float2 texCoords[] = { - float2(0.0, -1.0), - float2(0.0, 1.0), - float2(2.0, 1.0), + constant float2 positions[] = { + float2(-1.0, -3.0), + float2(-1.0, 1.0), + float2( 3.0, 1.0), }; struct VertexOut { @@ -93,8 +93,9 @@ void RendererMetal::CreateBlitPipelineState() { vertex VertexOut vertexMain(uint vid [[vertex_id]]) { VertexOut out; - out.position = float4(texCoords[vid] * 2.0 - 1.0, 0.0, 1.0); - out.texCoord = texCoords[vid]; + out.position = float4(positions[vid], 0.0, 1.0); + out.texCoord = positions[vid] * 0.5 + 0.5; + out.texCoord.y = 1.0 - out.texCoord.y; return out; }