Merge pull request #740 from Sergio0694/dev/ctor-permutations2

Add all combinatorial constructors for HLSL vector types
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2023-12-25 22:48:00 +00:00
コミット 0e2f83d336
34ファイル変更
+2384 -652

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

-11
ファイルの表示
@@ -7,17 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Bool2
{
/// <summary>
/// Creates a new <see cref="Bool2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Bool2(bool x, bool y)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool2"/> value with the same value for all its components.
/// </summary>
+11
ファイルの表示
@@ -17,6 +17,17 @@ public unsafe partial struct Bool2
[FieldOffset(4)]
private int y;
/// <summary>
/// Creates a new <see cref="Bool2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Bool2(bool x, bool y)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Bool2"/> instance.
/// </summary>
-37
ファイルの表示
@@ -7,43 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Bool3
{
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(bool x, bool y, bool z)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(Bool2 xy, bool z)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the second and thirt vector components.</param>
public Bool3(bool x, Bool2 yz)
{
this.x = x ? 1 : 0;
this.y = yz.X ? 1 : 0;
this.z = yz.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> value with the same value for all its components.
/// </summary>
+85
ファイルの表示
@@ -20,6 +20,91 @@ public unsafe partial struct Bool3
[FieldOffset(8)]
private int z;
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(bool x, bool y, bool z)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(Bool2 xy, bool z)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(Bool1x2 xy, bool z)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M12 ? 1 : 0;
this.z = z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(Bool2x1 xy, bool z)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M21 ? 1 : 0;
this.z = z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Bool3(bool x, Bool2 yz)
{
this.x = x ? 1 : 0;
this.y = yz.X ? 1 : 0;
this.z = yz.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Bool3(bool x, Bool1x2 yz)
{
this.x = x ? 1 : 0;
this.y = yz.M11 ? 1 : 0;
this.z = yz.M12 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Bool3(bool x, Bool2x1 yz)
{
this.x = x ? 1 : 0;
this.y = yz.M11 ? 1 : 0;
this.z = yz.M21 ? 1 : 0;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Bool3"/> instance.
/// </summary>
-82
ファイルの表示
@@ -7,88 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Bool4
{
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(bool x, bool y, bool z, bool w)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool2 xy, bool z, bool w)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Bool4(bool x, bool y, Bool2 zw)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = zw.X ? 1 : 0;
this.w = zw.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Bool4(Bool2 xy, Bool2 zw)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = zw.X ? 1 : 0;
this.w = zw.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool3 xyz, bool w)
{
this.x = xyz.X ? 1 : 0;
this.y = xyz.Y ? 1 : 0;
this.z = xyz.Z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the second, third and fourth vector components.</param>
public Bool4(bool x, Bool3 yzw)
{
this.x = x ? 1 : 0;
this.y = yzw.X ? 1 : 0;
this.z = yzw.Y ? 1 : 0;
this.w = yzw.Z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> value with the same value for all its components.
/// </summary>
+336
ファイルの表示
@@ -23,6 +23,342 @@ public unsafe partial struct Bool4
[FieldOffset(12)]
private int w;
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(bool x, bool y, bool z, bool w)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool2 xy, bool z, bool w)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool1x2 xy, bool z, bool w)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M12 ? 1 : 0;
this.z = z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool2x1 xy, bool z, bool w)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M21 ? 1 : 0;
this.z = z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(bool x, Bool2 yz, bool w)
{
this.x = x ? 1 : 0;
this.y = yz.X ? 1 : 0;
this.z = yz.Y ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(bool x, Bool1x2 yz, bool w)
{
this.x = x ? 1 : 0;
this.y = yz.M11 ? 1 : 0;
this.z = yz.M12 ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(bool x, Bool2x1 yz, bool w)
{
this.x = x ? 1 : 0;
this.y = yz.M11 ? 1 : 0;
this.z = yz.M21 ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(bool x, bool y, Bool2 zw)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = zw.X ? 1 : 0;
this.w = zw.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(bool x, bool y, Bool1x2 zw)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M12 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(bool x, bool y, Bool2x1 zw)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M21 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool2 xy, Bool2 zw)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = zw.X ? 1 : 0;
this.w = zw.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool2 xy, Bool1x2 zw)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M12 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool2 xy, Bool2x1 zw)
{
this.x = xy.X ? 1 : 0;
this.y = xy.Y ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M21 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool1x2 xy, Bool2 zw)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M12 ? 1 : 0;
this.z = zw.X ? 1 : 0;
this.w = zw.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool1x2 xy, Bool1x2 zw)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M12 ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M12 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool1x2 xy, Bool2x1 zw)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M12 ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M21 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool2x1 xy, Bool2 zw)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M21 ? 1 : 0;
this.z = zw.X ? 1 : 0;
this.w = zw.Y ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool2x1 xy, Bool1x2 zw)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M21 ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M12 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(Bool2x1 xy, Bool2x1 zw)
{
this.x = xy.M11 ? 1 : 0;
this.y = xy.M21 ? 1 : 0;
this.z = zw.M11 ? 1 : 0;
this.w = zw.M21 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool3 xyz, bool w)
{
this.x = xyz.X ? 1 : 0;
this.y = xyz.Y ? 1 : 0;
this.z = xyz.Z ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool1x3 xyz, bool w)
{
this.x = xyz.M11 ? 1 : 0;
this.y = xyz.M12 ? 1 : 0;
this.z = xyz.M13 ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(Bool3x1 xyz, bool w)
{
this.x = xyz.M11 ? 1 : 0;
this.y = xyz.M21 ? 1 : 0;
this.z = xyz.M31 ? 1 : 0;
this.w = w ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(bool x, Bool3 yzw)
{
this.x = x ? 1 : 0;
this.y = yzw.X ? 1 : 0;
this.z = yzw.Y ? 1 : 0;
this.w = yzw.Z ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(bool x, Bool1x3 yzw)
{
this.x = x ? 1 : 0;
this.y = yzw.M11 ? 1 : 0;
this.z = yzw.M12 ? 1 : 0;
this.w = yzw.M13 ? 1 : 0;
}
/// <summary>
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Bool4(bool x, Bool3x1 yzw)
{
this.x = x ? 1 : 0;
this.y = yzw.M11 ? 1 : 0;
this.z = yzw.M21 ? 1 : 0;
this.w = yzw.M31 ? 1 : 0;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Bool4"/> instance.
/// </summary>
-11
ファイルの表示
@@ -7,17 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Double2
{
/// <summary>
/// Creates a new <see cref="Double2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Double2(double x, double y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Creates a new <see cref="Double2"/> value with the same value for all its components.
/// </summary>
+11
ファイルの表示
@@ -19,6 +19,17 @@ public unsafe partial struct Double2
[FieldOffset(8)]
private double y;
/// <summary>
/// Creates a new <see cref="Double2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Double2(double x, double y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Double2"/> instance.
/// </summary>
-37
ファイルの表示
@@ -7,43 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Double3
{
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(double x, double y, double z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(Double2 xy, double z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the second and thirt vector components.</param>
public Double3(double x, Double2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="Double3"/> value with the same value for all its components.
/// </summary>
+85
ファイルの表示
@@ -22,6 +22,91 @@ public unsafe partial struct Double3
[FieldOffset(16)]
private double z;
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(double x, double y, double z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(Double2 xy, double z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(Double1x2 xy, double z)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(Double2x1 xy, double z)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Double3(double x, Double2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Double3(double x, Double1x2 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
}
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Double3(double x, Double2x1 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Double3"/> instance.
/// </summary>
-82
ファイルの表示
@@ -7,88 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Double4
{
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(double x, double y, double z, double w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double2 xy, double z, double w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Double4(double x, double y, Double2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Double4(Double2 xy, Double2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double3 xyz, double w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the second, third and fourth vector components.</param>
public Double4(double x, Double3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="Double4"/> value with the same value for all its components.
/// </summary>
+336
ファイルの表示
@@ -25,6 +25,342 @@ public unsafe partial struct Double4
[FieldOffset(24)]
private double w;
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(double x, double y, double z, double w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double2 xy, double z, double w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double1x2 xy, double z, double w)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double2x1 xy, double z, double w)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(double x, Double2 yz, double w)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(double x, Double1x2 yz, double w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(double x, Double2x1 yz, double w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(double x, double y, Double2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(double x, double y, Double1x2 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(double x, double y, Double2x1 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double2 xy, Double2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double2 xy, Double1x2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double2 xy, Double2x1 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double1x2 xy, Double2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double1x2 xy, Double1x2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double1x2 xy, Double2x1 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double2x1 xy, Double2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double2x1 xy, Double1x2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(Double2x1 xy, Double2x1 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double3 xyz, double w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double1x3 xyz, double w)
{
this.x = xyz.M11;
this.y = xyz.M12;
this.z = xyz.M13;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(Double3x1 xyz, double w)
{
this.x = xyz.M11;
this.y = xyz.M21;
this.z = xyz.M31;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(double x, Double3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(double x, Double1x3 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M12;
this.w = yzw.M13;
}
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Double4(double x, Double3x1 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M21;
this.w = yzw.M31;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Double4"/> instance.
/// </summary>
-11
ファイルの表示
@@ -9,17 +9,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Float2
{
/// <summary>
/// Creates a new <see cref="Float2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Float2(float x, float y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Creates a new <see cref="Float2"/> value with the same value for all its components.
/// </summary>
+11
ファイルの表示
@@ -20,6 +20,17 @@ public unsafe partial struct Float2
[FieldOffset(4)]
private float y;
/// <summary>
/// Creates a new <see cref="Float2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Float2(float x, float y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float2"/> instance.
/// </summary>
-37
ファイルの表示
@@ -9,43 +9,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Float3
{
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(Float2 xy, float z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the second and thirt vector components.</param>
public Float3(float x, Float2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="Float3"/> value with the same value for all its components.
/// </summary>
+85
ファイルの表示
@@ -23,6 +23,91 @@ public unsafe partial struct Float3
[FieldOffset(8)]
private float z;
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(Float2 xy, float z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(Float1x2 xy, float z)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(Float2x1 xy, float z)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Float3(float x, Float2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Float3(float x, Float1x2 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
}
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Float3(float x, Float2x1 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float3"/> instance.
/// </summary>
-82
ファイルの表示
@@ -9,88 +9,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Float4
{
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(float x, float y, float z, float w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float2 xy, float z, float w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Float4(float x, float y, Float2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Float4(Float2 xy, Float2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float3 xyz, float w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the second, third and fourth vector components.</param>
public Float4(float x, Float3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="Float4"/> value with the same value for all its components.
/// </summary>
+336
ファイルの表示
@@ -26,6 +26,342 @@ public unsafe partial struct Float4
[FieldOffset(12)]
private float w;
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(float x, float y, float z, float w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float2 xy, float z, float w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float1x2 xy, float z, float w)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float2x1 xy, float z, float w)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(float x, Float2 yz, float w)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(float x, Float1x2 yz, float w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(float x, Float2x1 yz, float w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(float x, float y, Float2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(float x, float y, Float1x2 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(float x, float y, Float2x1 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float2 xy, Float2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float2 xy, Float1x2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float2 xy, Float2x1 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float1x2 xy, Float2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float1x2 xy, Float1x2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float1x2 xy, Float2x1 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float2x1 xy, Float2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float2x1 xy, Float1x2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(Float2x1 xy, Float2x1 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float3 xyz, float w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float1x3 xyz, float w)
{
this.x = xyz.M11;
this.y = xyz.M12;
this.z = xyz.M13;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(Float3x1 xyz, float w)
{
this.x = xyz.M11;
this.y = xyz.M21;
this.z = xyz.M31;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(float x, Float3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(float x, Float1x3 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M12;
this.w = yzw.M13;
}
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Float4(float x, Float3x1 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M21;
this.w = yzw.M31;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float4"/> instance.
/// </summary>
-11
ファイルの表示
@@ -7,17 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Int2
{
/// <summary>
/// Creates a new <see cref="Int2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Int2(int x, int y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Creates a new <see cref="Int2"/> value with the same value for all its components.
/// </summary>
+11
ファイルの表示
@@ -20,6 +20,17 @@ public unsafe partial struct Int2
[FieldOffset(4)]
private int y;
/// <summary>
/// Creates a new <see cref="Int2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public Int2(int x, int y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Int2"/> instance.
/// </summary>
-37
ファイルの表示
@@ -7,43 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Int3
{
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(Int2 xy, int z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the second and thirt vector components.</param>
public Int3(int x, Int2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="Int3"/> value with the same value for all its components.
/// </summary>
+85
ファイルの表示
@@ -23,6 +23,91 @@ public unsafe partial struct Int3
[FieldOffset(8)]
private int z;
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(Int2 xy, int z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(Int1x2 xy, int z)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(Int2x1 xy, int z)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Int3(int x, Int2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Int3(int x, Int1x2 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
}
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public Int3(int x, Int2x1 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Int3"/> instance.
/// </summary>
-82
ファイルの表示
@@ -7,88 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct Int4
{
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(int x, int y, int z, int w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int2 xy, int z, int w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Int4(int x, int y, Int2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public Int4(Int2 xy, Int2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int3 xyz, int w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the second, third and fourth vector components.</param>
public Int4(int x, Int3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="Int4"/> value with the same value for all its components.
/// </summary>
+336
ファイルの表示
@@ -26,6 +26,342 @@ public unsafe partial struct Int4
[FieldOffset(12)]
private int w;
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(int x, int y, int z, int w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int2 xy, int z, int w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int1x2 xy, int z, int w)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int2x1 xy, int z, int w)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(int x, Int2 yz, int w)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(int x, Int1x2 yz, int w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(int x, Int2x1 yz, int w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(int x, int y, Int2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(int x, int y, Int1x2 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(int x, int y, Int2x1 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int2 xy, Int2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int2 xy, Int1x2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int2 xy, Int2x1 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int1x2 xy, Int2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int1x2 xy, Int1x2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int1x2 xy, Int2x1 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int2x1 xy, Int2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int2x1 xy, Int1x2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(Int2x1 xy, Int2x1 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int3 xyz, int w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int1x3 xyz, int w)
{
this.x = xyz.M11;
this.y = xyz.M12;
this.z = xyz.M13;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(Int3x1 xyz, int w)
{
this.x = xyz.M11;
this.y = xyz.M21;
this.z = xyz.M31;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(int x, Int3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(int x, Int1x3 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M12;
this.w = yzw.M13;
}
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public Int4(int x, Int3x1 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M21;
this.w = yzw.M31;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Int4"/> instance.
/// </summary>
+1 -1
ファイルの表示
@@ -1,8 +1,8 @@
<#@include file="..\Intrinsics\Hlsl.MulOverloads.ttinclude" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".g.cs"#>
<#
// Generates all matrix members and types for a given HLSL type
-11
ファイルの表示
@@ -7,17 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct UInt2
{
/// <summary>
/// Creates a new <see cref="UInt2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public UInt2(uint x, uint y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Creates a new <see cref="UInt2"/> value with the same value for all its components.
/// </summary>
+11
ファイルの表示
@@ -19,6 +19,17 @@ public unsafe partial struct UInt2
[FieldOffset(4)]
private uint y;
/// <summary>
/// Creates a new <see cref="UInt2"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
public UInt2(uint x, uint y)
{
this.x = x;
this.y = y;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="UInt2"/> instance.
/// </summary>
-37
ファイルの表示
@@ -7,43 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct UInt3
{
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(uint x, uint y, uint z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(UInt2 xy, uint z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the second and thirt vector components.</param>
public UInt3(uint x, UInt2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> value with the same value for all its components.
/// </summary>
+85
ファイルの表示
@@ -22,6 +22,91 @@ public unsafe partial struct UInt3
[FieldOffset(8)]
private uint z;
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(uint x, uint y, uint z)
{
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(UInt2 xy, uint z)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(UInt1x2 xy, uint z)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(UInt2x1 xy, uint z)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public UInt3(uint x, UInt2 yz)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public UInt3(uint x, UInt1x2 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
}
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
public UInt3(uint x, UInt2x1 yz)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="UInt3"/> instance.
/// </summary>
-82
ファイルの表示
@@ -7,88 +7,6 @@ namespace ComputeSharp;
/// </summary>
public partial struct UInt4
{
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(uint x, uint y, uint z, uint w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt2 xy, uint z, uint w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public UInt4(uint x, uint y, UInt2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the third and fourth vector components.</param>
public UInt4(UInt2 xy, UInt2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt3 xyz, uint w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the second, third and fourth vector components.</param>
public UInt4(uint x, UInt3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> value with the same value for all its components.
/// </summary>
+336
ファイルの表示
@@ -25,6 +25,342 @@ public unsafe partial struct UInt4
[FieldOffset(12)]
private uint w;
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(uint x, uint y, uint z, uint w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt2 xy, uint z, uint w)
{
this.x = xy.X;
this.y = xy.Y;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt1x2 xy, uint z, uint w)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="z">The value to assign to the third vector component.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt2x1 xy, uint z, uint w)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(uint x, UInt2 yz, uint w)
{
this.x = x;
this.y = yz.X;
this.z = yz.Y;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(uint x, UInt1x2 yz, uint w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M12;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(uint x, UInt2x1 yz, uint w)
{
this.x = x;
this.y = yz.M11;
this.z = yz.M21;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(uint x, uint y, UInt2 zw)
{
this.x = x;
this.y = y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(uint x, uint y, UInt1x2 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="y">The value to assign to the second vector component.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(uint x, uint y, UInt2x1 zw)
{
this.x = x;
this.y = y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt2 xy, UInt2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt2 xy, UInt1x2 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt2 xy, UInt2x1 zw)
{
this.x = xy.X;
this.y = xy.Y;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt1x2 xy, UInt2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt1x2 xy, UInt1x2 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt1x2 xy, UInt2x1 zw)
{
this.x = xy.M11;
this.y = xy.M12;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt2x1 xy, UInt2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.X;
this.w = zw.Y;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt2x1 xy, UInt1x2 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M12;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xy">The value to assign to the first and second vector components.</param>
/// <param name="zw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(UInt2x1 xy, UInt2x1 zw)
{
this.x = xy.M11;
this.y = xy.M21;
this.z = zw.M11;
this.w = zw.M21;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt3 xyz, uint w)
{
this.x = xyz.X;
this.y = xyz.Y;
this.z = xyz.Z;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt1x3 xyz, uint w)
{
this.x = xyz.M11;
this.y = xyz.M12;
this.z = xyz.M13;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="xyz">The value to assign to the first, second and third vector components.</param>
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(UInt3x1 xyz, uint w)
{
this.x = xyz.M11;
this.y = xyz.M21;
this.z = xyz.M31;
this.w = w;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(uint x, UInt3 yzw)
{
this.x = x;
this.y = yzw.X;
this.z = yzw.Y;
this.w = yzw.Z;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(uint x, UInt1x3 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M12;
this.w = yzw.M13;
}
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
/// </summary>
/// <param name="x">The value to assign to the first vector component.</param>
/// <param name="yzw">The value to assign to the first, second, third and fourth vector components.</param>
public UInt4(uint x, UInt3x1 yzw)
{
this.x = x;
this.y = yzw.M11;
this.z = yzw.M21;
this.w = yzw.M31;
}
/// <summary>
/// Gets a reference to a specific component in the current <see cref="UInt4"/> instance.
/// </summary>
+186
ファイルの表示
@@ -0,0 +1,186 @@
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#
// Enumerates all combinations of values that sum up to a given size.
// This method is only supported for valid sizes for HLSL vector types.
string[][] GetConstructorParameterCombinations(int size)
{
switch (size)
{
case 2:
return new[] { new[] { "T", "T" } };
case 3:
return new[]
{
new[] { "T", "T", "T" },
new[] { "T2", "T" },
new[] { "T1x2", "T" },
new[] { "T2x1", "T" },
new[] { "T", "T2" },
new[] { "T", "T1x2" },
new[] { "T", "T2x1" }
};
case 4:
return new[]
{
new[] { "T", "T", "T", "T" },
new[] { "T2", "T", "T" },
new[] { "T1x2", "T", "T" },
new[] { "T2x1", "T", "T" },
new[] { "T", "T2", "T" },
new[] { "T", "T1x2", "T" },
new[] { "T", "T2x1", "T" },
new[] { "T", "T", "T2" },
new[] { "T", "T", "T1x2" },
new[] { "T", "T", "T2x1" },
new[] { "T2", "T2" },
new[] { "T2", "T1x2" },
new[] { "T2", "T2x1" },
new[] { "T1x2", "T2" },
new[] { "T1x2", "T1x2" },
new[] { "T1x2", "T2x1" },
new[] { "T2x1", "T2" },
new[] { "T2x1", "T1x2" },
new[] { "T2x1", "T2x1" },
new[] { "T3", "T" },
new[] { "T1x3", "T" },
new[] { "T3x1", "T" },
new[] { "T", "T3" },
new[] { "T", "T1x3" },
new[] { "T", "T3x1" }
};
default:
throw new ArgumentOutOfRangeException("size");
}
}
// Gets the size of the parameters for a given constructor
int[] GetConstructorParameterSizes(string[] parameters)
{
return parameters.Select(p =>
{
if (p == "T3" || p == "T1x3" || p == "T3x1") return 3;
if (p == "T2" || p == "T1x2" || p == "T2x1") return 2;
return 1;
}).ToArray();
}
// Gets the sequence of constructor parameter names for a given sequence of sizes
string[] GetConstructorParameterNames(int[] parameterSizes)
{
List<string> parameterNames = new List<string>();
int offset = 0;
foreach (int parameterSize in parameterSizes)
{
parameterNames.Add("xyzw".Substring(offset, parameterSize));
offset += parameterSize;
}
return parameterNames.ToArray();
}
// Get the ordinal name for a given index
string GetOrdinalName(int index)
{
switch (index)
{
case 0: return "first";
case 1: return "second";
case 2: return "third";
default: return "fourth";
}
}
// Generates all constructor declarations for a specified type
void GenerateConstructors(string typeName, int elementSize)
{
string elementTypeName = Regex.Match(typeName, @"^[A-Za-z]+").Value;
string hlslElementTypeName = elementTypeName.ToLower();
foreach (string[] parameters in GetConstructorParameterCombinations(elementSize))
{
int[] parameterSizes = GetConstructorParameterSizes(parameters);
string[] parameterNames = GetConstructorParameterNames(parameterSizes);
WriteLine("/// <summary>");
WriteLine($"/// Creates a new <see cref=\"{typeName}\"/> instance with the specified parameters.");
WriteLine("/// </summary>");
int inputOffset = 0;
// Declare all constructor parameters
foreach (string parameterName in parameterNames)
{
if (parameterName.Length == 1)
{
WriteLine($"/// <param name=\"{parameterName}\">The value to assign to the {GetOrdinalName(inputOffset)} vector component.</param>");
}
else
{
string ordinals = string.Join(", ", Enumerable.Range(0, inputOffset + parameterName.Length - 1).Select(GetOrdinalName));
ordinals += $" and {GetOrdinalName(inputOffset + parameterName.Length - 1)}";
WriteLine($"/// <param name=\"{parameterName}\">The value to assign to the {ordinals} vector components.</param>");
}
inputOffset += parameterName.Length;
}
Write($"public {typeName}(");
// Write all the declared parameters for the current constructor
Write(string.Join(", ", parameterNames.Select((name, index) =>
{
return name.Length == 1
? $"{hlslElementTypeName} {name}"
: $"{parameters[index].Replace("T", elementTypeName)} {name}";
})));
WriteLine(")");
WriteLine("{");
PushIndent(" ");
inputOffset = 0;
// Write all constructor statements
for (int i = 0; i < parameterSizes.Length; i++)
{
for (int j = 0; j < parameterSizes[i]; j++)
{
Write($"this.{"xyzw"[inputOffset++]} = ");
string expression;
if (parameters[i].EndsWith("x1"))
{
expression = $"{parameterNames[i]}.M{j + 1}1";
}
else if (parameters[i].Contains('x'))
{
expression = $"{parameterNames[i]}.M1{j + 1}";
}
else if (parameterSizes[i] > 1)
{
expression = $"{parameterNames[i]}.{char.ToUpperInvariant("xyzw"[j])}";
}
else
{
expression = $"{parameterNames[i]}";
}
WriteLine(typeName.StartsWith("Bool")
? $"{expression} ? 1 : 0;"
: $"{expression};");
}
}
PopIndent();
WriteLine("}");
WriteLine("");
}
}
#>
+5 -1
ファイルの表示
@@ -1,8 +1,9 @@
<#@include file="..\Intrinsics\Hlsl.MulOverloads.ttinclude" #>
<#@include file="VectorType.Ctors.ttinclude" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".g.cs"#>
<#
IEnumerable<string> EnumeratePropertyNames(string characters)
@@ -96,6 +97,9 @@ public unsafe partial struct <#=typeName#>
WriteLine("");
}
// Generate the constructors
GenerateConstructors(typeName, i);
PopIndent();
#>
/// <summary>
+32
ファイルの表示
@@ -1242,6 +1242,38 @@ namespace ComputeSharp.Tests
this.buffer[ThreadIds.X] = new float4(data.value, data.value, data.value, this.alpha);
}
}
// See https://github.com/Sergio0694/ComputeSharp/issues/435
[TestMethod]
public void HlslVectorTypeConstructorCombinations()
{
_ = ReflectionServices.GetShaderInfo<HlslVectorTypeConstructorCombinationsShader>();
}
[AutoConstructor]
[ThreadGroupSize(DefaultThreadGroupSizes.X)]
[GeneratedComputeShaderDescriptor]
public readonly partial struct HlslVectorTypeConstructorCombinationsShader : IComputeShader
{
public readonly ReadWriteBuffer<float> buffer;
public readonly float2 f2;
public readonly int4 i4;
public readonly int2 i2;
public readonly int3 i3;
public void Execute()
{
float3 f3 = new float3(f2, 0) + new float3(0, f2);
float4 f4 = new float4(0, f3) + new float4(0, f2, 1) + new float4(0, 1, f2) + new float4((float1x3)f3, 0);
int4 temp = new int4(i2, 0, 1) + new int4(new int3x1(i3.X, i3.Y, i3.Z), 0);
// Just here to avoid warnings, this shader doesn't really have to do anything
buffer[0] = f3[0];
buffer[1] = f4[1];
buffer[2] = temp[0];
}
}
}
}