Exemple #1
0
        private void ShuddownShader()
        {
            // Release the matrix constant buffer.
            if (ConstantClipPlaneBuffer != null)
            {
                ConstantClipPlaneBuffer.Dispose();
                ConstantClipPlaneBuffer = null;
            }

            // Release the sampler state.
            if (SampleState != null)
            {
                SampleState.Dispose();
                SampleState = null;
            }

            // Release the matrix constant buffer.
            if (ConstantMatrixBuffer != null)
            {
                ConstantMatrixBuffer.Dispose();
                ConstantMatrixBuffer = 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.
     ConstantClipPlaneBuffer?.Dispose();
     ConstantClipPlaneBuffer = 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;
 }