mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 02:03:47 +01:00
Logging API change (refactor) (#19324)
* Rename LogType to Log * Explicitly use the Log:: enum when logging. Allows for autocomplete when editing. * Mac/ARM64 buildfix * Do the same with the hle result log macros * Rename the log names to mixed case while at it. * iOS buildfix * Qt buildfix attempt, ARM32 buildfix
This commit is contained in:
1 parent
ae3ff686f0
commit
e01ca5b057
393 files changed
+6198
-6193
No files matched your search
@@ -42,19 +42,19 @@ AndroidVulkanContext::~AndroidVulkanContext() {
|
||||
}
|
||||
|
||||
bool AndroidVulkanContext::InitAPI() {
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::Init");
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Init");
|
||||
init_glslang();
|
||||
|
||||
g_LogOptions.breakOnError = true;
|
||||
g_LogOptions.breakOnWarning = true;
|
||||
g_LogOptions.msgBoxOnError = false;
|
||||
|
||||
INFO_LOG(G3D, "Creating Vulkan context");
|
||||
INFO_LOG(Log::G3D, "Creating Vulkan context");
|
||||
Version gitVer(PPSSPP_GIT_VERSION);
|
||||
|
||||
std::string errorStr;
|
||||
if (!VulkanLoad(&errorStr)) {
|
||||
ERROR_LOG(G3D, "Failed to load Vulkan driver library: %s", errorStr.c_str());
|
||||
ERROR_LOG(Log::G3D, "Failed to load Vulkan driver library: %s", errorStr.c_str());
|
||||
state_ = GraphicsContextState::FAILED_INIT;
|
||||
return false;
|
||||
}
|
||||
@@ -75,21 +75,21 @@ bool AndroidVulkanContext::InitAPI() {
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(G3D, "Vulkan device created!");
|
||||
INFO_LOG(Log::G3D, "Vulkan device created!");
|
||||
state_ = GraphicsContextState::INITIALIZED;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) {
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::InitFromRenderThread: desiredwidth=%d desiredheight=%d", desiredBackbufferSizeX, desiredBackbufferSizeY);
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::InitFromRenderThread: desiredwidth=%d desiredheight=%d", desiredBackbufferSizeX, desiredBackbufferSizeY);
|
||||
if (!g_Vulkan) {
|
||||
ERROR_LOG(G3D, "AndroidVulkanContext::InitFromRenderThread: No Vulkan context");
|
||||
ERROR_LOG(Log::G3D, "AndroidVulkanContext::InitFromRenderThread: No Vulkan context");
|
||||
return false;
|
||||
}
|
||||
|
||||
VkResult res = g_Vulkan->InitSurface(WINDOWSYSTEM_ANDROID, (void *)wnd, nullptr);
|
||||
if (res != VK_SUCCESS) {
|
||||
ERROR_LOG(G3D, "g_Vulkan->InitSurface failed: '%s'", VulkanResultToString(res));
|
||||
ERROR_LOG(Log::G3D, "g_Vulkan->InitSurface failed: '%s'", VulkanResultToString(res));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredB
|
||||
success = false;
|
||||
}
|
||||
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::Init completed, %s", success ? "successfully" : "but failed");
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Init completed, %s", success ? "successfully" : "but failed");
|
||||
if (!success) {
|
||||
g_Vulkan->DestroySwapchain();
|
||||
g_Vulkan->DestroySurface();
|
||||
@@ -123,7 +123,7 @@ bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredB
|
||||
}
|
||||
|
||||
void AndroidVulkanContext::ShutdownFromRenderThread() {
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::Shutdown");
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Shutdown");
|
||||
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
delete draw_;
|
||||
draw_ = nullptr;
|
||||
@@ -131,20 +131,20 @@ void AndroidVulkanContext::ShutdownFromRenderThread() {
|
||||
g_Vulkan->PerformPendingDeletes();
|
||||
g_Vulkan->DestroySwapchain();
|
||||
g_Vulkan->DestroySurface();
|
||||
INFO_LOG(G3D, "Done with ShutdownFromRenderThread");
|
||||
INFO_LOG(Log::G3D, "Done with ShutdownFromRenderThread");
|
||||
}
|
||||
|
||||
void AndroidVulkanContext::Shutdown() {
|
||||
INFO_LOG(G3D, "Calling NativeShutdownGraphics");
|
||||
INFO_LOG(Log::G3D, "Calling NativeShutdownGraphics");
|
||||
g_Vulkan->DestroyDevice();
|
||||
g_Vulkan->DestroyInstance();
|
||||
// We keep the g_Vulkan context around to avoid invalidating a ton of pointers around the app.
|
||||
finalize_glslang();
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::Shutdown completed");
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Shutdown completed");
|
||||
}
|
||||
|
||||
void AndroidVulkanContext::Resize() {
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::Resize begin (oldsize: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Resize begin (oldsize: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
|
||||
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
g_Vulkan->DestroySwapchain();
|
||||
@@ -155,5 +155,5 @@ void AndroidVulkanContext::Resize() {
|
||||
g_Vulkan->ReinitSurface();
|
||||
g_Vulkan->InitSwapchain();
|
||||
draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
INFO_LOG(G3D, "AndroidVulkanContext::Resize end (final size: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Resize end (final size: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
}
|
||||
Reference in new issue
Block a user