mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-25 21:03:18 +00:00
texture_cache: Enable anisotropic filtering (#1872)
This commit is contained in:
parent
a86ee7e7f5
commit
0351b864d0
3 changed files with 41 additions and 0 deletions
|
@ -364,6 +364,16 @@ enum class Filter : u64 {
|
|||
AnisoLinear = 3,
|
||||
};
|
||||
|
||||
constexpr bool IsAnisoFilter(const Filter filter) {
|
||||
switch (filter) {
|
||||
case Filter::AnisoPoint:
|
||||
case Filter::AnisoLinear:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
enum class MipFilter : u64 {
|
||||
None = 0,
|
||||
Point = 1,
|
||||
|
@ -435,6 +445,23 @@ struct Sampler {
|
|||
float MaxLod() const noexcept {
|
||||
return static_cast<float>(max_lod.Value()) / 256.0f;
|
||||
}
|
||||
|
||||
float MaxAniso() const {
|
||||
switch (max_aniso) {
|
||||
case AnisoRatio::One:
|
||||
return 1.0f;
|
||||
case AnisoRatio::Two:
|
||||
return 2.0f;
|
||||
case AnisoRatio::Four:
|
||||
return 4.0f;
|
||||
case AnisoRatio::Eight:
|
||||
return 8.0f;
|
||||
case AnisoRatio::Sixteen:
|
||||
return 16.0f;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AmdGpu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue