diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs index c450e9f8..9e78758f 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Bool2 { - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool2 TrueX => new(true, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool2 TrueY => new(false, true); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs index 5eb8866a..34d874b1 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs @@ -42,6 +42,16 @@ public unsafe partial struct Bool2 /// public static Bool2 True => true; + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool2 TrueX => new(true, false); + + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool2 TrueY => new(false, true); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs index c70622e5..8d861f35 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs @@ -7,21 +7,6 @@ namespace ComputeSharp; /// public partial struct Bool3 { - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool3 TrueX => new(true, false, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool3 TrueY => new(false, true, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool3 TrueZ => new(false, false, true); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs index 664ec6ce..43b366c4 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs @@ -45,6 +45,21 @@ public unsafe partial struct Bool3 /// public static Bool3 True => true; + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool3 TrueX => new(true, false, false); + + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool3 TrueY => new(false, true, false); + + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool3 TrueZ => new(false, false, true); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs index 08ec4fdf..050a9d0c 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs @@ -7,26 +7,6 @@ namespace ComputeSharp; /// public partial struct Bool4 { - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueX => new(true, false, false, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueY => new(false, true, false, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueZ => new(false, false, true, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueW => new(false, false, false, true); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs index 909ba0e6..13e9c565 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs @@ -48,6 +48,26 @@ public unsafe partial struct Bool4 /// public static Bool4 True => true; + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool4 TrueX => new(true, false, false, false); + + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool4 TrueY => new(false, true, false, false); + + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool4 TrueZ => new(false, false, true, false); + + /// + /// Gets a value with the component set to , and the others to . + /// + public static Bool4 TrueW => new(false, false, false, true); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double2.cs b/src/ComputeSharp.Core/Primitives/Double/Double2.cs index 24a3b6de..15bec764 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double2.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double2.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Double2 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double2 UnitY => new(0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs index ff5577d8..da4767ab 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs @@ -47,6 +47,16 @@ public unsafe partial struct Double2 /// public static Double2 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double2 UnitX => new(1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double2 UnitY => new(0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double3.cs b/src/ComputeSharp.Core/Primitives/Double/Double3.cs index bdf8b4f6..aadd36e5 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double3.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double3.cs @@ -7,21 +7,6 @@ namespace ComputeSharp; /// public partial struct Double3 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double3 UnitZ => new(0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs index 2d80bffd..1dcfc3a3 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs @@ -50,6 +50,21 @@ public unsafe partial struct Double3 /// public static Double3 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double3 UnitX => new(1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double3 UnitY => new(0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double3 UnitZ => new(0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double4.cs b/src/ComputeSharp.Core/Primitives/Double/Double4.cs index f0dc3e4f..345e51a9 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double4.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double4.cs @@ -7,26 +7,6 @@ namespace ComputeSharp; /// public partial struct Double4 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitW => new(0, 0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs index 36e83179..6aa4489a 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs @@ -53,6 +53,26 @@ public unsafe partial struct Double4 /// public static Double4 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Double4 UnitW => new(0, 0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float2.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.cs index 91cddeb4..aa9a566f 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float2.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float2.cs @@ -9,16 +9,6 @@ namespace ComputeSharp; /// public partial struct Float2 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float2 UnitY => new(0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs index 806a8f15..b6d8ddde 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs @@ -47,6 +47,16 @@ public unsafe partial struct Float2 /// public static Float2 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float2 UnitX => new(1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float2 UnitY => new(0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float3.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.cs index a40f2644..b934c43b 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float3.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float3.cs @@ -9,21 +9,6 @@ namespace ComputeSharp; /// public partial struct Float3 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float3 UnitZ => new(0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs index 044e1461..2ae26205 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs @@ -50,6 +50,21 @@ public unsafe partial struct Float3 /// public static Float3 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float3 UnitX => new(1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float3 UnitY => new(0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float3 UnitZ => new(0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float4.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.cs index c9eeb82a..8796eda4 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float4.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float4.cs @@ -9,26 +9,6 @@ namespace ComputeSharp; /// public partial struct Float4 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitW => new(0, 0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs index bc7cf39e..4f079788 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs @@ -53,6 +53,26 @@ public unsafe partial struct Float4 /// public static Float4 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Float4 UnitW => new(0, 0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int2.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.cs index 63779ad1..2093f902 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int2.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int2.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Int2 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int2 UnitY => new(0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs index daee20be..ee4096bb 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs @@ -47,6 +47,16 @@ public unsafe partial struct Int2 /// public static Int2 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int2 UnitX => new(1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int2 UnitY => new(0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int3.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.cs index f79f2076..cdfd9641 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.cs @@ -7,21 +7,6 @@ namespace ComputeSharp; /// public partial struct Int3 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int3 UnitZ => new(0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs index 3b6daff4..c4dce83c 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs @@ -50,6 +50,21 @@ public unsafe partial struct Int3 /// public static Int3 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int3 UnitX => new(1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int3 UnitY => new(0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int3 UnitZ => new(0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int4.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.cs index 663cbd39..d5f44c49 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.cs @@ -7,26 +7,6 @@ namespace ComputeSharp; /// public partial struct Int4 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitW => new(0, 0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs index f2f80023..fd0e40c1 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs @@ -53,6 +53,26 @@ public unsafe partial struct Int4 /// public static Int4 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static Int4 UnitW => new(0, 0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs index d86c2177..782624e7 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct UInt2 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt2 UnitY => new(0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs index 5d5835ff..e3ab439d 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs @@ -47,6 +47,16 @@ public unsafe partial struct UInt2 /// public static UInt2 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt2 UnitX => new(1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt2 UnitY => new(0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs index 959d2a32..88fab923 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs @@ -7,21 +7,6 @@ namespace ComputeSharp; /// public partial struct UInt3 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt3 UnitZ => new(0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs index c393c643..e7afaa1d 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs @@ -50,6 +50,21 @@ public unsafe partial struct UInt3 /// public static UInt3 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitX => new(1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitY => new(0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitZ => new(0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs index 1d5cd634..3be7d78d 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs @@ -7,26 +7,6 @@ namespace ComputeSharp; /// public partial struct UInt4 { - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitW => new(0, 0, 0, 1); - /// /// Creates a new instance with the specified parameters. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs index fa9f91bb..4ef9a6cf 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs @@ -53,6 +53,26 @@ public unsafe partial struct UInt4 /// public static UInt4 One => 1; + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets a value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitW => new(0, 0, 0, 1); + /// /// Gets a reference to the value representing the X component. /// diff --git a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude index 9c4192b2..8f52a8e0 100644 --- a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude @@ -140,6 +140,40 @@ public unsafe partial struct <#=typeName#> <# } + string unitName, unitOne, unitZero, unitOneXmlName, unitZeroXmlName; + + if (elementTypeName == "Bool") + { + unitName = "True"; + unitOne = "true"; + unitZero = "false"; + unitOneXmlName = ""; + unitZeroXmlName = ""; + } + else + { + unitName = "Unit"; + unitOne = "1"; + unitZero = "0"; + unitOneXmlName = "1"; + unitZeroXmlName = "0"; + } + + // Generate the True and Unit properties + for (int j = 0; j < i; j++) + { + string unitComponentName = ("XYZW"[j]).ToString(); + string[] unitArguments = Enumerable.Range(0, i).Select(x => x == j ? unitOne : unitZero).ToArray(); + string unitArgumentExpression = string.Join(", ", unitArguments); +#> + + /// + /// Gets a value with the component set to <#=unitOneXmlName#>, and the others to <#=unitZeroXmlName#>. + /// + public static <#=typeName#> <#=unitName#><#=unitComponentName#> => new(<#=unitArgumentExpression#>); +<# + } + PushIndent(" "); // Generate the combinatorial swizzling properties