summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-06-08 15:26:40 +0200
committerGitHub <noreply@github.com>2023-06-08 15:26:40 +0200
commite4636ad0a2f04c606f995d656706cbd83a40fb1d (patch)
tree065efb744224a971403e59bfcf7e8d379a4585a2 /Source/Core
parent4905acf080743464424a4841fcafc0ce18b4b296 (diff)
parent80d12e3e88c6d58b00e0828b3cd9fb7489b6e7ba (diff)
Merge pull request #11898 from Filoppi/patch-19
Video: Fix crash when getting the AA modes
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoBackends/D3D12/DX12Context.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D12/DX12Context.cpp b/Source/Core/VideoBackends/D3D12/DX12Context.cpp
index 19a13f64b4..7b33ffe8d9 100644
--- a/Source/Core/VideoBackends/D3D12/DX12Context.cpp
+++ b/Source/Core/VideoBackends/D3D12/DX12Context.cpp
@@ -48,7 +48,10 @@ std::vector<u32> DXContext::GetAAModes(u32 adapter_index)
return {};
ComPtr<IDXGIAdapter> adapter;
- temp_dxgi_factory->EnumAdapters(adapter_index, &adapter);
+ HRESULT hr = temp_dxgi_factory->EnumAdapters(adapter_index, &adapter);
+
+ if (!SUCCEEDED(hr))
+ return {};
PFN_D3D12_CREATE_DEVICE d3d12_create_device;
if (!temp_lib.Open("d3d12.dll") ||
@@ -57,8 +60,7 @@ std::vector<u32> DXContext::GetAAModes(u32 adapter_index)
return {};
}
- HRESULT hr =
- d3d12_create_device(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&temp_device));
+ hr = d3d12_create_device(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&temp_device));
if (!SUCCEEDED(hr))
return {};
}