Those are RaycastCommand and RaycastHit respectively.
And since they’re passed to the RaycastCommand.ScheduleBatch don’t think they can be resized.
Because internally it looks like this (RaycastCommand.cs):
public static unsafe JobHandle ScheduleBatch(
NativeArray<RaycastCommand> commands,
NativeArray<RaycastHit> results,
int minCommandsPerJob,
JobHandle dependsOn = default (JobHandle))
{
BatchQueryJob<RaycastCommand, RaycastHit> output = new BatchQueryJob<RaycastCommand, RaycastHit>(commands, results);
JobsUtility.JobScheduleParameters parameters = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf<BatchQueryJob<RaycastCommand, RaycastHit>>(ref output), BatchQueryJobStruct<BatchQueryJob<RaycastCommand, RaycastHit>>.Initialize(), dependsOn, ScheduleMode.Batched);
return RaycastCommand.ScheduleRaycastBatch(ref parameters, NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks<RaycastCommand>(commands), commands.Length, NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks<RaycastHit>(results), results.Length, minCommandsPerJob);
}
Total size of both are taken at the schedule time.
Now I’ve got a deja vu, like I’ve already asked this question. (Probably did, and forgot)
Edit:
Definitely did, now I remember that its not possible.
Guess I’ll just iterate on main thread, shouldn’t take that much time just to figure out total count in my case.
Anyways, if anyone has other suggestions - I’m all ears.