using System;
using Cpp2IlInjected;

namespace UnityEngine.PostProcessing
{
	// Token: 0x02000573 RID: 1395
	[Token(Token = "0x2000573")]
	public sealed class EyeAdaptationComponent : PostProcessingComponentRenderTexture<EyeAdaptationModel>
	{
		// Token: 0x17000350 RID: 848
		// (get) Token: 0x06002FF5 RID: 12277 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x17000350")]
		public override bool active
		{
			[Token(Token = "0x6002FF5")]
			[Address(RVA = "0xD0DDF0", Offset = "0xD0CDF0", VA = "0x180D0DDF0", Slot = "5")]
			get
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x06002FF6 RID: 12278 RVA: 0x000689B0 File Offset: 0x00066BB0
		[Token(Token = "0x6002FF6")]
		[Address(RVA = "0xD0CE60", Offset = "0xD0BE60", VA = "0x180D0CE60")]
		public void ResetHistory()
		{
			this.m_FirstFrame = true;
		}

		// Token: 0x06002FF7 RID: 12279 RVA: 0x000689C4 File Offset: 0x00066BC4
		[Token(Token = "0x6002FF7")]
		[Address(RVA = "0xD0CE60", Offset = "0xD0BE60", VA = "0x180D0CE60", Slot = "6")]
		public override void OnEnable()
		{
			this.m_FirstFrame = true;
		}

		// Token: 0x06002FF8 RID: 12280 RVA: 0x000689D8 File Offset: 0x00066BD8
		[Token(Token = "0x6002FF8")]
		[Address(RVA = "0xD0CD50", Offset = "0xD0BD50", VA = "0x180D0CD50", 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: 0x06002FF9 RID: 12281 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002FF9")]
		[Address(RVA = "0xD0CC20", Offset = "0xD0BC20", VA = "0x180D0CC20")]
		private Vector4 GetHistogramScaleOffsetRes()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002FFA RID: 12282 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002FFA")]
		[Address(RVA = "0xD0D030", Offset = "0xD0C030", VA = "0x180D0D030")]
		public Texture Prepare(RenderTexture source, Material uberMaterial)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002FFB RID: 12283 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002FFB")]
		[Address(RVA = "0xD0CE70", Offset = "0xD0BE70", VA = "0x180D0CE70")]
		public void OnGUI()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002FFC RID: 12284 RVA: 0x00068A58 File Offset: 0x00066C58
		[Token(Token = "0x6002FFC")]
		[Address(RVA = "0xD0DD80", Offset = "0xD0CD80", VA = "0x180D0DD80")]
		public EyeAdaptationComponent()
		{
			RenderTexture[] array = new RenderTexture[2];
			this.m_AutoExposurePool = array;
			this.m_FirstFrame = true;
			base..ctor();
		}

		// Token: 0x04003850 RID: 14416
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003850")]
		private ComputeShader m_EyeCompute;

		// Token: 0x04003851 RID: 14417
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003851")]
		private ComputeBuffer m_HistogramBuffer;

		// Token: 0x04003852 RID: 14418
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003852")]
		private readonly RenderTexture[] m_AutoExposurePool;

		// Token: 0x04003853 RID: 14419
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003853")]
		private int m_AutoExposurePingPing;

		// Token: 0x04003854 RID: 14420
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003854")]
		private RenderTexture m_CurrentAutoExposure;

		// Token: 0x04003855 RID: 14421
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003855")]
		private RenderTexture m_DebugHistogram;

		// Token: 0x04003856 RID: 14422
		[Token(Token = "0x4003856")]
		private static uint[] s_EmptyHistogramBuffer;

		// Token: 0x04003857 RID: 14423
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003857")]
		private bool m_FirstFrame;

		// Token: 0x04003858 RID: 14424
		[Token(Token = "0x4003858")]
		private const int k_HistogramBins = 64;

		// Token: 0x04003859 RID: 14425
		[Token(Token = "0x4003859")]
		private const int k_HistogramThreadX = 16;

		// Token: 0x0400385A RID: 14426
		[Token(Token = "0x400385A")]
		private const int k_HistogramThreadY = 16;

		// Token: 0x02000574 RID: 1396
		[Token(Token = "0x2000574")]
		private static class Uniforms
		{
			// Token: 0x0400385B RID: 14427
			[Token(Token = "0x400385B")]
			internal static readonly int _Params = Shader.PropertyToID("_Params");

			// Token: 0x0400385C RID: 14428
			[Token(Token = "0x400385C")]
			internal static readonly int _Speed = Shader.PropertyToID("_Speed");

			// Token: 0x0400385D RID: 14429
			[Token(Token = "0x400385D")]
			internal static readonly int _ScaleOffsetRes = Shader.PropertyToID("_ScaleOffsetRes");

			// Token: 0x0400385E RID: 14430
			[Token(Token = "0x400385E")]
			internal static readonly int _ExposureCompensation = Shader.PropertyToID("_ExposureCompensation");

			// Token: 0x0400385F RID: 14431
			[Token(Token = "0x400385F")]
			internal static readonly int _AutoExposure = Shader.PropertyToID("_AutoExposure");

			// Token: 0x04003860 RID: 14432
			[Token(Token = "0x4003860")]
			internal static readonly int _DebugWidth = Shader.PropertyToID("_DebugWidth");
		}
	}
}
