From 27a60517afdedc9ada7fbd28490a94a7ed261703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 27 Nov 2024 15:23:50 +0100 Subject: [PATCH 1/2] Fix broken check for intel macs (for auto-disabling Vulkan) --- Common/GPU/Vulkan/VulkanLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/GPU/Vulkan/VulkanLoader.cpp b/Common/GPU/Vulkan/VulkanLoader.cpp index 05a09af73e17..92e7e7865929 100644 --- a/Common/GPU/Vulkan/VulkanLoader.cpp +++ b/Common/GPU/Vulkan/VulkanLoader.cpp @@ -343,7 +343,7 @@ static VulkanLibraryHandle VulkanLoadLibrary(std::string *errorString) { return nullptr; #elif PPSSPP_PLATFORM(UWP) return nullptr; -#elif PPSSPP_PLATFORM(MACOS) && PPSSPP_ARCH(AMD64) +#elif PPSSPP_PLATFORM(MAC) && PPSSPP_ARCH(AMD64) // Disable Vulkan on Mac/x86. Too many configurations that don't work with MoltenVK // for whatever reason. return nullptr; From 91c82205eb813febc053a2bbdfc7d8a909ec7168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 27 Nov 2024 15:38:41 +0100 Subject: [PATCH 2/2] Logging: When not on EmuThread, log with the host thread name instead of the PSP thread name. --- Common/Log/LogManager.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Common/Log/LogManager.cpp b/Common/Log/LogManager.cpp index 75e9451dfcf2..2ff671df420a 100644 --- a/Common/Log/LogManager.cpp +++ b/Common/Log/LogManager.cpp @@ -36,6 +36,7 @@ #include "Common/Log/StdioListener.h" #include "Common/TimeUtil.h" +#include "Common/Thread/ThreadUtil.h" #include "Common/File/FileUtil.h" #include "Common/StringUtils.h" @@ -254,11 +255,23 @@ void LogManager::LogLine(LogLevel level, Log type, const char *file, int line, c file = fileshort + 1; } - GetCurrentTimeFormatted(message.timestamp); + const char *threadName; +#if PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(MAC) + const char *hostThreadName = GetCurrentThreadName(); + if (strcmp(hostThreadName, "EmuThread") != 0 || !hleCurrentThreadName) { + // Use the host thread name. + threadName = hostThreadName; + } else { + // Use the PSP HLE thread name. + threadName = hleCurrentThreadName; + } +#else + threadName = hleCurrentThreadName; +#endif - if (hleCurrentThreadName) { + if (threadName) { snprintf(message.header, sizeof(message.header), "%-12.12s %c[%s]: %s:%d", - hleCurrentThreadName, level_to_char[(int)level], + threadName, level_to_char[(int)level], log.m_shortName, file, line); } else { @@ -267,6 +280,8 @@ void LogManager::LogLine(LogLevel level, Log type, const char *file, int line, c log.m_shortName); } + GetCurrentTimeFormatted(message.timestamp); + char msgBuf[1024]; va_list args_copy;