protected override void Dispose(bool disposing)
{
if (!IsDisposed)
{
if (disposing)
{
if (!_isClone)
{
// Only the clone source can dispose the shaders.
if (_shaders != null)
{
foreach (var shader in _shaders)
shader.Dispose();
}
}
if (ConstantBuffers != null)
{
foreach (var buffer in ConstantBuffers)
buffer.Dispose();
ConstantBuffers = null;
}
}
}
base.Dispose(disposing);
}