Merge pull request #11898 from Filoppi/patch-19

Video: Fix crash when getting the AA modes
This commit is contained in:
Admiral H. Curtiss 2023-06-08 15:26:40 +02:00 committed by GitHub
commit e4636ad0a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {};
}