diff options
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, } template <class P> -typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView( +std::pair<typename P::ImageView*, bool> TextureCache<P>::TryFindFramebufferImageView( const Tegra::FramebufferConfig& config, DAddr cpu_addr) { // TODO: Properly implement this const auto it = page_table.find(cpu_addr >> YUZU_PAGEBITS); if (it == page_table.end()) { - return nullptr; + return {}; } const auto& image_map_ids = it->second; boost::container::small_vector<ImageId, 4> valid_image_ids; @@ -747,7 +747,8 @@ typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView( const auto GetImageViewForFramebuffer = [&](ImageId image_id) { const ImageViewInfo info{ImageViewType::e2D, view_format}; - return &slot_image_views[FindOrEmplaceImageView(image_id, info)]; + return std::make_pair(&slot_image_views[FindOrEmplaceImageView(image_id, info)], + slot_images[image_id].IsRescaled()); }; if (valid_image_ids.size() == 1) [[likely]] { @@ -761,7 +762,7 @@ typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView( return GetImageViewForFramebuffer(*most_recent); } - return nullptr; + return {}; } 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: const Tegra::Engines::Fermi2D::Config& copy); /// Try to find a cached image view in the given CPU address - [[nodiscard]] ImageView* TryFindFramebufferImageView(const Tegra::FramebufferConfig& config, - DAddr cpu_addr); + [[nodiscard]] std::pair<ImageView*, bool> TryFindFramebufferImageView( + const Tegra::FramebufferConfig& config, DAddr cpu_addr); /// Return true when there are uncommitted images to be downloaded [[nodiscard]] bool HasUncommittedFlushes() const noexcept; |