mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-27 04:54:15 +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
|
# Supported values: True, False
|
||||||
|
|
||||||
|
# d3d11.clampNegativeLodBias = False
|
||||||
# d3d9.clampNegativeLodBias = False
|
# d3d9.clampNegativeLodBias = False
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ namespace dxvk {
|
|||||||
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
|
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
|
||||||
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
|
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
|
||||||
this->samplerLodBias = config.getOption<float>("d3d11.samplerLodBias", 0.0f);
|
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->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);
|
||||||
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
|
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
|
||||||
this->forceSampleRateShading = config.getOption<bool>("d3d11.forceSampleRateShading", false);
|
this->forceSampleRateShading = config.getOption<bool>("d3d11.forceSampleRateShading", false);
|
||||||
|
@ -63,6 +63,9 @@ namespace dxvk {
|
|||||||
/// Enforces the given LOD bias for all samplers.
|
/// Enforces the given LOD bias for all samplers.
|
||||||
float samplerLodBias;
|
float samplerLodBias;
|
||||||
|
|
||||||
|
/// Clamps negative LOD bias
|
||||||
|
bool clampNegativeLodBias;
|
||||||
|
|
||||||
/// Declare vertex positions in shaders as invariant
|
/// Declare vertex positions in shaders as invariant
|
||||||
bool invariantPosition;
|
bool invariantPosition;
|
||||||
|
|
||||||
|
@ -47,9 +47,13 @@ namespace dxvk {
|
|||||||
if (desc.MaxAnisotropy > 16) info.maxAnisotropy = 16.0f;
|
if (desc.MaxAnisotropy > 16) info.maxAnisotropy = 16.0f;
|
||||||
|
|
||||||
// Enforce LOD bias specified in the device options
|
// 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;
|
info.mipmapLodBias += device->GetOptions()->samplerLodBias;
|
||||||
|
|
||||||
|
if (device->GetOptions()->clampNegativeLodBias)
|
||||||
|
info.mipmapLodBias = std::max(info.mipmapLodBias, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
// Enforce anisotropy specified in the device options
|
// Enforce anisotropy specified in the device options
|
||||||
int32_t samplerAnisotropyOption = device->GetOptions()->samplerAnisotropy;
|
int32_t samplerAnisotropyOption = device->GetOptions()->samplerAnisotropy;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user