From 4528441c74276f45d3e37c0d311fdeeffe29fe85 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Sat, 9 Nov 2024 14:19:02 +0100 Subject: [PATCH] for OGL renderer W buffer rendering avoid undefined vertex z see https://github.com/melonDS-emu/melonDS/issues/2017 --- src/GPU3D_OpenGL_shaders.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GPU3D_OpenGL_shaders.h b/src/GPU3D_OpenGL_shaders.h index 03bd43f9..1bd8296a 100644 --- a/src/GPU3D_OpenGL_shaders.h +++ b/src/GPU3D_OpenGL_shaders.h @@ -681,6 +681,7 @@ void main() vec4 fpos; fpos.xy = (((vec2(vPosition.xy) ) * 2.0) / uScreenSize) - 1.0; + fpos.z = 0.0; fZ = float(vPosition.z << zshift) / 16777216.0; fpos.w = float(vPosition.w) / 65536.0f; fpos.xy *= fpos.w;