From c53c33c0c21a678a964d6e8b77b8d0f1a4768ded Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 28 Sep 2023 21:16:54 -0700 Subject: [PATCH 01/22] irjit: Fix vhtfm instruction. --- Core/MIPS/IR/IRCompVFPU.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index b6f42b237f..6f44c2ccdd 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -1675,7 +1675,7 @@ namespace MIPSComp { if (homogenous) { // This is probably even what the hardware basically does, wiring t[3] to 1.0f. ir.Write(IROp::Vec4Init, IRVTEMP_PFX_T, (int)Vec4Init::AllONE); - ir.Write(IROp::Vec4Blend, IRVTEMP_PFX_T, t, IRVTEMP_PFX_T, 0x7); + ir.Write(IROp::Vec4Blend, IRVTEMP_PFX_T, IRVTEMP_PFX_T, t, 0x7); t = IRVTEMP_PFX_T; } for (int i = 0; i < 4; i++) From 358cfd4bc65cff3419e573581351da2208d74492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 1 Oct 2023 17:59:43 +0200 Subject: [PATCH 02/22] Prevent duplicate alternate-speed status messages --- UI/EmuScreen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 09ddf81411..d4851dbc87 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -606,13 +606,13 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) { // Cycle through enabled speeds. if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL && g_Config.iFpsLimit1 >= 0) { PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0, "altspeed"); } else if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1 && g_Config.iFpsLimit2 >= 0) { PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM2; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0, "altspeed"); } else if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1 || PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) { PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0, "altspeed"); } } break; @@ -621,12 +621,12 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) { if (down) { if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) { PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM1; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("fixed", "Speed: alternate"), 1.0, "altspeed"); } } else { if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1) { PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0, "altspeed"); } } break; @@ -634,12 +634,12 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) { if (down) { if (PSP_CoreParameter().fpsLimit == FPSLimit::NORMAL) { PSP_CoreParameter().fpsLimit = FPSLimit::CUSTOM2; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("SpeedCustom2", "Speed: alternate 2"), 1.0, "altspeed"); } } else { if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2) { PSP_CoreParameter().fpsLimit = FPSLimit::NORMAL; - g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0); + g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("standard", "Speed: standard"), 1.0, "altspeed"); } } break; From 3236f5469380ab1e26d9d988ec3fcce1f99c1857 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 2 Oct 2023 20:26:07 -0700 Subject: [PATCH 03/22] x86: Fix 32-bit IR jit block entry. --- Core/MIPS/x86/X64IRAsm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/MIPS/x86/X64IRAsm.cpp b/Core/MIPS/x86/X64IRAsm.cpp index 2e095c4c12..86cb3929cb 100644 --- a/Core/MIPS/x86/X64IRAsm.cpp +++ b/Core/MIPS/x86/X64IRAsm.cpp @@ -247,7 +247,7 @@ void X64JitBackend::GenerateFixedCode(MIPSState *mipsState) { FixupBranch needsCompile = J_CC(CC_NE); // We don't mask here - that's baked into jitbase. #if PPSSPP_ARCH(X86) - LEA(32, SCRATCH1, MDisp(SCRATCH1, (u32)GetBasePtr() - MIPS_EMUHACK_VALUE_MASK)); + LEA(32, SCRATCH1, MDisp(SCRATCH1, (u32)GetBasePtr() - MIPS_EMUHACK_OPCODE)); #elif PPSSPP_ARCH(AMD64) if (jitbaseInR15) { ADD(64, R(SCRATCH1), R(JITBASEREG)); From 833fc35462f99c5489ec9c1915e3ed43283456ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 3 Oct 2023 01:06:07 +0200 Subject: [PATCH 04/22] Reduce refresh rate checks. These turned out to be unexpectedly expensive, so cache the value and also try to check it a bit less. --- Core/Core.cpp | 3 +-- Windows/main.cpp | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Core/Core.cpp b/Core/Core.cpp index b9293259a9..f6b6dc422e 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -207,8 +207,6 @@ void UpdateRunLoop(GraphicsContext *ctx) { // Note: not used on Android. void Core_RunLoop(GraphicsContext *ctx) { - float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE); - if (windowHidden && g_Config.bPauseWhenMinimized) { sleep_ms(16); return; @@ -224,6 +222,7 @@ void Core_RunLoop(GraphicsContext *ctx) { NativeFrame(ctx); if (menuThrottle) { + float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE); // Simple throttling to not burn the GPU in the menu. // TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes. double diffTime = time_now_d() - startTime; diff --git a/Windows/main.cpp b/Windows/main.cpp index 5149ebcc53..828c82a5fd 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -283,22 +283,28 @@ static int ScreenDPI() { #endif static int ScreenRefreshRateHz() { - DEVMODE lpDevMode; - memset(&lpDevMode, 0, sizeof(DEVMODE)); - lpDevMode.dmSize = sizeof(DEVMODE); - lpDevMode.dmDriverExtra = 0; + static int rate = 0; + static double lastCheck = 0.0; + double now = time_now_d(); + if (!rate || lastCheck < now - 10.0) { + lastCheck = now; + DEVMODE lpDevMode{}; + lpDevMode.dmSize = sizeof(DEVMODE); + lpDevMode.dmDriverExtra = 0; - // TODO: Use QueryDisplayConfig instead (Win7+) so we can get fractional refresh rates correctly. + // TODO: Use QueryDisplayConfig instead (Win7+) so we can get fractional refresh rates correctly. - if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &lpDevMode) == 0) { - return 60; // default value - } else { - if (lpDevMode.dmFields & DM_DISPLAYFREQUENCY) { - return lpDevMode.dmDisplayFrequency > 60 ? lpDevMode.dmDisplayFrequency : 60; + if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &lpDevMode) == 0) { + rate = 60; // default value } else { - return 60; + if (lpDevMode.dmFields & DM_DISPLAYFREQUENCY) { + rate = lpDevMode.dmDisplayFrequency > 60 ? lpDevMode.dmDisplayFrequency : 60; + } else { + rate = 60; + } } } + return rate; } int System_GetPropertyInt(SystemProperty prop) { From 15b6a480705db7814f864f7d07d2353182ccf551 Mon Sep 17 00:00:00 2001 From: aeiouaeiouaeiouaeiouaeiouaeiou Date: Tue, 3 Oct 2023 23:01:53 +0300 Subject: [PATCH 05/22] Update Russian translation --- assets/lang/ru_RU.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/lang/ru_RU.ini b/assets/lang/ru_RU.ini index 9db13ad473..cd81ee58e4 100644 --- a/assets/lang/ru_RU.ini +++ b/assets/lang/ru_RU.ini @@ -194,7 +194,7 @@ Direct3D9 = Direct3D &9 Direct3D11 = &Direct3D 11 Disassembly = &Дизассемблер... Discord = Discord -Display Layout && Effects = Редактор расположения экрана... +Display Layout && Effects = Редактор расположения экрана и эффектов... Display Rotation = Ориентация экрана Dump Next Frame to Log = Сохранить &кадр в логе Emulation = &Эмуляция @@ -581,7 +581,7 @@ Device = Устройство Direct3D 9 = Direct3D 9 Direct3D 11 = Direct3D 11 Disabled = Отключено -Display Layout && Effects = Редактор расположения экрана +Display Layout && Effects = Редактор расположения экрана и эффектов Display Resolution (HW scaler) = Разрешение экрана (аппаратное) Enable Cardboard VR = Включить Cardboard VR FPS = FPS From 89effbf498c22ed9fc3d46c7022e836b38bfb26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 4 Oct 2023 17:02:23 +0200 Subject: [PATCH 06/22] Revert "UI: Round wave coords to prevent gaps." This reverts commit ebf9de78640984d9fbba380c80872ce543b5fe00. --- UI/MiscScreens.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 754c8f6206..1d462f6065 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -136,28 +136,21 @@ public: // 500 is enough for any resolution really. 24 * 500 = 12000 which fits handily in our UI vertex buffer (max 65536 per flush). const int steps = std::max(20, std::min((int)g_display.dp_xres, 500)); - float stepSize = (float)g_display.dp_xres / (float)steps; + float step = (float)g_display.dp_xres / (float)steps; t *= speed; - float stepx = x; for (int n = 0; n < steps; n++) { - float nextx = stepx + stepSize; - // Round actual x and width to prevent gaps between waves. - float roundedx = floorf(stepx); - float w = floorf(nextx) - roundedx; + float x = (float)n * step; + float i = x * 1280 / bounds.w; - float i = stepx * 1280 / bounds.w; float wave0 = sin(i*0.005+t*0.8)*0.05 + sin(i*0.002+t*0.25)*0.02 + sin(i*0.001+t*0.3)*0.03 + 0.625; float wave1 = sin(i*0.0044+t*0.4)*0.07 + sin(i*0.003+t*0.1)*0.02 + sin(i*0.001+t*0.3)*0.01 + 0.625; - - dc.Draw()->RectVGradient(roundedx, wave0*bounds.h, w, (1.0-wave0)*bounds.h, color, 0x00000000); - dc.Draw()->RectVGradient(roundedx, wave1*bounds.h, w, (1.0-wave1)*bounds.h, color, 0x00000000); + dc.Draw()->RectVGradient(x, wave0*bounds.h, step, (1.0-wave0)*bounds.h, color, 0x00000000); + dc.Draw()->RectVGradient(x, wave1*bounds.h, step, (1.0-wave1)*bounds.h, color, 0x00000000); // Add some "antialiasing" - dc.Draw()->RectVGradient(roundedx, wave0*bounds.h-3.0f * g_display.pixel_in_dps_y, w, 3.0f * g_display.pixel_in_dps_y, 0x00000000, color); - dc.Draw()->RectVGradient(roundedx, wave1*bounds.h-3.0f * g_display.pixel_in_dps_y, w, 3.0f * g_display.pixel_in_dps_y, 0x00000000, color); - - stepx = nextx; + dc.Draw()->RectVGradient(x, wave0*bounds.h-3.0f * g_display.pixel_in_dps_y, step, 3.0f * g_display.pixel_in_dps_y, 0x00000000, color); + dc.Draw()->RectVGradient(x, wave1*bounds.h-3.0f * g_display.pixel_in_dps_y, step, 3.0f * g_display.pixel_in_dps_y, 0x00000000, color); } dc.Flush(); From d00928e1db07ebbe76567f2e485780045c6af2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 4 Oct 2023 17:07:55 +0200 Subject: [PATCH 07/22] Guaranteed gap-free rendering of waves background --- Common/Render/DrawBuffer.cpp | 18 +++++++++--------- Common/Render/DrawBuffer.h | 5 +++-- UI/MiscScreens.cpp | 9 +++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Common/Render/DrawBuffer.cpp b/Common/Render/DrawBuffer.cpp index 73c0f30a68..f8d388f074 100644 --- a/Common/Render/DrawBuffer.cpp +++ b/Common/Render/DrawBuffer.cpp @@ -106,7 +106,7 @@ void DrawBuffer::V(float x, float y, float z, uint32_t color, float u, float v) void DrawBuffer::Rect(float x, float y, float w, float h, uint32_t color, int align) { DoAlign(align, &x, &y, &w, &h); - RectVGradient(x, y, w, h, color, color); + RectVGradient(x, y, x + w, y + h, color, color); } void DrawBuffer::hLine(float x1, float y, float x2, uint32_t color) { @@ -121,13 +121,13 @@ void DrawBuffer::vLine(float x, float y1, float y2, uint32_t color) { Rect(x, y1, g_display.pixel_in_dps_x, y2 - y1, color); } -void DrawBuffer::RectVGradient(float x, float y, float w, float h, uint32_t colorTop, uint32_t colorBottom) { - V(x, y, 0, colorTop, 0, 0); - V(x + w, y, 0, colorTop, 1, 0); - V(x + w, y + h, 0, colorBottom, 1, 1); - V(x, y, 0, colorTop, 0, 0); - V(x + w, y + h, 0, colorBottom, 1, 1); - V(x, y + h, 0, colorBottom, 0, 1); +void DrawBuffer::RectVGradient(float x1, float y1, float x2, float y2, uint32_t colorTop, uint32_t colorBottom) { + V(x1, y1, 0, colorTop, 0, 0); + V(x2, y1, 0, colorTop, 1, 0); + V(x2, y2, 0, colorBottom, 1, 1); + V(x1, y1, 0, colorTop, 0, 0); + V(x2, y2, 0, colorBottom, 1, 1); + V(x1, y2, 0, colorBottom, 0, 1); } void DrawBuffer::RectOutline(float x, float y, float w, float h, uint32_t color, int align) { @@ -142,7 +142,7 @@ void DrawBuffer::MultiVGradient(float x, float y, float w, float h, const Gradie for (int i = 0; i < numStops - 1; i++) { float t0 = stops[i].t, t1 = stops[i+1].t; uint32_t c0 = stops[i].color, c1 = stops[i+1].color; - RectVGradient(x, y + h * t0, w, h * (t1 - t0), c0, c1); + RectVGradient(x, y + h * t0, x + w, y + h * (t1 - t0), c0, c1); } } diff --git a/Common/Render/DrawBuffer.h b/Common/Render/DrawBuffer.h index 8c6262c7c7..f16ab1e62c 100644 --- a/Common/Render/DrawBuffer.h +++ b/Common/Render/DrawBuffer.h @@ -83,9 +83,10 @@ public: void RectOutline(float x, float y, float w, float h, uint32_t color, int align = ALIGN_TOPLEFT); - void RectVGradient(float x, float y, float w, float h, uint32_t colorTop, uint32_t colorBottom); + // NOTE: This one takes x2/y2 instead of w/h, better for gap-free graphics. + void RectVGradient(float x1, float y1, float x2, float y2, uint32_t colorTop, uint32_t colorBottom); void RectVDarkFaded(float x, float y, float w, float h, uint32_t colorTop) { - RectVGradient(x, y, w, h, colorTop, darkenColor(colorTop)); + RectVGradient(x, y, x + w, y + h, colorTop, darkenColor(colorTop)); } void MultiVGradient(float x, float y, float w, float h, const GradientStop *stops, int numStops); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 1d462f6065..2b0ba08094 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -141,16 +141,17 @@ public: for (int n = 0; n < steps; n++) { float x = (float)n * step; + float nextX = (float)(n + 1) * step; float i = x * 1280 / bounds.w; float wave0 = sin(i*0.005+t*0.8)*0.05 + sin(i*0.002+t*0.25)*0.02 + sin(i*0.001+t*0.3)*0.03 + 0.625; float wave1 = sin(i*0.0044+t*0.4)*0.07 + sin(i*0.003+t*0.1)*0.02 + sin(i*0.001+t*0.3)*0.01 + 0.625; - dc.Draw()->RectVGradient(x, wave0*bounds.h, step, (1.0-wave0)*bounds.h, color, 0x00000000); - dc.Draw()->RectVGradient(x, wave1*bounds.h, step, (1.0-wave1)*bounds.h, color, 0x00000000); + dc.Draw()->RectVGradient(x, wave0*bounds.h, nextX, bounds.h, color, 0x00000000); + dc.Draw()->RectVGradient(x, wave1*bounds.h, nextX, bounds.h, color, 0x00000000); // Add some "antialiasing" - dc.Draw()->RectVGradient(x, wave0*bounds.h-3.0f * g_display.pixel_in_dps_y, step, 3.0f * g_display.pixel_in_dps_y, 0x00000000, color); - dc.Draw()->RectVGradient(x, wave1*bounds.h-3.0f * g_display.pixel_in_dps_y, step, 3.0f * g_display.pixel_in_dps_y, 0x00000000, color); + dc.Draw()->RectVGradient(x, wave0*bounds.h-3.0f * g_display.pixel_in_dps_y, nextX, wave0 * bounds.h, 0x00000000, color); + dc.Draw()->RectVGradient(x, wave1*bounds.h-3.0f * g_display.pixel_in_dps_y, nextX, wave1 * bounds.h, 0x00000000, color); } dc.Flush(); From 37de5b9d0db10352f287277692de6353b5658343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 4 Oct 2023 16:57:06 +0200 Subject: [PATCH 08/22] Move the menu frame-rate throttling to NativeFrame Now needed on Android since we added the ability to turn off vsync, which caused the menu to burn battery by rendering too fast. --- Core/Core.cpp | 17 ----------------- UI/NativeApp.cpp | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Core/Core.cpp b/Core/Core.cpp index f6b6dc422e..36f9fd0f83 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -212,24 +212,7 @@ void Core_RunLoop(GraphicsContext *ctx) { return; } - bool menuThrottle = (GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT; - - double startTime; - if (menuThrottle) { - startTime = time_now_d(); - } - NativeFrame(ctx); - - if (menuThrottle) { - float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE); - // Simple throttling to not burn the GPU in the menu. - // TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes. - double diffTime = time_now_d() - startTime; - int sleepTime = (int)(1000.0 / refreshRate) - (int)(diffTime * 1000.0); - if (sleepTime > 0) - sleep_ms(sleepTime); - } } void Core_DoSingleStep() { diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index f4056c10b3..0c4a9ba32c 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1070,6 +1070,13 @@ static Matrix4x4 ComputeOrthoMatrix(float xres, float yres) { void NativeFrame(GraphicsContext *graphicsContext) { PROFILE_END_FRAME(); + bool menuThrottle = (GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT; + + double startTime; + if (menuThrottle) { + startTime = time_now_d(); + } + std::vector toProcess; { std::lock_guard lock(pendingMutex); @@ -1183,6 +1190,16 @@ void NativeFrame(GraphicsContext *graphicsContext) { // INFO_LOG(G3D, "Polling graphics context"); graphicsContext->Poll(); } + + if (menuThrottle) { + float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE); + // Simple throttling to not burn the GPU in the menu. + // TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes. + double diffTime = time_now_d() - startTime; + int sleepTime = (int)(1000.0 / refreshRate) - (int)(diffTime * 1000.0); + if (sleepTime > 0) + sleep_ms(sleepTime); + } } bool HandleGlobalMessage(const std::string &msg, const std::string &value) { From 8d59e30b53d929e9dceaa0c99cb281204fd40789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 22 Aug 2023 17:10:25 +0200 Subject: [PATCH 09/22] Gradle: Fix some deprecation warnings --- android/build.gradle | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index c2e08dc091..1acfad56d2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -45,10 +45,9 @@ android { } } - compileSdkVersion 33 + compileSdk 33 ndkVersion "21.4.7075529" - defaultConfig { applicationId 'org.ppsspp.ppsspp' if (androidGitVersion.name() != "unknown" && androidGitVersion.code() >= 14000000) { @@ -63,8 +62,8 @@ android { new File("versionname.txt").write(androidGitVersion.name()) new File("versioncode.txt").write(androidGitVersion.code().toString()) - minSdkVersion 9 - targetSdkVersion 33 + minSdk 9 + targetSdk 33 if (project.hasProperty("ANDROID_VERSION_CODE") && project.hasProperty("ANDROID_VERSION_NAME")) { versionCode ANDROID_VERSION_CODE versionName ANDROID_VERSION_NAME From a9987c6885b23bd047b053858bc5e1d1c9751c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 8 Oct 2023 19:07:29 +0200 Subject: [PATCH 10/22] Turn off HTTPS support for iOS. Should fix #18322 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d36a7e4b78..3c8a1b196e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,7 +220,7 @@ else() set(CoreLinkType STATIC) endif() -if(NOT ANDROID AND NOT WIN32 AND NOT APPLE) +if(NOT ANDROID AND NOT WIN32 AND NOT MACOSX) set(HTTPS_NOT_AVAILABLE ON) endif() From 31f28a3eaf998e1153bf0a0b4c8a50740a3bfdbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 8 Oct 2023 21:16:47 +0200 Subject: [PATCH 11/22] Fix the CMake expression, thanks Halo-Michael --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c8a1b196e..2dfb26e2b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,7 +220,7 @@ else() set(CoreLinkType STATIC) endif() -if(NOT ANDROID AND NOT WIN32 AND NOT MACOSX) +if(NOT ANDROID AND NOT WIN32 AND (NOT APPLE OR IOS)) set(HTTPS_NOT_AVAILABLE ON) endif() From c362c159d7020eed013515467e2fc03d0fb82673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Oct 2023 19:14:19 +0200 Subject: [PATCH 12/22] VulkanDescSetPool: Don't forget to increment usage --- Common/GPU/Vulkan/VulkanMemory.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Common/GPU/Vulkan/VulkanMemory.cpp b/Common/GPU/Vulkan/VulkanMemory.cpp index f29fc33d0b..a112499493 100644 --- a/Common/GPU/Vulkan/VulkanMemory.cpp +++ b/Common/GPU/Vulkan/VulkanMemory.cpp @@ -202,6 +202,8 @@ VkDescriptorSet VulkanDescSetPool::Allocate(int n, const VkDescriptorSetLayout * return VK_NULL_HANDLE; } + usage_ += n; + vulkan_->SetDebugName(desc, VK_OBJECT_TYPE_DESCRIPTOR_SET, tag); return desc; } From 51fd502d7dc21b87172c1aaa2c0924e39b8531f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Oct 2023 19:15:59 +0200 Subject: [PATCH 13/22] Update rcheevos --- ext/rcheevos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/rcheevos b/ext/rcheevos index a34895b5e5..24dc84ca2d 160000 --- a/ext/rcheevos +++ b/ext/rcheevos @@ -1 +1 @@ -Subproject commit a34895b5e59b70e0d58714f71df416dca2437ebc +Subproject commit 24dc84ca2dfbdbddebc9a26f4df225888e56a4f4 From a3c2d058e0845784a616a38cf3040d948a303193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 3 Oct 2023 12:16:53 +0200 Subject: [PATCH 14/22] Fix main-thread stalls due to decimate during replacement texture loading --- GPU/Common/TextureReplacer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index a3f0cf8496..be1fc7fff3 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -809,9 +809,13 @@ void TextureReplacer::Decimate(ReplacerDecimateMode mode) { const double threshold = time_now_d() - age; size_t totalSize = 0; for (auto &item : levelCache_) { - std::lock_guard guard(item.second->lock_); - item.second->PurgeIfNotUsedSinceTime(threshold); - totalSize += item.second->GetTotalDataSize(); // TODO: Make something better. + // During decimation, it's fine to try-lock here to avoid blocking the main thread while + // the level is being loaded - in that case we don't want to decimate anyway. + if (item.second->lock_.try_lock()) { + item.second->PurgeIfNotUsedSinceTime(threshold); + totalSize += item.second->GetTotalDataSize(); // TODO: Make something better. + item.second->lock_.unlock(); + } // don't actually delete the items here, just clean out the data. } From 52dae5c9a79c49e9b6c662e20527f2f3e51a6311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Oct 2023 23:44:23 +0200 Subject: [PATCH 15/22] README.md update for 1.16.6 --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92a73befab..678d0d2467 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,15 @@ If you want to download regularly updated builds for Android, Windows x86 and x6 For game compatibility, see [community compatibility feedback](https://report.ppsspp.org/games). +What's new in 1.16.6 +==================== +- Fix performance issue with Vulkan descriptor set allocation ([#18332]) +- Smoother loading of replacement textures +- Fix the store on iOS ([#18323]) +- Fix problem with waves background ([#18310]) +- Some translation updates +- Other minor fixes + What's new in 1.16.5 ==================== - Additional crash and memory-leak fixes ([#18243], [#18244], [#18247]) @@ -449,4 +458,4 @@ Credit goes to: [#18261]: https://github.com/hrydgard/ppsspp/issues/18261 "Revert \"Merge pull request #18184 from hrydgard/expand-lines-mem-fix\"" [#18255]: https://github.com/hrydgard/ppsspp/issues/18255 "Fix issue uploading narrow textures in OpenGL." [#18250]: https://github.com/hrydgard/ppsspp/issues/18250 "Separate out accelerometer events from joystick axis events" -[#18249]: https://github.com/hrydgard/ppsspp/issues/18249 "arm64jit: Avoid fused multiplies in vcrsp.t" \ No newline at end of file +[#18249]: https://github.com/hrydgard/ppsspp/issues/18249 "arm64jit: Avoid fused multiplies in vcrsp.t" From d60c9a015f4aa0d53b41085fc21fcd3143c72266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 11 Oct 2023 09:04:28 +0200 Subject: [PATCH 16/22] Vulkan: Fix synchronization when shutting the GPU down in-game. --- Common/GPU/Vulkan/VulkanQueueRunner.cpp | 6 ++++-- Common/GPU/Vulkan/VulkanRenderManager.cpp | 4 ++++ GPU/Vulkan/GPU_Vulkan.cpp | 2 ++ UI/EmuScreen.cpp | 15 +++++++++------ UI/EmuScreen.h | 2 +- Windows/EmuThread.cpp | 2 ++ 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.cpp b/Common/GPU/Vulkan/VulkanQueueRunner.cpp index c4a04f90bc..b785d48f3a 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.cpp +++ b/Common/GPU/Vulkan/VulkanQueueRunner.cpp @@ -1261,7 +1261,8 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c if (pipeline != VK_NULL_HANDLE) { vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); - pipelineLayout = c.pipeline.pipelineLayout; + pipelineLayout = c.graphics_pipeline.pipelineLayout; + _dbg_assert_(pipelineLayout != VK_NULL_HANDLE); lastGraphicsPipeline = graphicsPipeline; pipelineOK = true; } else { @@ -1283,7 +1284,8 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c VkPipeline pipeline = computePipeline->pipeline->BlockUntilReady(); if (pipeline != VK_NULL_HANDLE) { vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline); - pipelineLayout = c.pipeline.pipelineLayout; + pipelineLayout = c.compute_pipeline.pipelineLayout; + _dbg_assert_(pipelineLayout != VK_NULL_HANDLE); lastComputePipeline = computePipeline; } } diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 4414af64f9..8b18b512c1 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -518,12 +518,14 @@ void VulkanRenderManager::CompileThreadFunc() { } void VulkanRenderManager::DrainAndBlockCompileQueue() { + EndCurRenderStep(); std::unique_lock lock(compileMutex_); compileBlocked_ = true; compileCond_.notify_all(); while (!compileQueue_.empty()) { queueRunner_.WaitForCompileNotification(); } + FlushSync(); } void VulkanRenderManager::ReleaseCompileQueue() { @@ -1518,6 +1520,8 @@ void VulkanRenderManager::Run(VKRRenderThreadTask &task) { // Called from main thread. void VulkanRenderManager::FlushSync() { + _dbg_assert_(!curRenderStep_); + if (invalidationCallback_) { invalidationCallback_(InvalidationCallbackFlags::COMMAND_BUFFER_STATE); } diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 10a46ca9ee..5f045f265d 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -167,6 +167,7 @@ void GPU_Vulkan::SaveCache(const Path &filename) { GPU_Vulkan::~GPU_Vulkan() { if (draw_) { VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); + // This now also does a hard sync with the render thread, so that we can safely delete our pipeline layout below. rm->DrainAndBlockCompileQueue(); } @@ -427,6 +428,7 @@ void GPU_Vulkan::DeviceLost() { sleep_ms(10); } // draw_ is normally actually still valid here in Vulkan. But we null it out in GPUCommonHW::DeviceLost so we don't try to use it again. + // So, we have to save it here to be able to call ReleaseCompileQueue(). Draw::DrawContext *draw = draw_; if (draw) { VulkanRenderManager *rm = (VulkanRenderManager *)draw->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index d4851dbc87..dffc575022 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1174,7 +1174,7 @@ void EmuScreen::update() { } } -void EmuScreen::checkPowerDown() { +bool EmuScreen::checkPowerDown() { if (PSP_IsRebooting()) { bootPending_ = true; invalid_ = true; @@ -1188,7 +1188,9 @@ void EmuScreen::checkPowerDown() { screenManager()->switchScreen(new MainScreen()); bootPending_ = false; invalid_ = true; + return true; } + return false; } static const char *CPUCoreAsString(int core) { @@ -1451,6 +1453,7 @@ void EmuScreen::render() { Core_UpdateDebugStats((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS || g_Config.bLogFrameDrops); bool blockedExecution = Achievements::IsBlockingExecution(); + bool rebind = false; if (!blockedExecution) { PSP_BeginHostFrame(); PSP_RunLoopWhileState(); @@ -1487,7 +1490,7 @@ void EmuScreen::render() { // Didn't actually reach the end of the frame, ran out of the blockTicks cycles. // In this case we need to bind and wipe the backbuffer, at least. // It's possible we never ended up outputted anything - make sure we have the backbuffer cleared - thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_NoFrame"); + rebind = true; break; } @@ -1495,10 +1498,10 @@ void EmuScreen::render() { } // This must happen after PSP_EndHostFrame so that things like push buffers are end-frame'd before we start destroying stuff. - checkPowerDown(); - - if (invalid_) - return; + if (checkPowerDown() || rebind) { + // Shutting down can end up ending the current render pass + thin3d->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR }, "EmuScreen_NoFrame"); + } if (hasVisibleUI()) { // In most cases, this should already be bound and a no-op. diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 970844ba18..6dd30aa3ca 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -76,7 +76,7 @@ private: void onVKeyAnalog(int virtualKeyCode, float value); void autoLoad(); - void checkPowerDown(); + bool checkPowerDown(); UI::Event OnDevMenu; UI::Event OnChatMenu; diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 71af97e683..e0ae538222 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -335,6 +335,8 @@ shutdown: g_graphicsContext->Shutdown(); + delete g_graphicsContext; + UpdateConsolePosition(); NativeShutdown(); From 028c7c3ea80a993f1ac92c004a7afca7000fa6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 9 Oct 2023 18:24:43 +0200 Subject: [PATCH 17/22] Android: Fix crashes on screen rotation --- Common/GPU/Vulkan/VulkanFrameData.cpp | 4 ++++ Common/Render/ManagedTexture.cpp | 9 ++++++++- android/jni/app-android.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Common/GPU/Vulkan/VulkanFrameData.cpp b/Common/GPU/Vulkan/VulkanFrameData.cpp index c2d233356c..3f1ee51133 100644 --- a/Common/GPU/Vulkan/VulkanFrameData.cpp +++ b/Common/GPU/Vulkan/VulkanFrameData.cpp @@ -90,6 +90,10 @@ void FrameData::AcquireNextImage(VulkanContext *vulkan, FrameDataShared &shared) WARN_LOG(G3D, "%s returned from AcquireNextImage - processing the frame, but not presenting", VulkanResultToString(res)); skipSwap = true; break; + case VK_ERROR_SURFACE_LOST_KHR: + ERROR_LOG(G3D, "%s returned from AcquireNextImage - ignoring, but this better be during shutdown", VulkanResultToString(res)); + skipSwap = true; + break; default: // Weird, shouldn't get any other values. Maybe lost device? _assert_msg_(false, "vkAcquireNextImageKHR failed! result=%s", VulkanResultToString(res)); diff --git a/Common/Render/ManagedTexture.cpp b/Common/Render/ManagedTexture.cpp index dce43253c2..c926ea9ddd 100644 --- a/Common/Render/ManagedTexture.cpp +++ b/Common/Render/ManagedTexture.cpp @@ -186,8 +186,15 @@ void ManagedTexture::DeviceLost() { void ManagedTexture::DeviceRestored(Draw::DrawContext *draw) { INFO_LOG(G3D, "ManagedTexture::DeviceRestored(%s)", filename_.c_str()); - _assert_(!texture_); + draw_ = draw; + + _dbg_assert_(!texture_); + if (texture_) { + ERROR_LOG(G3D, "ManagedTexture: Unexpected - texture already present: %s", filename_.c_str()); + return; + } + // Vulkan: Can't load textures before the first frame has started. // Should probably try to lift that restriction again someday.. loadPending_ = true; diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 79048d9595..ffaf3d05a2 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -1454,6 +1454,12 @@ static void ProcessFrameCommands(JNIEnv *env) { extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoop(JNIEnv *env, jobject obj, jobject _surf) { _assert_(!useCPUThread); + if (renderLoopRunning) { + // Shouldn't happen. + ERROR_LOG(G3D, "runVulkanRenderLoop: Loop already running."); + return false; + } + if (!graphicsContext) { ERROR_LOG(G3D, "runVulkanRenderLoop: Tried to enter without a created graphics context."); renderLoopRunning = false; From 2c751d39f8f7b947ba30bd143f033dde7f6d5efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 12 Oct 2023 09:01:34 +0200 Subject: [PATCH 18/22] Vulkan: Add simple delete count to GPU profiler, to make sure we don't have more resource churn Also fix the render pass type name lookup table. --- Common/GPU/Vulkan/VulkanContext.cpp | 21 +++++++++++++++++++++ Common/GPU/Vulkan/VulkanContext.h | 9 +++++++++ Common/GPU/Vulkan/VulkanQueueRunner.cpp | 8 -------- Common/GPU/Vulkan/VulkanRenderManager.cpp | 2 ++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index b100e83a96..05607469c8 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -1666,80 +1666,101 @@ void VulkanDeleteList::Take(VulkanDeleteList &del) { } void VulkanDeleteList::PerformDeletes(VulkanContext *vulkan, VmaAllocator allocator) { + int deleteCount = 0; + for (auto &callback : callbacks_) { callback.func(vulkan, callback.userdata); + deleteCount++; } callbacks_.clear(); VkDevice device = vulkan->GetDevice(); for (auto &cmdPool : cmdPools_) { vkDestroyCommandPool(device, cmdPool, nullptr); + deleteCount++; } cmdPools_.clear(); for (auto &descPool : descPools_) { vkDestroyDescriptorPool(device, descPool, nullptr); + deleteCount++; } descPools_.clear(); for (auto &module : modules_) { vkDestroyShaderModule(device, module, nullptr); + deleteCount++; } modules_.clear(); for (auto &buf : buffers_) { vkDestroyBuffer(device, buf, nullptr); + deleteCount++; } buffers_.clear(); for (auto &buf : buffersWithAllocs_) { vmaDestroyBuffer(allocator, buf.buffer, buf.alloc); + deleteCount++; } buffersWithAllocs_.clear(); for (auto &bufView : bufferViews_) { vkDestroyBufferView(device, bufView, nullptr); + deleteCount++; } bufferViews_.clear(); for (auto &imageWithAlloc : imagesWithAllocs_) { vmaDestroyImage(allocator, imageWithAlloc.image, imageWithAlloc.alloc); + deleteCount++; } imagesWithAllocs_.clear(); for (auto &imageView : imageViews_) { vkDestroyImageView(device, imageView, nullptr); + deleteCount++; } imageViews_.clear(); for (auto &mem : deviceMemory_) { vkFreeMemory(device, mem, nullptr); + deleteCount++; } deviceMemory_.clear(); for (auto &sampler : samplers_) { vkDestroySampler(device, sampler, nullptr); + deleteCount++; } samplers_.clear(); for (auto &pipeline : pipelines_) { vkDestroyPipeline(device, pipeline, nullptr); + deleteCount++; } pipelines_.clear(); for (auto &pcache : pipelineCaches_) { vkDestroyPipelineCache(device, pcache, nullptr); + deleteCount++; } pipelineCaches_.clear(); for (auto &renderPass : renderPasses_) { vkDestroyRenderPass(device, renderPass, nullptr); + deleteCount++; } renderPasses_.clear(); for (auto &framebuffer : framebuffers_) { vkDestroyFramebuffer(device, framebuffer, nullptr); + deleteCount++; } framebuffers_.clear(); for (auto &pipeLayout : pipelineLayouts_) { vkDestroyPipelineLayout(device, pipeLayout, nullptr); + deleteCount++; } pipelineLayouts_.clear(); for (auto &descSetLayout : descSetLayouts_) { vkDestroyDescriptorSetLayout(device, descSetLayout, nullptr); + deleteCount++; } descSetLayouts_.clear(); for (auto &queryPool : queryPools_) { vkDestroyQueryPool(device, queryPool, nullptr); + deleteCount++; } queryPools_.clear(); + deleteCount_ = deleteCount; } void VulkanContext::GetImageMemoryRequirements(VkImage image, VkMemoryRequirements *mem_reqs, bool *dedicatedAllocation) { diff --git a/Common/GPU/Vulkan/VulkanContext.h b/Common/GPU/Vulkan/VulkanContext.h index 4dea4ed380..0d0e93417f 100644 --- a/Common/GPU/Vulkan/VulkanContext.h +++ b/Common/GPU/Vulkan/VulkanContext.h @@ -138,6 +138,10 @@ public: void Take(VulkanDeleteList &del); void PerformDeletes(VulkanContext *vulkan, VmaAllocator allocator); + int GetLastDeleteCount() const { + return deleteCount_; + } + private: std::vector cmdPools_; std::vector descPools_; @@ -157,6 +161,7 @@ private: std::vector descSetLayouts_; std::vector queryPools_; std::vector callbacks_; + int deleteCount_ = 0; }; // VulkanContext manages the device and swapchain, and deferred deletion of objects. @@ -392,6 +397,10 @@ public: return availablePresentModes_; } + int GetLastDeleteCount() const { + return frame_[curFrame_].deleteList.GetLastDeleteCount(); + } + private: bool ChooseQueue(); diff --git a/Common/GPU/Vulkan/VulkanQueueRunner.cpp b/Common/GPU/Vulkan/VulkanQueueRunner.cpp index b785d48f3a..556924bced 100644 --- a/Common/GPU/Vulkan/VulkanQueueRunner.cpp +++ b/Common/GPU/Vulkan/VulkanQueueRunner.cpp @@ -677,20 +677,12 @@ const char *AspectToString(VkImageAspectFlags aspect) { static const char *rpTypeDebugNames[] = { "RENDER", "RENDER_DEPTH", - "RENDER_INPUT", - "RENDER_DEPTH_INPUT", "MV_RENDER", "MV_RENDER_DEPTH", - "MV_RENDER_INPUT", - "MV_RENDER_DEPTH_INPUT", "MS_RENDER", "MS_RENDER_DEPTH", - "MS_RENDER_INPUT", - "MS_RENDER_DEPTH_INPUT", "MS_MV_RENDER", "MS_MV_RENDER_DEPTH", - "MS_MV_RENDER_INPUT", - "MS_MV_RENDER_DEPTH_INPUT", "BACKBUF", }; diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 8b18b512c1..e5f3eeba2e 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -681,6 +681,8 @@ void VulkanRenderManager::BeginFrame(bool enableProfiling, bool enableLogProfile renderCPUTimeMs_.Update((frameData.profile.cpuEndTime - frameData.profile.cpuStartTime) * 1000.0); renderCPUTimeMs_.Format(line, sizeof(line)); str << line; + snprintf(line, sizeof(line), "Resource deletions: %d\n", vulkan_->GetLastDeleteCount()); + str << line; for (int i = 0; i < numQueries - 1; i++) { uint64_t diff = (queryResults[i + 1] - queryResults[i]) & timestampDiffMask; double milliseconds = (double)diff * timestampConversionFactor; From a507563708192f091fc3ad91e7bb90cdfc865255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 12 Oct 2023 10:14:19 +0200 Subject: [PATCH 19/22] Remove the exit-game sync again. It's not actually needed until some of the additions made on master, and in that case, I'm going to change the solution again. --- Common/GPU/Vulkan/VulkanRenderManager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index e5f3eeba2e..4ca7fa39c0 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -518,14 +518,12 @@ void VulkanRenderManager::CompileThreadFunc() { } void VulkanRenderManager::DrainAndBlockCompileQueue() { - EndCurRenderStep(); std::unique_lock lock(compileMutex_); compileBlocked_ = true; compileCond_.notify_all(); while (!compileQueue_.empty()) { queueRunner_.WaitForCompileNotification(); } - FlushSync(); } void VulkanRenderManager::ReleaseCompileQueue() { From fc9a0570838293afb4ed218434a774dff9f38bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 12 Oct 2023 10:22:41 +0200 Subject: [PATCH 20/22] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 678d0d2467..270c0970dc 100644 --- a/README.md +++ b/README.md @@ -459,3 +459,6 @@ Credit goes to: [#18255]: https://github.com/hrydgard/ppsspp/issues/18255 "Fix issue uploading narrow textures in OpenGL." [#18250]: https://github.com/hrydgard/ppsspp/issues/18250 "Separate out accelerometer events from joystick axis events" [#18249]: https://github.com/hrydgard/ppsspp/issues/18249 "arm64jit: Avoid fused multiplies in vcrsp.t" +[#18332]: https://github.com/hrydgard/ppsspp/issues/18332 "We somehow lost the usage_ counter increment in VulkanDescSetPool, fix that" +[#18323]: https://github.com/hrydgard/ppsspp/issues/18323 "Turn off HTTPS support for iOS." +[#18310]: https://github.com/hrydgard/ppsspp/issues/18310 "Fix waves background" \ No newline at end of file From 1dd98c5a554b041bc0105e7d6370aa8fb96b51dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 12 Oct 2023 12:22:38 +0200 Subject: [PATCH 21/22] Update UWP version --- UWP/Package.appxmanifest | 2 +- UWP/PackageGold.appxmanifest | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UWP/Package.appxmanifest b/UWP/Package.appxmanifest index 9a2de41ac2..ec681ab8b2 100644 --- a/UWP/Package.appxmanifest +++ b/UWP/Package.appxmanifest @@ -1,6 +1,6 @@ - + PPSSPP - PSP emulator diff --git a/UWP/PackageGold.appxmanifest b/UWP/PackageGold.appxmanifest index b4b3569a0c..0396b3ee4e 100644 --- a/UWP/PackageGold.appxmanifest +++ b/UWP/PackageGold.appxmanifest @@ -1,6 +1,6 @@ - + PPSSPP Gold - PSP emulator