public override void Render(RenderTarget rt) { if (!bRunning) { return; } Camera camera = rt.cam; float4 *planes = stackalloc float4[6]; CameraUtils.GetFrustumPlanes(camera, planes); UnsafeUtility.MemCpy(UnsafeUtility.AddressOf(ref planesVector[0]), planes, 6 * sizeof(float4)); // 视锥体裁剪 if (enableFrustumCulling) { frustumCulling.SetVectorArray(ShaderIDs.ID_FrustumPlanes, planesVector); frustumCulling.Dispatch(KERNEL_FRUSTUM_CULLING, instanceCount, 1, 1); } Shader.SetGlobalBuffer(ShaderIDs.ID_ResultBuffer, resultBuffer); }