Annotate ControlPoint
and Mod
for AOT trimming support
#28503
Merged
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.
I have a native AOT compilation project here: https://github.com/smoogipoo/osu-native-diffcalc It compiles the most minimal types from osu+osu-framework+osuTK into a project that can be used to perform difficulty calculation with.
In it, I've had to add a few workarounds for these types which use
Activator.CreateInstance()
down various paths: https://github.com/smoogipoo/osu-native-diffcalc/blob/8fb300329425e52aa078b78728ba802bb8124345/Sources/osu.Game.Native.Desktop/Program.cs#L25-L71This change should remove the need for these workarounds with very little code-wise overhead from the game itself. This is probably good practice in general though I'm not sure when we'll/if ever move towards trimming more aggressively in production.
Here's a test app:
In .csproj: