A* Pathfinding Project
4.3.5
The A* Pathfinding Project for Unity 3D
|
Automatic dependency tracking for the Unity Job System. More...
Automatic dependency tracking for the Unity Job System.
Uses reflection to find the [ReadOnly] and [WriteOnly] attributes on job data struct fields. These are used to automatically figure out dependencies between jobs.
A job that reads from an array depends on the last job that wrote to that array. A job that writes to an array depends on the last job that wrote to the array as well as all jobs that read from the array.
Classes | |
struct | JobDispose |
struct | JobInstance |
struct | JobRaycastCommandDummy |
struct | MainThreadWork |
struct | NativeArraySlot |
Public Member Functions | |
void | CompleteMainThreadWork () |
void | DeferDispose< T > (NativeArray< T > data) |
Disposes the native array after all the current jobs are finished with it. More... | |
void | DeferFree (GCHandle handle, JobHandle dependsOn) |
Frees the GCHandle when the JobDependencyTracker is disposed. More... | |
void | ForceLinearDependencies () |
Disable dependency tracking and just run jobs one after the other. More... | |
NativeArray< T > | NewNativeArray< T > (int length, Allocator allocator, NativeArrayOptions options=NativeArrayOptions.ClearMemory) |
void | RunMainThreadWork () |
JobHandle | ScheduleBatch (NativeArray< UnityEngine.RaycastCommand > commands, NativeArray< UnityEngine.RaycastHit > results, int minCommandsPerJob) |
Schedules a raycast batch command. More... | |
Package Functions | |
void | AddMainThreadWork (IJob job, ManualResetEvent doneEvent, ManualResetEvent dependenciesDoneEvent, JobHandle dependsOn) |
void | JobReadsFrom (JobHandle job, long nativeArrayHash, int jobHash) |
void | JobWritesTo (JobHandle job, long nativeArrayHash, int jobHash) |
Package Attributes | |
List< NativeArraySlot > | slots = ListPool<NativeArraySlot>.Claim() |
Properties | |
JobHandle | AllWritesDependency [get] |
JobHandle that represents a dependency for all jobs. More... | |
bool | forceLinearDependencies [get, private set] |
Private Member Functions | |
void | Dispose () |
Diposes this tracker. More... | |
void IAstarPooledObject. | OnEnterPool () |
Private Attributes | |
NativeArrayArena | arena |
List< GCHandle > | gcHandlesToFree |
List< MainThreadWork > | mainThreadWork = ListPool<MainThreadWork>.Claim() |
NativeList< JobHandle > | temporaryJobs |
|
package |
void CompleteMainThreadWork | ( | ) |
void DeferDispose< T > | ( | NativeArray< T > | data | ) |
Disposes the native array after all the current jobs are finished with it.
T | : | struct |
void DeferFree | ( | GCHandle | handle, |
JobHandle | dependsOn | ||
) |
Frees the GCHandle when the JobDependencyTracker is disposed.
|
private |
Diposes this tracker.
This will pool all used lists which makes the GC happy.
void ForceLinearDependencies | ( | ) |
Disable dependency tracking and just run jobs one after the other.
This may be faster in some cases since dependency tracking has some overhead.
|
package |
|
package |
NativeArray<T> NewNativeArray< T > | ( | int | length, |
Allocator | allocator, | ||
NativeArrayOptions | options = NativeArrayOptions.ClearMemory |
||
) |
T | : | struct |
|
private |
Implements IAstarPooledObject.
void RunMainThreadWork | ( | ) |
JobHandle ScheduleBatch | ( | NativeArray< UnityEngine.RaycastCommand > | commands, |
NativeArray< UnityEngine.RaycastHit > | results, | ||
int | minCommandsPerJob | ||
) |
Schedules a raycast batch command.
Like RaycastCommand.ScheduleBatch, but dependencies are tracked automatically.
|
private |
|
private |
|
private |
|
package |
|
private |
|
get |
JobHandle that represents a dependency for all jobs.
All native arrays that are written (and have been tracked by this tracker) to will have their final results in them when the returned job handle is complete.
|
getprivate set |