From ee88e7f9480b239326189230935f34f46a75174f Mon Sep 17 00:00:00 2001 From: kd-11 Date: Thu, 15 Feb 2018 21:37:12 +0300 Subject: [PATCH] rsx/gl: Hotfix for GL format compatibility check when high precision depth buffers is enabled --- rpcs3/Emu/RSX/GL/GLTextureCache.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index 37a2a1093d..2b577fc63e 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -591,7 +591,20 @@ namespace gl if (auto as_rtt = dynamic_cast(tex)) { - return (GLenum)as_rtt->get_compatible_internal_format() == fmt; + const auto rtt_internal_fmt = (GLenum)as_rtt->get_compatible_internal_format(); + if (rtt_internal_fmt != fmt) + { + //When high precision Z is enabled, RTT depth surfaces use DEPTH32F instead of DEPTH24 + if (rtt_internal_fmt == GL_DEPTH32F_STENCIL8 && fmt == GL_DEPTH24_STENCIL8) + return true; + + return false; + } + else + { + //Match + return true; + } } return (gl::texture::format)fmt == tex->get_internal_format();