2016-03-24 02:23:56 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-03-24 02:23:56 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-03-24 02:42:08 +00:00
|
|
|
namespace SamplerCommon
|
|
|
|
{
|
2016-03-24 02:23:56 +00:00
|
|
|
// 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.
|
|
|
|
template <class T>
|
|
|
|
constexpr bool IsBpTexMode0PointFiltering(const T& tm0)
|
|
|
|
{
|
2021-02-11 02:11:31 +00:00
|
|
|
return tm0.min_filter == FilterMode::Near && tm0.mag_filter == FilterMode::Near;
|
2016-03-24 02:23:56 +00:00
|
|
|
}
|
2016-03-24 02:42:08 +00:00
|
|
|
|
|
|
|
// Check if the minification filter has mipmap based filtering modes enabled.
|
|
|
|
template <class T>
|
|
|
|
constexpr bool AreBpTexMode0MipmapsEnabled(const T& tm0)
|
|
|
|
{
|
2021-02-11 02:11:31 +00:00
|
|
|
return tm0.mipmap_filter != MipMode::None;
|
2016-03-24 02:42:08 +00:00
|
|
|
}
|
2019-05-05 23:48:12 +00:00
|
|
|
} // namespace SamplerCommon
|