public float ApplyViewParameters_PopulateParameterLightsDirectArray()
        {
            int sum = 0;

            for (int ii = 0; ii < N; ii++)
            {
                for (int viewIndex = 0; viewIndex < lightRanges.Length; viewIndex++)
                {
                    var lightRange = lightRanges[viewIndex];
                    PopulateLightsInRange(ref lights, lightRange, ref currentLights);

                    lightsData.Clear();
                    // ----- Test
                    lightsData.EnsureCapacity(currentLights.Count);
                    var lightsDataArray = lightsData.Items;
                    for (int i = 0; i < currentLights.Count; i++)
                    {
                        var light = currentLights[i].Light;
                        lightsDataArray[i] = new DirectionalLightData
                        {
                            DirectionWS = light.Direction,
                            Color       = light.Color,
                        };
                    }
                    lightsData.Count = currentLights.Count;
                    // ----- End Test
                    sum += lightsData.Count;
                }
            }
            return(sum);
        }
        internal static void PopulateLightsInRange(ref FastListStruct <LightDynamicEntry> allLights, LightShaderGroupDynamic.LightRange lightRange, ref FastListStruct <LightDynamicEntry> lightsInRange)
        {
            int lightsCount = lightRange.End - lightRange.Start;

            lightsInRange.EnsureCapacity(lightsCount);
            var lightsInRangeArray = lightsInRange.Items;

            for (int i = 0; i < lightsCount; i++)
            {
                lightsInRangeArray[i] = allLights[lightRange.Start + i];
            }
            lightsInRange.Count = lightsCount;
        }