mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
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:
@ -10,6 +10,7 @@
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/DynamicLibrary.h"
|
||||
#include "Common/HRWrap.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
@ -89,7 +90,7 @@ Microsoft::WRL::ComPtr<IDXGIFactory> CreateDXGIFactory(bool debug_device)
|
||||
HRESULT hr = create_dxgi_factory(IID_PPV_ARGS(factory.ReleaseAndGetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlertFmt("CreateDXGIFactory() failed with HRESULT {:08X}", hr);
|
||||
PanicAlertFmt("CreateDXGIFactory() failed: {}", Common::HRWrap(hr));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/HRWrap.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
@ -118,8 +119,8 @@ std::optional<Shader::BinaryData> Shader::CompileShader(D3D_FEATURE_LEVEL featur
|
||||
file << "Video Backend: " + g_video_backend->GetDisplayName();
|
||||
file.close();
|
||||
|
||||
PanicAlertFmt("Failed to compile {}:\nDebug info ({}):\n{}", filename, target,
|
||||
static_cast<const char*>(errors->GetBufferPointer()));
|
||||
PanicAlertFmt("Failed to compile {}: {}\nDebug info ({}):\n{}", filename, Common::HRWrap(hr),
|
||||
target, static_cast<const char*>(errors->GetBufferPointer()));
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user