From 35373c5185d586602a44c51544f85fb6acde10f1 Mon Sep 17 00:00:00 2001 From: degasus Date: Sun, 1 Mar 2015 13:04:48 +0100 Subject: TextureCache: load all mipmap levels from custom textures This drops the "feature" to load level 0 from the custom texture and all other levels from the native one if the size matches. But in my opinion, when a custom texture only provide one level, no more should be used at all. --- Source/Core/VideoBackends/OGL/SamplerCache.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/OGL/SamplerCache.cpp') diff --git a/Source/Core/VideoBackends/OGL/SamplerCache.cpp b/Source/Core/VideoBackends/OGL/SamplerCache.cpp index a20b42d29f..71e039c449 100644 --- a/Source/Core/VideoBackends/OGL/SamplerCache.cpp +++ b/Source/Core/VideoBackends/OGL/SamplerCache.cpp @@ -20,7 +20,7 @@ SamplerCache::~SamplerCache() Clear(); } -void SamplerCache::SetSamplerState(int stage, const TexMode0& tm0, const TexMode1& tm1) +void SamplerCache::SetSamplerState(int stage, const TexMode0& tm0, const TexMode1& tm1, bool custom_tex) { // TODO: can this go somewhere else? if (m_last_max_anisotropy != g_ActiveConfig.iMaxAnisotropy) @@ -38,6 +38,12 @@ void SamplerCache::SetSamplerState(int stage, const TexMode0& tm0, const TexMode params.tm0.mag_filter |= 0x1; } + // custom textures may have higher resolution, so disable the max_lod + if (custom_tex) + { + params.tm1.max_lod = 255; + } + // TODO: Should keep a circular buffer for each stage of recently used samplers. auto& active_sampler = m_active_samplers[stage]; -- cgit v1.2.3