namespace UnityEngine.Rendering.Universal
{
    public class GammaLinearConvertor : ScriptableRendererFeature
    {
        public enum ConvertorType
        {
            GammaToLinear,
            LinearToGamma
        }

        [System.Serializable]
        public class GammaLineaConvertorSettings
        {
            public RenderPassEvent Event = RenderPassEvent.AfterRenderingTransparents;
            public ConvertorType ConvertorType = ConvertorType.GammaToLinear;
        }

        public GammaLineaConvertorSettings settings = new GammaLineaConvertorSettings();

        GammaLinearConvertorPass pass;

        public override void Create()
        {
            pass = new GammaLinearConvertorPass(settings.Event, settings.ConvertorType);
        }

        public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
        {
            pass.Setup(renderingData.cameraData.cameraTargetDescriptor, renderer.cameraColorTarget);
            renderer.EnqueuePass(pass);
        }
    }
}

