mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 00:04:53 +00:00
The D3D backend was always forcing Anisotropic filtering when that is enabled regardless of how the game chose to configure the texture filtering registers; this causes the same issues as "Force Filtering" without Anisotropy, such as causing game UI elements to no longer line up adjacent correctly. Historically, OpenGL's Anisotropy support has always worked "better" than D3D's due to seeming to not have this problem; unfortunately, OpenGL's Anisotropy specification only gives GL_LINEAR based filtering modes defined behavior, with only the mipmap setting being required to be considered. Some OpenGL implementations were implicitly disabling Anisotropy when the min/mag filters were set to GL_NEAREST, but this behavior is not required by the spec so cannot be relied on.
18 lines
743 B
C++
18 lines
743 B
C++
// Copyright 2016 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
// 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)
|
|
{
|
|
return tm0.min_filter < 4 && !tm0.mag_filter;
|
|
}
|