[texture_cache] Skip alias synchronization in texture cache when the image has no aliases. (#3740)

PrepareImage() is on a very hot path and previously called SynchronizeAliases() unconditionally.  For most images, aliased_images` is empty, so this created unnecessary overhead, now we only synchronize only when image requires it

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3740
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: wildcard <wildcard@eden-emu.dev>
Co-committed-by: wildcard <wildcard@eden-emu.dev>
This commit is contained in:
wildcard 2026-04-02 06:06:16 +02:00 committed by crueter
parent 9ace6742d7
commit 34fa39eae8
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6

View file

@ -2733,8 +2733,10 @@ void TextureCache<P>::PrepareImage(ImageId image_id, bool is_modification, bool
} }
} else { } else {
RefreshContents(image, image_id); RefreshContents(image, image_id);
if (!image.aliased_images.empty()) {
SynchronizeAliases(image_id); SynchronizeAliases(image_id);
} }
}
if (is_modification) { if (is_modification) {
MarkModification(image); MarkModification(image);
} }