diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-12-23 01:40:45 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:52 +0200 |
commit | 9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee (patch) | |
tree | b213e143366041f07ac9389e91801384f698b0d8 /src/video_core/texture_cache/texture_cache.h | |
parent | Refactor VideoCore to use AS sepparate from Channel. (diff) | |
download | yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.gz yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.bz2 yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.lz yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.xz yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.tar.zst yuzu-9cf4c8831d6a8b0d9c6e2a48e89b667fd73accee.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 89c5faf88..5ef07d18f 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -41,9 +41,6 @@ TextureCache<P>::TextureCache(Runtime& runtime_, VideoCore::RasterizerInterface& sampler_descriptor.mipmap_filter.Assign(Tegra::Texture::TextureMipmapFilter::Linear); sampler_descriptor.cubemap_anisotropy.Assign(1); - // Setup channels - current_channel_id = UNSET_CHANNEL; - // Make sure the first index is reserved for the null resources // This way the null resource becomes a compile time constant void(slot_images.insert(NullImageParams{})); @@ -886,13 +883,15 @@ void TextureCache<P>::InvalidateScale(Image& image) { } image.image_view_ids.clear(); image.image_view_infos.clear(); - auto& channel_info = channel_storage[image.channel]; - if constexpr (ENABLE_VALIDATION) { - std::ranges::fill(channel_info.graphics_image_view_ids, CORRUPT_ID); - std::ranges::fill(channel_info.compute_image_view_ids, CORRUPT_ID); + for (size_t c : active_channel_ids) { + auto& channel_info = channel_storage[c]; + if constexpr (ENABLE_VALIDATION) { + std::ranges::fill(channel_info.graphics_image_view_ids, CORRUPT_ID); + std::ranges::fill(channel_info.compute_image_view_ids, CORRUPT_ID); + } + channel_info.graphics_image_table.Invalidate(); + channel_info.compute_image_table.Invalidate(); } - channel_info.graphics_image_table.Invalidate(); - channel_info.compute_image_table.Invalidate(); has_deleted_images = true; } @@ -1690,26 +1689,30 @@ void TextureCache<P>::DeleteImage(ImageId image_id, bool immediate_delete) { if (alloc_images.empty()) { image_allocs_table.erase(alloc_it); } - for (auto& this_state : channel_storage) { + for (size_t c : active_channel_ids) { + auto& channel_info = channel_storage[c]; if constexpr (ENABLE_VALIDATION) { - std::ranges::fill(this_state.graphics_image_view_ids, CORRUPT_ID); - std::ranges::fill(this_state.compute_image_view_ids, CORRUPT_ID); + std::ranges::fill(channel_info.graphics_image_view_ids, CORRUPT_ID); + std::ranges::fill(channel_info.compute_image_view_ids, CORRUPT_ID); } - this_state.graphics_image_table.Invalidate(); - this_state.compute_image_table.Invalidate(); + channel_info.graphics_image_table.Invalidate(); + channel_info.compute_image_table.Invalidate(); } has_deleted_images = true; } template <class P> void TextureCache<P>::RemoveImageViewReferences(std::span<const ImageViewId> removed_views) { - auto it = channel_state->image_views.begin(); - while (it != channel_state->image_views.end()) { - const auto found = std::ranges::find(removed_views, it->second); - if (found != removed_views.end()) { - it = channel_state->image_views.erase(it); - } else { - ++it; + for (size_t c : active_channel_ids) { + auto& channel_info = channel_storage[c]; + auto it = channel_info.image_views.begin(); + while (it != channel_info.image_views.end()) { + const auto found = std::ranges::find(removed_views, it->second); + if (found != removed_views.end()) { + it = channel_info.image_views.erase(it); + } else { + ++it; + } } } } |