From b4507cd5cca1133a44a782658568590e854a7ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 6 Nov 2022 14:36:51 +0100 Subject: [PATCH] Make a lot more code VR build for all platforms --- Common/GPU/OpenGL/GLQueueRunner.cpp | 6 ++-- Common/GPU/OpenGL/GLRenderManager.cpp | 2 +- Common/GPU/Vulkan/VulkanLoader.cpp | 2 +- Common/GPU/Vulkan/VulkanQueueRunner.cpp | 2 +- Common/GPU/Vulkan/VulkanRenderManager.cpp | 2 +- Common/VR/PPSSPPVR.cpp | 8 ++++- Common/VR/PPSSPPVR.h | 4 +-- Common/VR/VRBase.cpp | 6 ++-- Common/VR/VRBase.h | 4 +-- Common/VR/VRFramebuffer.cpp | 40 +++++++++++++---------- Common/VR/VRInput.cpp | 4 --- Common/VR/VRRenderer.cpp | 4 --- Core/Compatibility.cpp | 3 ++ Core/Config.cpp | 2 +- Core/KeyMap.cpp | 2 +- GPU/Common/PresentationCommon.cpp | 2 +- GPU/GLES/GPU_GLES.cpp | 2 +- GPU/GLES/ShaderManagerGLES.cpp | 2 +- UI/NativeApp.cpp | 2 +- android/jni/AndroidEGLContext.cpp | 2 +- android/jni/app-android.cpp | 12 +++---- assets/compatvr.ini | 18 +++++----- 22 files changed, 69 insertions(+), 62 deletions(-) diff --git a/Common/GPU/OpenGL/GLQueueRunner.cpp b/Common/GPU/OpenGL/GLQueueRunner.cpp index 84f1b1a375..bf27a4fcfa 100644 --- a/Common/GPU/OpenGL/GLQueueRunner.cpp +++ b/Common/GPU/OpenGL/GLQueueRunner.cpp @@ -280,7 +280,7 @@ void GLQueueRunner::RunInitSteps(const std::vector &steps, bool ski _dbg_assert_(query.name); int location = -1; - if (IsVRBuild() && IsMultiviewSupported()) { + if (IsVREnabled() && IsMultiviewSupported()) { int index = GetStereoBufferIndex(query.name); if (index >= 0) { std::string layout = GetStereoBufferLayout(query.name); @@ -707,7 +707,7 @@ void GLQueueRunner::RunSteps(const std::vector &steps, bool skipGLCal switch (step.stepType) { case GLRStepType::RENDER: renderCount++; - if (IsVRBuild()) { + if (IsVREnabled()) { GLRStep vrStep = step; PreprocessStepVR(&vrStep); PerformRenderPass(vrStep, renderCount == 1, renderCount == totalRenderCount); @@ -1603,7 +1603,7 @@ void GLQueueRunner::PerformBindFramebufferAsRenderTarget(const GLRStep &pass) { fbo_bind_fb_target(false, curFB_->handle); } else { fbo_unbind(); - if (IsVRBuild()) { + if (IsVREnabled()) { BindVRFramebuffer(); } // Backbuffer is now bound. diff --git a/Common/GPU/OpenGL/GLRenderManager.cpp b/Common/GPU/OpenGL/GLRenderManager.cpp index 23c133272d..f3eb5f59eb 100644 --- a/Common/GPU/OpenGL/GLRenderManager.cpp +++ b/Common/GPU/OpenGL/GLRenderManager.cpp @@ -577,7 +577,7 @@ void GLRenderManager::Run(int frame) { } } - if (IsVRBuild()) { + if (IsVREnabled()) { int passes = GetVRPassesCount(); for (int i = 0; i < passes; i++) { PreVRFrameRender(i); diff --git a/Common/GPU/Vulkan/VulkanLoader.cpp b/Common/GPU/Vulkan/VulkanLoader.cpp index 52ece65731..32984494ce 100644 --- a/Common/GPU/Vulkan/VulkanLoader.cpp +++ b/Common/GPU/Vulkan/VulkanLoader.cpp @@ -309,7 +309,7 @@ void VulkanSetAvailable(bool available) { bool VulkanMayBeAvailable() { // Unsupported in VR at the moment - if (IsVRBuild()) { + if (IsVREnabled()) { return false; } diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.cpp b/Common/GPU/Vulkan/VulkanQueueRunner.cpp index 4038c991d1..ae231d63df 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.cpp +++ b/Common/GPU/Vulkan/VulkanQueueRunner.cpp @@ -1711,7 +1711,7 @@ VKRRenderPass *VulkanQueueRunner::PerformBindFramebufferAsRenderTarget(const VKR }; renderPass = GetRenderPass(key); - if (IsVRBuild()) { + if (IsVREnabled()) { framebuf = (VkFramebuffer)BindVRFramebuffer(); } else { framebuf = backbuffer_; diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 3c1ea6f07f..732aa2a0fd 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -1325,7 +1325,7 @@ void VulkanRenderManager::Run(VKRRenderThreadTask &task) { if (task.steps.empty() && !frameData.hasAcquired) frameData.skipSwap = true; //queueRunner_.LogSteps(stepsOnThread, false); - if (IsVRBuild()) { + if (IsVREnabled()) { int passes = GetVRPassesCount(); for (int i = 0; i < passes; i++) { PreVRFrameRender(i); diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index ec20865e7b..e133ebd277 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -98,8 +98,14 @@ VR app flow integration ================================================================================ */ -bool IsVRBuild() { +bool IsVREnabled() { + // For now, let the OPENXR build flag control enablement. + // This will change. +#ifdef OPENXR return true; +#else + return false; +#endif } #if PPSSPP_PLATFORM(ANDROID) diff --git a/Common/VR/PPSSPPVR.h b/Common/VR/PPSSPPVR.h index 65a14158ff..dfb38471b1 100644 --- a/Common/VR/PPSSPPVR.h +++ b/Common/VR/PPSSPPVR.h @@ -20,7 +20,7 @@ enum VRCompatFlag { #ifdef OPENXR // VR app flow integration -bool IsVRBuild(); +bool IsVREnabled(); void InitVROnAndroid(void* vm, void* activity, const char* system, int version, const char* name); void EnterVR(bool firstStart, void* vulkanContext); void GetVRResolutionPerEye(int* width, int* height); @@ -49,7 +49,7 @@ void UpdateVRView(float* leftEye, float* rightEye); #else //dummy integration // VR app flow integration -inline bool IsVRBuild() { return false; } +inline bool IsVREnabled() { return false; } inline void InitVROnAndroid(void* vm, void* activity, const char* system, int version, const char* name) {} inline void EnterVR(bool firstTime, void* vulkanContext) {} inline void GetVRResolutionPerEye(int* width, int* height) {} diff --git a/Common/VR/VRBase.cpp b/Common/VR/VRBase.cpp index 9c36fab0db..c6661f1cf0 100644 --- a/Common/VR/VRBase.cpp +++ b/Common/VR/VRBase.cpp @@ -5,9 +5,9 @@ #include #include -#if defined(OPENXR) - +#ifndef _WIN32 #include +#endif enum ConfigsSetEXT { UNREAL_VERSION = 0, @@ -41,6 +41,8 @@ static bool vr_platform[VR_PLATFORM_MAX]; static engine_t vr_engine; int vr_initialized = 0; +#if defined(OPENXR) + void VR_Init( void* system, const char* name, int version ) { if (vr_initialized) return; diff --git a/Common/VR/VRBase.h b/Common/VR/VRBase.h index b77e6dc7d0..4e0e1e266a 100644 --- a/Common/VR/VRBase.h +++ b/Common/VR/VRBase.h @@ -28,12 +28,12 @@ using namespace PPSSPP_VK; #include #elif defined(_WIN32) #include "Common/CommonWindows.h" +#include "Common/GPU/OpenGL/GLCommon.h" #include #define XR_USE_PLATFORM_WIN32 1 -#define XR_USE_GRAPHICS_API_OPENGL_ES 1 +#define XR_USE_GRAPHICS_API_OPENGL 1 #define XR_USE_GRAPHICS_API_VULKAN 1 #else -#define XR_USE_GRAPHICS_API_OPENGL_ES 1 #define XR_USE_GRAPHICS_API_VULKAN 1 #endif diff --git a/Common/VR/VRFramebuffer.cpp b/Common/VR/VRFramebuffer.cpp index be4b14c3e0..2122191bec 100644 --- a/Common/VR/VRFramebuffer.cpp +++ b/Common/VR/VRFramebuffer.cpp @@ -43,9 +43,9 @@ void ovrFramebuffer_Clear(ovrFramebuffer* frameBuffer) { frameBuffer->Acquired = false; } -#ifdef OPENXR +#if XR_USE_GRAPHICS_API_OPENGL_ES -bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, bool multiview) { +static bool ovrFramebuffer_CreateGLES(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, bool multiview) { frameBuffer->Width = width; frameBuffer->Height = height; @@ -56,12 +56,11 @@ bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int } typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVR)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei); - auto glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVR)eglGetProcAddress ("glFramebufferTextureMultiviewOVR"); - if (!glFramebufferTextureMultiviewOVR) - { + PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVR glFramebufferTextureMultiviewOVR = nullptr; + glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVR)eglGetProcAddress ("glFramebufferTextureMultiviewOVR"); + if (!glFramebufferTextureMultiviewOVR) { ALOGE("Can not get proc address for glFramebufferTextureMultiviewOVR.\n"); } - XrSwapchainCreateInfo swapChainCreateInfo; memset(&swapChainCreateInfo, 0, sizeof(swapChainCreateInfo)); swapChainCreateInfo.type = XR_TYPE_SWAPCHAIN_CREATE_INFO; @@ -136,8 +135,10 @@ bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int return true; } -bool ovrFramebuffer_CreateVK(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, - bool multiview, void* context) { +#endif + +static bool ovrFramebuffer_CreateVK(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, + bool multiview, void* context) { frameBuffer->Width = width; frameBuffer->Height = height; @@ -241,7 +242,7 @@ bool ovrFramebuffer_CreateVK(XrSession session, ovrFramebuffer* frameBuffer, int void ovrFramebuffer_Destroy(ovrFramebuffer* frameBuffer) { if (VR_GetPlatformFLag(VR_PLATFORM_RENDERER_VULKAN)) { - for (int i = 0; i < frameBuffer->TextureSwapChainLength; i++) { + for (int i = 0; i < (int)frameBuffer->TextureSwapChainLength; i++) { vkDestroyImageView(frameBuffer->VKContext->device, frameBuffer->VKColorImages[i], nullptr); vkDestroyImageView(frameBuffer->VKContext->device, frameBuffer->VKDepthImages[i], nullptr); vkDestroyFramebuffer(frameBuffer->VKContext->device, frameBuffer->VKFrameBuffers[i], nullptr); @@ -250,7 +251,7 @@ void ovrFramebuffer_Destroy(ovrFramebuffer* frameBuffer) { delete[] frameBuffer->VKDepthImages; delete[] frameBuffer->VKFrameBuffers; } else { -#ifdef XR_USE_GRAPHICS_API_OPENGL_ES +#if XR_USE_GRAPHICS_API_OPENGL_ES || XR_USE_GRAPHICS_API_OPENGL GL(glDeleteFramebuffers(frameBuffer->TextureSwapChainLength, frameBuffer->GLFrameBuffers)); free(frameBuffer->GLFrameBuffers); #endif @@ -267,7 +268,7 @@ void* ovrFramebuffer_SetCurrent(ovrFramebuffer* frameBuffer) { if (VR_GetPlatformFLag(VR_PLATFORM_RENDERER_VULKAN)) { return (void *)frameBuffer->VKFrameBuffers[frameBuffer->TextureSwapChainIndex]; } else { -#ifdef XR_USE_GRAPHICS_API_OPENGL_ES +#if XR_USE_GRAPHICS_API_OPENGL_ES || XR_USE_GRAPHICS_API_OPENGL GL(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBuffer->GLFrameBuffers[frameBuffer->TextureSwapChainIndex])); #endif return nullptr; @@ -299,7 +300,7 @@ void ovrFramebuffer_Acquire(ovrFramebuffer* frameBuffer) { if (VR_GetPlatformFLag(VR_PLATFORM_RENDERER_VULKAN)) { //TODO:implement } else { -#ifdef XR_USE_GRAPHICS_API_OPENGL_ES +#if XR_USE_GRAPHICS_API_OPENGL_ES || XR_USE_GRAPHICS_API_OPENGL GL(glEnable( GL_SCISSOR_TEST )); GL(glViewport( 0, 0, frameBuffer->Width, frameBuffer->Height )); GL(glClearColor( 0.0f, 0.0f, 0.0f, 1.0f )); @@ -321,7 +322,7 @@ void ovrFramebuffer_Release(ovrFramebuffer* frameBuffer) { if (VR_GetPlatformFLag(VR_PLATFORM_RENDERER_VULKAN)) { //TODO:implement } else { -#ifdef XR_USE_GRAPHICS_API_OPENGL_ES +#if XR_USE_GRAPHICS_API_OPENGL_ES || XR_USE_GRAPHICS_API_OPENGL GL(glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE)); GL(glClearColor(0.0f, 0.0f, 0.0f, 1.0f)); GL(glClear(GL_COLOR_BUFFER_BIT)); @@ -352,8 +353,10 @@ void ovrRenderer_Create(XrSession session, ovrRenderer* renderer, int width, int if (vulkanContext) { ovrFramebuffer_CreateVK(session, &renderer->FrameBuffer[i], width, height, multiview, vulkanContext); } else { -#ifdef XR_USE_GRAPHICS_API_OPENGL_ES - ovrFramebuffer_CreateGL(session, &renderer->FrameBuffer[i], width, height, multiview); +#if XR_USE_GRAPHICS_API_OPENGL_ES + ovrFramebuffer_CreateGLES(session, &renderer->FrameBuffer[i], width, height, multiview); +#elif XR_USE_GRAPHICS_API_OPENGL + // TODO #endif } } @@ -370,7 +373,7 @@ void ovrRenderer_MouseCursor(ovrRenderer* renderer, int x, int y, int size) { if (VR_GetPlatformFLag(VR_PLATFORM_RENDERER_VULKAN)) { //TODO:implement } else { -#ifdef XR_USE_GRAPHICS_API_OPENGL_ES +#if XR_USE_GRAPHICS_API_OPENGL_ES || XR_USE_GRAPHICS_API_OPENGL GL(glEnable(GL_SCISSOR_TEST)); GL(glScissor(x, y, size, size)); GL(glViewport(x, y, size, size)); @@ -414,6 +417,7 @@ void ovrApp_Destroy(ovrApp* app) { ovrApp_Clear(app); } + void ovrApp_HandleSessionStateChanges(ovrApp* app, XrSessionState state) { if (state == XR_SESSION_STATE_READY) { assert(app->SessionActive == false); @@ -428,6 +432,7 @@ void ovrApp_HandleSessionStateChanges(ovrApp* app, XrSessionState state) { OXR(result = xrBeginSession(app->Session, &sessionBeginInfo)); app->SessionActive = (result == XR_SUCCESS); +#ifdef ANDROID if (app->SessionActive && VR_GetPlatformFLag(VR_PLATFORM_PERFORMANCE_EXT)) { XrPerfSettingsLevelEXT cpuPerfLevel = XR_PERF_SETTINGS_LEVEL_BOOST_EXT; XrPerfSettingsLevelEXT gpuPerfLevel = XR_PERF_SETTINGS_LEVEL_BOOST_EXT; @@ -450,6 +455,7 @@ void ovrApp_HandleSessionStateChanges(ovrApp* app, XrSessionState state) { OXR(pfnSetAndroidApplicationThreadKHR(app->Session, XR_ANDROID_THREAD_TYPE_APPLICATION_MAIN_KHR, app->MainThreadTid)); OXR(pfnSetAndroidApplicationThreadKHR(app->Session, XR_ANDROID_THREAD_TYPE_RENDERER_MAIN_KHR, app->RenderThreadTid)); } +#endif } else if (state == XR_SESSION_STATE_STOPPING) { assert(app->SessionActive); @@ -538,5 +544,3 @@ int ovrApp_HandleXrEvents(ovrApp* app) { } return recenter; } - -#endif diff --git a/Common/VR/VRInput.cpp b/Common/VR/VRInput.cpp index 27cf0eb2fd..912bbca17f 100644 --- a/Common/VR/VRInput.cpp +++ b/Common/VR/VRInput.cpp @@ -1,8 +1,6 @@ #include "VRInput.h" #include -#ifdef OPENXR - //OpenXR XrPath leftHandPath; XrPath rightHandPath; @@ -464,5 +462,3 @@ XrPosef IN_VRGetPose( int controllerIndex ) { xrLocateSpace(aimSpace[controllerIndex], engine->appState.CurrentSpace, (XrTime)(engine->predictedDisplayTime), &loc); return loc.pose; } - -#endif diff --git a/Common/VR/VRRenderer.cpp b/Common/VR/VRRenderer.cpp index f04a3c15c8..50fc4c0003 100644 --- a/Common/VR/VRRenderer.cpp +++ b/Common/VR/VRRenderer.cpp @@ -22,8 +22,6 @@ float vrConfigFloat[VR_CONFIG_FLOAT_MAX] = {}; XrVector3f hmdorientation; XrVector3f hmdposition; -#ifdef OPENXR - void VR_UpdateStageBounds(ovrApp* pappState) { XrExtent2Df stageBounds = {}; @@ -554,5 +552,3 @@ void* VR_BindFramebuffer(engine_t *engine) { ovrMatrix4f VR_GetMatrix( VRMatrix matrix ) { return vrMatrix[matrix]; } - -#endif diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index f59a0da45b..4ce6b322e5 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -17,6 +17,7 @@ #include +#include "Common/Log.h" #include "Common/Data/Format/IniFile.h" #include "Common/StringUtils.h" #include "Core/Compatibility.h" @@ -122,6 +123,8 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) { CheckSetting(iniFile, gameID, "Skyplane", &vrCompat_.Skyplane); CheckSetting(iniFile, gameID, "UnitsPerMeter", &vrCompat_.UnitsPerMeter); + + NOTICE_LOG(G3D, "UnitsPerMeter for %s: %f", gameID.c_str(), vrCompat_.UnitsPerMeter); } void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) { diff --git a/Core/Config.cpp b/Core/Config.cpp index b8d1408144..b1f22523f4 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -697,7 +697,7 @@ const char * const vulkanDefaultBlacklist[] = { }; static int DefaultGPUBackend() { - if (IsVRBuild()) { + if (IsVREnabled()) { return (int)GPUBackend::OPENGL; } diff --git a/Core/KeyMap.cpp b/Core/KeyMap.cpp index 0be4dd7182..8c84be11e1 100644 --- a/Core/KeyMap.cpp +++ b/Core/KeyMap.cpp @@ -667,7 +667,7 @@ void RestoreDefault() { g_controllerMap.clear(); g_controllerMapGeneration++; - if (IsVRBuild()) { + if (IsVREnabled()) { SetDefaultKeyMap(DEFAULT_MAPPING_VR_HEADSET, false); return; } diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index b4e05d8d50..aec95318ec 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -77,7 +77,7 @@ void CenterDisplayOutputRect(FRect *rc, float origW, float origH, const FRect &f SmallDisplayZoom zoomType = (SmallDisplayZoom)g_Config.iSmallDisplayZoomType; - if (IsVRBuild()) { + if (IsVREnabled()) { if (IsFlatVRScene()) { zoomType = SmallDisplayZoom::AUTO; } else { diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index b6b2b6a661..f67e90d335 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -210,7 +210,7 @@ u32 GPU_GLES::CheckGPUFeatures() const { features |= GPU_USE_FRAGMENT_TEST_CACHE; } - if (IsVRBuild()) { + if (IsVREnabled()) { features |= GPU_USE_VIRTUAL_REALITY; } if (IsMultiviewSupported()) { diff --git a/GPU/GLES/ShaderManagerGLES.cpp b/GPU/GLES/ShaderManagerGLES.cpp index 118c8c3fed..04a1a85974 100644 --- a/GPU/GLES/ShaderManagerGLES.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -457,7 +457,7 @@ void LinkedShader::UpdateUniforms(u32 vertType, const ShaderID &vsid, bool useBu } if (dirty & DIRTY_FOGCOLOR) { SetColorUniform3(render_, &u_fogcolor, gstate.fogcolor); - if (IsVRBuild()) { + if (IsVREnabled()) { SetVRCompat(VR_COMPAT_FOG_COLOR, gstate.fogcolor); } } diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 0f4cac7f37..d387e7064b 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1297,7 +1297,7 @@ bool NativeTouch(const TouchInput &touch) { bool NativeKey(const KeyInput &key) { // Special key VR actions - if (IsVRBuild()) { + if (IsVREnabled()) { UpdateVRSpecialKeys(key); } diff --git a/android/jni/AndroidEGLContext.cpp b/android/jni/AndroidEGLContext.cpp index 9507c217e6..0cddc2b7f3 100644 --- a/android/jni/AndroidEGLContext.cpp +++ b/android/jni/AndroidEGLContext.cpp @@ -47,7 +47,7 @@ bool AndroidEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int des } gl->MakeCurrent(); if (gl->GetMode() == GLInterfaceMode::MODE_OPENGL) - SetGLCoreContext(!IsVRBuild()); + SetGLCoreContext(!IsVREnabled()); CheckGLExtensions(); draw_ = Draw::T3DCreateGLContext(); SetGPUBackend(GPUBackend::OPENGL); diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 9e685cfaaf..b74d345dc4 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -757,7 +757,7 @@ retry: EmuThreadStart(); } - if (IsVRBuild()) { + if (IsVREnabled()) { Version gitVer(PPSSPP_GIT_VERSION); InitVROnAndroid(gJvm, nativeActivity, systemName.c_str(), gitVer.ToInteger(), "PPSSPP"); } @@ -939,7 +939,7 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, } NativeMessageReceived("recreateviews", ""); - if (IsVRBuild()) { + if (IsVREnabled()) { EnterVR(firstStart, graphicsContext->GetAPIContext()); } @@ -982,7 +982,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv pixel_yres = bufh; backbuffer_format = format; - if (IsVRBuild()) { + if (IsVREnabled()) { GetVRResolutionPerEye(&pixel_xres, &pixel_yres); } @@ -1057,7 +1057,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env, SetCurrentThreadName("AndroidRender"); } - if (IsVRBuild() && !StartVRRender()) + if (IsVREnabled() && !StartVRRender()) return; if (useCPUThread) { @@ -1068,7 +1068,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env, UpdateRunLoopAndroid(env); } - if (IsVRBuild()) { + if (IsVREnabled()) { UpdateVRInput(NativeKey, NativeTouch, g_Config.bHapticFeedback, dp_xscale, dp_yscale); FinishVRRender(); } @@ -1291,7 +1291,7 @@ void getDesiredBackbufferSize(int &sz_x, int &sz_y) { extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JNIEnv *, jclass, jint xres, jint yres, jint dpi, jfloat refreshRate) { INFO_LOG(G3D, "NativeApp.setDisplayParameters(%d x %d, dpi=%d, refresh=%0.2f)", xres, yres, dpi, refreshRate); - if (IsVRBuild()) { + if (IsVREnabled()) { int width, height; GetVRResolutionPerEye(&width, &height); xres = width; diff --git a/assets/compatvr.ini b/assets/compatvr.ini index 430fb80e47..bc4e1a6dd1 100644 --- a/assets/compatvr.ini +++ b/assets/compatvr.ini @@ -313,15 +313,6 @@ ULUS10319 = 10.0 # Bowling 3D NPUZ00002 = 1.0 -# Burnout Legends -NPJH50305 = 1.0 -ULAS42019 = 1.0 -ULES00125 = 1.0 -ULJM05049 = 1.0 -ULJM05228 = 1.0 -ULKS46027 = 1.0 -ULUS10025 = 1.0 - # Brain Challenge NPEH00003 = 30.0 NPJH00002 = 30.0 @@ -335,6 +326,15 @@ NPUZ00031 = 1.0 NPEZ00023 = 1.0 NPUZ00007 = 1.0 +# Burnout Legends +ULES00125 = 2.0 +ULUS10025 = 2.0 +ULJM05228 = 2.0 +NPJH50305 = 2.0 +ULJM05049 = 2.0 +ULKS46027 = 2.0 +ULAS42019 = 2.0 + # Bust-A-Move Deluxe NPJH50087 = 1.0 ULES00233 = 1.0