- Notifications
You must be signed in to change notification settings - Fork5.2k
Change Vector2/3/4, Quaternion, Plane, Vector<T>, and Vector64/128/256/512<T> to be implemented in managed where trivially possible#102301
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
603dc39c4bef1f10c5dfdbcd892669b9d08d93b6212514560c9938453eae1a66c6d71e4dae1fcFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -12,14 +12,26 @@ public static unsafe partial class Vector | ||
| /// <summary>Reinterprets a <see cref="Vector4" /> as a new <see cref="Plane" />.</summary> | ||
| /// <param name="value">The vector to reinterpret.</param> | ||
| /// <returns><paramref name="value" /> reinterpreted as a new <see cref="Plane" />.</returns> | ||
| internal static Plane AsPlane(this Vector4 value) | ||
| { | ||
| #if MONO | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is this perf problem or functionality problem? Either way, it is likely going to be fixed as side-effect of#102988 . MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Possibly a functionality problem that I've not dug into yet. The previous tested commit had seen some failures related to Quaternion/Vector4/Plane and their equality tests, but only on Mono. My current guess is that there's something subtly incorrect in the Mono handling that breaks for SIMD here and it will need a fix before BitCast can be used, but I'd like to try and ensure CoreCLR is clean without regressions before I do any more in depth Mono changes. | ||
| return Unsafe.As<Vector4, Plane>(ref value); | ||
| #else | ||
| return Unsafe.BitCast<Vector4, Plane>(value); | ||
| #endif | ||
| } | ||
| /// <summary>Reinterprets a <see cref="Vector4" /> as a new <see cref="Quaternion" />.</summary> | ||
| /// <param name="value">The vector to reinterpret.</param> | ||
| /// <returns><paramref name="value" /> reinterpreted as a new <see cref="Quaternion" />.</returns> | ||
| internal static Quaternion AsQuaternion(this Vector4 value) | ||
| { | ||
| #if MONO | ||
| return Unsafe.As<Vector4, Quaternion>(ref value); | ||
| #else | ||
| return Unsafe.BitCast<Vector4, Quaternion>(value); | ||
| #endif | ||
| } | ||
| /// <summary>Gets the element at the specified index.</summary> | ||
| /// <param name="vector">The vector to get the element from.</param> | ||