diff options
| author | EmptyChaos <EmptyChaos@users.noreply.github.com> | 2016-03-24 02:42:08 +0000 |
|---|---|---|
| committer | EmptyChaos <EmptyChaos@users.noreply.github.com> | 2016-03-24 13:43:29 +1100 |
| commit | 0b9a72a62d38481ff08f742b2318d07f29ff5dff (patch) | |
| tree | 2e50552fefad959ae7e4502d419b016e29f0d02e /Source/Core/VideoBackends/OGL/SamplerCache.cpp | |
| parent | 902e5cddf76e941af8bd506cef34176d080184e6 (diff) | |
VideoCommon: Refactor TexMode0 mipmaps disabled test into a helper function
Diffstat (limited to 'Source/Core/VideoBackends/OGL/SamplerCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/SamplerCache.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/OGL/SamplerCache.cpp b/Source/Core/VideoBackends/OGL/SamplerCache.cpp index 5f809825d5..d9a2008a50 100644 --- a/Source/Core/VideoBackends/OGL/SamplerCache.cpp +++ b/Source/Core/VideoBackends/OGL/SamplerCache.cpp @@ -60,7 +60,7 @@ void SamplerCache::SetSamplerState(int stage, const TexMode0& tm0, const TexMode // take equivalent forced linear when bForceFiltering if (g_ActiveConfig.bForceFiltering) { - params.tm0.min_filter = (tm0.min_filter & 3) == TexMode0::TEXF_NONE ? 4 : 6; + params.tm0.min_filter = SamplerCommon::AreBpTexMode0MipmapsEnabled(tm0) ? 6 : 4; params.tm0.mag_filter = 1; } @@ -136,7 +136,7 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params) GLint mag_filter = tm0.mag_filter ? GL_LINEAR : GL_NEAREST; if (g_ActiveConfig.iMaxAnisotropy > 0 && g_ogl_config.bSupportsAniso && - !IsBpTexMode0PointFiltering(tm0)) + !SamplerCommon::IsBpTexMode0PointFiltering(tm0)) { // https://www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt // For predictable results on all hardware/drivers, only use one of: @@ -145,7 +145,7 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params) // Letting the game set other combinations will have varying arbitrary results; // possibly being interpreted as equal to bilinear/trilinear, implicitly // disabling anisotropy, or changing the anisotropic algorithm employed. - min_filter = (tm0.min_filter & 3) == TexMode0::TEXF_NONE ? GL_LINEAR : GL_LINEAR_MIPMAP_LINEAR; + min_filter = SamplerCommon::AreBpTexMode0MipmapsEnabled(tm0) ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; mag_filter = GL_LINEAR; glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)(1 << g_ActiveConfig.iMaxAnisotropy)); } |
