Add optional async scene drawing and improve stability

This commit is contained in:
Wojtek Figat
2022-11-11 15:47:33 +01:00
parent 881880fc34
commit b47d95205f
5 changed files with 20 additions and 5 deletions

View File

@@ -1216,7 +1216,7 @@ void Foliage::Draw(RenderContextBatch& renderContextBatch)
#if !FOLIAGE_USE_SINGLE_QUAD_TREE
// Run async job for each foliage type
const RenderView& view = renderContextBatch.GetMainContext().View;
if ((view.Pass & DrawPass::GBuffer) && !(view.Pass & (DrawPass::GlobalSDF | DrawPass::GlobalSurfaceAtlas)))
if ((view.Pass & DrawPass::GBuffer) && !(view.Pass & (DrawPass::GlobalSDF | DrawPass::GlobalSurfaceAtlas)) && renderContextBatch.EnableAsync)
{
// Cache data per foliage instance type
for (FoliageType& type : FoliageTypes)