mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
Eliminate SamplerCommon
This commit is contained in:
@ -40,7 +40,6 @@
|
||||
#include "VideoCommon/OpcodeDecoding.h"
|
||||
#include "VideoCommon/PixelShaderManager.h"
|
||||
#include "VideoCommon/RenderBase.h"
|
||||
#include "VideoCommon/SamplerCommon.h"
|
||||
#include "VideoCommon/ShaderCache.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
#include "VideoCommon/TMEM.h"
|
||||
@ -966,6 +965,18 @@ void TextureCacheBase::DumpTexture(TCacheEntry* entry, std::string basename, uns
|
||||
entry->texture->Save(filename, level);
|
||||
}
|
||||
|
||||
// Helper for checking if a BPMemory TexMode0 register is set to Point
|
||||
// Filtering modes. This is used to decide whether Anisotropic enhancements
|
||||
// are (mostly) safe in the VideoBackends.
|
||||
// If both the minification and magnification filters are set to POINT modes
|
||||
// then applying anisotropic filtering is equivalent to forced filtering. Point
|
||||
// mode textures are usually some sort of 2D UI billboard which will end up
|
||||
// misaligned from the correct pixels when filtered anisotropically.
|
||||
static bool IsAnisostropicEnhancementSafe(const TexMode0& tm0)
|
||||
{
|
||||
return !(tm0.min_filter == FilterMode::Near && tm0.mag_filter == FilterMode::Near);
|
||||
}
|
||||
|
||||
static void SetSamplerState(u32 index, float custom_tex_scale, bool custom_tex,
|
||||
bool has_arbitrary_mips)
|
||||
{
|
||||
@ -988,7 +999,7 @@ static void SetSamplerState(u32 index, float custom_tex_scale, bool custom_tex,
|
||||
state.max_lod = 255;
|
||||
|
||||
// Anisotropic filtering option.
|
||||
if (g_ActiveConfig.iMaxAnisotropy != 0 && !SamplerCommon::IsBpTexMode0PointFiltering(tm0))
|
||||
if (g_ActiveConfig.iMaxAnisotropy != 0 && IsAnisostropicEnhancementSafe(tm0))
|
||||
{
|
||||
// https://www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt
|
||||
// For predictable results on all hardware/drivers, only use one of:
|
||||
|
Reference in New Issue
Block a user