From edd8de29aec08177f5385fb7454a2248215a05df Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:37:38 -0700 Subject: [PATCH] renderer/vulkan: Make gl_Position invariant. (#48) This fixes an issue with black artifacts in Pokemon games on Apple GPUs. If the vertex calculations differ slightly between render passes, it can cause parts of model faces to fail depth test. --- src/video_core/renderer_vulkan/vk_shader_gen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_shader_gen.cpp b/src/video_core/renderer_vulkan/vk_shader_gen.cpp index ca69efa1d..bec4d316e 100644 --- a/src/video_core/renderer_vulkan/vk_shader_gen.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_gen.cpp @@ -46,7 +46,7 @@ static std::string GetVertexInterfaceDeclaration(bool is_output, bool use_clip_p if (is_output) { // gl_PerVertex redeclaration is required for separate shader object out += "out gl_PerVertex {\n"; - out += " vec4 gl_Position;\n"; + out += " invariant vec4 gl_Position;\n"; if (use_clip_planes) { out += " float gl_ClipDistance[2];\n"; }