Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to invalidate preview cache #77697

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented May 31, 2023

The new tooltips for textures and audio streams rely on preview metadata. But for previews generated before the metadata was added it will be empty, so the tooltips will display 0x0 dimensions or 0 length. It will display as that until the resource is modified (i.e. its hash changes).

This PR adds a mechanism to force refreshing the previews, so that correct metadata is loaded. Preview cache gets a new field: version. To invalidate previews we just need to increase the current version. Note that it forces all exiting previews to be generated again, which is rather costly in terms of I/O in big projects. Also some previews seem to be generated only on demand, so their tooltips are invalid and print an error when displayed for the first time.

@KoBeWi KoBeWi added this to the 4.1 milestone May 31, 2023
@akien-mga akien-mga modified the milestones: 4.1, 4.2, 4.x Jun 13, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 26, 2024
@akien-mga akien-mga merged commit 47d8654 into godotengine:master Apr 29, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the cachepocalypse branch April 29, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants