private void ShuddownShader() { // Release the fog constant buffer. if (ConstantFogBuffer != null) { ConstantFogBuffer.Dispose(); ConstantFogBuffer = null; } // Release the sampler state. if (SampleState != null) { SampleState.Dispose(); SampleState = null; } // Release the matrix constant buffer. if (ConstantPerFrameBuffer != null) { ConstantPerFrameBuffer.Dispose(); ConstantPerFrameBuffer = null; } // Release the layout. if (Layout != null) { Layout.Dispose(); Layout = null; } // Release the pixel shader. if (PixelShader != null) { PixelShader.Dispose(); PixelShader = null; } // Release the vertex shader. if (VertexShader != null) { VertexShader.Dispose(); VertexShader = null; } }
private void ShuddownShader() { // Release the sampler state. SamplerState?.Dispose(); SamplerState = null; // Release the matrix constant buffer. ConstantPerFrameBuffer?.Dispose(); ConstantPerFrameBuffer = null; // Release the fog constant buffer. ConstantFogBuffer?.Dispose(); ConstantFogBuffer = null; // Release the layout. Layout?.Dispose(); Layout = null; // Release the pixel shader. PixelShader?.Dispose(); PixelShader = null; // Release the vertex shader. VertexShader?.Dispose(); VertexShader = null; }