D3D11HostDisplay: Ensure we only get feature level 10-11

This commit is contained in:
Connor McLaughlin 2020-07-09 13:00:31 +10:00
parent e3db2f5ffe
commit 5984f977ca
1 changed files with 7 additions and 3 deletions

View File

@ -205,9 +205,13 @@ bool D3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view
if (FAILED(hr)) if (FAILED(hr))
Log_WarningPrintf("Failed to enumerate adapter %u, using default", adapter_index); Log_WarningPrintf("Failed to enumerate adapter %u, using default", adapter_index);
hr = D3D11CreateDevice(dxgi_adapter.Get(), dxgi_adapter ? D3D_DRIVER_TYPE_UNKNOWN : D3D_DRIVER_TYPE_HARDWARE, nullptr, static constexpr std::array<D3D_FEATURE_LEVEL, 3> requested_feature_levels = {
create_flags, nullptr, 0, D3D11_SDK_VERSION, m_device.GetAddressOf(), nullptr, {D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_11_0}};
m_context.GetAddressOf());
hr =
D3D11CreateDevice(dxgi_adapter.Get(), dxgi_adapter ? D3D_DRIVER_TYPE_UNKNOWN : D3D_DRIVER_TYPE_HARDWARE, nullptr,
create_flags, requested_feature_levels.data(), static_cast<UINT>(requested_feature_levels.size()),
D3D11_SDK_VERSION, m_device.GetAddressOf(), nullptr, m_context.GetAddressOf());
// we re-grab these later, see below // we re-grab these later, see below
dxgi_adapter.Reset(); dxgi_adapter.Reset();