diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-13 14:17:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-13 14:17:59 +0100 |
commit | f75fceb3c030ac2ed589eb01bc7f3fa61905a76d (patch) | |
tree | c50e54988d79b98b326993e9b4b61461e42bd531 | |
parent | Merge pull request #12989 from german77/hotcake (diff) | |
parent | Texture Cache: Fix untracking on GPU remap (diff) | |
download | yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.tar yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.tar.gz yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.tar.bz2 yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.tar.lz yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.tar.xz yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.tar.zst yuzu-f75fceb3c030ac2ed589eb01bc7f3fa61905a76d.zip |
-rw-r--r-- | src/video_core/texture_cache/image_info.cpp | 1 | ||||
-rw-r--r-- | src/video_core/texture_cache/image_info.h | 1 | ||||
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 15 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index b72788c6d..9444becce 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -42,6 +42,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept { }; } rescaleable = false; + is_sparse = config.is_sparse != 0; tile_width_spacing = config.tile_width_spacing; if (config.texture_type != TextureType::Texture2D && config.texture_type != TextureType::Texture2DNoMipmap) { diff --git a/src/video_core/texture_cache/image_info.h b/src/video_core/texture_cache/image_info.h index 8a4cb0cbd..eb490a642 100644 --- a/src/video_core/texture_cache/image_info.h +++ b/src/video_core/texture_cache/image_info.h @@ -41,6 +41,7 @@ struct ImageInfo { bool downscaleable = false; bool forced_flushed = false; bool dma_downloaded = false; + bool is_sparse = false; }; } // namespace VideoCommon diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 3a1cc060e..01c3561c9 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -600,17 +600,17 @@ void TextureCache<P>::UnmapGPUMemory(size_t as_id, GPUVAddr gpu_addr, size_t siz [&](ImageId id, Image&) { deleted_images.push_back(id); }); for (const ImageId id : deleted_images) { Image& image = slot_images[id]; - if (True(image.flags & ImageFlagBits::CpuModified)) { - continue; + if (False(image.flags & ImageFlagBits::CpuModified)) { + image.flags |= ImageFlagBits::CpuModified; + if (True(image.flags & ImageFlagBits::Tracked)) { + UntrackImage(image, id); + } } - image.flags |= ImageFlagBits::CpuModified; + if (True(image.flags & ImageFlagBits::Remapped)) { continue; } image.flags |= ImageFlagBits::Remapped; - if (True(image.flags & ImageFlagBits::Tracked)) { - UntrackImage(image, id); - } } } @@ -1469,7 +1469,8 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA const ImageId new_image_id = slot_images.insert(runtime, new_info, gpu_addr, cpu_addr); Image& new_image = slot_images[new_image_id]; - if (!gpu_memory->IsContinuousRange(new_image.gpu_addr, new_image.guest_size_bytes)) { + if (!gpu_memory->IsContinuousRange(new_image.gpu_addr, new_image.guest_size_bytes) && + new_info.is_sparse) { new_image.flags |= ImageFlagBits::Sparse; } |