aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache/texture_cache.h
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-12-23 20:55:48 -0500
committerameerj <52414509+ameerj@users.noreply.github.com>2021-12-23 20:55:48 -0500
commit481b210c0d035d3de36dc7845802135d90d25a8b (patch)
tree40fb9593457a28b9389140a2e649b9423a414a5b /src/video_core/texture_cache/texture_cache.h
parent516325eba85c759d0164de9690c5c3ab0b865155 (diff)
vk_texture_cache: Fix invalidated pointer access
The vulkan ImageView held a reference to its source image for rescale status checking. This pointer is sometimes invalidated when the texture cache slot_images container is resized. To avoid an invalid pointer dereference, the ImageView now holds a reference to the container itself.
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r--src/video_core/texture_cache/texture_cache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 2e19fced2..b494152b8 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1397,7 +1397,8 @@ ImageViewId TextureCache<P>::FindOrEmplaceImageView(ImageId image_id, const Imag
if (const ImageViewId image_view_id = image.FindView(info); image_view_id) {
return image_view_id;
}
- const ImageViewId image_view_id = slot_image_views.insert(runtime, info, image_id, image);
+ const ImageViewId image_view_id =
+ slot_image_views.insert(runtime, info, image_id, image, slot_images);
image.InsertView(info, image_view_id);
return image_view_id;
}