Use HRWrap in remaining locations

Note that D3DCommon can't use DX11HRWrap or DX12HRWrap since it's shared between them.
This commit is contained in:
Pokechu22
2021-12-12 13:50:18 -08:00
parent 1b32e6dae2
commit ca9bf3174f
8 changed files with 58 additions and 34 deletions

View File

@ -8,8 +8,10 @@
#include "Common/Assert.h"
#include "Common/CommonFuncs.h"
#include "Common/HRWrap.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "VideoCommon/VideoConfig.h"
static bool IsTearingSupported(IDXGIFactory2* dxgi_factory)
@ -125,7 +127,7 @@ bool SwapChain::CreateSwapChain(bool stereo)
if (FAILED(hr))
{
PanicAlertFmt("Failed to create swap chain with HRESULT {:08X}", hr);
PanicAlertFmt("Failed to create swap chain: {}", Common::HRWrap(hr));
return false;
}
@ -133,7 +135,7 @@ bool SwapChain::CreateSwapChain(bool stereo)
hr = m_dxgi_factory->MakeWindowAssociation(static_cast<HWND>(m_wsi.render_surface),
DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER);
if (FAILED(hr))
WARN_LOG_FMT(VIDEO, "MakeWindowAssociation() failed with HRESULT {:08X}", hr);
WARN_LOG_FMT(VIDEO, "MakeWindowAssociation() failed: {}", Common::HRWrap(hr));
m_stereo = stereo;
if (!CreateSwapChainBuffers())
@ -166,7 +168,7 @@ bool SwapChain::ResizeSwapChain()
GetDXGIFormatForAbstractFormat(m_texture_format, false),
GetSwapChainFlags());
if (FAILED(hr))
WARN_LOG_FMT(VIDEO, "ResizeBuffers() failed with HRESULT {:08X}", hr);
WARN_LOG_FMT(VIDEO, "ResizeBuffers() failed: {}", Common::HRWrap(hr));
DXGI_SWAP_CHAIN_DESC desc;
if (SUCCEEDED(m_swap_chain->GetDesc(&desc)))
@ -236,7 +238,7 @@ bool SwapChain::Present()
HRESULT hr = m_swap_chain->Present(static_cast<UINT>(g_ActiveConfig.bVSyncActive), present_flags);
if (FAILED(hr))
{
WARN_LOG_FMT(VIDEO, "Swap chain present failed with HRESULT {:08X}", hr);
WARN_LOG_FMT(VIDEO, "Swap chain present failed: {}", Common::HRWrap(hr));
return false;
}