using System; using System.Runtime.InteropServices; using UnityEngine; namespace FidelityFX { public abstract class FfxContextBase { protected static ComputeBuffer CreateConstantBuffer() where TBuf: struct { return new ComputeBuffer(1, Marshal.SizeOf(), ComputeBufferType.Constant); } protected static void DestroyConstantBuffer(ref ComputeBuffer bufferRef) { if (bufferRef == null) return; bufferRef.Release(); bufferRef = null; } protected static void DestroyPass(ref TPass pass) where TPass: class, IDisposable { if (pass == null) return; pass.Dispose(); pass = null; } } }