diff options
| author | 2024-01-26 22:27:34 -0500 | |
|---|---|---|
| committer | 2024-01-31 11:27:20 -0500 | |
| commit | 453091f61100effba637950dc840da41d95be477 (patch) | |
| tree | 0e1d46a7c5a354769d04b9bde090b5a9b1f02eb7 /src/video_core/texture_cache | |
| parent | video_core: simplify accelerated surface fetch and crop handling between APIs (diff) | |
| download | yuzu-453091f61100effba637950dc840da41d95be477.tar.gz yuzu-453091f61100effba637950dc840da41d95be477.tar.xz yuzu-453091f61100effba637950dc840da41d95be477.zip | |
video_core: consistently account for resolution scaling when rendering
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 9 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index a7400adfa..a20c956ff 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -713,12 +713,12 @@ bool TextureCache<P>::BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, | |||
| 713 | } | 713 | } |
| 714 | 714 | ||
| 715 | template <class P> | 715 | template <class P> |
| 716 | typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView( | 716 | std::pair<typename P::ImageView*, bool> TextureCache<P>::TryFindFramebufferImageView( |
| 717 | const Tegra::FramebufferConfig& config, DAddr cpu_addr) { | 717 | const Tegra::FramebufferConfig& config, DAddr cpu_addr) { |
| 718 | // TODO: Properly implement this | 718 | // TODO: Properly implement this |
| 719 | const auto it = page_table.find(cpu_addr >> YUZU_PAGEBITS); | 719 | const auto it = page_table.find(cpu_addr >> YUZU_PAGEBITS); |
| 720 | if (it == page_table.end()) { | 720 | if (it == page_table.end()) { |
| 721 | return nullptr; | 721 | return {}; |
| 722 | } | 722 | } |
| 723 | const auto& image_map_ids = it->second; | 723 | const auto& image_map_ids = it->second; |
| 724 | boost::container::small_vector<ImageId, 4> valid_image_ids; | 724 | boost::container::small_vector<ImageId, 4> valid_image_ids; |
| @@ -747,7 +747,8 @@ typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView( | |||
| 747 | 747 | ||
| 748 | const auto GetImageViewForFramebuffer = [&](ImageId image_id) { | 748 | const auto GetImageViewForFramebuffer = [&](ImageId image_id) { |
| 749 | const ImageViewInfo info{ImageViewType::e2D, view_format}; | 749 | const ImageViewInfo info{ImageViewType::e2D, view_format}; |
| 750 | return &slot_image_views[FindOrEmplaceImageView(image_id, info)]; | 750 | return std::make_pair(&slot_image_views[FindOrEmplaceImageView(image_id, info)], |
| 751 | slot_images[image_id].IsRescaled()); | ||
| 751 | }; | 752 | }; |
| 752 | 753 | ||
| 753 | if (valid_image_ids.size() == 1) [[likely]] { | 754 | if (valid_image_ids.size() == 1) [[likely]] { |
| @@ -761,7 +762,7 @@ typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView( | |||
| 761 | return GetImageViewForFramebuffer(*most_recent); | 762 | return GetImageViewForFramebuffer(*most_recent); |
| 762 | } | 763 | } |
| 763 | 764 | ||
| 764 | return nullptr; | 765 | return {}; |
| 765 | } | 766 | } |
| 766 | 767 | ||
| 767 | template <class P> | 768 | template <class P> |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index f9aebb293..e7b910121 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -212,8 +212,8 @@ public: | |||
| 212 | const Tegra::Engines::Fermi2D::Config& copy); | 212 | const Tegra::Engines::Fermi2D::Config& copy); |
| 213 | 213 | ||
| 214 | /// Try to find a cached image view in the given CPU address | 214 | /// Try to find a cached image view in the given CPU address |
| 215 | [[nodiscard]] ImageView* TryFindFramebufferImageView(const Tegra::FramebufferConfig& config, | 215 | [[nodiscard]] std::pair<ImageView*, bool> TryFindFramebufferImageView( |
| 216 | DAddr cpu_addr); | 216 | const Tegra::FramebufferConfig& config, DAddr cpu_addr); |
| 217 | 217 | ||
| 218 | /// Return true when there are uncommitted images to be downloaded | 218 | /// Return true when there are uncommitted images to be downloaded |
| 219 | [[nodiscard]] bool HasUncommittedFlushes() const noexcept; | 219 | [[nodiscard]] bool HasUncommittedFlushes() const noexcept; |