diff --git a/source/renderer/backend/vulkan/Device.cpp b/source/renderer/backend/vulkan/Device.cpp index 8a74178933..b1751f1580 100644 --- a/source/renderer/backend/vulkan/Device.cpp +++ b/source/renderer/backend/vulkan/Device.cpp @@ -674,7 +674,6 @@ void CDevice::Report(const ScriptRequest& rq, JS::HandleValue settings) std::unique_ptr CDevice::CreateGraphicsPipelineState( const SGraphicsPipelineStateDesc& pipelineStateDesc) { - UNUSED2(pipelineStateDesc); return CGraphicsPipelineState::Create(this, pipelineStateDesc); } @@ -778,8 +777,12 @@ void CDevice::Present() void CDevice::OnWindowResize(const uint32_t width, const uint32_t height) { - UNUSED2(width); - UNUSED2(height); + if (!IsSwapChainValid() || + width != m_SwapChain->GetDepthTexture()->GetWidth() || + height != m_SwapChain->GetDepthTexture()->GetHeight()) + { + RecreateSwapChain(); + } } bool CDevice::IsTextureFormatSupported(const Format format) const diff --git a/source/renderer/backend/vulkan/SwapChain.h b/source/renderer/backend/vulkan/SwapChain.h index 175b9b4838..6d82ca6069 100644 --- a/source/renderer/backend/vulkan/SwapChain.h +++ b/source/renderer/backend/vulkan/SwapChain.h @@ -62,6 +62,8 @@ public: const AttachmentLoadOp depthStencilAttachmentLoadOp, const AttachmentStoreOp depthStencilAttachmentStoreOp); + CTexture* GetDepthTexture() { return m_DepthTexture.get(); } + private: friend class CDevice;