diff --git a/Common/GPU/OpenGL/GLQueueRunner.cpp b/Common/GPU/OpenGL/GLQueueRunner.cpp index f29ffbe2cd..986167903d 100644 --- a/Common/GPU/OpenGL/GLQueueRunner.cpp +++ b/Common/GPU/OpenGL/GLQueueRunner.cpp @@ -14,6 +14,7 @@ #include "Common/Data/Convert/SmallDataConvert.h" #include "Core/Reporting.h" +#include "Core/System.h" #include "GLQueueRunner.h" #include "GLRenderManager.h" #include "DataFormatGL.h" @@ -768,6 +769,13 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step, bool first, bool last PerformBindFramebufferAsRenderTarget(step); + if (IsVRBuild() && PSP_CoreParameter().compat.flags().VRClearFramebuffer) { + if ((strcmp(step.tag, "FramebufferSwitch") == 0) && (step.commands.size() > 50)) { + glClearColor(0.5f, 0.75f, 1.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + } + } + if (first) { glDisable(GL_DEPTH_TEST); glDisable(GL_STENCIL_TEST); diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 84d42df284..4487c3f203 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -97,6 +97,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "AllowLargeFBTextureOffsets", &flags_.AllowLargeFBTextureOffsets); CheckSetting(iniFile, gameID, "AtracLoopHack", &flags_.AtracLoopHack); CheckSetting(iniFile, gameID, "DeswizzleDepth", &flags_.DeswizzleDepth); + CheckSetting(iniFile, gameID, "VRClearFramebuffer", &flags_.VRClearFramebuffer); } void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) { diff --git a/Core/Compatibility.h b/Core/Compatibility.h index dc22c45e0f..941844bd85 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -87,6 +87,7 @@ struct CompatFlags { bool AllowLargeFBTextureOffsets; bool AtracLoopHack; bool DeswizzleDepth; + bool VRClearFramebuffer; }; class IniFile; diff --git a/assets/compat.ini b/assets/compat.ini index 27b8fd571b..692173597f 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -1263,3 +1263,20 @@ UCKS45048 = true UCJS18030 = true UCJS18047 = true NPJG00015 = true + +[VRClearFramebuffer] +#Grand Theft Auto: Liberty City Stories +ULUS10041 = true +ULES00151 = true +ULJM05255 = true +ULJM05359 = true +ULJM05885 = true +NPJH50825 = true + +#Grand Theft Auto: Vice City Stories +ULES00502 = true +ULUS10160 = true +ULJM05297 = true +ULJM05395 = true +ULJM05884 = true +NPJH50827 = true