From 1d452a2e0148a74a405ba388b33aba6b3d167fd9 Mon Sep 17 00:00:00 2001 From: Lubos Date: Thu, 3 Nov 2022 21:33:46 +0100 Subject: [PATCH] OpenXR - Add an option to disable 72Hz update --- Common/VR/PPSSPPVR.cpp | 3 +-- Core/Config.cpp | 1 + Core/Config.h | 1 + UI/GameSettingsScreen.cpp | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index ead9690173..5a81f71eec 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -111,8 +111,6 @@ void InitVROnAndroid(void* vm, void* activity, int version, const char* name) { java.AppVersion = version; strcpy(java.AppName, name); VR_Init(java, useVulkan); - - __DisplaySetFramerate(72); } #endif @@ -376,6 +374,7 @@ bool StartVRRender() { } // Set customizations + __DisplaySetFramerate(g_Config.bForce72Hz ? 72 : 60); VR_SetConfig(VR_CONFIG_6DOF_ENABLED, g_Config.bEnable6DoF); VR_SetConfig(VR_CONFIG_CAMERA_DISTANCE, g_Config.fCameraDistance * 1000); VR_SetConfig(VR_CONFIG_CAMERA_HEIGHT, g_Config.fCameraHeight * 1000); diff --git a/Core/Config.cpp b/Core/Config.cpp index f62a4baaae..03a5bb26ee 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1208,6 +1208,7 @@ static ConfigSetting vrSettings[] = { ConfigSetting("VREnable", &g_Config.bEnableVR, true), ConfigSetting("VREnable6DoF", &g_Config.bEnable6DoF, true), ConfigSetting("VREnableStereo", &g_Config.bEnableStereo, false), + ConfigSetting("VRbForce72Hz", &g_Config.bForce72Hz, true), ConfigSetting("VRCameraDistance", &g_Config.fCameraDistance, 0.0f), ConfigSetting("VRCameraHeight", &g_Config.fCameraHeight, 0.0f), ConfigSetting("VRCameraSide", &g_Config.fCameraSide, 0.0f), diff --git a/Core/Config.h b/Core/Config.h index a494cf4c61..4e15c3bb4b 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -463,6 +463,7 @@ public: bool bEnableVR; bool bEnable6DoF; bool bEnableStereo; + bool bForce72Hz; float fCameraDistance; float fCameraHeight; float fCameraSide; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 78a162f3b3..b6c3e06a8e 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1162,6 +1162,7 @@ void GameSettingsScreen::CreateViews() { CheckBox *vr6DoF = vrSettings->Add(new CheckBox(&g_Config.bEnable6DoF, vr->T("6DoF movement"))); vr6DoF->SetEnabledPtr(&g_Config.bEnableVR); vrSettings->Add(new CheckBox(&g_Config.bEnableStereo, vr->T("Stereoscopic vision (Experimental)"))); + vrSettings->Add(new CheckBox(&g_Config.bForce72Hz, vr->T("Force 72Hz update"))); vrSettings->Add(new ItemHeader(vr->T("VR camera"))); vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fCameraDistance, -10.0f, 10.0f, vr->T("Camera distance adjust", "Camera distance adjust"), 1.0f, screenManager(), ""));