mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-24 13:53:05 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user