private void ShuddownShader() { // Release the matrix constant buffer. ConstantTransparentBuffer?.Dispose(); ConstantTransparentBuffer = null; // Release the sampler state. SamplerState?.Dispose(); SamplerState = null; // Release the matrix constant buffer. ConstantMatrixBuffer?.Dispose(); ConstantMatrixBuffer = null; // Release the layout. Layout?.Dispose(); Layout = null; // Release the pixel shader. PixelShader?.Dispose(); PixelShader = null; // Release the vertex shader. VertexShader?.Dispose(); VertexShader = null; }