Skip to content

Commit

Permalink
texture_cache: Prevent unregistered images from being tracked. (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
squidbus authored Jan 20, 2025
1 parent 0f93edb commit e1132db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video_core/texture_cache/texture_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,9 @@ void TextureCache::UnregisterImage(ImageId image_id) {

void TextureCache::TrackImage(ImageId image_id) {
auto& image = slot_images[image_id];
if (!(image.flags & ImageFlagBits::Registered)) {
return;
}
const auto image_begin = image.info.guest_address;
const auto image_end = image.info.guest_address + image.info.guest_size;
if (image_begin == image.track_addr && image_end == image.track_addr_end) {
Expand All @@ -666,6 +669,9 @@ void TextureCache::TrackImage(ImageId image_id) {

void TextureCache::TrackImageHead(ImageId image_id) {
auto& image = slot_images[image_id];
if (!(image.flags & ImageFlagBits::Registered)) {
return;
}
const auto image_begin = image.info.guest_address;
if (image_begin == image.track_addr) {
return;
Expand All @@ -678,6 +684,9 @@ void TextureCache::TrackImageHead(ImageId image_id) {

void TextureCache::TrackImageTail(ImageId image_id) {
auto& image = slot_images[image_id];
if (!(image.flags & ImageFlagBits::Registered)) {
return;
}
const auto image_end = image.info.guest_address + image.info.guest_size;
if (image_end == image.track_addr_end) {
return;
Expand Down

0 comments on commit e1132db

Please sign in to comment.