diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 27 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 2 |
2 files changed, 7 insertions, 22 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index cf0d33a45..c885586e8 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -221,7 +221,6 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | |||
| 221 | scale_rating = 0; | 221 | scale_rating = 0; |
| 222 | bool any_rescaled = false; | 222 | bool any_rescaled = false; |
| 223 | bool can_rescale = true; | 223 | bool can_rescale = true; |
| 224 | bool any_blacklisted = false; | ||
| 225 | const auto check_rescale = [&](ImageViewId view_id, ImageId& id_save) { | 224 | const auto check_rescale = [&](ImageViewId view_id, ImageId& id_save) { |
| 226 | if (view_id != NULL_IMAGE_VIEW_ID && view_id != ImageViewId{}) { | 225 | if (view_id != NULL_IMAGE_VIEW_ID && view_id != ImageViewId{}) { |
| 227 | const auto& view = slot_image_views[view_id]; | 226 | const auto& view = slot_image_views[view_id]; |
| @@ -229,7 +228,6 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | |||
| 229 | id_save = image_id; | 228 | id_save = image_id; |
| 230 | auto& image = slot_images[image_id]; | 229 | auto& image = slot_images[image_id]; |
| 231 | can_rescale &= ImageCanRescale(image); | 230 | can_rescale &= ImageCanRescale(image); |
| 232 | any_blacklisted |= True(image.flags & ImageFlagBits::Blacklisted); | ||
| 233 | any_rescaled |= True(image.flags & ImageFlagBits::Rescaled) || | 231 | any_rescaled |= True(image.flags & ImageFlagBits::Rescaled) || |
| 234 | GetFormatType(image.info.format) != SurfaceType::ColorTexture; | 232 | GetFormatType(image.info.format) != SurfaceType::ColorTexture; |
| 235 | scale_rating = std::max<u32>(scale_rating, image.scale_tick <= frame_tick | 233 | scale_rating = std::max<u32>(scale_rating, image.scale_tick <= frame_tick |
| @@ -270,20 +268,17 @@ void TextureCache<P>::UpdateRenderTargets(bool is_clear) { | |||
| 270 | } | 268 | } |
| 271 | } else { | 269 | } else { |
| 272 | rescaled = false; | 270 | rescaled = false; |
| 273 | const auto scale_down = [this, any_blacklisted](ImageId image_id) { | 271 | const auto scale_down = [this](ImageId image_id) { |
| 274 | if (image_id != CORRUPT_ID) { | 272 | if (image_id != CORRUPT_ID) { |
| 275 | Image& image = slot_images[image_id]; | 273 | Image& image = slot_images[image_id]; |
| 276 | ScaleDown(image); | 274 | ScaleDown(image); |
| 277 | if (any_blacklisted) { | ||
| 278 | image.flags |= ImageFlagBits::Blacklisted; | ||
| 279 | } | ||
| 280 | } | 275 | } |
| 281 | }; | 276 | }; |
| 282 | for (size_t index = 0; index < NUM_RT; ++index) { | 277 | for (size_t index = 0; index < NUM_RT; ++index) { |
| 283 | scale_down(tmp_color_images[index]); | 278 | scale_down(tmp_color_images[index]); |
| 284 | } | 279 | } |
| 285 | scale_down(tmp_depth_image); | 280 | scale_down(tmp_depth_image); |
| 286 | scale_rating = 0; | 281 | scale_rating = 1; |
| 287 | } | 282 | } |
| 288 | } while (has_deleted_images); | 283 | } while (has_deleted_images); |
| 289 | // Rescale End | 284 | // Rescale End |
| @@ -352,7 +347,10 @@ void TextureCache<P>::FillImageViews(DescriptorTable<TICEntry>& table, | |||
| 352 | if constexpr (has_blacklists) { | 347 | if constexpr (has_blacklists) { |
| 353 | if (view.blacklist && view.id != NULL_IMAGE_VIEW_ID) { | 348 | if (view.blacklist && view.id != NULL_IMAGE_VIEW_ID) { |
| 354 | const ImageViewBase& image_view{slot_image_views[view.id]}; | 349 | const ImageViewBase& image_view{slot_image_views[view.id]}; |
| 355 | has_blacklisted |= BlackListImage(image_view.image_id); | 350 | auto& image = slot_images[image_view.image_id]; |
| 351 | image.flags |= ImageFlagBits::Blacklisted; | ||
| 352 | has_blacklisted |= ScaleDown(image); | ||
| 353 | image.scale_rating = 0; | ||
| 356 | } | 354 | } |
| 357 | } | 355 | } |
| 358 | } | 356 | } |
| @@ -784,19 +782,8 @@ ImageId TextureCache<P>::FindImage(const ImageInfo& info, GPUVAddr gpu_addr, | |||
| 784 | } | 782 | } |
| 785 | 783 | ||
| 786 | template <class P> | 784 | template <class P> |
| 787 | bool TextureCache<P>::BlackListImage(ImageId image_id) { | ||
| 788 | auto& image = slot_images[image_id]; | ||
| 789 | if (True(image.flags & ImageFlagBits::Blacklisted)) { | ||
| 790 | return false; | ||
| 791 | } | ||
| 792 | image.flags |= ImageFlagBits::Blacklisted; | ||
| 793 | ScaleDown(image); | ||
| 794 | return true; | ||
| 795 | } | ||
| 796 | |||
| 797 | template <class P> | ||
| 798 | bool TextureCache<P>::ImageCanRescale(ImageBase& image) { | 785 | bool TextureCache<P>::ImageCanRescale(ImageBase& image) { |
| 799 | if (!image.info.rescaleable || True(image.flags & ImageFlagBits::Blacklisted)) { | 786 | if (!image.info.rescaleable) { |
| 800 | return false; | 787 | return false; |
| 801 | } | 788 | } |
| 802 | if (Settings::values.resolution_info.downscale && !image.info.downscaleable) { | 789 | if (Settings::values.resolution_info.downscale && !image.info.downscaleable) { |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index e210393ba..4f876b2f4 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -166,8 +166,6 @@ public: | |||
| 166 | 166 | ||
| 167 | [[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept; | 167 | [[nodiscard]] bool IsRescaling(const ImageViewBase& image_view) const noexcept; |
| 168 | 168 | ||
| 169 | [[nodiscard]] bool BlackListImage(ImageId image_id); | ||
| 170 | |||
| 171 | std::mutex mutex; | 169 | std::mutex mutex; |
| 172 | 170 | ||
| 173 | private: | 171 | private: |