-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[d3d11] Add option to control sampler LOD bias
- Loading branch information
Showing
4 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
727fd7a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) good
727fd7a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dx9/11 specific:
./src/d3d9/d3d9_sampler.h
./src/d3d11/d3d11_sampler.cpp
dx9:
key.MipmapLodBias = -1.2;
For ex..., then comment out up to: if (key.MipFilter == D3DTEXF_NONE) {
You can set it as an option but whatever.
(I used to at one point)
I'd prefer env var tbh.
This controls dx9 and (dx10?) / 11
And works as an env var, a little easier to work with per game/app imo.
Maybe the prefered method ?
But I'm unsure if the code is clean, with those if statements.
I just wanted to catch all use cases.
It should be -15 -> +15.
Doa6 and the forest are interesting tests.
The latter having a hidden bg image on the load screen.
And doa, it would be interesting if it could be tweaked per object or use case.
Like if lod ='s this range, or this range.. do this or that.
But I could never get that to work right, or do much.
It's not like I had a debugger open or anything though.
Other then guesswork lol.
Sorry it's not in legit diff format.
./src/dxvk/dxvk_sampler.cpp
.. -->
.. borderColorInfo.customBorderColor = info.borderColor;
..
std::string dxvk_lodbias = env::getEnvVar("DXVK_dxvk_lodbias");
std::string dxvk_minlod = env::getEnvVar("DXVK_dxvk_minlod");
std::string dxvk_maxlod = env::getEnvVar("DXVK_dxvk_maxlod");
..
.. VkSamplerCreateInfo samplerInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO };
..
// samplerInfo.minLod = info.mipmapLodMin;
// samplerInfo.maxLod = info.mipmapLodMax;
..
.. samplerInfo.unnormalizedCoordinates = info.usePixelCoord;
..
if (dxvk_lodbias == "")
{
samplerInfo.mipLodBias = info.mipmapLodBias;
}
else
{
float num_dxvk_lodbias = std::stof(dxvk_lodbias);
samplerInfo.mipLodBias = num_dxvk_lodbias;
}
if (dxvk_minlod == "")
{
samplerInfo.minLod = info.mipmapLodMin;
}
else
{
float num_dxvk_minlod = std::stof(dxvk_minlod);
samplerInfo.minLod = num_dxvk_minlod;
}
if (dxvk_maxlod == "")
{
samplerInfo.maxLod = info.mipmapLodMax;
}
else
{
float num_dxvk_maxlod = std::stof(dxvk_maxlod);
samplerInfo.maxLod = num_dxvk_maxlod;
}
..
.. if (!device->features().core.features.samplerAnisotropy)