From 2345d5f98d997a8f546f1aefb3c1922814740fe7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 9 Nov 2020 03:01:58 -0500 Subject: [PATCH] D3D: Migrate logging over to fmt Migrates the logging over to the fmt-capable logger. --- Source/Core/VideoBackends/D3D/D3DBase.cpp | 10 +++++----- Source/Core/VideoBackends/D3D/D3DState.cpp | 2 +- Source/Core/VideoBackends/D3D/PerfQuery.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/D3DBase.cpp b/Source/Core/VideoBackends/D3D/D3DBase.cpp index 81220dcfc3..5a2d093541 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBase.cpp @@ -67,7 +67,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer) HRESULT hr = dxgi_factory->EnumAdapters(adapter_index, adapter.GetAddressOf()); if (FAILED(hr)) { - WARN_LOG(VIDEO, "Adapter %u not found, using default", adapter_index); + WARN_LOG_FMT(VIDEO, "Adapter {} not found, using default", adapter_index); adapter = nullptr; } @@ -99,7 +99,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer) } else { - WARN_LOG(VIDEO, "Debug layer requested but not available."); + WARN_LOG_FMT(VIDEO, "Debug layer requested but not available."); } } @@ -124,7 +124,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer) hr = device.As(&device1); if (FAILED(hr)) { - WARN_LOG(VIDEO, "Missing Direct3D 11.1 support. Logical operations will not be supported."); + WARN_LOG_FMT(VIDEO, "Missing Direct3D 11.1 support. Logical operations will not be supported."); } stateman = std::make_unique(); @@ -156,9 +156,9 @@ void Destroy() } if (remaining_references) - ERROR_LOG(VIDEO, "Unreleased references: %i.", remaining_references); + ERROR_LOG_FMT(VIDEO, "Unreleased references: {}.", remaining_references); else - NOTICE_LOG(VIDEO, "Successfully released all device references!"); + NOTICE_LOG_FMT(VIDEO, "Successfully released all device references!"); dxgi_factory.Reset(); D3DCommon::UnloadLibraries(); diff --git a/Source/Core/VideoBackends/D3D/D3DState.cpp b/Source/Core/VideoBackends/D3D/D3DState.cpp index 8923a9e676..8e10385af6 100644 --- a/Source/Core/VideoBackends/D3D/D3DState.cpp +++ b/Source/Core/VideoBackends/D3D/D3DState.cpp @@ -386,7 +386,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state) { return m_blend.emplace(state.hex, std::move(res)).first->second.Get(); } - WARN_LOG(VIDEO, "Creating D3D blend state failed with an error: %x", hr); + WARN_LOG_FMT(VIDEO, "Creating D3D blend state failed with an error: {:08X}", hr); } D3D11_BLEND_DESC desc = {}; diff --git a/Source/Core/VideoBackends/D3D/PerfQuery.cpp b/Source/Core/VideoBackends/D3D/PerfQuery.cpp index c62cc9f4fc..70eba20c57 100644 --- a/Source/Core/VideoBackends/D3D/PerfQuery.cpp +++ b/Source/Core/VideoBackends/D3D/PerfQuery.cpp @@ -35,7 +35,7 @@ void PerfQuery::EnableQuery(PerfQueryGroup type) { // TODO FlushOne(); - ERROR_LOG(VIDEO, "Flushed query buffer early!"); + ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!"); } // start query