mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
textures: Fix anisotropy hack
Previous code could generate an anisotropy value way higher than x16.
This commit is contained in:
parent
84e9f9f395
commit
1aa75b1081
1 changed files with 16 additions and 14 deletions
|
@ -337,20 +337,22 @@ struct TSCEntry {
|
||||||
};
|
};
|
||||||
|
|
||||||
float GetMaxAnisotropy() const {
|
float GetMaxAnisotropy() const {
|
||||||
|
const u32 min_value = [] {
|
||||||
switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) {
|
switch (static_cast<Anisotropy>(Settings::values.max_anisotropy)) {
|
||||||
case Anisotropy::Default:
|
|
||||||
return static_cast<float>(1U << max_anisotropy);
|
|
||||||
case Anisotropy::Filter2x:
|
|
||||||
return static_cast<float>(2U << max_anisotropy);
|
|
||||||
case Anisotropy::Filter4x:
|
|
||||||
return static_cast<float>(4U << max_anisotropy);
|
|
||||||
case Anisotropy::Filter8x:
|
|
||||||
return static_cast<float>(8U << max_anisotropy);
|
|
||||||
case Anisotropy::Filter16x:
|
|
||||||
return static_cast<float>(16U << max_anisotropy);
|
|
||||||
default:
|
default:
|
||||||
return static_cast<float>(1U << max_anisotropy);
|
case Anisotropy::Default:
|
||||||
|
return 1U;
|
||||||
|
case Anisotropy::Filter2x:
|
||||||
|
return 2U;
|
||||||
|
case Anisotropy::Filter4x:
|
||||||
|
return 4U;
|
||||||
|
case Anisotropy::Filter8x:
|
||||||
|
return 8U;
|
||||||
|
case Anisotropy::Filter16x:
|
||||||
|
return 16U;
|
||||||
}
|
}
|
||||||
|
}();
|
||||||
|
return static_cast<float>(std::max(1U << max_anisotropy, min_value));
|
||||||
}
|
}
|
||||||
|
|
||||||
float GetMinLod() const {
|
float GetMinLod() const {
|
||||||
|
|
Loading…
Reference in a new issue