/// <summary> /// Disposes the texture manager. /// It's an error to use the texture manager after disposal. /// </summary> public void Dispose() { _cpBindingsManager.Dispose(); _gpBindingsManager.Dispose(); for (int i = 0; i < _rtColors.Length; i++) { _rtColors[i]?.DecrementReferenceCount(); _rtColors[i] = null; } _rtDepthStencil?.DecrementReferenceCount(); _rtDepthStencil = null; }
/// <summary> /// Disposes the texture manager. /// It's an error to use the texture manager after disposal. /// </summary> public void Dispose() { // Textures are owned by the texture cache, so we shouldn't dispose the texture pool cache. _samplerPoolCache.Dispose(); for (int i = 0; i < _rtColors.Length; i++) { _rtColors[i]?.DecrementReferenceCount(); _rtColors[i] = null; } _rtDepthStencil?.DecrementReferenceCount(); _rtDepthStencil = null; }