diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp index 6ebd55384..e9d83bfc3 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp @@ -99,8 +99,6 @@ void GPUSwapChainDX11::SetFullscreen(bool isFullscreen) swapChainDesc.BufferDesc = outputDX.DesktopViewMode; } - releaseBackBuffer(); - if (FAILED(_swapChain->ResizeTarget(&swapChainDesc.BufferDesc))) { LOG(Warning, "Swapchain resize failed."); @@ -110,10 +108,6 @@ void GPUSwapChainDX11::SetFullscreen(bool isFullscreen) { LOG(Warning, "Cannot change fullscreen mode for '{0}' to {1}.", ToString(), isFullscreen); } - - VALIDATE_DIRECTX_RESULT(_swapChain->ResizeBuffers(swapChainDesc.BufferCount, _width, _height, swapChainDesc.BufferDesc.Format, swapChainDesc.Flags)); - - getBackBuffer(); } #else LOG(Info, "Cannot change fullscreen mode on this platform"); @@ -208,7 +202,7 @@ bool GPUSwapChainDX11::Resize(int32 width, int32 height) ASSERT(_swapChain); // Disable DXGI changes to the window - VALIDATE_DIRECTX_RESULT(dxgi->MakeWindowAssociation(_windowHandle, DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER)); + VALIDATE_DIRECTX_RESULT(dxgi->MakeWindowAssociation(_windowHandle, 0)); #else auto dxgiFactory = (IDXGIFactory2*)_device->GetDXGIFactory(); VALIDATE_DIRECTX_RESULT(dxgiFactory->CreateSwapChainForCoreWindow(_device->GetDevice(), static_cast(_windowHandle), &swapChainDesc, nullptr, &_swapChain)); diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp index 669b217e4..b8ac22bba 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp @@ -124,8 +124,6 @@ void GPUSwapChainDX12::SetFullscreen(bool isFullscreen) swapChainDesc.BufferDesc = outputDX.DesktopViewMode; } - releaseBackBuffer(); - if (FAILED(_swapChain->ResizeTarget(&swapChainDesc.BufferDesc))) { LOG(Warning, "Swapchain resize failed."); @@ -136,10 +134,6 @@ void GPUSwapChainDX12::SetFullscreen(bool isFullscreen) LOG(Warning, "Cannot change fullscreen mode for '{0}' to {1}.", ToString(), isFullscreen); } - VALIDATE_DIRECTX_RESULT(_swapChain->ResizeBuffers(swapChainDesc.BufferCount, _width, _height, swapChainDesc.BufferDesc.Format, swapChainDesc.Flags)); - - getBackBuffer(); - _isFullscreen = isFullscreen; } #else @@ -223,7 +217,7 @@ bool GPUSwapChainDX12::Resize(int32 width, int32 height) _backBuffers.Resize(swapChainDesc.BufferCount); // Disable DXGI changes to the window - dxgiFactory->MakeWindowAssociation(_windowHandle, DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER); + dxgiFactory->MakeWindowAssociation(_windowHandle, 0); } else {