video-core: Move logging macros over to new fmt-capable ones

This commit is contained in:
Lioncash 2018-04-25 08:13:44 -04:00
parent ea3151f475
commit b7551e457b
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
5 changed files with 20 additions and 18 deletions

View file

@ -31,12 +31,14 @@ enum class BufferMethods {
}; };
void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) { void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) {
LOG_WARNING(HW_GPU, "Processing method %08X on subchannel %u value %08X remaining params %u", NGLOG_WARNING(HW_GPU,
"Processing method {:08X} on subchannel {} value "
"{:08X} remaining params {}",
method, subchannel, value, remaining_params); method, subchannel, value, remaining_params);
if (method == static_cast<u32>(BufferMethods::SetGraphMacroEntry)) { if (method == static_cast<u32>(BufferMethods::SetGraphMacroEntry)) {
// Prepare to upload a new macro, reset the upload counter. // Prepare to upload a new macro, reset the upload counter.
LOG_DEBUG(HW_GPU, "Uploading GPU macro %08X", value); NGLOG_DEBUG(HW_GPU, "Uploading GPU macro {:08X}", value);
current_macro_entry = value; current_macro_entry = value;
current_macro_code.clear(); current_macro_code.clear();
return; return;
@ -58,7 +60,7 @@ void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params)
if (method == static_cast<u32>(BufferMethods::BindObject)) { if (method == static_cast<u32>(BufferMethods::BindObject)) {
// Bind the current subchannel to the desired engine id. // Bind the current subchannel to the desired engine id.
LOG_DEBUG(HW_GPU, "Binding subchannel %u to engine %u", subchannel, value); NGLOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value);
ASSERT(bound_engines.find(subchannel) == bound_engines.end()); ASSERT(bound_engines.find(subchannel) == bound_engines.end());
bound_engines[subchannel] = static_cast<EngineID>(value); bound_engines[subchannel] = static_cast<EngineID>(value);
return; return;
@ -66,7 +68,7 @@ void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params)
if (method < static_cast<u32>(BufferMethods::CountBufferMethods)) { if (method < static_cast<u32>(BufferMethods::CountBufferMethods)) {
// TODO(Subv): Research and implement these methods. // TODO(Subv): Research and implement these methods.
LOG_ERROR(HW_GPU, "Special buffer methods other than Bind are not implemented"); NGLOG_ERROR(HW_GPU, "Special buffer methods other than Bind are not implemented");
return; return;
} }

View file

@ -186,8 +186,8 @@ void Maxwell3D::ProcessQueryGet() {
} }
void Maxwell3D::DrawArrays() { void Maxwell3D::DrawArrays() {
LOG_DEBUG(HW_GPU, "called, topology=%d, count=%d", regs.draw.topology.Value(), NGLOG_DEBUG(HW_GPU, "called, topology={}, count={}",
regs.vertex_buffer.count); static_cast<u32>(regs.draw.topology.Value()), regs.vertex_buffer.count);
ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?"); ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?");
auto debug_context = Core::System::GetInstance().GetGPUDebugContext(); auto debug_context = Core::System::GetInstance().GetGPUDebugContext();

View file

@ -116,7 +116,7 @@ RasterizerOpenGL::RasterizerOpenGL() {
glEnable(GL_BLEND); glEnable(GL_BLEND);
LOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!"); NGLOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!");
} }
RasterizerOpenGL::~RasterizerOpenGL() { RasterizerOpenGL::~RasterizerOpenGL() {
@ -252,8 +252,8 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) {
break; break;
} }
default: default:
LOG_CRITICAL(HW_GPU, "Unimplemented shader index=%d, enable=%d, offset=0x%08X", index, NGLOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset={:#010X}",
shader_config.enable.Value(), shader_config.offset); index, shader_config.enable.Value(), shader_config.offset);
UNREACHABLE(); UNREACHABLE();
} }

View file

@ -302,8 +302,8 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,
right = texcoords.left; right = texcoords.left;
} else { } else {
// Other transformations are unsupported // Other transformations are unsupported
LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags=%d", NGLOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
framebuffer_transform_flags); static_cast<u32>(framebuffer_transform_flags));
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
} }
@ -428,9 +428,9 @@ bool RendererOpenGL::Init() {
const char* gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))}; const char* gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
const char* gpu_model{reinterpret_cast<char const*>(glGetString(GL_RENDERER))}; const char* gpu_model{reinterpret_cast<char const*>(glGetString(GL_RENDERER))};
LOG_INFO(Render_OpenGL, "GL_VERSION: %s", gl_version); NGLOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
LOG_INFO(Render_OpenGL, "GL_VENDOR: %s", gpu_vendor); NGLOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
LOG_INFO(Render_OpenGL, "GL_RENDERER: %s", gpu_model); NGLOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Vendor", gpu_vendor); Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Vendor", gpu_vendor);
Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model); Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model);

View file

@ -24,9 +24,9 @@ bool Init(EmuWindow* emu_window) {
g_renderer = std::make_unique<RendererOpenGL>(); g_renderer = std::make_unique<RendererOpenGL>();
g_renderer->SetWindow(g_emu_window); g_renderer->SetWindow(g_emu_window);
if (g_renderer->Init()) { if (g_renderer->Init()) {
LOG_DEBUG(Render, "initialized OK"); NGLOG_DEBUG(Render, "initialized OK");
} else { } else {
LOG_CRITICAL(Render, "initialization failed !"); NGLOG_CRITICAL(Render, "initialization failed !");
return false; return false;
} }
return true; return true;
@ -36,7 +36,7 @@ bool Init(EmuWindow* emu_window) {
void Shutdown() { void Shutdown() {
g_renderer.reset(); g_renderer.reset();
LOG_DEBUG(Render, "shutdown OK"); NGLOG_DEBUG(Render, "shutdown OK");
} }
} // namespace VideoCore } // namespace VideoCore