/// <summary>Function to dispose any texture resources.</summary> protected override void OnDestroyTexture() { _texture?.Dispose(); _textureView?.Dispose(); _texture = null; _textureView = null; }
public void TestAutoSRV() { GorgonTexture1D _1D = null; GorgonTexture2D _2D = null; GorgonTexture3D _3D = null; try { _1D = _framework.Graphics.Textures.CreateTexture("Test1D", new GorgonTexture1DSettings { Width = 256, ArrayCount = 1, Format = BufferFormat.R8_UIntNormal, MipCount = 1, ShaderViewFormat = BufferFormat.Unknown, AllowUnorderedAccessViews = false, Usage = BufferUsage.Default }); Assert.IsNotNull((GorgonShaderView)_1D); Assert.AreEqual(_1D.Settings.Format, ((GorgonShaderView)_1D).Format); _2D = _framework.Graphics.Textures.CreateTexture("Test2D", new GorgonTexture2DSettings { Width = 256, Height = 256, ArrayCount = 1, Format = BufferFormat.R8G8B8A8_UIntNormal, MipCount = 1, ShaderViewFormat = BufferFormat.Unknown, AllowUnorderedAccessViews = false, Usage = BufferUsage.Default }); Assert.IsNotNull((GorgonShaderView)_2D); Assert.AreEqual(_2D.Settings.Format, ((GorgonShaderView)_2D).Format); _3D = _framework.Graphics.Textures.CreateTexture("Test3D", new GorgonTexture3DSettings { Width = 256, Height = 256, Depth = 64, Format = BufferFormat.R8G8B8A8_UIntNormal, MipCount = 1, ShaderViewFormat = BufferFormat.Unknown, AllowUnorderedAccessViews = false, Usage = BufferUsage.Default }); Assert.IsNotNull((GorgonShaderView)_3D); Assert.AreEqual(_3D.Settings.Format, ((GorgonShaderView)_3D).Format); } finally { if (_1D != null) { _1D.Dispose(); } if (_2D != null) { _2D.Dispose(); } if (_3D != null) { _3D.Dispose(); } } }