aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorliamwhite <[email protected]>2024-02-27 09:42:46 -0500
committerGitHub <[email protected]>2024-02-27 09:42:46 -0500
commitf1b15302498bd3f8d77af266e404456e59ea5a76 (patch)
tree608a399704cff022cc043ff324622d490f9c2be0
parent6948ac8c1622ebb3f9da065d3678e571b7ff726e (diff)
parentfd9ed54f279e40a415075c4ae748bef7c5ceb1ff (diff)
downloadyuzu-android-f1b15302498bd3f8d77af266e404456e59ea5a76.tar.gz
yuzu-android-f1b15302498bd3f8d77af266e404456e59ea5a76.zip
Merge pull request #13171 from liamwhite/fake-address
texture_cache: do not track invalid addresses
-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 67487b463..feb1c575e 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -2114,7 +2114,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)) {
@@ -2140,7 +2142,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));