From 0e2fd7c2a2ee05d94f55b019e58c84762bc4670d Mon Sep 17 00:00:00 2001 From: Lubos Date: Thu, 24 Nov 2022 19:17:00 +0100 Subject: [PATCH] OpenXR - Fix HUD in many games which breaks postprocess effects --- Common/VR/PPSSPPVR.cpp | 2 +- GPU/GLES/ShaderManagerGLES.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index 423b74bd27..0fba20ac61 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -727,7 +727,7 @@ bool Is2DVRObject(float* projMatrix, bool ortho) { if (!identity && !ortho) { vr3DGeometryCount++; } - return identity; + return identity || ortho; } void UpdateVRParams(float* projMatrix, float* viewMatrix) { diff --git a/GPU/GLES/ShaderManagerGLES.cpp b/GPU/GLES/ShaderManagerGLES.cpp index 7195bcd8af..aed35841f8 100644 --- a/GPU/GLES/ShaderManagerGLES.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -385,12 +385,11 @@ void LinkedShader::UpdateUniforms(u32 vertType, const ShaderID &vsid, bool useBu // Set HUD mode if (gstate_c.Use(GPU_USE_VIRTUAL_REALITY)) { - bool is3D = gstate.isDepthWriteEnabled(); - bool hud = is2D && !is3D && !flatScreen && - gstate.isModeThrough() && //2D content requires orthographic projection + bool hud = is2D && !flatScreen && gstate.isAlphaBlendEnabled() && //2D content has to be blended !gstate.isLightingEnabled() && //2D content cannot be rendered with lights on - !gstate.isFogEnabled(); //2D content cannot be rendered with fog on + !gstate.isFogEnabled() && //2D content cannot be rendered with fog on + !gstate.isDepthWriteEnabled(); //This breaks minimap in GTA but works elsewhere if (hud) { float scale = 0.5f; render_->SetUniformF1(&u_scaleX, scale);