diff --git a/Common/GPU/OpenGL/GLRenderManager.cpp b/Common/GPU/OpenGL/GLRenderManager.cpp index 01cccb8874..bca19e274f 100644 --- a/Common/GPU/OpenGL/GLRenderManager.cpp +++ b/Common/GPU/OpenGL/GLRenderManager.cpp @@ -5,8 +5,6 @@ #include "Common/Thread/ThreadUtil.h" #include "Common/VR/PPSSPPVR.h" -#include "Core/Config.h" - #include "Common/Log.h" #include "Common/MemoryUtil.h" #include "Common/Math/math_util.h" @@ -580,10 +578,7 @@ void GLRenderManager::Run(int frame) { } if (IsVRBuild()) { - int passes = 1; - if (!IsMultiviewSupported() && g_Config.bEnableStereo) { - passes = 2; - } + int passes = GetVRPassesCount(); for (int i = 0; i < passes; i++) { PreVRFrameRender(i); queueRunner_.RunSteps(stepsOnThread, skipGLCalls_, i < passes - 1); diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 4e248a0077..66f3e287e9 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -14,8 +14,6 @@ #include "Common/Thread/ThreadUtil.h" #include "Common/VR/PPSSPPVR.h" -#include "Core/Config.h" - #if 0 // def _DEBUG #define VLOG(...) NOTICE_LOG(G3D, __VA_ARGS__) #else @@ -1282,10 +1280,7 @@ void VulkanRenderManager::Run(VKRRenderThreadTask &task) { frameData.skipSwap = true; //queueRunner_.LogSteps(stepsOnThread, false); if (IsVRBuild()) { - int passes = 1; - if (!IsMultiviewSupported() && g_Config.bEnableStereo) { - passes = 2; - } + int passes = GetVRPassesCount(); for (int i = 0; i < passes; i++) { PreVRFrameRender(i); queueRunner_.RunSteps(task.steps, frameData, frameDataShared_, i < passes - 1); diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index 80bbc9a81b..a0807b049a 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -339,6 +339,14 @@ int GetVRFBOIndex() { return VR_GetConfig(VR_CONFIG_CURRENT_FBO); } +int GetVRPassesCount() { + if (!IsMultiviewSupported() && g_Config.bEnableStereo) { + return 2; + } else { + return 1; + } +} + bool IsMultiviewSupported() { return false; } diff --git a/Common/VR/PPSSPPVR.h b/Common/VR/PPSSPPVR.h index a7b5d8420d..91f5862ff0 100644 --- a/Common/VR/PPSSPPVR.h +++ b/Common/VR/PPSSPPVR.h @@ -38,6 +38,7 @@ void FinishVRRender(); void PreVRFrameRender(int fboIndex); void PostVRFrameRender(); int GetVRFBOIndex(); +int GetVRPassesCount(); bool IsMultiviewSupported(); bool IsFlatVRScene(); bool Is2DVRObject(float* projMatrix, bool ortho); @@ -65,6 +66,7 @@ inline void FinishVRRender() {} inline void PreVRFrameRender(int fboIndex) {} inline void PostVRFrameRender() {} inline int GetVRFBOIndex() { return 0; } +inline int GetVRPassesCount() { return 1; } inline bool IsMultiviewSupported() { return false; } inline bool IsFlatVRScene() { return true; } inline bool Is2DVRObject(float* projMatrix, bool ortho) { return false; }