Merge pull request #6118 from Tomcc/master

Resolution independent mipmaps (high IR Super Mario Galaxy Fix)
This commit is contained in:
Leo Lam
2017-10-31 21:37:20 +01:00
committed by GitHub
9 changed files with 204 additions and 30 deletions

View File

@ -299,7 +299,7 @@ ID3D11SamplerState* StateCache::Get(SamplerState state)
sampdc.AddressV = address_modes[static_cast<u32>(state.wrap_v.Value())];
sampdc.MaxLOD = state.max_lod / 16.f;
sampdc.MinLOD = state.min_lod / 16.f;
sampdc.MipLODBias = (s32)state.lod_bias / 32.0f;
sampdc.MipLODBias = (s32)state.lod_bias / 256.f;
if (state.anisotropic_filtering)
{

View File

@ -40,7 +40,7 @@ private:
std::unordered_map<u32, ID3D11DepthStencilState*> m_depth;
std::unordered_map<u32, ID3D11RasterizerState*> m_raster;
std::unordered_map<u32, ID3D11BlendState*> m_blend;
std::unordered_map<u32, ID3D11SamplerState*> m_sampler;
std::unordered_map<SamplerState::StorageType, ID3D11SamplerState*> m_sampler;
};
namespace D3D

View File

@ -100,7 +100,7 @@ void SamplerCache::SetParameters(GLuint sampler_id, const SamplerState& params)
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_LOD, params.max_lod / 16.f);
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
glSamplerParameterf(sampler_id, GL_TEXTURE_LOD_BIAS, params.lod_bias / 32.f);
glSamplerParameterf(sampler_id, GL_TEXTURE_LOD_BIAS, params.lod_bias / 256.f);
if (params.anisotropic_filtering && g_ogl_config.bSupportsAniso)
{

View File

@ -329,7 +329,7 @@ VkSampler ObjectCache::GetSampler(const SamplerState& info)
address_modes[static_cast<u32>(info.wrap_u.Value())], // VkSamplerAddressMode addressModeU
address_modes[static_cast<u32>(info.wrap_v.Value())], // VkSamplerAddressMode addressModeV
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // VkSamplerAddressMode addressModeW
info.lod_bias / 32.0f, // float mipLodBias
info.lod_bias / 256.0f, // float mipLodBias
VK_FALSE, // VkBool32 anisotropyEnable
0.0f, // float maxAnisotropy
VK_FALSE, // VkBool32 compareEnable