using System;
using Cpp2IlInjected;

namespace UnityEngine.PostProcessing
{
	// Token: 0x0200051B RID: 1307
	[Token(Token = "0x200051B")]
	public sealed class EyeAdaptationComponent : PostProcessingComponentRenderTexture<EyeAdaptationModel>
	{
		// Token: 0x1700032B RID: 811
		// (get) Token: 0x06002D2C RID: 11564 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x1700032B")]
		public override bool active
		{
			[Token(Token = "0x6002D2C")]
			[Address(RVA = "0xA6A9E0", Offset = "0xA697E0", VA = "0x180A6A9E0", Slot = "5")]
			get
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x06002D2D RID: 11565 RVA: 0x0006171C File Offset: 0x0005F91C
		[Token(Token = "0x6002D2D")]
		[Address(RVA = "0xA69A50", Offset = "0xA68850", VA = "0x180A69A50")]
		public void ResetHistory()
		{
			this.m_FirstFrame = true;
		}

		// Token: 0x06002D2E RID: 11566 RVA: 0x00061730 File Offset: 0x0005F930
		[Token(Token = "0x6002D2E")]
		[Address(RVA = "0xA69A50", Offset = "0xA68850", VA = "0x180A69A50", Slot = "6")]
		public override void OnEnable()
		{
			this.m_FirstFrame = true;
		}

		// Token: 0x06002D2F RID: 11567 RVA: 0x00061744 File Offset: 0x0005F944
		[Token(Token = "0x6002D2F")]
		[Address(RVA = "0xA69940", Offset = "0xA68740", VA = "0x180A69940", Slot = "7")]
		public override void OnDisable()
		{
			RenderTexture[] autoExposurePool = this.m_AutoExposurePool;
			int num = 0;
			int num2 = 0;
			int length = autoExposurePool.Length;
			if (num2 < length)
			{
				GraphicsUtils.Destroy(autoExposurePool[num]);
				num++;
			}
			ComputeBuffer histogramBuffer = this.m_HistogramBuffer;
			if (histogramBuffer != 0)
			{
				histogramBuffer.Dispose();
			}
			this.m_HistogramBuffer = (ulong)0L;
			RenderTexture debugHistogram = this.m_DebugHistogram;
			int num3 = 0;
			if (debugHistogram != num3)
			{
				this.m_DebugHistogram.Release();
			}
			this.m_DebugHistogram = (ulong)0L;
			throw new NullReferenceException();
		}

		// Token: 0x06002D30 RID: 11568 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D30")]
		[Address(RVA = "0xA69810", Offset = "0xA68610", VA = "0x180A69810")]
		private Vector4 GetHistogramScaleOffsetRes()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D31 RID: 11569 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D31")]
		[Address(RVA = "0xA69C20", Offset = "0xA68A20", VA = "0x180A69C20")]
		public Texture Prepare(RenderTexture source, Material uberMaterial)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D32 RID: 11570 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D32")]
		[Address(RVA = "0xA69A60", Offset = "0xA68860", VA = "0x180A69A60")]
		public void OnGUI()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D33 RID: 11571 RVA: 0x000617C4 File Offset: 0x0005F9C4
		[Token(Token = "0x6002D33")]
		[Address(RVA = "0xA6A970", Offset = "0xA69770", VA = "0x180A6A970")]
		public EyeAdaptationComponent()
		{
			RenderTexture[] array = new RenderTexture[2];
			this.m_AutoExposurePool = array;
			this.m_FirstFrame = true;
			base..ctor();
		}

		// Token: 0x04003566 RID: 13670
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003566")]
		private ComputeShader m_EyeCompute;

		// Token: 0x04003567 RID: 13671
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003567")]
		private ComputeBuffer m_HistogramBuffer;

		// Token: 0x04003568 RID: 13672
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003568")]
		private readonly RenderTexture[] m_AutoExposurePool;

		// Token: 0x04003569 RID: 13673
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003569")]
		private int m_AutoExposurePingPing;

		// Token: 0x0400356A RID: 13674
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400356A")]
		private RenderTexture m_CurrentAutoExposure;

		// Token: 0x0400356B RID: 13675
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400356B")]
		private RenderTexture m_DebugHistogram;

		// Token: 0x0400356C RID: 13676
		[Token(Token = "0x400356C")]
		private static uint[] s_EmptyHistogramBuffer;

		// Token: 0x0400356D RID: 13677
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x400356D")]
		private bool m_FirstFrame;

		// Token: 0x0400356E RID: 13678
		[Token(Token = "0x400356E")]
		private const int k_HistogramBins = 64;

		// Token: 0x0400356F RID: 13679
		[Token(Token = "0x400356F")]
		private const int k_HistogramThreadX = 16;

		// Token: 0x04003570 RID: 13680
		[Token(Token = "0x4003570")]
		private const int k_HistogramThreadY = 16;

		// Token: 0x0200051C RID: 1308
		[Token(Token = "0x200051C")]
		private static class Uniforms
		{
			// Token: 0x04003571 RID: 13681
			[Token(Token = "0x4003571")]
			internal static readonly int _Params = Shader.PropertyToID("_Params");

			// Token: 0x04003572 RID: 13682
			[Token(Token = "0x4003572")]
			internal static readonly int _Speed = Shader.PropertyToID("_Speed");

			// Token: 0x04003573 RID: 13683
			[Token(Token = "0x4003573")]
			internal static readonly int _ScaleOffsetRes = Shader.PropertyToID("_ScaleOffsetRes");

			// Token: 0x04003574 RID: 13684
			[Token(Token = "0x4003574")]
			internal static readonly int _ExposureCompensation = Shader.PropertyToID("_ExposureCompensation");

			// Token: 0x04003575 RID: 13685
			[Token(Token = "0x4003575")]
			internal static readonly int _AutoExposure = Shader.PropertyToID("_AutoExposure");

			// Token: 0x04003576 RID: 13686
			[Token(Token = "0x4003576")]
			internal static readonly int _DebugWidth = Shader.PropertyToID("_DebugWidth");
		}
	}
}
