Qt: Unrestrict resolution scale up to device limits

This commit is contained in:
Stenzek
2024-07-03 22:26:16 +10:00
parent 7927ec647f
commit 4b61a3cbf3
20 changed files with 405 additions and 543 deletions

View File

@ -754,39 +754,6 @@ void D3D12Device::DestroyDeferredObjects(u64 fence_value)
}
}
void D3D12Device::GetAdapterAndModeList(AdapterAndModeList* ret, IDXGIFactory5* factory)
{
ret->adapter_names = D3DCommon::GetAdapterNames(factory);
ret->fullscreen_modes = D3DCommon::GetFullscreenModes(factory, {});
}
GPUDevice::AdapterAndModeList D3D12Device::StaticGetAdapterAndModeList()
{
AdapterAndModeList ret;
std::unique_lock lock(s_instance_mutex);
// Device shouldn't be torn down since we have the lock.
if (g_gpu_device && g_gpu_device->GetRenderAPI() == RenderAPI::D3D12)
{
GetAdapterAndModeList(&ret, D3D12Device::GetInstance().m_dxgi_factory.Get());
}
else
{
ComPtr<IDXGIFactory5> factory = D3DCommon::CreateFactory(false, nullptr);
if (factory)
GetAdapterAndModeList(&ret, factory.Get());
}
return ret;
}
GPUDevice::AdapterAndModeList D3D12Device::GetAdapterAndModeList()
{
AdapterAndModeList ret;
GetAdapterAndModeList(&ret, m_dxgi_factory.Get());
return ret;
}
RenderAPI D3D12Device::GetRenderAPI() const
{
return RenderAPI::D3D12;