Fix various issues in WebGPU backend

This commit is contained in:
Wojtek Figat
2026-03-16 16:39:18 +01:00
parent a5bbf0dbde
commit 427f4647fc
9 changed files with 53 additions and 5 deletions

View File

@@ -362,7 +362,13 @@ Viewport SceneRenderTask::GetOutputViewport() const
if (Output && Output->IsAllocated())
return Viewport(0, 0, static_cast<float>(Output->Width()), static_cast<float>(Output->Height()));
if (SwapChain)
{
#if PLATFORM_WEB
// Hack fix for Web where swapchain texture might have different size than actual current size of the backbuffer, just precache it (GetBackBufferView might resize internally)
SwapChain->GetBackBufferView();
#endif
return Viewport(0, 0, static_cast<float>(SwapChain->GetWidth()), static_cast<float>(SwapChain->GetHeight()));
}
return GetViewport();
}