/// <summary> /// Function to perform clean up on the shader state. /// </summary> internal void CleanUp() { ConstantBuffers[0] = null; if (DefaultPixelShaderDiffuseMaterial != null) { DefaultPixelShaderDiffuseMaterial.Dispose(); } if (DefaultPixelShaderTexturedMaterial != null) { DefaultPixelShaderTexturedMaterial.Dispose(); } if (DefaultPixelShaderDiffuse != null) { DefaultPixelShaderDiffuse.Dispose(); } if (DefaultPixelShaderTextured != null) { DefaultPixelShaderTextured.Dispose(); } DefaultPixelShaderTextured = null; DefaultPixelShaderDiffuse = null; DefaultPixelShaderDiffuseMaterial = null; DefaultPixelShaderTexturedMaterial = null; if (MaterialBuffer != null) { MaterialBuffer.Dispose(); } MaterialBuffer = null; if (AlphaTestValuesBuffer == null) { return; } AlphaTestValuesBuffer.Dispose(); AlphaTestValuesBuffer = null; }