You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
575 B
C#
28 lines
575 B
C#
using Unity.Burst;
|
|
using Unity.Collections;
|
|
using Unity.Jobs;
|
|
using Unity.Mathematics;
|
|
|
|
namespace UnityEngine.Rendering.Universal
|
|
{
|
|
[BurstCompile]
|
|
struct ReorderJob<T> : IJobFor
|
|
where T : struct
|
|
{
|
|
[ReadOnly]
|
|
public NativeArray<int> indices;
|
|
|
|
[ReadOnly]
|
|
public NativeArray<T> input;
|
|
|
|
[NativeDisableParallelForRestriction]
|
|
public NativeArray<T> output;
|
|
|
|
public void Execute(int index)
|
|
{
|
|
var newIndex = indices[index];
|
|
output[newIndex] = input[index];
|
|
}
|
|
}
|
|
}
|