Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
SystemState.BeforeOnUpdate.Complete() removed
SystemState.BeforeOnUpdate.Complete() was removed to stop sync points in fixed updated. This has been replaced with CompleteWorldDependencySystem.
- Loading branch information
Showing
4 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| namespace Unity.Entities | ||
| { | ||
| using Unity.Burst; | ||
| using Unity.Collections; | ||
| using Unity.Jobs; | ||
| using UnityEngine.Scripting; | ||
|
|
||
| [Preserve] | ||
| [UpdateInGroup(typeof(InitializationSystemGroup))] | ||
| [WorldSystemFilter(WorldSystemFilterFlags.Default | WorldSystemFilterFlags.ThinClientSimulation | WorldSystemFilterFlags.Editor)] | ||
| public unsafe partial struct CompleteWorldDependencySystem : ISystem | ||
| { | ||
| private NativeList<JobHandle> m_dependencies; | ||
| private JobHandle m_dependency; | ||
|
|
||
| [BurstCompile] | ||
| public void OnCreate(ref SystemState state) | ||
| { | ||
| m_dependencies = new NativeList<JobHandle>(128, Allocator.Persistent); | ||
| } | ||
|
|
||
| [BurstCompile] | ||
| public void OnDestroy(ref SystemState state) | ||
| { | ||
| m_dependencies.Dispose(); | ||
| } | ||
|
|
||
| [BurstCompile] | ||
| public void OnUpdate(ref SystemState state) | ||
| { | ||
| m_dependency.Complete(); | ||
|
|
||
| using var e = state.WorldUnmanaged.GetImpl().m_SystemStatePtrMap.GetEnumerator(); | ||
| while (e.MoveNext()) | ||
| { | ||
| var systemState = (SystemState*)e.Current.Value; | ||
| this.m_dependencies.Add(systemState->m_JobHandle); | ||
| } | ||
|
|
||
| // This seems slightly faster than doing JobHandle.CompleteAll() | ||
| m_dependency = JobHandle.CombineDependencies(m_dependencies.AsArray()); | ||
| m_dependencies.Clear(); | ||
| } | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters