From 9bbfd3384271c128a2eecb59d8002856f70a79a1 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Thu, 26 Jan 2023 10:07:10 +0100 Subject: [PATCH] Latte: FragCoord w should not be reciprocal Fixes rendering in various Virtual Console DS titles --- .../LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp index c680ee43..677399c2 100644 --- a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp +++ b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp @@ -304,8 +304,7 @@ namespace LatteDecompiler } else if (decompilerContext->shaderType == LatteConst::ShaderType::Pixel) { - //fCStr_shaderSource->append("#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy+uf_fragCoordScale.zw,gl_FragCoord.zw)" STR_LINEBREAK); - src->add("#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.zw)" _CRLF); + src->add("#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.z, 1.0/gl_FragCoord.w)" _CRLF); } src->add("#else" _CRLF); // OpenGL defines