Marking Matrix3x2, Matrix4x4, Plane, and Quaternion as Intrinsic (#41829)
authorTanner Gooding <tagoo@outlook.com>
Fri, 4 Sep 2020 18:40:52 +0000 (11:40 -0700)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 18:40:52 +0000 (11:40 -0700)
src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix3x2.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Plane.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Quaternion.cs

index 5f65ddd3fd00afdf29dfeff22d70434ab4f54f07..a70b3d776c2a1b69080a19fa6737f58741709de5 100644 (file)
@@ -2,12 +2,14 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Globalization;
+using System.Runtime.CompilerServices;
 
 namespace System.Numerics
 {
     /// <summary>
     /// A structure encapsulating a 3x2 matrix.
     /// </summary>
+    [Intrinsic]
     public struct Matrix3x2 : IEquatable<Matrix3x2>
     {
         private const float RotationEpsilon = 0.001f * MathF.PI / 180f;     // 0.1% of a degree
index d009951583d8e66959b80607ae3362095c7aef19..cfd16ad73e7b59858bd7f7dd47a0e871b3609de6 100644 (file)
@@ -14,7 +14,7 @@ namespace System.Numerics
     /// <summary>
     /// A structure encapsulating a 4x4 matrix.
     /// </summary>
-    [StructLayout(LayoutKind.Sequential)]
+    [Intrinsic]
     public struct Matrix4x4 : IEquatable<Matrix4x4>
     {
         private const float BillboardEpsilon = 1e-4f;
index f03d5698efe896ffba5819be607e9e42077bfcab..631f6da2cef89af098cce5ade116a95f45857c2e 100644 (file)
@@ -9,6 +9,7 @@ namespace System.Numerics
     /// <summary>
     /// A structure encapsulating a 3D Plane
     /// </summary>
+    [Intrinsic]
     public struct Plane : IEquatable<Plane>
     {
         private const float NormalizeEpsilon = 1.192092896e-07f; // smallest such that 1.0+NormalizeEpsilon != 1.0
index 34e06ac7311ca357af70530c305b7f8a1521f2e0..b7a5bc39765506a0f38556d46104fa9f792ca0c6 100644 (file)
@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 
 using System.Globalization;
+using System.Runtime.CompilerServices;
 
 namespace System.Numerics
 {
@@ -9,6 +10,7 @@ namespace System.Numerics
     /// A structure encapsulating a four-dimensional vector (x,y,z,w),
     /// which is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where w = cos(theta/2).
     /// </summary>
+    [Intrinsic]
     public struct Quaternion : IEquatable<Quaternion>
     {
         private const float SlerpEpsilon = 1e-6f;