Host: Fix error when switching to surfaceless
This commit is contained in:
parent
4666057158
commit
428c3e3426
|
@ -378,10 +378,19 @@ void Host::UpdateDisplayWindow(bool fullscreen)
|
||||||
g_gpu_device->DestroyMainSwapChain();
|
g_gpu_device->DestroyMainSwapChain();
|
||||||
|
|
||||||
Error error;
|
Error error;
|
||||||
std::optional<WindowInfo> wi;
|
std::optional<WindowInfo> wi =
|
||||||
if (!(wi = Host::AcquireRenderWindow(g_gpu_device->GetRenderAPI(), fullscreen, fullscreen_mode.has_value(), &error))
|
Host::AcquireRenderWindow(g_gpu_device->GetRenderAPI(), fullscreen, fullscreen_mode.has_value(), &error);
|
||||||
.has_value() ||
|
if (!wi.has_value())
|
||||||
!g_gpu_device->RecreateMainSwapChain(wi.value(), vsync_mode, allow_present_throttle,
|
{
|
||||||
|
Host::ReportFatalError("Failed to get render window after update", error.GetDescription());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if surfaceless, just leave it
|
||||||
|
if (wi->IsSurfaceless())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!g_gpu_device->RecreateMainSwapChain(wi.value(), vsync_mode, allow_present_throttle,
|
||||||
fullscreen_mode.has_value() ? &fullscreen_mode.value() : nullptr,
|
fullscreen_mode.has_value() ? &fullscreen_mode.value() : nullptr,
|
||||||
exclusive_fullscreen_control, &error))
|
exclusive_fullscreen_control, &error))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue