/// <inheritdoc/>
        protected override void InitializeCore()
        {
            base.InitializeCore();

            prepareThreadContext = new ThreadLocal <PrepareThreadContext>(() => new PrepareThreadContext(Context));

            // Create RenderEffectKey
            RenderEffectKey = RenderData.CreateStaticObjectKey <RenderEffect>(null, EffectPermutationSlotCount);

            // TODO: Assign weights so that PerDraw is always last? (we usually most custom user ones to be between PerView and PerDraw)
            perFrameDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerFrame");
            perViewDescriptorSetSlot  = GetOrCreateEffectDescriptorSetSlot("PerView");
            perDrawDescriptorSetSlot  = GetOrCreateEffectDescriptorSetSlot("PerDraw");

            RenderSystem.RenderStages.CollectionChanged += RenderStages_CollectionChanged;

            // Create effect slots
            Array.Resize(ref effectSlots, RenderSystem.RenderStages.Count);
            for (int index = 0; index < RenderSystem.RenderStages.Count; index++)
            {
                var renderStage = RenderSystem.RenderStages[index];
                effectSlots[index] = CreateEffectPermutationSlot(renderStage.EffectSlotName);
            }
        }