Move cast explicit operators to T4

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-26 02:56:11 +01:00
1 親 0c2b2bca35
コミット 69df02005b
27ファイル変更
+277 -357

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

-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661, IDE0290
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="double2"/> HLSL type.
/// </summary>
public partial struct Double2
{
/// <summary>
/// Casts a <see cref="Double2"/> value to a <see cref="Int2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int2(Double2 xy) => default;
/// <summary>
/// Casts a <see cref="Double2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt2(Double2 xy) => default;
/// <summary>
/// Casts a <see cref="Double2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Float2(Double2 xy) => default;
}
+21
ファイルの表示
@@ -488,6 +488,27 @@ public unsafe partial struct Double2
/// <param name="x">The value to use for the components of the new <see cref="Double2"/> instance.</param>
public static implicit operator Double2(double x) => new(x, x);
/// <summary>
/// Casts a <see cref="Double2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Float2(Double2 xy) => default;
/// <summary>
/// Casts a <see cref="Double2"/> value to a <see cref="Int2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int2(Double2 xy) => default;
/// <summary>
/// Casts a <see cref="Double2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt2(Double2 xy) => default;
/// <summary>
/// Negates a <see cref="Double2"/> value.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="double3"/> HLSL type.
/// </summary>
public partial struct Double3
{
/// <summary>
/// Casts a <see cref="Double3"/> value to a <see cref="Int3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int3(Double3 xyz) => default;
/// <summary>
/// Casts a <see cref="Double3"/> value to a <see cref="UInt3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt3(Double3 xyz) => default;
/// <summary>
/// Casts a <see cref="Double3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Float3(Double3 xyz) => default;
}
+21
ファイルの表示
@@ -1828,6 +1828,27 @@ public unsafe partial struct Double3
/// <param name="x">The value to use for the components of the new <see cref="Double3"/> instance.</param>
public static implicit operator Double3(double x) => new(x, x, x);
/// <summary>
/// Casts a <see cref="Double3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Float3(Double3 xyz) => default;
/// <summary>
/// Casts a <see cref="Double3"/> value to a <see cref="Int3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int3(Double3 xyz) => default;
/// <summary>
/// Casts a <see cref="Double3"/> value to a <see cref="UInt3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt3(Double3 xyz) => default;
/// <summary>
/// Negates a <see cref="Double3"/> value.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="double4"/> HLSL type.
/// </summary>
public partial struct Double4
{
/// <summary>
/// Casts a <see cref="Double4"/> value to a <see cref="Int4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int4(Double4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Double4"/> value to a <see cref="UInt4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt4(Double4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Double4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Float4(Double4 xyzw) => default;
}
+21
ファイルの表示
@@ -5165,6 +5165,27 @@ public unsafe partial struct Double4
/// <param name="x">The value to use for the components of the new <see cref="Double4"/> instance.</param>
public static implicit operator Double4(double x) => new(x, x, x, x);
/// <summary>
/// Casts a <see cref="Double4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Float4(Double4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Double4"/> value to a <see cref="Int4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int4(Double4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Double4"/> value to a <see cref="UInt4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt4(Double4 xyzw) => default;
/// <summary>
/// Negates a <see cref="Double4"/> value.
/// </summary>
-21
ファイルの表示
@@ -20,25 +20,4 @@ public partial struct Float2
/// </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>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double2(Float2 xy) => default;
/// <summary>
/// Casts a <see cref="Float2"/> value to a <see cref="Int2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int2(Float2 xy) => default;
/// <summary>
/// Casts a <see cref="Float2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt2(Float2 xy) => default;
}
+21
ファイルの表示
@@ -489,6 +489,27 @@ public unsafe partial struct Float2
/// <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="Double2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double2(Float2 xy) => default;
/// <summary>
/// Casts a <see cref="Float2"/> value to a <see cref="Int2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int2(Float2 xy) => default;
/// <summary>
/// Casts a <see cref="Float2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt2(Float2 xy) => default;
/// <summary>
/// Negates a <see cref="Float2"/> value.
/// </summary>
-21
ファイルの表示
@@ -20,25 +20,4 @@ public partial struct Float3
/// </summary>
/// <param name="xyz">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>
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double3(Float3 xyz) => default;
/// <summary>
/// Casts a <see cref="Float3"/> value to a <see cref="Int3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int3(Float3 xyz) => default;
/// <summary>
/// Casts a <see cref="Float3"/> value to a <see cref="UInt3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt3(Float3 xyz) => default;
}
+21
ファイルの表示
@@ -1829,6 +1829,27 @@ public unsafe partial struct Float3
/// <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="Double3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double3(Float3 xyz) => default;
/// <summary>
/// Casts a <see cref="Float3"/> value to a <see cref="Int3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int3(Float3 xyz) => default;
/// <summary>
/// Casts a <see cref="Float3"/> value to a <see cref="UInt3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt3(Float3 xyz) => default;
/// <summary>
/// Negates a <see cref="Float3"/> value.
/// </summary>
-21
ファイルの表示
@@ -20,25 +20,4 @@ public partial struct Float4
/// </summary>
/// <param name="xyzw">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>
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double4(Float4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Float4"/> value to a <see cref="Int4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int4(Float4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Float4"/> value to a <see cref="UInt4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt4(Float4 xyzw) => default;
}
+21
ファイルの表示
@@ -5166,6 +5166,27 @@ public unsafe partial struct Float4
/// <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="Double4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double4(Float4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Float4"/> value to a <see cref="Int4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int4(Float4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Float4"/> value to a <see cref="UInt4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt4(Float4 xyzw) => default;
/// <summary>
/// Negates a <see cref="Float4"/> value.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661, IDE0290
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="int2"/> HLSL type.
/// </summary>
public partial struct Int2
{
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt2(Int2 xy) => default;
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float2(Int2 xy) => default;
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="Double2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double2(Int2 xy) => default;
}
+21
ファイルの表示
@@ -489,6 +489,27 @@ public unsafe partial struct Int2
/// <param name="x">The value to use for the components of the new <see cref="Int2"/> instance.</param>
public static implicit operator Int2(int x) => new(x, x);
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float2(Int2 xy) => default;
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="Double2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double2(Int2 xy) => default;
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt2(Int2 xy) => default;
/// <summary>
/// Negates a <see cref="Int2"/> value.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="int3"/> HLSL type.
/// </summary>
public partial struct Int3
{
/// <summary>
/// Casts a <see cref="Int3"/> value to a <see cref="UInt3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt3(Int3 xyz) => default;
/// <summary>
/// Casts a <see cref="Int3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float3(Int3 xyz) => default;
/// <summary>
/// Casts a <see cref="Int3"/> value to a <see cref="Double3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double3(Int3 xyz) => default;
}
+21
ファイルの表示
@@ -1829,6 +1829,27 @@ public unsafe partial struct Int3
/// <param name="x">The value to use for the components of the new <see cref="Int3"/> instance.</param>
public static implicit operator Int3(int x) => new(x, x, x);
/// <summary>
/// Casts a <see cref="Int3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float3(Int3 xyz) => default;
/// <summary>
/// Casts a <see cref="Int3"/> value to a <see cref="Double3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double3(Int3 xyz) => default;
/// <summary>
/// Casts a <see cref="Int3"/> value to a <see cref="UInt3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt3(Int3 xyz) => default;
/// <summary>
/// Negates a <see cref="Int3"/> value.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="int4"/> HLSL type.
/// </summary>
public partial struct Int4
{
/// <summary>
/// Casts a <see cref="Int4"/> value to a <see cref="UInt4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt4(Int4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Int4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float4(Int4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Int4"/> value to a <see cref="Double4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double4(Int4 xyzw) => default;
}
+21
ファイルの表示
@@ -5166,6 +5166,27 @@ public unsafe partial struct Int4
/// <param name="x">The value to use for the components of the new <see cref="Int4"/> instance.</param>
public static implicit operator Int4(int x) => new(x, x, x, x);
/// <summary>
/// Casts a <see cref="Int4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float4(Int4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Int4"/> value to a <see cref="Double4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double4(Int4 xyzw) => default;
/// <summary>
/// Casts a <see cref="Int4"/> value to a <see cref="UInt4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator UInt4(Int4 xyzw) => default;
/// <summary>
/// Negates a <see cref="Int4"/> value.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661, IDE0290
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="uint2"/> HLSL type.
/// </summary>
public partial struct UInt2
{
/// <summary>
/// Casts a <see cref="UInt2"/> value to a <see cref="Int2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int2(UInt2 xy) => default;
/// <summary>
/// Casts a <see cref="UInt2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float2(UInt2 xy) => default;
/// <summary>
/// Casts a <see cref="UInt2"/> value to a <see cref="Double2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double2(UInt2 xy) => default;
}
+21
ファイルの表示
@@ -488,6 +488,27 @@ public unsafe partial struct UInt2
/// <param name="x">The value to use for the components of the new <see cref="UInt2"/> instance.</param>
public static implicit operator UInt2(uint x) => new(x, x);
/// <summary>
/// Casts a <see cref="UInt2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float2(UInt2 xy) => default;
/// <summary>
/// Casts a <see cref="UInt2"/> value to a <see cref="Double2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double2(UInt2 xy) => default;
/// <summary>
/// Casts a <see cref="UInt2"/> value to a <see cref="Int2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int2(UInt2 xy) => default;
/// <summary>
/// Sums two <see cref="UInt2"/> values.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="uint3"/> HLSL type.
/// </summary>
public partial struct UInt3
{
/// <summary>
/// Casts a <see cref="UInt3"/> value to a <see cref="Int3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int3(UInt3 xyz) => default;
/// <summary>
/// Casts a <see cref="UInt3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float3(UInt3 xyz) => default;
/// <summary>
/// Casts a <see cref="UInt3"/> value to a <see cref="Double3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double3(UInt3 xyz) => default;
}
+21
ファイルの表示
@@ -1828,6 +1828,27 @@ public unsafe partial struct UInt3
/// <param name="x">The value to use for the components of the new <see cref="UInt3"/> instance.</param>
public static implicit operator UInt3(uint x) => new(x, x, x);
/// <summary>
/// Casts a <see cref="UInt3"/> value to a <see cref="Float3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float3(UInt3 xyz) => default;
/// <summary>
/// Casts a <see cref="UInt3"/> value to a <see cref="Double3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double3(UInt3 xyz) => default;
/// <summary>
/// Casts a <see cref="UInt3"/> value to a <see cref="Int3"/> one.
/// </summary>
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int3(UInt3 xyz) => default;
/// <summary>
/// Sums two <see cref="UInt3"/> values.
/// </summary>
-30
ファイルの表示
@@ -1,30 +0,0 @@
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="uint4"/> HLSL type.
/// </summary>
public partial struct UInt4
{
/// <summary>
/// Casts a <see cref="UInt4"/> value to a <see cref="Int4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int4(UInt4 xyzw) => default;
/// <summary>
/// Casts a <see cref="UInt4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float4(UInt4 xyzw) => default;
/// <summary>
/// Casts a <see cref="UInt4"/> value to a <see cref="Double4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double4(UInt4 xyzw) => default;
}
+21
ファイルの表示
@@ -5165,6 +5165,27 @@ public unsafe partial struct UInt4
/// <param name="x">The value to use for the components of the new <see cref="UInt4"/> instance.</param>
public static implicit operator UInt4(uint x) => new(x, x, x, x);
/// <summary>
/// Casts a <see cref="UInt4"/> value to a <see cref="Float4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Float4(UInt4 xyzw) => default;
/// <summary>
/// Casts a <see cref="UInt4"/> value to a <see cref="Double4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static implicit operator Double4(UInt4 xyzw) => default;
/// <summary>
/// Casts a <see cref="UInt4"/> value to a <see cref="Int4"/> one.
/// </summary>
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static explicit operator Int4(UInt4 xyzw) => default;
/// <summary>
/// Sums two <see cref="UInt4"/> values.
/// </summary>
+25
ファイルの表示
@@ -264,6 +264,31 @@ public unsafe partial struct <#=typeName#>
/// <param name="x">The value to use for the components of the new <see cref="<#=typeName#>"/> instance.</param>
public static implicit operator <#=typeName#>(<#=hlslElementTypeName#> x) => new(<#=string.Join(", ", Enumerable.Range(0, i).Select(_ => "x"))#>);
<#
// Generate the cast operators, when applicable
foreach (string targetType in new[] { "Float", "Double", "Int", "UInt" })
{
if (elementTypeName != "Bool" && elementTypeName != targetType)
{
WriteLine("");
string parameterName = new string("xyzw".Take(i).ToArray());
bool isImplicit =
(elementTypeName == "Float" && targetType == "Double") ||
(elementTypeName == "Int" && targetType == "Float") ||
(elementTypeName == "Int" && targetType == "Double") ||
(elementTypeName == "UInt" && targetType == "Float") ||
(elementTypeName == "UInt" && targetType == "Double");
#>
/// <summary>
/// Casts a <see cref="<#=typeName#>"/> value to a <see cref="<#=targetType#><#=i#>"/> one.
/// </summary>
/// <param name="<#=parameterName#>">The input <see cref="<#=typeName#>"/> value to cast.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static <#=isImplicit ? "implicit" : "explicit"#> operator <#=targetType#><#=i#>(<#=typeName#> <#=parameterName#>) => default;
<#
}
}
// Generate the negation operator
if (elementTypeName != "UInt")
{
-12
ファイルの表示
@@ -31,31 +31,19 @@
<Compile Include="..\ComputeSharp.Core\Primitives\Bool\Bool3.g.cs" Link="ComputeSharp.Core\Primitives\Bool\Bool3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Bool\Bool4.g.cs" Link="ComputeSharp.Core\Primitives\Bool\Bool4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Bool\BoolMxN.g.cs" Link="ComputeSharp.Core\Primitives\Bool\BoolMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double2.cs" Link="ComputeSharp.Core\Primitives\Double\Double2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double3.cs" Link="ComputeSharp.Core\Primitives\Double\Double3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double4.cs" Link="ComputeSharp.Core\Primitives\Double\Double4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double2.g.cs" Link="ComputeSharp.Core\Primitives\Double\Double2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double3.g.cs" Link="ComputeSharp.Core\Primitives\Double\Double3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double4.g.cs" Link="ComputeSharp.Core\Primitives\Double\Double4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\DoubleMxN.g.cs" Link="ComputeSharp.Core\Primitives\Double\DoubleMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float2.cs" Link="ComputeSharp.Core\Primitives\Float\Float2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float3.cs" Link="ComputeSharp.Core\Primitives\Float\Float3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float4.cs" Link="ComputeSharp.Core\Primitives\Float\Float4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float2.g.cs" Link="ComputeSharp.Core\Primitives\Float\Float2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float3.g.cs" Link="ComputeSharp.Core\Primitives\Float\Float3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float4.g.cs" Link="ComputeSharp.Core\Primitives\Float\Float4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\FloatMxN.g.cs" Link="ComputeSharp.Core\Primitives\Float\FloatMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int2.cs" Link="ComputeSharp.Core\Primitives\Int\Int2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int3.cs" Link="ComputeSharp.Core\Primitives\Int\Int3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int4.cs" Link="ComputeSharp.Core\Primitives\Int\Int4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int2.g.cs" Link="ComputeSharp.Core\Primitives\Int\Int2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int3.g.cs" Link="ComputeSharp.Core\Primitives\Int\Int3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int4.g.cs" Link="ComputeSharp.Core\Primitives\Int\Int4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\IntMxN.g.cs" Link="ComputeSharp.Core\Primitives\Int\IntMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Internals\UndefinedData.cs" Link="ComputeSharp.Core\Primitives\Internals\UndefinedData.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt2.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt3.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt4.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt2.g.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt3.g.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt4.g.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt4.g.cs" />
-12
ファイルの表示
@@ -25,31 +25,19 @@
<Compile Include="..\ComputeSharp.Core\Primitives\Bool\Bool3.g.cs" Link="ComputeSharp.Core\Primitives\Bool\Bool3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Bool\Bool4.g.cs" Link="ComputeSharp.Core\Primitives\Bool\Bool4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Bool\BoolMxN.g.cs" Link="ComputeSharp.Core\Primitives\Bool\BoolMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double2.cs" Link="ComputeSharp.Core\Primitives\Double\Double2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double3.cs" Link="ComputeSharp.Core\Primitives\Double\Double3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double4.cs" Link="ComputeSharp.Core\Primitives\Double\Double4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double2.g.cs" Link="ComputeSharp.Core\Primitives\Double\Double2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double3.g.cs" Link="ComputeSharp.Core\Primitives\Double\Double3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\Double4.g.cs" Link="ComputeSharp.Core\Primitives\Double\Double4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Double\DoubleMxN.g.cs" Link="ComputeSharp.Core\Primitives\Double\DoubleMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float2.cs" Link="ComputeSharp.Core\Primitives\Float\Float2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float3.cs" Link="ComputeSharp.Core\Primitives\Float\Float3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float4.cs" Link="ComputeSharp.Core\Primitives\Float\Float4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float2.g.cs" Link="ComputeSharp.Core\Primitives\Float\Float2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float3.g.cs" Link="ComputeSharp.Core\Primitives\Float\Float3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\Float4.g.cs" Link="ComputeSharp.Core\Primitives\Float\Float4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Float\FloatMxN.g.cs" Link="ComputeSharp.Core\Primitives\Float\FloatMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int2.cs" Link="ComputeSharp.Core\Primitives\Int\Int2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int3.cs" Link="ComputeSharp.Core\Primitives\Int\Int3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int4.cs" Link="ComputeSharp.Core\Primitives\Int\Int4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int2.g.cs" Link="ComputeSharp.Core\Primitives\Int\Int2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int3.g.cs" Link="ComputeSharp.Core\Primitives\Int\Int3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\Int4.g.cs" Link="ComputeSharp.Core\Primitives\Int\Int4.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Int\IntMxN.g.cs" Link="ComputeSharp.Core\Primitives\Int\IntMxN.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\Internals\UndefinedData.cs" Link="ComputeSharp.Core\Primitives\Internals\UndefinedData.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt2.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt2.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt3.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt3.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt4.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt4.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt2.g.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt2.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt3.g.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt3.g.cs" />
<Compile Include="..\ComputeSharp.Core\Primitives\UInt\UInt4.g.cs" Link="ComputeSharp.Core\Primitives\UInt\UInt4.g.cs" />