Skip to content

Commit

Permalink
Merge pull request #40 from Ji-Rath/ISMFix
Browse files Browse the repository at this point in the history
ISM Custom Data Query Optimization
  • Loading branch information
Megafunk authored Jul 15, 2022
2 parents 0560342 + 30b3cab commit ebc8ca2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ void UismPerInstanceDataUpdater::ConfigureQueries()
EntityQuery.AddRequirement<FMassRepresentationFragment>(EMassFragmentAccess::ReadWrite);
EntityQuery.AddRequirement<FMassRepresentationLODFragment>(EMassFragmentAccess::ReadOnly);
EntityQuery.AddSharedRequirement<FMassRepresentationSubsystemSharedFragment>(EMassFragmentAccess::ReadWrite);
EntityQuery.AddChunkRequirement<FMassVisualizationChunkFragment>(EMassFragmentAccess::ReadOnly);
EntityQuery.SetChunkFilter(&FMassVisualizationChunkFragment::AreAnyEntitiesVisibleInChunk);
}

void UismPerInstanceDataUpdater::Execute(UMassEntitySubsystem& EntitySubsystem, FMassExecutionContext& Context)
Expand All @@ -42,7 +44,7 @@ void UismPerInstanceDataUpdater::Execute(UMassEntitySubsystem& EntitySubsystem,


// This can accept any struct that the size of n floats. It seems to be required to be called every frame we want to change it
ISMInfo.AddBatchedCustomData(RenderData.Data, RepresentationLOD.LODSignificance);
ISMInfo.AddBatchedCustomData(RenderData.Data, RepresentationLOD.LODSignificance, Representation.PrevLODSignificance);
}
}
});
Expand Down

0 comments on commit ebc8ca2

Please sign in to comment.