Files
GameDevTVObstacleDodge/Library/PackageCache/com.unity.render-pipelines.core@67f868dbad82/Runtime/GPUDriven/InstanceCullerBurst.cs

23 lines
1.2 KiB
C#
Raw Normal View History

2026-01-08 16:50:20 +00:00
using Unity.Collections;
using Unity.Burst;
namespace UnityEngine.Rendering
{
[BurstCompile]
internal static class InstanceCullerBurst
{
[BurstCompile(DisableSafetyChecks = true, OptimizeFor = OptimizeFor.Performance)]
public static unsafe void SetupCullingJobInput(float lodBias, float meshLodThreshold, BatchCullingContext* context,
ReceiverPlanes* receiverPlanes, ReceiverSphereCuller* receiverSphereCuller, FrustumPlaneCuller* frustumPlaneCuller,
float* screenRelativeMetric, float* meshLodConstant)
{
*receiverPlanes = ReceiverPlanes.Create(*context, Allocator.TempJob);
*receiverSphereCuller = ReceiverSphereCuller.Create(*context, Allocator.TempJob);
*frustumPlaneCuller = FrustumPlaneCuller.Create(*context, receiverPlanes->planes.AsArray(), *receiverSphereCuller, Allocator.TempJob);
*screenRelativeMetric = LODRenderingUtils.CalculateScreenRelativeMetricNoBias(context->lodParameters);
*meshLodConstant = LODRenderingUtils.CalculateMeshLodConstant(context->lodParameters, *screenRelativeMetric, meshLodThreshold);
*screenRelativeMetric /= lodBias;
}
}
}