1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 13:54:16 +01:00

[d3d11] Add option to enforce anisotropic filtering

When setting d3d11.samplerAnisotropy to a non-negative value,
AF will be either disabled (0) or enabled with the given
anisotropy (>0) for all samplers.
This commit is contained in:
Philip Rebohle 2018-09-10 15:42:55 +02:00
parent 16a3ae52fe
commit 012a5c2f74
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 15 additions and 0 deletions

View File

@ -8,6 +8,7 @@ namespace dxvk {
this->allowMapFlagNoWait = config.getOption<bool>("d3d11.allowMapFlagNoWait", false);
this->fakeStreamOutSupport = config.getOption<bool>("d3d11.fakeStreamOutSupport", false);
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
}
}

View File

@ -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;
};
}

View File

@ -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);
}