diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp index 3856a7cd0..9a32ec076 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp @@ -162,11 +162,8 @@ void GPUSwapChainDX11::Present(bool vsync) bool GPUSwapChainDX11::Resize(int32 width, int32 height) { - // Check if size won't change if (width == _width && height == _height) - { return false; - } _device->WaitForGPU(); GPUDeviceLock lock(_device); @@ -174,6 +171,10 @@ bool GPUSwapChainDX11::Resize(int32 width, int32 height) _allowTearing = _device->_allowTearing; #endif _format = GPU_BACK_BUFFER_PIXEL_FORMAT; + if (_memoryUsage != 0) + { + PROFILE_MEM_DEC(Graphics, _memoryUsage); + } #if PLATFORM_WINDOWS DXGI_SWAP_CHAIN_DESC swapChainDesc; diff --git a/Source/Engine/Platform/Windows/WindowsWindow.cpp b/Source/Engine/Platform/Windows/WindowsWindow.cpp index 3a1cf0dd3..b028e3fc3 100644 --- a/Source/Engine/Platform/Windows/WindowsWindow.cpp +++ b/Source/Engine/Platform/Windows/WindowsWindow.cpp @@ -409,6 +409,17 @@ void WindowsWindow::SetClientBounds(const Rectangle& clientArea) int32 width = (int32)clientArea.GetWidth(); int32 height = (int32)clientArea.GetHeight(); + // Resize during fullscreen + if (changeSize && _swapChain && _swapChain->IsFullscreen()) + { + // Go out fullscreen, resize, and then go back in + _swapChain->SetFullscreen(false); + _clientSize = clientArea.Size; + OnResize(width, height); + _swapChain->SetFullscreen(true); + return; + } + if (changeSize) { _clientSize = clientArea.Size;