diff options
author | Liam <byteslice@airmail.cc> | 2024-01-27 04:27:34 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-31 17:27:20 +0100 |
commit | 453091f61100effba637950dc840da41d95be477 (patch) | |
tree | 0e1d46a7c5a354769d04b9bde090b5a9b1f02eb7 /src/video_core/texture_cache/texture_cache.h | |
parent | video_core: simplify accelerated surface fetch and crop handling between APIs (diff) | |
download | yuzu-453091f61100effba637950dc840da41d95be477.tar yuzu-453091f61100effba637950dc840da41d95be477.tar.gz yuzu-453091f61100effba637950dc840da41d95be477.tar.bz2 yuzu-453091f61100effba637950dc840da41d95be477.tar.lz yuzu-453091f61100effba637950dc840da41d95be477.tar.xz yuzu-453091f61100effba637950dc840da41d95be477.tar.zst yuzu-453091f61100effba637950dc840da41d95be477.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 9 |
1 files changed, 5 insertions, 4 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> |