diff --git a/Core/Debugger/WebSocket/WebSocketUtils.h b/Core/Debugger/WebSocket/WebSocketUtils.h index ac75838583..93110db6a0 100644 --- a/Core/Debugger/WebSocket/WebSocketUtils.h +++ b/Core/Debugger/WebSocket/WebSocketUtils.h @@ -19,9 +19,11 @@ #include #include + #include "json/json_reader.h" #include "json/json_writer.h" #include "net/websocket_server.h" + #include "Common/Log.h" #include "ppsspp_config.h" diff --git a/Core/Font/PGF.h b/Core/Font/PGF.h index 7b721726d4..a4e3f420d8 100644 --- a/Core/Font/PGF.h +++ b/Core/Font/PGF.h @@ -22,7 +22,6 @@ #include #include -#include "Common/Log.h" #include "Common/CommonTypes.h" class PointerWrap; diff --git a/GPU/Common/TransformCommon.h b/GPU/Common/TransformCommon.h index 0c528133c5..d3b78dd663 100644 --- a/GPU/Common/TransformCommon.h +++ b/GPU/Common/TransformCommon.h @@ -18,8 +18,8 @@ #pragma once #include + #include "base/basictypes.h" -#include "Common/Log.h" #include "Common/CommonTypes.h" #include "Core/Reporting.h" #include "GPU/ge_constants.h" diff --git a/GPU/Common/VertexDecoderCommon.h b/GPU/Common/VertexDecoderCommon.h index 209186fd96..333f2b1c36 100644 --- a/GPU/Common/VertexDecoderCommon.h +++ b/GPU/Common/VertexDecoderCommon.h @@ -18,6 +18,7 @@ #pragma once #include + #include "ppsspp_config.h" #include "base/basictypes.h" #include "Common/Hashmaps.h" diff --git a/android/jni/AndroidAudio.cpp b/android/jni/AndroidAudio.cpp index 98cf3a87be..56145b516e 100644 --- a/android/jni/AndroidAudio.cpp +++ b/android/jni/AndroidAudio.cpp @@ -1,4 +1,5 @@ -#include "base/logging.h" +#include "Common/Log.h" + #include "android/jni/AndroidAudio.h" #include "android/jni/OpenSLContext.h" @@ -31,13 +32,13 @@ AndroidAudioState *AndroidAudio_Init(AndroidAudioCallback callback, int optimalF bool AndroidAudio_Resume(AndroidAudioState *state) { if (!state) { - ELOG("Audio was shutdown, cannot resume!"); + ERROR_LOG(AUDIO, "Audio was shutdown, cannot resume!"); return false; } if (!state->ctx) { - ILOG("Calling OpenSLWrap_Init_T..."); + INFO_LOG(AUDIO, "Calling OpenSLWrap_Init_T..."); state->ctx = new OpenSLContext(state->callback, state->frames_per_buffer, state->sample_rate); - ILOG("Returned from OpenSLWrap_Init_T"); + INFO_LOG(AUDIO, "Returned from OpenSLWrap_Init_T"); bool init_retval = state->ctx->Init(); if (!init_retval) { delete state->ctx; @@ -50,14 +51,14 @@ bool AndroidAudio_Resume(AndroidAudioState *state) { bool AndroidAudio_Pause(AndroidAudioState *state) { if (!state) { - ELOG("Audio was shutdown, cannot pause!"); + ERROR_LOG(AUDIO, "Audio was shutdown, cannot pause!"); return false; } if (state->ctx) { - ILOG("Calling OpenSLWrap_Shutdown_T..."); + INFO_LOG(AUDIO, "Calling OpenSLWrap_Shutdown_T..."); delete state->ctx; state->ctx = nullptr; - ILOG("Returned from OpenSLWrap_Shutdown_T ..."); + INFO_LOG(AUDIO, "Returned from OpenSLWrap_Shutdown_T ..."); return true; } return false; @@ -65,14 +66,14 @@ bool AndroidAudio_Pause(AndroidAudioState *state) { bool AndroidAudio_Shutdown(AndroidAudioState *state) { if (!state) { - ELOG("Audio already shutdown!"); + ERROR_LOG(AUDIO, "Audio already shutdown!"); return false; } if (state->ctx) { - ELOG("Should not shut down when playing! Something is wrong!"); + ERROR_LOG(AUDIO, "Should not shut down when playing! Something is wrong!"); return false; } delete state; - ILOG("OpenSLWrap completely unloaded."); + INFO_LOG(AUDIO, "OpenSLWrap completely unloaded."); return true; } diff --git a/android/jni/AndroidEGLContext.cpp b/android/jni/AndroidEGLContext.cpp index de58b828c1..97b4ecd55a 100644 --- a/android/jni/AndroidEGLContext.cpp +++ b/android/jni/AndroidEGLContext.cpp @@ -1,25 +1,26 @@ #include -#include "base/logging.h" + #include "base/NativeApp.h" #include "gfx_es2/gpu_features.h" #include "thin3d/thin3d_create.h" +#include "Common/Log.h" #include "AndroidEGLContext.h" #include "GL/GLInterface/EGLAndroid.h" #include "Core/ConfigValues.h" #include "Core/System.h" bool AndroidEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) { - ILOG("AndroidEGLGraphicsContext::Init()"); + INFO_LOG(G3D, "AndroidEGLGraphicsContext::Init()"); wnd_ = wnd; gl = HostGL_CreateGLInterface(); if (!gl) { - ELOG("ERROR: Failed to create GL interface"); + ERROR_LOG(G3D, "ERROR: Failed to create GL interface"); return false; } int backbufferWidth = desiredBackbufferSizeX; int backbufferHeight = desiredBackbufferSizeY; - ILOG("EGL interface created. Desired backbuffer size: %dx%d", backbufferWidth, backbufferHeight); + INFO_LOG(G3D, "EGL interface created. Desired backbuffer size: %dx%d", backbufferWidth, backbufferHeight); // Apparently we still have to set this through Java through setFixedSize on the bufferHolder for it to take effect... gl->SetBackBufferDimensions(backbufferWidth, backbufferHeight); @@ -39,7 +40,7 @@ bool AndroidEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int des } if (!gl->Create(wnd, false, use565)) { - ELOG("EGL creation failed! (use565=%d)", (int)use565); + ERROR_LOG(G3D, "EGL creation failed! (use565=%d)", (int)use565); // TODO: What do we do now? delete gl; return false; @@ -58,7 +59,7 @@ bool AndroidEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int des } void AndroidEGLGraphicsContext::ShutdownFromRenderThread() { - ILOG("AndroidEGLGraphicsContext::Shutdown"); + INFO_LOG(G3D, "AndroidEGLGraphicsContext::Shutdown"); renderManager_->WaitUntilQueueIdle(); renderManager_ = nullptr; // owned by draw_. delete draw_; diff --git a/android/jni/AndroidJavaGLContext.cpp b/android/jni/AndroidJavaGLContext.cpp index d1b8e17a6a..36a2259f43 100644 --- a/android/jni/AndroidJavaGLContext.cpp +++ b/android/jni/AndroidJavaGLContext.cpp @@ -13,7 +13,7 @@ AndroidJavaEGLGraphicsContext::AndroidJavaEGLGraphicsContext() { } bool AndroidJavaEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) { - ILOG("AndroidJavaEGLGraphicsContext::InitFromRenderThread"); + INFO_LOG(G3D, "AndroidJavaEGLGraphicsContext::InitFromRenderThread"); CheckGLExtensions(); // OpenGL handles rotated rendering in the driver. g_display_rotation = DisplayRotation::ROTATE_0; @@ -26,7 +26,7 @@ bool AndroidJavaEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int } void AndroidJavaEGLGraphicsContext::ShutdownFromRenderThread() { - ILOG("AndroidJavaEGLGraphicsContext::Shutdown"); + INFO_LOG(G3D, "AndroidJavaEGLGraphicsContext::Shutdown"); renderManager_->WaitUntilQueueIdle(); renderManager_ = nullptr; // owned by draw_. delete draw_; diff --git a/android/jni/AndroidVulkanContext.cpp b/android/jni/AndroidVulkanContext.cpp index 76fc4d3e3c..b61ad99b84 100644 --- a/android/jni/AndroidVulkanContext.cpp +++ b/android/jni/AndroidVulkanContext.cpp @@ -3,6 +3,7 @@ #include "AndroidVulkanContext.h" #include "base/NativeApp.h" #include "base/display.h" +#include "Common/Log.h" #include "Common/Vulkan/VulkanContext.h" #include "Common/Vulkan/VulkanDebug.h" #include "Common/Vulkan/VulkanLoader.h" @@ -28,18 +29,18 @@ static uint32_t FlagsFromConfig() { } bool AndroidVulkanContext::InitAPI() { - ILOG("AndroidVulkanContext::Init"); + INFO_LOG(G3D, "AndroidVulkanContext::Init"); init_glslang(); g_LogOptions.breakOnError = true; g_LogOptions.breakOnWarning = true; g_LogOptions.msgBoxOnError = false; - ILOG("Creating Vulkan context"); + INFO_LOG(G3D, "Creating Vulkan context"); Version gitVer(PPSSPP_GIT_VERSION); if (!VulkanLoad()) { - ELOG("Failed to load Vulkan driver library"); + ERROR_LOG(G3D, "Failed to load Vulkan driver library"); return false; } @@ -54,7 +55,7 @@ bool AndroidVulkanContext::InitAPI() { info.flags = FlagsFromConfig(); VkResult res = g_Vulkan->CreateInstance(info); if (res != VK_SUCCESS) { - ELOG("Failed to create vulkan context: %s", g_Vulkan->InitError().c_str()); + ERROR_LOG(G3D, "Failed to create vulkan context: %s", g_Vulkan->InitError().c_str()); VulkanSetAvailable(false); delete g_Vulkan; g_Vulkan = nullptr; @@ -63,7 +64,7 @@ bool AndroidVulkanContext::InitAPI() { int physicalDevice = g_Vulkan->GetBestPhysicalDevice(); if (physicalDevice < 0) { - ELOG("No usable Vulkan device found."); + ERROR_LOG(G3D, "No usable Vulkan device found."); g_Vulkan->DestroyInstance(); delete g_Vulkan; g_Vulkan = nullptr; @@ -72,9 +73,9 @@ bool AndroidVulkanContext::InitAPI() { g_Vulkan->ChooseDevice(physicalDevice); - ILOG("Creating Vulkan device"); + INFO_LOG(G3D, "Creating Vulkan device"); if (g_Vulkan->CreateDevice() != VK_SUCCESS) { - ILOG("Failed to create vulkan device: %s", g_Vulkan->InitError().c_str()); + INFO_LOG(G3D, "Failed to create vulkan device: %s", g_Vulkan->InitError().c_str()); System_SendMessage("toast", "No Vulkan driver found. Using OpenGL instead."); g_Vulkan->DestroyInstance(); delete g_Vulkan; @@ -82,20 +83,20 @@ bool AndroidVulkanContext::InitAPI() { return false; } - ILOG("Vulkan device created!"); + INFO_LOG(G3D, "Vulkan device created!"); return true; } bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) { - ILOG("AndroidVulkanContext::InitFromRenderThread: desiredwidth=%d desiredheight=%d", desiredBackbufferSizeX, desiredBackbufferSizeY); + INFO_LOG(G3D, "AndroidVulkanContext::InitFromRenderThread: desiredwidth=%d desiredheight=%d", desiredBackbufferSizeX, desiredBackbufferSizeY); if (!g_Vulkan) { - ELOG("AndroidVulkanContext::InitFromRenderThread: No Vulkan context"); + ERROR_LOG(G3D, "AndroidVulkanContext::InitFromRenderThread: No Vulkan context"); return false; } VkResult res = g_Vulkan->InitSurface(WINDOWSYSTEM_ANDROID, (void *)wnd, nullptr); if (res != VK_SUCCESS) { - ELOG("g_Vulkan->InitSurface failed: '%s'", VulkanResultToString(res)); + ERROR_LOG(G3D, "g_Vulkan->InitSurface failed: '%s'", VulkanResultToString(res)); return false; } @@ -114,7 +115,7 @@ bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredB success = false; } - ILOG("AndroidVulkanContext::Init completed, %s", success ? "successfully" : "but failed"); + INFO_LOG(G3D, "AndroidVulkanContext::Init completed, %s", success ? "successfully" : "but failed"); if (!success) { g_Vulkan->DestroySwapchain(); g_Vulkan->DestroySurface(); @@ -125,7 +126,7 @@ bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredB } void AndroidVulkanContext::ShutdownFromRenderThread() { - ILOG("AndroidVulkanContext::Shutdown"); + INFO_LOG(G3D, "AndroidVulkanContext::Shutdown"); draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); delete draw_; draw_ = nullptr; @@ -133,23 +134,23 @@ void AndroidVulkanContext::ShutdownFromRenderThread() { g_Vulkan->PerformPendingDeletes(); g_Vulkan->DestroySwapchain(); g_Vulkan->DestroySurface(); - ILOG("Done with ShutdownFromRenderThread"); + INFO_LOG(G3D, "Done with ShutdownFromRenderThread"); } void AndroidVulkanContext::Shutdown() { - ILOG("Calling NativeShutdownGraphics"); + INFO_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(); - ILOG("AndroidVulkanContext::Shutdown completed"); + INFO_LOG(G3D, "AndroidVulkanContext::Shutdown completed"); } void AndroidVulkanContext::SwapBuffers() { } void AndroidVulkanContext::Resize() { - ILOG("AndroidVulkanContext::Resize begin (oldsize: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); + INFO_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(); @@ -160,7 +161,7 @@ void AndroidVulkanContext::Resize() { g_Vulkan->ReinitSurface(); g_Vulkan->InitSwapchain(); draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); - ILOG("AndroidVulkanContext::Resize end (final size: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); + INFO_LOG(G3D, "AndroidVulkanContext::Resize end (final size: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); } void AndroidVulkanContext::SwapInterval(int interval) { diff --git a/android/jni/Arm64EmitterTest.cpp b/android/jni/Arm64EmitterTest.cpp index b9240fc352..e14c98532d 100644 --- a/android/jni/Arm64EmitterTest.cpp +++ b/android/jni/Arm64EmitterTest.cpp @@ -1,5 +1,4 @@ #include "base/logging.h" -#include "Arm64EmitterTest.h" #include "Common/Arm64Emitter.h" #include "Common/BitSet.h" diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 0ac1036011..aad11b14f1 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -15,7 +15,6 @@ #ifndef _MSC_VER #include -#include #include #elif !defined(JNIEXPORT) // Just for better highlighting in MSVC if opening this file. @@ -52,7 +51,6 @@ struct JNIEnv {}; #include "base/stringutil.h" #include "base/display.h" #include "base/NativeApp.h" -#include "base/logging.h" #include "base/timeutil.h" #include "thread/threadutil.h" #include "file/zip_read.h" @@ -66,6 +64,7 @@ struct JNIEnv {}; #include "gfx/gl_common.h" #include "gfx_es2/gpu_features.h" +#include "Common/Log.h" #include "Common/GraphicsContext.h" #include "AndroidGraphicsContext.h" #include "AndroidVulkanContext.h" @@ -191,7 +190,7 @@ jclass findClass(const char* name) { } JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *pjvm, void *reserved) { - ILOG("JNI_OnLoad"); + INFO_LOG(SYSTEM, "JNI_OnLoad"); gJvm = pjvm; // cache the JavaVM pointer auto env = getEnv(); //replace with one of your classes in the line below @@ -211,20 +210,20 @@ static void EmuThreadFunc() { gJvm->AttachCurrentThread(&env, nullptr); setCurrentThreadName("Emu"); - ILOG("Entering emu thread"); + INFO_LOG(SYSTEM, "Entering emu thread"); // Wait for render loop to get started. if (!graphicsContext || !graphicsContext->Initialized()) { - ILOG("Runloop: Waiting for displayInit..."); + INFO_LOG(SYSTEM, "Runloop: Waiting for displayInit..."); while (!graphicsContext || !graphicsContext->Initialized()) { sleep_ms(20); } } else { - ILOG("Runloop: Graphics context available! %p", graphicsContext); + INFO_LOG(SYSTEM, "Runloop: Graphics context available! %p", graphicsContext); } NativeInitGraphics(graphicsContext); - ILOG("Graphics initialized. Entering loop."); + INFO_LOG(SYSTEM, "Graphics initialized. Entering loop."); // There's no real requirement that NativeInit happen on this thread. // We just call the update/render loop here. @@ -232,7 +231,7 @@ static void EmuThreadFunc() { while (emuThreadState != (int)EmuThreadState::QUIT_REQUESTED) { UpdateRunLoopAndroid(env); } - ILOG("QUIT_REQUESTED found, left loop. Setting state to STOPPED."); + INFO_LOG(SYSTEM, "QUIT_REQUESTED found, left loop. Setting state to STOPPED."); emuThreadState = (int)EmuThreadState::STOPPED; NativeShutdownGraphics(); @@ -241,11 +240,11 @@ static void EmuThreadFunc() { graphicsContext->StopThread(); gJvm->DetachCurrentThread(); - ILOG("Leaving emu thread"); + INFO_LOG(SYSTEM, "Leaving emu thread"); } static void EmuThreadStart() { - ILOG("EmuThreadStart"); + INFO_LOG(SYSTEM, "EmuThreadStart"); emuThreadState = (int)EmuThreadState::START_REQUESTED; emuThread = std::thread(&EmuThreadFunc); } @@ -254,14 +253,14 @@ static void EmuThreadStart() { // as long as emuThreadState isn't STOPPED and/or there are still things queued up. // Only after that, call EmuThreadJoin. static void EmuThreadStop(const char *caller) { - ILOG("EmuThreadStop - stopping (%s)...", caller); + INFO_LOG(SYSTEM, "EmuThreadStop - stopping (%s)...", caller); emuThreadState = (int)EmuThreadState::QUIT_REQUESTED; } static void EmuThreadJoin() { emuThread.join(); emuThread = std::thread(); - ILOG("EmuThreadJoin - joined"); + INFO_LOG(SYSTEM, "EmuThreadJoin - joined"); } static void ProcessFrameCommands(JNIEnv *env); @@ -496,7 +495,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init // Makes sure we get early permission grants. ProcessFrameCommands(env); - ILOG("NativeApp.init() -- begin"); + INFO_LOG(SYSTEM, "NativeApp.init() -- begin"); PROFILE_INIT(); renderer_inited = false; @@ -516,7 +515,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init systemName = GetJavaString(env, jmodel); langRegion = GetJavaString(env, jlangRegion); - ILOG("NativeApp.init(): device name: '%s'", systemName.c_str()); + INFO_LOG(SYSTEM, "NativeApp.init(): device name: '%s'", systemName.c_str()); std::string externalDir = GetJavaString(env, jexternalDir); std::string user_data_path = GetJavaString(env, jdataDir); @@ -527,8 +526,8 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init std::string cacheDir = GetJavaString(env, jcacheDir); std::string buildBoard = GetJavaString(env, jboard); boardName = buildBoard; - ILOG("NativeApp.init(): External storage path: %s", externalDir.c_str()); - ILOG("NativeApp.init(): Launch shortcut parameter: %s", shortcut_param.c_str()); + INFO_LOG(SYSTEM, "NativeApp.init(): External storage path: %s", externalDir.c_str()); + INFO_LOG(SYSTEM, "NativeApp.init(): Launch shortcut parameter: %s", shortcut_param.c_str()); std::string app_name; std::string app_nice_name; @@ -567,7 +566,7 @@ retry: case (int)GPUBackend::OPENGL: useCPUThread = true; if (javaGL) { - ILOG("NativeApp.init() -- creating OpenGL context (JavaGL)"); + INFO_LOG(SYSTEM, "NativeApp.init() -- creating OpenGL context (JavaGL)"); graphicsContext = new AndroidJavaEGLGraphicsContext(); } else { graphicsContext = new AndroidEGLGraphicsContext(); @@ -575,12 +574,12 @@ retry: break; case (int)GPUBackend::VULKAN: { - ILOG("NativeApp.init() -- creating Vulkan context"); + INFO_LOG(SYSTEM, "NativeApp.init() -- creating Vulkan context"); useCPUThread = false; // The Vulkan render manager manages its own thread. // We create and destroy the Vulkan graphics context in the "EGL" thread. AndroidVulkanContext *ctx = new AndroidVulkanContext(); if (!ctx->InitAPI()) { - ILOG("Failed to initialize Vulkan, switching to OpenGL"); + INFO_LOG(SYSTEM, "Failed to initialize Vulkan, switching to OpenGL"); g_Config.iGPUBackend = (int)GPUBackend::OPENGL; SetGPUBackend(GPUBackend::OPENGL); goto retry; @@ -590,13 +589,13 @@ retry: break; } default: - ELOG("NativeApp.init(): iGPUBackend %d not supported. Switching to OpenGL.", (int)g_Config.iGPUBackend); + ERROR_LOG(SYSTEM, "NativeApp.init(): iGPUBackend %d not supported. Switching to OpenGL.", (int)g_Config.iGPUBackend); g_Config.iGPUBackend = (int)GPUBackend::OPENGL; goto retry; } if (useCPUThread) { - ILOG("NativeApp.init() - launching emu thread"); + INFO_LOG(SYSTEM, "NativeApp.init() - launching emu thread"); EmuThreadStart(); } } @@ -619,11 +618,11 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioInit(JNIEnv *, jclass) { sampleRate = 44100; } - ILOG("NativeApp.audioInit() -- Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: %i", optimalFramesPerBuffer, optimalSampleRate, sampleRate); + INFO_LOG(AUDIO, "NativeApp.audioInit() -- Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: %i", optimalFramesPerBuffer, optimalSampleRate, sampleRate); if (!g_audioState) { g_audioState = AndroidAudio_Init(&NativeMix, framesPerBuffer, sampleRate); } else { - ELOG("Audio state already initialized"); + ERROR_LOG(AUDIO, "Audio state already initialized"); } } @@ -632,17 +631,17 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioShutdown(JNIEnv *, jclass) AndroidAudio_Shutdown(g_audioState); g_audioState = nullptr; } else { - ELOG("Audio state already shutdown!"); + ERROR_LOG(AUDIO, "Audio state already shutdown!"); } } extern "C" void Java_org_ppsspp_ppsspp_NativeApp_resume(JNIEnv *, jclass) { - ILOG("NativeApp.resume() - resuming audio"); + INFO_LOG(SYSTEM, "NativeApp.resume() - resuming audio"); AndroidAudio_Resume(g_audioState); } extern "C" void Java_org_ppsspp_ppsspp_NativeApp_pause(JNIEnv *, jclass) { - ILOG("NativeApp.pause() - pausing audio"); + INFO_LOG(SYSTEM, "NativeApp.pause() - pausing audio"); AndroidAudio_Pause(g_audioState); } @@ -650,31 +649,31 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) { if (renderer_inited && useCPUThread && graphicsContext) { // Only used in Java EGL path. EmuThreadStop("shutdown"); - ILOG("BeginAndroidShutdown"); + INFO_LOG(SYSTEM, "BeginAndroidShutdown"); graphicsContext->BeginAndroidShutdown(); // Skipping GL calls, the old context is gone. while (graphicsContext->ThreadFrame()) { - ILOG("graphicsContext->ThreadFrame executed to clear buffers"); + INFO_LOG(SYSTEM, "graphicsContext->ThreadFrame executed to clear buffers"); } - ILOG("Joining emuthread"); + INFO_LOG(SYSTEM, "Joining emuthread"); EmuThreadJoin(); - ILOG("Joined emuthread"); + INFO_LOG(SYSTEM, "Joined emuthread"); graphicsContext->ThreadEnd(); graphicsContext->ShutdownFromRenderThread(); - ILOG("Graphics context now shut down from NativeApp_shutdown"); + INFO_LOG(SYSTEM, "Graphics context now shut down from NativeApp_shutdown"); } - ILOG("NativeApp.shutdown() -- begin"); + INFO_LOG(SYSTEM, "NativeApp.shutdown() -- begin"); if (renderer_inited) { - ILOG("Shutting down renderer"); + INFO_LOG(G3D, "Shutting down renderer"); // This will be from the wrong thread? :/ graphicsContext->Shutdown(); delete graphicsContext; graphicsContext = nullptr; renderer_inited = false; } else { - ILOG("Not shutting down renderer - not initialized"); + INFO_LOG(G3D, "Not shutting down renderer - not initialized"); } inputBoxCallbacks.clear(); @@ -682,7 +681,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) { VFSShutdown(); while (frameCommands.size()) frameCommands.pop(); - ILOG("NativeApp.shutdown() -- end"); + INFO_LOG(SYSTEM, "NativeApp.shutdown() -- end"); } // JavaEGL @@ -691,16 +690,16 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, std::string errorMessage; if (renderer_inited) { // Would be really nice if we could get something on the GL thread immediately when shutting down. - ILOG("NativeApp.displayInit() restoring"); + INFO_LOG(G3D, "NativeApp.displayInit() restoring"); if (useCPUThread) { EmuThreadStop("displayInit"); graphicsContext->BeginAndroidShutdown(); - ILOG("BeginAndroidShutdown. Looping until emu thread done..."); + INFO_LOG(G3D, "BeginAndroidShutdown. Looping until emu thread done..."); // Skipping GL calls here because the old context is lost. while (graphicsContext->ThreadFrame()) { continue; } - ILOG("Joining emu thread"); + INFO_LOG(G3D, "Joining emu thread"); EmuThreadJoin(); } else { NativeShutdownGraphics(); @@ -708,7 +707,7 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, graphicsContext->ThreadEnd(); graphicsContext->ShutdownFromRenderThread(); - ILOG("Shut down both threads. Now let's bring it up again!"); + INFO_LOG(G3D, "Shut down both threads. Now let's bring it up again!"); if (!graphicsContext->InitFromRenderThread(nullptr, 0, 0, 0, 0)) { SystemToast("Graphics initialization failed. Quitting."); @@ -726,9 +725,9 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, } graphicsContext->ThreadStart(); - ILOG("Restored."); + INFO_LOG(G3D, "Restored."); } else { - ILOG("NativeApp.displayInit() first time"); + INFO_LOG(G3D, "NativeApp.displayInit() first time"); if (!graphicsContext->InitFromRenderThread(nullptr, 0, 0, 0, 0)) { SystemToast("Graphics initialization failed. Quitting."); return false; @@ -758,15 +757,15 @@ static void recalculateDpi() { pixel_in_dps_x = (float)pixel_xres / dp_xres; pixel_in_dps_y = (float)pixel_yres / dp_yres; - ILOG("RecalcDPI: display_xres=%d display_yres=%d", display_xres, display_yres); - ILOG("RecalcDPI: g_dpi=%f g_dpi_scale_x=%f g_dpi_scale_y=%f", g_dpi, g_dpi_scale_x, g_dpi_scale_y); - ILOG("RecalcDPI: dp_xscale=%f dp_yscale=%f", dp_xscale, dp_yscale); - ILOG("RecalcDPI: dp_xres=%d dp_yres=%d", dp_xres, dp_yres); - ILOG("RecalcDPI: pixel_xres=%d pixel_yres=%d", pixel_xres, pixel_yres); + INFO_LOG(G3D, "RecalcDPI: display_xres=%d display_yres=%d", display_xres, display_yres); + INFO_LOG(G3D, "RecalcDPI: g_dpi=%f g_dpi_scale_x=%f g_dpi_scale_y=%f", g_dpi, g_dpi_scale_x, g_dpi_scale_y); + INFO_LOG(G3D, "RecalcDPI: dp_xscale=%f dp_yscale=%f", dp_xscale, dp_yscale); + INFO_LOG(G3D, "RecalcDPI: dp_xres=%d dp_yres=%d", dp_xres, dp_yres); + INFO_LOG(G3D, "RecalcDPI: pixel_xres=%d pixel_yres=%d", pixel_xres, pixel_yres); } extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv *, jclass, jint bufw, jint bufh, jint format) { - ILOG("NativeApp.backbufferResize(%d x %d)", bufw, bufh); + INFO_LOG(SYSTEM, "NativeApp.backbufferResize(%d x %d)", bufw, bufh); bool new_size = pixel_xres != bufw || pixel_yres != bufh; int old_w = pixel_xres; @@ -779,10 +778,10 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv recalculateDpi(); if (new_size) { - ILOG("Size change detected (previously %d,%d) - calling NativeResized()", old_w, old_h); + INFO_LOG(G3D, "Size change detected (previously %d,%d) - calling NativeResized()", old_w, old_h); NativeResized(); } else { - ILOG("NativeApp::backbufferResize: Size didn't change."); + INFO_LOG(G3D, "NativeApp::backbufferResize: Size didn't change."); } } @@ -801,20 +800,20 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendInputBox(JNIEnv *en static std::string lastSeqID = ""; if (lastSeqID == seqID) { // We send this on dismiss, so twice in many cases. - DLOG("Ignoring duplicate sendInputBox"); + DEBUG_LOG(SYSTEM, "Ignoring duplicate sendInputBox"); return; } lastSeqID = seqID; int seq = 0; if (!TryParse(seqID, &seq)) { - ELOG("Invalid inputbox seqID value: %s", seqID.c_str()); + ERROR_LOG(SYSTEM, "Invalid inputbox seqID value: %s", seqID.c_str()); return; } auto entry = inputBoxCallbacks.find(seq); if (entry == inputBoxCallbacks.end()) { - ELOG("Did not find inputbox callback for %s, shutdown?", seqID.c_str()); + ERROR_LOG(SYSTEM, "Did not find inputbox callback for %s, shutdown?", seqID.c_str()); return; } @@ -988,19 +987,19 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendMessage(JNIEnv *env if (msg == "moga") { mogaVersion = prm; } else if (msg == "permission_pending") { - ILOG("STORAGE PERMISSION: PENDING"); + INFO_LOG(SYSTEM, "STORAGE PERMISSION: PENDING"); // TODO: Add support for other permissions permissions[SYSTEM_PERMISSION_STORAGE] = PERMISSION_STATUS_PENDING; } else if (msg == "permission_denied") { - ILOG("STORAGE PERMISSION: DENIED"); + INFO_LOG(SYSTEM, "STORAGE PERMISSION: DENIED"); permissions[SYSTEM_PERMISSION_STORAGE] = PERMISSION_STATUS_DENIED; } else if (msg == "permission_granted") { - ILOG("STORAGE PERMISSION: GRANTED"); + INFO_LOG(SYSTEM, "STORAGE PERMISSION: GRANTED"); permissions[SYSTEM_PERMISSION_STORAGE] = PERMISSION_STATUS_GRANTED; } else if (msg == "sustained_perf_supported") { sustainedPerfSupported = true; } else if (msg == "safe_insets") { - ILOG("Got insets: %s", prm.c_str()); + INFO_LOG(SYSTEM, "Got insets: %s", prm.c_str()); // We don't bother with supporting exact rectangular regions. Safe insets are good enough. int left, right, top, bottom; if (4 == sscanf(prm.c_str(), "%d:%d:%d:%d", &left, &right, &top, &bottom)) { @@ -1017,7 +1016,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendMessage(JNIEnv *env extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeActivity_exitEGLRenderLoop(JNIEnv *env, jobject obj) { if (!renderLoopRunning) { - ELOG("Render loop already exited"); + ERROR_LOG(SYSTEM, "Render loop already exited"); return; } exitRenderLoop = true; @@ -1030,7 +1029,7 @@ void correctRatio(int &sz_x, int &sz_y, float scale) { float x = (float)sz_x; float y = (float)sz_y; float ratio = x / y; - ILOG("CorrectRatio: Considering size: %0.2f/%0.2f=%0.2f for scale %f", x, y, ratio, scale); + INFO_LOG(G3D, "CorrectRatio: Considering size: %0.2f/%0.2f=%0.2f for scale %f", x, y, ratio, scale); float targetRatio; // Try to get the longest dimension to match scale*PSP resolution. @@ -1045,7 +1044,7 @@ void correctRatio(int &sz_x, int &sz_y, float scale) { } float correction = targetRatio / ratio; - ILOG("Target ratio: %0.2f ratio: %0.2f correction: %0.2f", targetRatio, ratio, correction); + INFO_LOG(G3D, "Target ratio: %0.2f ratio: %0.2f correction: %0.2f", targetRatio, ratio, correction); if (ratio < targetRatio) { y *= correction; } else { @@ -1054,7 +1053,7 @@ void correctRatio(int &sz_x, int &sz_y, float scale) { sz_x = x; sz_y = y; - ILOG("Corrected ratio: %dx%d", sz_x, sz_y); + INFO_LOG(G3D, "Corrected ratio: %dx%d", sz_x, sz_y); } void getDesiredBackbufferSize(int &sz_x, int &sz_y) { @@ -1071,7 +1070,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) { - ILOG("NativeApp.setDisplayParameters(%d x %d, dpi=%d, refresh=%0.2f)", xres, yres, dpi, refreshRate); + INFO_LOG(G3D, "NativeApp.setDisplayParameters(%d x %d, dpi=%d, refresh=%0.2f)", xres, yres, dpi, refreshRate); bool changed = false; changed = changed || display_xres != xres || display_yres != yres; changed = changed || display_dpi_x != dpi || display_dpi_y != dpi; @@ -1156,7 +1155,7 @@ static void ProcessFrameCommands(JNIEnv *env) { frameCmd = frameCommands.front(); frameCommands.pop(); - ILOG("frameCommand '%s' '%s'", frameCmd.command.c_str(), frameCmd.params.c_str()); + INFO_LOG(SYSTEM, "frameCommand '%s' '%s'", frameCmd.command.c_str(), frameCmd.params.c_str()); jstring cmd = env->NewStringUTF(frameCmd.command.c_str()); jstring param = env->NewStringUTF(frameCmd.params.c_str()); @@ -1168,7 +1167,7 @@ static void ProcessFrameCommands(JNIEnv *env) { extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(JNIEnv *env, jobject obj, jobject _surf) { if (!graphicsContext) { - ELOG("runEGLRenderLoop: Tried to enter without a created graphics context."); + ERROR_LOG(G3D, "runEGLRenderLoop: Tried to enter without a created graphics context."); return false; } @@ -1180,10 +1179,10 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J ANativeWindow *wnd = _surf ? ANativeWindow_fromSurface(env, _surf) : nullptr; - WLOG("runEGLRenderLoop. display_xres=%d display_yres=%d", display_xres, display_yres); + WARN_LOG(G3D, "runEGLRenderLoop. display_xres=%d display_yres=%d", display_xres, display_yres); if (wnd == nullptr) { - ELOG("Error: Surface is null."); + ERROR_LOG(G3D, "Error: Surface is null."); renderLoopRunning = false; return false; } @@ -1192,7 +1191,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J if (graphicsContext->InitFromRenderThread(wnd, desiredBackbufferSizeX, desiredBackbufferSizeY, backbuffer_format, androidVersion)) { return true; } else { - ELOG("Failed to initialize graphics context."); + ERROR_LOG(G3D, "Failed to initialize graphics context."); SystemToast("Failed to initialize graphics context."); return false; } @@ -1201,7 +1200,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J bool initSuccess = tryInit(); if (!initSuccess) { if (!exitRenderLoop && g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { - ILOG("Trying again, this time with OpenGL."); + INFO_LOG(G3D, "Trying again, this time with OpenGL."); SetGPUBackend(GPUBackend::OPENGL); g_Config.iGPUBackend = (int)GetGPUBackend(); @@ -1220,7 +1219,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J if (!exitRenderLoop) { if (!useCPUThread) { if (!NativeInitGraphics(graphicsContext)) { - ELOG("Failed to initialize graphics."); + ERROR_LOG(G3D, "Failed to initialize graphics."); // Gonna be in a weird state here.. } } @@ -1237,7 +1236,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J } if (useCPUThread) { - ELOG("Running graphics loop"); + ERROR_LOG(SYSTEM, "Running graphics loop"); while (!exitRenderLoop) { // This is the "GPU thread". graphicsContext->ThreadFrame(); @@ -1256,7 +1255,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J } } - ILOG("Leaving EGL/Vulkan render loop."); + INFO_LOG(G3D, "Leaving EGL/Vulkan render loop."); if (useCPUThread) { EmuThreadStop("exitrenderloop"); @@ -1271,10 +1270,10 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J graphicsContext->ThreadEnd(); // Shut the graphics context down to the same state it was in when we entered the render thread. - ILOG("Shutting down graphics context from render thread..."); + INFO_LOG(G3D, "Shutting down graphics context from render thread..."); graphicsContext->ShutdownFromRenderThread(); renderLoopRunning = false; - WLOG("Render loop function exited."); + WARN_LOG(G3D, "Render loop function exited."); return true; } diff --git a/ext/native/thin3d/GLRenderManager.cpp b/ext/native/thin3d/GLRenderManager.cpp index 220b54aec4..f21f67aac0 100644 --- a/ext/native/thin3d/GLRenderManager.cpp +++ b/ext/native/thin3d/GLRenderManager.cpp @@ -20,6 +20,24 @@ static bool OnRenderThread() { } #endif +void GLDeleter::Take(GLDeleter &other) { + _assert_msg_(IsEmpty(), "Deleter already has stuff"); + shaders = std::move(other.shaders); + programs = std::move(other.programs); + buffers = std::move(other.buffers); + textures = std::move(other.textures); + inputLayouts = std::move(other.inputLayouts); + framebuffers = std::move(other.framebuffers); + pushBuffers = std::move(other.pushBuffers); + other.shaders.clear(); + other.programs.clear(); + other.buffers.clear(); + other.textures.clear(); + other.inputLayouts.clear(); + other.framebuffers.clear(); + other.pushBuffers.clear(); +} + // Runs on the GPU thread. void GLDeleter::Perform(GLRenderManager *renderManager, bool skipGLCalls) { for (auto pushBuffer : pushBuffers) { diff --git a/ext/native/thin3d/GLRenderManager.h b/ext/native/thin3d/GLRenderManager.h index 13aa599741..3e5870507d 100644 --- a/ext/native/thin3d/GLRenderManager.h +++ b/ext/native/thin3d/GLRenderManager.h @@ -8,9 +8,7 @@ #include #include #include -#include -#include "base/logging.h" #include "gfx/gl_common.h" #include "math/dataconv.h" #include "Common/Log.h" @@ -30,6 +28,7 @@ public: glDeleteTextures(1, &texture); } } + GLuint texture = 0; // Could also trust OpenGL defaults I guess.. GLenum target = 0xFFFF; @@ -217,7 +216,7 @@ private: // Note: we must defrag because some buffers may be smaller than size_. Defragment(); Map(); - assert(writePtr_); + _dbg_assert_(writePtr_); } void BeginNoReset() { @@ -253,14 +252,14 @@ public: // Returns the offset that should be used when binding this buffer to get this data. size_t Push(const void *data, size_t size, GLRBuffer **vkbuf) { - assert(writePtr_); + _dbg_assert_(writePtr_); size_t off = Allocate(size, vkbuf); memcpy(writePtr_ + off, data, size); return off; } uint32_t PushAligned(const void *data, size_t size, int align, GLRBuffer **vkbuf) { - assert(writePtr_); + _dbg_assert_(writePtr_); offset_ = (offset_ + align - 1) & ~(align - 1); size_t off = Allocate(size, vkbuf); memcpy(writePtr_ + off, data, size); @@ -274,13 +273,13 @@ public: // "Zero-copy" variant - you can write the data directly as you compute it. // Recommended. void *Push(size_t size, uint32_t *bindOffset, GLRBuffer **vkbuf) { - assert(writePtr_); + _dbg_assert_(writePtr_); size_t off = Allocate(size, vkbuf); *bindOffset = (uint32_t)off; return writePtr_ + off; } void *PushAligned(size_t size, uint32_t *bindOffset, GLRBuffer **vkbuf, int align) { - assert(writePtr_); + _dbg_assert_(writePtr_); offset_ = (offset_ + align - 1) & ~(align - 1); size_t off = Allocate(size, vkbuf); *bindOffset = (uint32_t)off; @@ -324,23 +323,7 @@ public: return shaders.empty() && programs.empty() && buffers.empty() && textures.empty() && inputLayouts.empty() && framebuffers.empty() && pushBuffers.empty(); } - void Take(GLDeleter &other) { - _assert_msg_(IsEmpty(), "Deleter already has stuff"); - shaders = std::move(other.shaders); - programs = std::move(other.programs); - buffers = std::move(other.buffers); - textures = std::move(other.textures); - inputLayouts = std::move(other.inputLayouts); - framebuffers = std::move(other.framebuffers); - pushBuffers = std::move(other.pushBuffers); - other.shaders.clear(); - other.programs.clear(); - other.buffers.clear(); - other.textures.clear(); - other.inputLayouts.clear(); - other.framebuffers.clear(); - other.pushBuffers.clear(); - } + void Take(GLDeleter &other); std::vector shaders; std::vector programs; @@ -431,7 +414,7 @@ public: std::vector shaders, std::vector semantics, std::vector queries, std::vector initalizers, bool supportDualSource) { GLRInitStep step{ GLRInitStepType::CREATE_PROGRAM }; - assert(shaders.size() <= ARRAY_SIZE(step.create_program.shaders)); + _assert_(shaders.size() <= ARRAY_SIZE(step.create_program.shaders)); step.create_program.program = new GLRProgram(); step.create_program.program->semantics_ = semantics; step.create_program.program->queries_ = queries; @@ -443,10 +426,10 @@ public: } #ifdef _DEBUG for (auto &iter : queries) { - assert(iter.name); + _dbg_assert_(iter.name); } for (auto &sem : semantics) { - assert(sem.attrib); + _dbg_assert_(sem.attrib); } #endif step.create_program.num_shaders = (int)shaders.size(); @@ -616,7 +599,7 @@ public: void BindVertexBuffer(GLRInputLayout *inputLayout, GLRBuffer *buffer, size_t offset) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); - assert(inputLayout); + _dbg_assert_(inputLayout); GLRRenderData data{ GLRRenderCommand::BIND_VERTEX_BUFFER }; data.bindVertexBuffer.inputLayout = inputLayout; data.bindVertexBuffer.offset = offset; @@ -650,7 +633,7 @@ public: void SetUniformI(const GLint *loc, int count, const int *udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORM4I }; data.uniform4.loc = loc; @@ -662,7 +645,7 @@ public: void SetUniformI1(const GLint *loc, int udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORM4I }; data.uniform4.loc = loc; @@ -674,7 +657,7 @@ public: void SetUniformF(const GLint *loc, int count, const float *udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORM4F }; data.uniform4.loc = loc; @@ -686,7 +669,7 @@ public: void SetUniformF1(const GLint *loc, const float udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORM4F }; data.uniform4.loc = loc; @@ -698,7 +681,7 @@ public: void SetUniformF(const char *name, int count, const float *udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORM4F }; data.uniform4.name = name; @@ -710,7 +693,7 @@ public: void SetUniformM4x4(const GLint *loc, const float *udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORMMATRIX }; data.uniformMatrix4.loc = loc; @@ -721,7 +704,7 @@ public: void SetUniformM4x4(const char *name, const float *udata) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER); #ifdef _DEBUG - assert(curProgram_); + _dbg_assert_(curProgram_); #endif GLRRenderData data{ GLRRenderCommand::UNIFORMMATRIX }; data.uniformMatrix4.name = name; @@ -902,7 +885,7 @@ public: foundCount++; } } - assert(foundCount == 1); + _dbg_assert_(foundCount == 1); } void SetSwapFunction(std::function swapFunction) {