summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-02-26 15:51:19 +0100
committerLiam <byteslice@airmail.cc>2024-02-26 16:26:27 +0100
commitfd9ed54f279e40a415075c4ae748bef7c5ceb1ff (patch)
treee5abe6770723f20c2c4f66f4394e2cf2cdc828dc
parentMerge pull request #13164 from merryhime/reset-submodules (diff)
downloadyuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.tar
yuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.tar.gz
yuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.tar.bz2
yuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.tar.lz
yuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.tar.xz
yuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.tar.zst
yuzu-fd9ed54f279e40a415075c4ae748bef7c5ceb1ff.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/texture_cache/texture_cache.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 53b4876f2..bfd3d00b6 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -2098,7 +2098,9 @@ void TextureCache<P>::TrackImage(ImageBase& image, ImageId image_id) {
ASSERT(False(image.flags & ImageFlagBits::Tracked));
image.flags |= ImageFlagBits::Tracked;
if (False(image.flags & ImageFlagBits::Sparse)) {
- device_memory.UpdatePagesCachedCount(image.cpu_addr, image.guest_size_bytes, 1);
+ if (image.cpu_addr < ~(1ULL << 40)) {
+ device_memory.UpdatePagesCachedCount(image.cpu_addr, image.guest_size_bytes, 1);
+ }
return;
}
if (True(image.flags & ImageFlagBits::Registered)) {
@@ -2124,7 +2126,9 @@ void TextureCache<P>::UntrackImage(ImageBase& image, ImageId image_id) {
ASSERT(True(image.flags & ImageFlagBits::Tracked));
image.flags &= ~ImageFlagBits::Tracked;
if (False(image.flags & ImageFlagBits::Sparse)) {
- device_memory.UpdatePagesCachedCount(image.cpu_addr, image.guest_size_bytes, -1);
+ if (image.cpu_addr < ~(1ULL << 40)) {
+ device_memory.UpdatePagesCachedCount(image.cpu_addr, image.guest_size_bytes, -1);
+ }
return;
}
ASSERT(True(image.flags & ImageFlagBits::Registered));