public static JobHandle ScheduleParallel <T>(this FindPairsConfig <T> config, JobHandle inputDeps = default) where T : struct, IFindPairsProcessor { if (config.isLayerLayer) { JobHandle jh = new FindPairsInternal.LayerLayerPart1 <T> { layerA = config.layerA, layerB = config.layerB, processor = config.processor }.Schedule(config.layerB.BucketCount, 1, inputDeps); jh = new FindPairsInternal.LayerLayerPart2 <T> { layerA = config.layerA, layerB = config.layerB, processor = config.processor }.Schedule(2, 1, jh); return(jh); } else { JobHandle jh = new FindPairsInternal.LayerSelfPart1 <T> { layer = config.layerA, processor = config.processor }.Schedule(config.layerA.BucketCount, 1, inputDeps); jh = new FindPairsInternal.LayerSelfPart2 <T> { layer = config.layerA, processor = config.processor }.Schedule(jh); return(jh); } }
public static void RunImmediate <T>(this FindPairsConfig <T> config) where T : struct, IFindPairsProcessor { if (config.isLayerLayer) { FindPairsInternal.RunImmediate(config.layerA, config.layerB, config.processor); } else { FindPairsInternal.RunImmediate(config.layerA, config.processor); } }
public static void Run <T>(this FindPairsConfig <T> config) where T : struct, IFindPairsProcessor { if (config.isLayerLayer) { new FindPairsInternal.LayerLayerSingle <T> { layerA = config.layerA, layerB = config.layerB, processor = config.processor }.Run(); } else { new FindPairsInternal.LayerSelfSingle <T> { layer = config.layerA, processor = config.processor }.Run(); } }
public static JobHandle ScheduleSingle <T>(this FindPairsConfig <T> config, JobHandle inputDeps = default) where T : struct, IFindPairsProcessor { if (config.isLayerLayer) { return(new FindPairsInternal.LayerLayerSingle <T> { layerA = config.layerA, layerB = config.layerB, processor = config.processor }.Schedule(inputDeps)); } else { return(new FindPairsInternal.LayerSelfSingle <T> { layer = config.layerA, processor = config.processor }.Schedule(inputDeps)); } }