Recreates Vulkan swapchain on window resize.

Tested By: hyperion
Differential Revision: https://code.wildfiregames.com/D4879
This was SVN commit r27422.
This commit is contained in:
vladislavbelov
2023-01-12 06:35:59 +00:00
parent ccda54a662
commit ec704d8179
2 changed files with 8 additions and 3 deletions
+6 -3
View File
@@ -674,7 +674,6 @@ void CDevice::Report(const ScriptRequest& rq, JS::HandleValue settings)
std::unique_ptr<IGraphicsPipelineState> 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
@@ -62,6 +62,8 @@ public:
const AttachmentLoadOp depthStencilAttachmentLoadOp,
const AttachmentStoreOp depthStencilAttachmentStoreOp);
CTexture* GetDepthTexture() { return m_DepthTexture.get(); }
private:
friend class CDevice;