Fix threading issue of Atlas.FallbackStack, and introduce overloads with fallback parameter#1089
Open
Saplonily wants to merge 3 commits intoEverestAPI:devfrom
Open
Fix threading issue of Atlas.FallbackStack, and introduce overloads with fallback parameter#1089Saplonily wants to merge 3 commits intoEverestAPI:devfrom
Atlas.FallbackStack, and introduce overloads with fallback parameter#1089Saplonily wants to merge 3 commits intoEverestAPI:devfrom
Conversation
This reverts commit d76dc85.
…h fallback parameter
maddie480
approved these changes
Mar 1, 2026
DashingCat
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pr changes the
Atlas.FallbackStackimplementation intoThreadLocal<T>, since the expected usage of it is that, pushing a fallback, get something fromAtlasin this context, and then pop it, which make sense to make it thread local.If we're using
ConcurrentStack, then one thread may get a fallback that pushed from another thread, which is not expected.There's an optional commit that marks stack operation methods as obsolete, and add some overloads that accept a
fallbackparameter, because this is a much easier way to reach that.namespace Monocle; public class Atlas { + [Obsolete(MessageFallbackStackObsolete)] public void PushFallback(MTexture fallback) + [Obsolete(MessageFallbackStackObsolete)] public MTexture PopFallback() + public MTexture GetDefaultFallback(); + public MTexture GetAtlasSubtexturesAt(string key, int index, MTexture fallback) + public List<MTexture> GetAtlasSubtextures(string key, MTexture fallback) + public MTexture GetWithFallback(string id, MTexture fallback) }