Skip to content

Switch all vector/quaternions to System.Numerics#6699

Open
stanriders wants to merge 6 commits intoppy:masterfrom
stanriders:switch-to-numerics-vectors
Open

Switch all vector/quaternions to System.Numerics#6699
stanriders wants to merge 6 commits intoppy:masterfrom
stanriders:switch-to-numerics-vectors

Conversation

@stanriders
Copy link
Copy Markdown
Member

Part of the #2448

This changes all usages of Vector2, Vector3, Vector4 and Quaternion from osuTK to System.Numerics.
Matrices were left as is because they require way more involved changes (column- vs row-major) and this PR is already quite massive.

Changes were split into several commits:

  • 0ac5ca4 and 6deb069 are simple find-and-replace using osuTK->using System.Numerics
  • 45b6266 is a direct port of missing opentk's vector/quaternion functions to extensions
  • 44ce95a are changes where the logic doesn't change, but the syntax does (mostly usage of new extensions instead of built-in functions)
  • 668a172 the commit that's actually worth looking into - changes that can potentially be changing the behavior, mostly just related to vectors ref usage. Those should still be fine unless I missed some hidden pitfalls which is the reason for the separate commit

I've ran all tests (framework and game side) with no issues, as well as a couple of benchmarks and the game itself - everything seems to be working so far. Performance seems to be the same which is expected - while Numerics can use SIMD they prefer doing it only for workloads that are alignable - which are mostly Vector4's (barely being used) and matrices (didn't change)

This PR is missing mobile platforms for now - I'll go through them if this PR is considered worth merging

Game-side branch: https://github.com/stanriders/osu/tree/switch-to-numerics-vectors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant