Migrate force_log_printf to new logging (#714)

This commit is contained in:
why-keith 2023-04-12 15:31:34 +01:00 committed by GitHub
parent 072c18a6e3
commit 4be57f4896
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 401 additions and 399 deletions

View file

@ -89,7 +89,7 @@ OpenGLRenderer::OpenGLRenderer()
void* buffer = glMapNamedBufferRange(glRendererState.uploadBuffer, 0, TEXBUFFER_SIZE, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_FLUSH_EXPLICIT_BIT);
if (buffer == nullptr)
{
forceLog_printf("Failed to allocate GL texture upload buffer. Using traditional API instead");
cemuLog_log(LogType::Force, "Failed to allocate GL texture upload buffer. Using traditional API instead");
cemu_assert_debug(false);
}
glRendererState.uploadBufferPtr = buffer;
@ -104,7 +104,7 @@ OpenGLRenderer::OpenGLRenderer()
}
catch (const std::exception& ex)
{
forceLog_printf("Unable to create dxgi wrapper: %s (VRAM overlay stat won't be available)", ex.what());
cemuLog_log(LogType::Force, "Unable to create dxgi wrapper: {} (VRAM overlay stat won't be available)", ex.what());
}
#endif
}
@ -254,7 +254,7 @@ void OpenGLRenderer::Initialize()
{
Renderer::Initialize();
auto lock = cafeLog_acquire();
forceLog_printf("------- Init OpenGL graphics backend -------");
cemuLog_log(LogType::Force, "------- Init OpenGL graphics backend -------");
GLCanvas_MakeCurrent(false);
LoadOpenGLImports();
@ -268,12 +268,12 @@ void OpenGLRenderer::Initialize()
if (glMaxShaderCompilerThreadsARB)
glMaxShaderCompilerThreadsARB(0xFFFFFFFF);
forceLog_printf("OpenGL extensions:");
forceLog_printf("ARB_clip_control: %s", glClipControl ? "available" : "not supported");
forceLog_printf("ARB_get_program_binary: %s", (glGetProgramBinary != NULL && glProgramBinary != NULL) ? "available" : "not supported");
forceLog_printf("ARB_clear_texture: %s", (glClearTexImage != NULL) ? "available" : "not supported");
forceLog_printf("ARB_copy_image: %s", (glCopyImageSubData != NULL) ? "available" : "not supported");
forceLog_printf("NV_depth_buffer_float: %s", (glDepthRangedNV != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "OpenGL extensions:");
cemuLog_log(LogType::Force, "ARB_clip_control: {}", glClipControl ? "available" : "not supported");
cemuLog_log(LogType::Force, "ARB_get_program_binary: {}", (glGetProgramBinary != NULL && glProgramBinary != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "ARB_clear_texture: {}", (glClearTexImage != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "ARB_copy_image: {}", (glCopyImageSubData != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "NV_depth_buffer_float: {}", (glDepthRangedNV != NULL) ? "available" : "not supported");
// generate default frame buffer
glGenFramebuffers(1, &m_defaultFramebufferId);
@ -376,9 +376,9 @@ void OpenGLRenderer::GetVendorInformation()
char* glRendererString = (char*)glGetString(GL_RENDERER);
char* glVersionString = (char*)glGetString(GL_VERSION);
forceLog_printf("GL_VENDOR: %s", glVendorString ? glVendorString : "unknown");
forceLog_printf("GL_RENDERER: %s", glRendererString ? glRendererString : "unknown");
forceLog_printf("GL_VERSION: %s", glVersionString ? glVersionString : "unknown");
cemuLog_log(LogType::Force, "GL_VENDOR: {}", glVendorString ? glVendorString : "unknown");
cemuLog_log(LogType::Force, "GL_RENDERER: {}", glRendererString ? glRendererString : "unknown");
cemuLog_log(LogType::Force, "GL_VERSION: {}", glVersionString ? glVersionString : "unknown");
if(boost::icontains(glVersionString, "Mesa"))
{
@ -424,7 +424,7 @@ void _glDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GL
if (LatteGPUState.glVendor == GLVENDOR_NVIDIA && strstr(message, "does not have a defined base level"))
return;
forceLog_printf("GLDEBUG: %s", message);
cemuLog_log(LogType::Force, "GLDEBUG: {}", message);
cemu_assert_debug(false);
}