diff --git a/src/d3d11/d3d11_options.cpp b/src/d3d11/d3d11_options.cpp index 38274b7f..fcf6ba8b 100644 --- a/src/d3d11/d3d11_options.cpp +++ b/src/d3d11/d3d11_options.cpp @@ -8,6 +8,7 @@ namespace dxvk { this->allowMapFlagNoWait = config.getOption("d3d11.allowMapFlagNoWait", false); this->fakeStreamOutSupport = config.getOption("d3d11.fakeStreamOutSupport", false); this->maxTessFactor = config.getOption("d3d11.maxTessFactor", 0); + this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); } } \ No newline at end of file diff --git a/src/d3d11/d3d11_options.h b/src/d3d11/d3d11_options.h index 4acee2d8..dcbe73cd 100644 --- a/src/d3d11/d3d11_options.h +++ b/src/d3d11/d3d11_options.h @@ -30,6 +30,12 @@ namespace dxvk { /// control shaders. Values from 8 to 64 are /// supported, other values will be ignored. int32_t maxTessFactor; + + /// Anisotropic filter override + /// + /// Enforces anisotropic filtering with the + /// given anisotropy value for all samplers. + int32_t samplerAnisotropy; }; } \ No newline at end of file diff --git a/src/d3d11/d3d11_sampler.cpp b/src/d3d11/d3d11_sampler.cpp index 1c063079..189cdb7f 100644 --- a/src/d3d11/d3d11_sampler.cpp +++ b/src/d3d11/d3d11_sampler.cpp @@ -46,6 +46,14 @@ namespace dxvk { || info.addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) info.borderColor = DecodeBorderColor(desc.BorderColor); + // Enforce anisotropy specified in the device options + int32_t samplerAnisotropyOption = device->GetOptions()->samplerAnisotropy; + + if (samplerAnisotropyOption >= 0) { + info.useAnisotropy = samplerAnisotropyOption > 0; + info.maxAnisotropy = float(samplerAnisotropyOption); + } + m_sampler = device->GetDXVKDevice()->createSampler(info); }