diff options
| author | 2021-07-31 17:42:37 -0300 | |
|---|---|---|
| committer | 2021-11-16 22:11:29 +0100 | |
| commit | c7a1cbad44487b2c5f9da31ce6d3c76b7dec4f05 (patch) | |
| tree | de6a0d7767ce12ee65846c53a18c2744ca636ec1 /src/video_core/texture_cache | |
| parent | vk_rasterizer: Minor style change (diff) | |
| download | yuzu-c7a1cbad44487b2c5f9da31ce6d3c76b7dec4f05.tar.gz yuzu-c7a1cbad44487b2c5f9da31ce6d3c76b7dec4f05.tar.xz yuzu-c7a1cbad44487b2c5f9da31ce6d3c76b7dec4f05.zip | |
texture_cache: Add getter to query if image view is rescaled
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 16 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 9 |
2 files changed, 9 insertions, 16 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 4dbded635..0e70c4db2 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -120,16 +120,6 @@ typename P::ImageView& TextureCache<P>::GetImageView(ImageViewId id) noexcept { | |||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | template <class P> | 122 | template <class P> |
| 123 | const typename P::Image& TextureCache<P>::GetImage(ImageId id) const noexcept { | ||
| 124 | return slot_images[id]; | ||
| 125 | } | ||
| 126 | |||
| 127 | template <class P> | ||
| 128 | typename P::Image& TextureCache<P>::GetImage(ImageId id) noexcept { | ||
| 129 | return slot_images[id]; | ||
| 130 | } | ||
| 131 | |||
| 132 | template <class P> | ||
| 133 | void TextureCache<P>::MarkModification(ImageId id) noexcept { | 123 | void TextureCache<P>::MarkModification(ImageId id) noexcept { |
| 134 | MarkModification(slot_images[id]); | 124 | MarkModification(slot_images[id]); |
| 135 | } | 125 | } |
| @@ -635,6 +625,12 @@ bool TextureCache<P>::IsRescaling() const noexcept { | |||
| 635 | } | 625 | } |
| 636 | 626 | ||
| 637 | template <class P> | 627 | template <class P> |
| 628 | bool TextureCache<P>::IsRescaling(const ImageViewBase& image_view) const noexcept { | ||
| 629 | const ImageBase& image = slot_images[image_view.image_id]; | ||
| 630 | return True(image.flags & ImageFlagBits::Rescaled); | ||
| 631 | } | ||
| 632 | |||
| 633 | template <class P> | ||
| 638 | bool TextureCache<P>::IsRegionGpuModified(VAddr addr, size_t size) { | 634 | bool TextureCache<P>::IsRegionGpuModified(VAddr addr, size_t size) { |
| 639 | bool is_modified = false; | 635 | bool is_modified = false; |
| 640 | ForEachImageInRegion(addr, size, [&is_modified](ImageId, ImageBase& image) { | 636 | ForEachImageInRegion(addr, size, [&is_modified](ImageId, ImageBase& image) { |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index b6cc09682..8b417b611 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include "video_core/texture_cache/descriptor_table.h" | 21 | #include "video_core/texture_cache/descriptor_table.h" |
| 22 | #include "video_core/texture_cache/image_base.h" | 22 | #include "video_core/texture_cache/image_base.h" |
| 23 | #include "video_core/texture_cache/image_info.h" | 23 | #include "video_core/texture_cache/image_info.h" |
| 24 | #include "video_core/texture_cache/image_view_base.h" | ||
| 24 | #include "video_core/texture_cache/image_view_info.h" | 25 | #include "video_core/texture_cache/image_view_info.h" |
| 25 | #include "video_core/texture_cache/render_targets.h" | 26 | #include "video_core/texture_cache/render_targets.h" |
| 26 | #include "video_core/texture_cache/slot_vector.h" | 27 | #include "video_core/texture_cache/slot_vector.h" |
| @@ -100,12 +101,6 @@ public: | |||
| 100 | /// Return a reference to the given image view id | 101 | /// Return a reference to the given image view id |
| 101 | [[nodiscard]] ImageView& GetImageView(ImageViewId id) noexcept; | 102 | [[nodiscard]] ImageView& GetImageView(ImageViewId id) noexcept; |
| 102 | 103 | ||
| 103 | /// Return a constant reference to the given image id | ||
| 104 | [[nodiscard]] const Image& GetImage(ImageId id) const noexcept; | ||
| 105 | |||
| 106 | /// Return a reference to the given image id | ||
| 107 | [[nodiscard]] Image& GetImage(ImageId id) noexcept; | ||
| 108 | |||
| 109 | /// Mark an image as modified from the GPU | 104 | /// Mark an image as modified from the GPU |
| 110 | void MarkModification(ImageId id) noexcept; | 105 | void MarkModification(ImageId id) noexcept; |
| 111 | 106 | ||
| @@ -181,6 +176,8 @@ public: | |||
| 181 | 176 | ||
| 182 | [[nodiscard]] bool IsRescaling() const noexcept; | 177 | [[nodiscard]] bool IsRescaling() const noexcept; |
| 183 | 178 | ||
| 179 | [[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept; | ||
| 180 | |||
| 184 | [[nodiscard]] bool BlackListImage(ImageId image_id); | 181 | [[nodiscard]] bool BlackListImage(ImageId image_id); |
| 185 | 182 | ||
| 186 | std::mutex mutex; | 183 | std::mutex mutex; |