mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 01:24:11 +01:00
[d3d11] implement 'clampNegativeLodBias' as a conf option
This commit is contained in:
parent
3fce9886f5
commit
bd575a4a46
@ -197,6 +197,7 @@
|
||||
#
|
||||
# Supported values: True, False
|
||||
|
||||
# d3d11.clampNegativeLodBias = False
|
||||
# d3d9.clampNegativeLodBias = False
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@ namespace dxvk {
|
||||
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
|
||||
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
|
||||
this->samplerLodBias = config.getOption<float>("d3d11.samplerLodBias", 0.0f);
|
||||
this->clampNegativeLodBias = config.getOption<bool>("d3d11.clampNegativeLodBias", false);
|
||||
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);
|
||||
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
|
||||
this->forceSampleRateShading = config.getOption<bool>("d3d11.forceSampleRateShading", false);
|
||||
|
@ -63,6 +63,9 @@ namespace dxvk {
|
||||
/// Enforces the given LOD bias for all samplers.
|
||||
float samplerLodBias;
|
||||
|
||||
/// Clamps negative LOD bias
|
||||
bool clampNegativeLodBias;
|
||||
|
||||
/// Declare vertex positions in shaders as invariant
|
||||
bool invariantPosition;
|
||||
|
||||
|
@ -47,9 +47,13 @@ namespace dxvk {
|
||||
if (desc.MaxAnisotropy > 16) info.maxAnisotropy = 16.0f;
|
||||
|
||||
// Enforce LOD bias specified in the device options
|
||||
if (info.minFilter == VK_FILTER_LINEAR && info.magFilter == VK_FILTER_LINEAR)
|
||||
if (info.minFilter == VK_FILTER_LINEAR && info.magFilter == VK_FILTER_LINEAR) {
|
||||
info.mipmapLodBias += device->GetOptions()->samplerLodBias;
|
||||
|
||||
if (device->GetOptions()->clampNegativeLodBias)
|
||||
info.mipmapLodBias = std::max(info.mipmapLodBias, 0.0f);
|
||||
}
|
||||
|
||||
// Enforce anisotropy specified in the device options
|
||||
int32_t samplerAnisotropyOption = device->GetOptions()->samplerAnisotropy;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user