diff options
Diffstat (limited to 'src/video_core/textures/texture.cpp')
| -rw-r--r-- | src/video_core/textures/texture.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index 4171e3ef2..ae5621a7d 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp | |||
| @@ -5,9 +5,13 @@ | |||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <array> | 6 | #include <array> |
| 7 | 7 | ||
| 8 | #include "common/cityhash.h" | ||
| 8 | #include "core/settings.h" | 9 | #include "core/settings.h" |
| 9 | #include "video_core/textures/texture.h" | 10 | #include "video_core/textures/texture.h" |
| 10 | 11 | ||
| 12 | using Tegra::Texture::TICEntry; | ||
| 13 | using Tegra::Texture::TSCEntry; | ||
| 14 | |||
| 11 | namespace Tegra::Texture { | 15 | namespace Tegra::Texture { |
| 12 | 16 | ||
| 13 | namespace { | 17 | namespace { |
| @@ -65,7 +69,7 @@ unsigned SettingsMinimumAnisotropy() noexcept { | |||
| 65 | 69 | ||
| 66 | } // Anonymous namespace | 70 | } // Anonymous namespace |
| 67 | 71 | ||
| 68 | std::array<float, 4> TSCEntry::GetBorderColor() const noexcept { | 72 | std::array<float, 4> TSCEntry::BorderColor() const noexcept { |
| 69 | if (!srgb_conversion) { | 73 | if (!srgb_conversion) { |
| 70 | return border_color; | 74 | return border_color; |
| 71 | } | 75 | } |
| @@ -73,8 +77,16 @@ std::array<float, 4> TSCEntry::GetBorderColor() const noexcept { | |||
| 73 | SRGB_CONVERSION_LUT[srgb_border_color_b], border_color[3]}; | 77 | SRGB_CONVERSION_LUT[srgb_border_color_b], border_color[3]}; |
| 74 | } | 78 | } |
| 75 | 79 | ||
| 76 | float TSCEntry::GetMaxAnisotropy() const noexcept { | 80 | float TSCEntry::MaxAnisotropy() const noexcept { |
| 77 | return static_cast<float>(std::max(1U << max_anisotropy, SettingsMinimumAnisotropy())); | 81 | return static_cast<float>(std::max(1U << max_anisotropy, SettingsMinimumAnisotropy())); |
| 78 | } | 82 | } |
| 79 | 83 | ||
| 80 | } // namespace Tegra::Texture | 84 | } // namespace Tegra::Texture |
| 85 | |||
| 86 | size_t std::hash<TICEntry>::operator()(const TICEntry& tic) const noexcept { | ||
| 87 | return Common::CityHash64(reinterpret_cast<const char*>(&tic), sizeof tic); | ||
| 88 | } | ||
| 89 | |||
| 90 | size_t std::hash<TSCEntry>::operator()(const TSCEntry& tsc) const noexcept { | ||
| 91 | return Common::CityHash64(reinterpret_cast<const char*>(&tsc), sizeof tsc); | ||
| 92 | } | ||