diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-06-20 12:25:59 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-07-04 22:32:35 +0200 |
commit | 8f9f142956bb5de205cad2237f0cf60770796867 (patch) | |
tree | 00aa9899f418b73889955da8dfdbb6a9c3c20a27 /src/video_core/texture_cache/texture_cache.h | |
parent | Texture Cache: Improve accuracy of sparse texture detection. (diff) | |
download | yuzu-8f9f142956bb5de205cad2237f0cf60770796867.tar yuzu-8f9f142956bb5de205cad2237f0cf60770796867.tar.gz yuzu-8f9f142956bb5de205cad2237f0cf60770796867.tar.bz2 yuzu-8f9f142956bb5de205cad2237f0cf60770796867.tar.lz yuzu-8f9f142956bb5de205cad2237f0cf60770796867.tar.xz yuzu-8f9f142956bb5de205cad2237f0cf60770796867.tar.zst yuzu-8f9f142956bb5de205cad2237f0cf60770796867.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 1704fc48c..500c4dd52 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -156,9 +156,6 @@ public: /// Remove images in a region void UnmapGPUMemory(GPUVAddr gpu_addr, size_t size); - /// Used when GPU memory changes layout on sparse textures. - // void CheckRemaps(); - /// Blit an image with the given parameters void BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, const Tegra::Engines::Fermi2D::Surface& src, @@ -1179,8 +1176,9 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, VA const ImageId new_image_id = slot_images.insert(runtime, new_info, gpu_addr, cpu_addr); Image& new_image = slot_images[new_image_id]; - new_image.is_sparse = - !gpu_memory.IsContinousRange(new_image.gpu_addr, new_image.guest_size_bytes); + if (!gpu_memory.IsContinousRange(new_image.gpu_addr, new_image.guest_size_bytes)) { + new_image.flags |= ImageFlagBits::Sparse; + } for (const ImageId overlap_id : ignore_textures) { Image& overlap = slot_images[overlap_id]; @@ -1519,7 +1517,7 @@ void TextureCache<P>::RegisterImage(ImageId image_id) { total_used_memory += Common::AlignUp(tentative_size, 1024); ForEachGPUPage(image.gpu_addr, image.guest_size_bytes, [this, image_id](u64 page) { gpu_page_table[page].push_back(image_id); }); - if (!image.is_sparse) { + if (False(image.flags & ImageFlagBits::Sparse)) { auto map_id = slot_map_views.insert(image.gpu_addr, image.cpu_addr, image.guest_size_bytes, image_id); ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, @@ -1574,7 +1572,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { }; ForEachGPUPage(image.gpu_addr, image.guest_size_bytes, [this, &clear_page_table](u64 page) { clear_page_table(page, gpu_page_table); }); - if (!image.is_sparse) { + if (False(image.flags & ImageFlagBits::Sparse)) { const auto map_id = image.map_view_id; ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { const auto page_it = page_table.find(page); @@ -1633,7 +1631,7 @@ template <class P> void TextureCache<P>::TrackImage(ImageBase& image, ImageId image_id) { ASSERT(False(image.flags & ImageFlagBits::Tracked)); image.flags |= ImageFlagBits::Tracked; - if (!image.is_sparse) { + if (False(image.flags & ImageFlagBits::Sparse)) { rasterizer.UpdatePagesCachedCount(image.cpu_addr, image.guest_size_bytes, 1); return; } @@ -1659,7 +1657,7 @@ template <class P> void TextureCache<P>::UntrackImage(ImageBase& image, ImageId image_id) { ASSERT(True(image.flags & ImageFlagBits::Tracked)); image.flags &= ~ImageFlagBits::Tracked; - if (!image.is_sparse) { + if (False(image.flags & ImageFlagBits::Sparse)) { rasterizer.UpdatePagesCachedCount(image.cpu_addr, image.guest_size_bytes, -1); return; } |