public static unsafe void Execute(ref T data, IntPtr listDataPtr, IntPtr bufferRangePatchData, ref JobRanges ranges, int jobIndex)
        {
            NativeParticleData particleData;
            var listData = (NativeListData *)listDataPtr;

            ParticleSystem.CopyManagedJobData(listData->system, out particleData);

            ParticleSystemJobData jobData = new ParticleSystemJobData(ref particleData);

            while (true)
            {
                int begin;
                int end;
                if (!JobsUtility.GetWorkStealingRange(ref ranges, jobIndex, out begin, out end))
                {
                    break;
                }

                JobsUtility.PatchBufferMinMaxRanges(bufferRangePatchData, UnsafeUtility.AddressOf(ref data), begin, end - begin);

                data.Execute(jobData, begin, end - begin);
            }

            AtomicSafetyHandle.CheckDeallocateAndThrow(jobData.m_Safety);
            AtomicSafetyHandle.Release(jobData.m_Safety);
        }
Ejemplo n.º 2
0
        public unsafe static void Execute(ref T data, IntPtr listDataPtr, IntPtr bufferRangePatchData, ref JobRanges ranges, int jobIndex)
        {
            NativeListData *   ptr = (NativeListData *)((void *)listDataPtr);
            NativeParticleData nativeParticleData;

            ParticleSystem.CopyManagedJobData(ptr->system, out nativeParticleData);
            ParticleSystemJobData particleSystemJobData = new ParticleSystemJobData(ref nativeParticleData);

            while (true)
            {
                int  num;
                int  num2;
                bool flag = !JobsUtility.GetWorkStealingRange(ref ranges, jobIndex, out num, out num2);
                if (flag)
                {
                    break;
                }
                JobsUtility.PatchBufferMinMaxRanges(bufferRangePatchData, UnsafeUtility.AddressOf <T>(ref data), num, num2 - num);
                for (int i = num; i < num2; i++)
                {
                    data.Execute(particleSystemJobData, i);
                }
            }
            AtomicSafetyHandle.CheckDeallocateAndThrow(particleSystemJobData.m_Safety);
            AtomicSafetyHandle.Release(particleSystemJobData.m_Safety);
        }
Ejemplo n.º 3
0
        public unsafe static void Execute(ref T data, IntPtr listDataPtr, IntPtr unusedPtr, ref JobRanges ranges, int jobIndex)
        {
            NativeListData *   ptr = (NativeListData *)((void *)listDataPtr);
            NativeParticleData nativeParticleData;

            ParticleSystem.CopyManagedJobData(ptr->system, out nativeParticleData);
            ParticleSystemJobData particleSystemJobData = new ParticleSystemJobData(ref nativeParticleData);

            data.Execute(particleSystemJobData);
            AtomicSafetyHandle.CheckDeallocateAndThrow(particleSystemJobData.m_Safety);
            AtomicSafetyHandle.Release(particleSystemJobData.m_Safety);
        }
        public static unsafe void Execute(ref T data, IntPtr listDataPtr, IntPtr unusedPtr, ref JobRanges ranges, int jobIndex)
        {
            NativeParticleData particleData;
            var listData = (NativeListData *)listDataPtr;

            ParticleSystem.CopyManagedJobData(listData->system, out particleData);

            ParticleSystemJobData jobData = new ParticleSystemJobData(ref particleData);

            data.Execute(jobData);

            AtomicSafetyHandle.CheckDeallocateAndThrow(jobData.m_Safety);
            AtomicSafetyHandle.Release(jobData.m_Safety);
        }