Fix crash in SSAO when using very low render resolution

This commit is contained in:
Wojtek Figat
2023-01-15 14:08:24 +01:00
parent e40cdc8a7f
commit 675aa92b53

View File

@@ -206,7 +206,7 @@ void AmbientOcclusionPass::Render(RenderContext& renderContext)
if (renderContext.List == nullptr)
return;
auto& aoSettings = renderContext.List->Settings.AmbientOcclusion;
if (aoSettings.Enabled == false || (renderContext.View.Flags & ViewFlags::AO) == 0)
if (aoSettings.Enabled == false || (renderContext.View.Flags & ViewFlags::AO) == 0 || Math::Min(renderContext.Buffers->GetWidth(), renderContext.Buffers->GetHeight()) < 16)
return;
// TODO: add support for SSAO in ortho projection