WAYN-Games / MGM-Ability

Other
88 stars 17 forks source link

Error with JobsDebugger enabled #4

Closed nicolasgramlich closed 4 years ago

nicolasgramlich commented 4 years ago

Line 154 throws an error complaining that ForEachCount is accesses before RemapEffectsJob from line 149 is completed, which I think is technically properly detected error, yet does not seem to cause any issues 🤔

https://github.com/WAYNGROUP/MGM-Skill/blob/832fbea7701f8ef56f792e0f273d0182aec94191/Runtime/Systems/EffectConsumerSystems.cs#L149-L154

nicolasgramlich commented 4 years ago

One solution is to add a TriggerJobHandle.Complete(); to the beginning of the method, but introducing a sync point is likely not ideal performance wise. 🤔

Unfortunately I'm not familiar at all with how to pass a ForEachCount aka arrayLength to a IJobParallelFor :(

WAYN-Games commented 4 years ago

Best ay to fiw IMO is create a foreach count field in the EffectConsumerSystem class, populate it when creating the stream in GetConsumerWriter and replace the effectReader.ForEachCount with it in OnUpdate.

WAYN-Games commented 4 years ago

Fixed

nicolasgramlich commented 4 years ago

Excellent! Way better solution that the Complete() 🙌