D3D11 Unable to use Sampler ComparisonFunc

Hi,
I don’t know why I can’t set ComparisonFunc.

Details:
-Tested and not working using Nvidia 660 and 1050 cards.
-The same code is working on XBox One correctly.
-Value checked using NSight and Visual Studio Graphics Debugger.
-Also checked using the following code:

// ---- Creating state

D3D11_SAMPLER_DESC state;
...
state.ComparisonFunc=D3D11_COMPARISON_LESS_EQUAL;
...
mDevice->CreateSamplerState( &samplerDesc, &state );


// Check
D3D11_SAMPLER_DESC check;
state->GetDesc ( &check );

// In PC check.ComparisonFunc==D3D11_COMPARISON_NEVER
// In XBox One check.ComparisonFunc==D3D11_COMPARISON_LESS_EQUAL

Thanks in Advance,
Julio

I’ve found a patch:

D3D11_SAMPLER_DESC samplerFixedDesc = samplerDesc;
            if ( samplerFixedDesc.ComparisonFunc != D3D11_COMPARISON_NEVER )
            {
                samplerFixedDesc.AddressU = D3D11_TEXTURE_ADDRESS_BORDER;
                samplerFixedDesc.AddressV = D3D11_TEXTURE_ADDRESS_BORDER;
                samplerFixedDesc.AddressW = D3D11_TEXTURE_ADDRESS_BORDER;
                samplerFixedDesc.BorderColor[0] = 1.0f;
                samplerFixedDesc.BorderColor[1] = 1.0f;
                samplerFixedDesc.BorderColor[2] = 1.0f;
                samplerFixedDesc.BorderColor[3] = 1.0f;
                samplerFixedDesc.Filter = D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT;
            }
            HRESULT hr = mDevice->CreateSamplerState( &samplerFixedDesc, &state );