Added implicit FloatN <-> VectorN conversions

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-05 18:38:02 +01:00
1 親 20762e0089
コミット 7a87cf1841
5ファイル変更
+41 -1241

検索条件に一致するファイルはありません

ファイル差分が大きすぎるため表示されません。 差分を読み込み
+13
ファイルの表示
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
@@ -142,6 +143,18 @@ namespace ComputeSharp
/// <param name="x">The value to use for the components of the new <see cref="Float2"/> instance.</param>
public static implicit operator Float2(float x) => new(x, x);
/// <summary>
/// Casts a <see cref="Float2"/> value to a <see cref="Vector2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
public static unsafe implicit operator Vector2(Float2 xy) => *(Vector2*)&xy;
/// <summary>
/// Casts a <see cref="Vector2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Vector2"/> value to cast.</param>
public static unsafe implicit operator Float2(Vector2 xy) => *(Float2*)&xy;
/// <summary>
/// Casts a <see cref="Float2"/> value to a <see cref="Double2"/> one.
/// </summary>
+13
ファイルの表示
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
@@ -563,6 +564,18 @@ namespace ComputeSharp
/// <param name="x">The value to use for the components of the new <see cref="Float3"/> instance.</param>
public static implicit operator Float3(float x) => new(x, x, x);
/// <summary>
/// Casts a <see cref="Float3"/> value to a <see cref="Vector3"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float3"/> value to cast.</param>
public static unsafe implicit operator Vector3(Float3 xyz) => *(Vector3*)&xyz;
/// <summary>
/// Casts a <see cref="Vector3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Vector3"/> value to cast.</param>
public static unsafe implicit operator Float3(Vector3 xyz) => *(Float3*)&xyz;
/// <summary>
/// Casts a <see cref="Float3"/> value to a <see cref="Double3"/> one.
/// </summary>
+13
ファイルの表示
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
@@ -3968,6 +3969,18 @@ namespace ComputeSharp
/// <param name="x">The value to use for the components of the new <see cref="Float4"/> instance.</param>
public static implicit operator Float4(float x) => new(x, x, x, x);
/// <summary>
/// Casts a <see cref="Float4"/> value to a <see cref="Vector4"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float4"/> value to cast.</param>
public static unsafe implicit operator Vector4(Float4 xyzw) => *(Vector4*)&xyzw;
/// <summary>
/// Casts a <see cref="Vector4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Vector4"/> value to cast.</param>
public static unsafe implicit operator Float4(Vector4 xyzw) => *(Float4*)&xyzw;
/// <summary>
/// Casts a <see cref="Float4"/> value to a <see cref="Double4"/> one.
/// </summary>