From f5c4e6aacd59909e29c4855238bb66c8a7d0a02d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 24 Aug 2022 23:40:15 +0200 Subject: [PATCH 1/5] Move True/False and One/Zero properties to T4 templates --- .../Primitives/Bool/Bool2.cs | 10 ------ .../Primitives/Bool/Bool2.g.cs | 10 ++++++ .../Primitives/Bool/Bool3.cs | 10 ------ .../Primitives/Bool/Bool3.g.cs | 10 ++++++ .../Primitives/Bool/Bool4.cs | 10 ------ .../Primitives/Bool/Bool4.g.cs | 10 ++++++ .../Primitives/Double/Double2.cs | 10 ------ .../Primitives/Double/Double2.g.cs | 10 ++++++ .../Primitives/Double/Double3.cs | 10 ------ .../Primitives/Double/Double3.g.cs | 10 ++++++ .../Primitives/Double/Double4.cs | 10 ------ .../Primitives/Double/Double4.g.cs | 10 ++++++ .../Primitives/Float/Float2.cs | 10 ------ .../Primitives/Float/Float2.g.cs | 10 ++++++ .../Primitives/Float/Float3.cs | 10 ------ .../Primitives/Float/Float3.g.cs | 10 ++++++ .../Primitives/Float/Float4.cs | 10 ------ .../Primitives/Float/Float4.g.cs | 10 ++++++ src/ComputeSharp.Core/Primitives/Int/Int2.cs | 10 ------ .../Primitives/Int/Int2.g.cs | 10 ++++++ src/ComputeSharp.Core/Primitives/Int/Int3.cs | 10 ------ .../Primitives/Int/Int3.g.cs | 10 ++++++ src/ComputeSharp.Core/Primitives/Int/Int4.cs | 10 ------ .../Primitives/Int/Int4.g.cs | 10 ++++++ .../Primitives/UInt/UInt2.cs | 10 ------ .../Primitives/UInt/UInt2.g.cs | 10 ++++++ .../Primitives/UInt/UInt3.cs | 10 ------ .../Primitives/UInt/UInt3.g.cs | 10 ++++++ .../Primitives/UInt/UInt4.cs | 10 ------ .../Primitives/UInt/UInt4.g.cs | 10 ++++++ .../Primitives/VectorType.ttinclude | 33 +++++++++++++++++-- 31 files changed, 181 insertions(+), 152 deletions(-) diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs index b9305ab0..c450e9f8 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 all components set to . - /// - public static Bool2 False => false; - - /// - /// Gets an value with all components set to . - /// - public static Bool2 True => true; - /// /// Gets an value with the component set to , and the others to . /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs index 75399fac..5eb8866a 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs @@ -32,6 +32,16 @@ public unsafe partial struct Bool2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref bool this[int i] => ref *(bool*)UndefinedData; + /// + /// Gets a value with all components set to . + /// + public static Bool2 False => false; + + /// + /// Gets a value with all components set to . + /// + public static Bool2 True => 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 34cdffc1..c70622e5 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Bool3 { - /// - /// Gets an value with all components set to . - /// - public static Bool3 False => false; - - /// - /// Gets an value with all components set to . - /// - public static Bool3 True => true; - /// /// Gets an value with the component set to , and the others to . /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs index 87322361..664ec6ce 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs @@ -35,6 +35,16 @@ public unsafe partial struct Bool3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref bool this[int i] => ref *(bool*)UndefinedData; + /// + /// Gets a value with all components set to . + /// + public static Bool3 False => false; + + /// + /// Gets a value with all components set to . + /// + public static Bool3 True => 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 fcf9f11a..08ec4fdf 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Bool4 { - /// - /// Gets an value with all components set to . - /// - public static Bool4 False => false; - - /// - /// Gets an value with all components set to . - /// - public static Bool4 True => true; - /// /// Gets an value with the component set to , and the others to . /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs index c7728eb3..909ba0e6 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs @@ -38,6 +38,16 @@ public unsafe partial struct Bool4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref bool this[int i] => ref *(bool*)UndefinedData; + /// + /// Gets a value with all components set to . + /// + public static Bool4 False => false; + + /// + /// Gets a value with all components set to . + /// + public static Bool4 True => 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 e43f3e40..24a3b6de 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 all components set to 0. - /// - public static Double2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Double2 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs index 0717e604..ff5577d8 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double2.g.cs @@ -37,6 +37,16 @@ public unsafe partial struct Double2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref double this[int i] => ref *(double*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Double2 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Double2 One => 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 326a25f5..bdf8b4f6 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double3.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double3.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Double3 { - /// - /// Gets an value with all components set to 0. - /// - public static Double3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Double3 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs index 42662832..2d80bffd 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double3.g.cs @@ -40,6 +40,16 @@ public unsafe partial struct Double3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref double this[int i] => ref *(double*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Double3 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Double3 One => 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 634dc47a..f0dc3e4f 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double4.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double4.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Double4 { - /// - /// Gets an value with all components set to 0. - /// - public static Double4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Double4 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs b/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs index edbb0676..36e83179 100644 --- a/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/Double4.g.cs @@ -43,6 +43,16 @@ public unsafe partial struct Double4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref double this[int i] => ref *(double*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Double4 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Double4 One => 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 b8e667cb..91cddeb4 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 all components set to 0. - /// - public static Float2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Float2 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs index 9094132f..806a8f15 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs @@ -37,6 +37,16 @@ public unsafe partial struct Float2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref float this[int i] => ref *(float*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Float2 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Float2 One => 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 16693e7e..a40f2644 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float3.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float3.cs @@ -9,16 +9,6 @@ namespace ComputeSharp; /// public partial struct Float3 { - /// - /// Gets an value with all components set to 0. - /// - public static Float3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Float3 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs index 557b29b4..044e1461 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs @@ -40,6 +40,16 @@ public unsafe partial struct Float3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref float this[int i] => ref *(float*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Float3 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Float3 One => 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 18a16673..c9eeb82a 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float4.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float4.cs @@ -9,16 +9,6 @@ namespace ComputeSharp; /// public partial struct Float4 { - /// - /// Gets an value with all components set to 0. - /// - public static Float4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Float4 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs index e011344e..bc7cf39e 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs @@ -43,6 +43,16 @@ public unsafe partial struct Float4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref float this[int i] => ref *(float*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Float4 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Float4 One => 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 2441d744..63779ad1 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 all components set to 0. - /// - public static Int2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Int2 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs index 27a71a8f..daee20be 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs @@ -37,6 +37,16 @@ public unsafe partial struct Int2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref int this[int i] => ref *(int*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Int2 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Int2 One => 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 74f26765..f79f2076 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Int3 { - /// - /// Gets an value with all components set to 0. - /// - public static Int3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Int3 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs index a5d0d39b..3b6daff4 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs @@ -40,6 +40,16 @@ public unsafe partial struct Int3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref int this[int i] => ref *(int*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Int3 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Int3 One => 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 744a6c7d..663cbd39 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct Int4 { - /// - /// Gets an value with all components set to 0. - /// - public static Int4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Int4 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs index 408a4435..f2f80023 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs @@ -43,6 +43,16 @@ public unsafe partial struct Int4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref int this[int i] => ref *(int*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static Int4 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static Int4 One => 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 2cf71c34..d86c2177 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 all components set to 0. - /// - public static UInt2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static UInt2 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs index 454e74f3..5d5835ff 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs @@ -37,6 +37,16 @@ public unsafe partial struct UInt2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref uint this[int i] => ref *(uint*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static UInt2 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static UInt2 One => 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 806a92ad..959d2a32 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct UInt3 { - /// - /// Gets an value with all components set to 0. - /// - public static UInt3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static UInt3 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs index d7e02e90..c393c643 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs @@ -40,6 +40,16 @@ public unsafe partial struct UInt3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref uint this[int i] => ref *(uint*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static UInt3 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static UInt3 One => 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 2327cca4..1d5cd634 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs @@ -7,16 +7,6 @@ namespace ComputeSharp; /// public partial struct UInt4 { - /// - /// Gets an value with all components set to 0. - /// - public static UInt4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static UInt4 One => 1; - /// /// Gets an value with the component set to 1, and the others to 0. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs index d7475dda..fa9f91bb 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs @@ -43,6 +43,16 @@ public unsafe partial struct UInt4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref uint this[int i] => ref *(uint*)UndefinedData; + /// + /// Gets a value with all components set to 0. + /// + public static UInt4 Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static UInt4 One => 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 a0876551..9c4192b2 100644 --- a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude @@ -108,7 +108,38 @@ public unsafe partial struct <#=typeName#> /// The index of the component to access. /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public readonly ref <#=hlslElementTypeName#> this[int i] => ref *(<#=hlslElementTypeName#>*)UndefinedData; + <# + // Generate the true/false and zero/one properties + if (elementTypeName == "Bool") + { +#> + /// + /// Gets a value with all components set to . + /// + public static <#=typeName#> False => false; + + /// + /// Gets a value with all components set to . + /// + public static <#=typeName#> True => true; +<# + } + else + { +#> + /// + /// Gets a value with all components set to 0. + /// + public static <#=typeName#> Zero => 0; + + /// + /// Gets a value with all components set to 1. + /// + public static <#=typeName#> One => 1; +<# + } + PushIndent(" "); // Generate the combinatorial swizzling properties @@ -161,7 +192,6 @@ public unsafe partial struct <#=typeName#> #if !SOURCE_GENERATOR <# - if (elementTypeName == "Bool") { #> @@ -222,7 +252,6 @@ public unsafe partial struct <#=typeName#> #endif <# - // Generate the negation operator if (elementTypeName != "UInt") { From 97447fbc68eab8d79aa3d9f70d0733a8bb238ba0 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 24 Aug 2022 23:56:18 +0200 Subject: [PATCH 2/5] Move TrueN and OneN properties to T4 templates --- .../Primitives/Bool/Bool2.cs | 10 ------ .../Primitives/Bool/Bool2.g.cs | 10 ++++++ .../Primitives/Bool/Bool3.cs | 15 -------- .../Primitives/Bool/Bool3.g.cs | 15 ++++++++ .../Primitives/Bool/Bool4.cs | 20 ----------- .../Primitives/Bool/Bool4.g.cs | 20 +++++++++++ .../Primitives/Double/Double2.cs | 10 ------ .../Primitives/Double/Double2.g.cs | 10 ++++++ .../Primitives/Double/Double3.cs | 15 -------- .../Primitives/Double/Double3.g.cs | 15 ++++++++ .../Primitives/Double/Double4.cs | 20 ----------- .../Primitives/Double/Double4.g.cs | 20 +++++++++++ .../Primitives/Float/Float2.cs | 10 ------ .../Primitives/Float/Float2.g.cs | 10 ++++++ .../Primitives/Float/Float3.cs | 15 -------- .../Primitives/Float/Float3.g.cs | 15 ++++++++ .../Primitives/Float/Float4.cs | 20 ----------- .../Primitives/Float/Float4.g.cs | 20 +++++++++++ src/ComputeSharp.Core/Primitives/Int/Int2.cs | 10 ------ .../Primitives/Int/Int2.g.cs | 10 ++++++ src/ComputeSharp.Core/Primitives/Int/Int3.cs | 15 -------- .../Primitives/Int/Int3.g.cs | 15 ++++++++ src/ComputeSharp.Core/Primitives/Int/Int4.cs | 20 ----------- .../Primitives/Int/Int4.g.cs | 20 +++++++++++ .../Primitives/UInt/UInt2.cs | 10 ------ .../Primitives/UInt/UInt2.g.cs | 10 ++++++ .../Primitives/UInt/UInt3.cs | 15 -------- .../Primitives/UInt/UInt3.g.cs | 15 ++++++++ .../Primitives/UInt/UInt4.cs | 20 ----------- .../Primitives/UInt/UInt4.g.cs | 20 +++++++++++ .../Primitives/VectorType.ttinclude | 34 +++++++++++++++++++ 31 files changed, 259 insertions(+), 225 deletions(-) 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 From 4ad7bba4b8b12f74000cb8f8000fa4f650987244 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Aug 2022 00:46:25 +0200 Subject: [PATCH 3/5] Add bitwise operators to HLSL vector types --- .../Primitives/Int/Int2.g.cs | 100 ++++++++++++++++ .../Primitives/Int/Int3.g.cs | 100 ++++++++++++++++ .../Primitives/Int/Int4.g.cs | 100 ++++++++++++++++ .../Primitives/UInt/UInt2.g.cs | 100 ++++++++++++++++ .../Primitives/UInt/UInt3.g.cs | 100 ++++++++++++++++ .../Primitives/UInt/UInt4.g.cs | 100 ++++++++++++++++ .../Primitives/VectorType.ttinclude | 109 ++++++++++++++++++ 7 files changed, 709 insertions(+) diff --git a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs index ee4096bb..0fb6dc1b 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs @@ -543,6 +543,106 @@ public unsafe partial struct Int2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2 operator <=(Int2 left, Int2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator ~(Int2 xy) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator >>(Int2 xy, Int2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator >>(Int2 xy, UInt2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator <<(Int2 xy, Int2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator <<(Int2 xy, UInt2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator &(Int2 left, Int2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator &(Int2 left, UInt2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator |(Int2 left, Int2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator |(Int2 left, UInt2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator ^(Int2 left, Int2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator ^(Int2 left, UInt2 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs index c4dce83c..086c6910 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs @@ -1629,6 +1629,106 @@ public unsafe partial struct Int3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3 operator <=(Int3 left, Int3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator ~(Int3 xyz) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator >>(Int3 xyz, Int3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator >>(Int3 xyz, UInt3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator <<(Int3 xyz, Int3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator <<(Int3 xyz, UInt3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator &(Int3 left, Int3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator &(Int3 left, UInt3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator |(Int3 left, Int3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator |(Int3 left, UInt3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator ^(Int3 left, Int3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator ^(Int3 left, UInt3 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs index fd0e40c1..fbcf0214 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs @@ -4275,6 +4275,106 @@ public unsafe partial struct Int4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4 operator <=(Int4 left, Int4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator ~(Int4 xyzw) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator >>(Int4 xyzw, Int4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator >>(Int4 xyzw, UInt4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator <<(Int4 xyzw, Int4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator <<(Int4 xyzw, UInt4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator &(Int4 left, Int4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator &(Int4 left, UInt4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator |(Int4 left, Int4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator |(Int4 left, UInt4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator ^(Int4 left, Int4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator ^(Int4 left, UInt4 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs index e3ab439d..7fdeb3ec 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt2.g.cs @@ -535,6 +535,106 @@ public unsafe partial struct UInt2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2 operator <=(UInt2 left, UInt2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator ~(UInt2 xy) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator >>(UInt2 xy, Int2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator >>(UInt2 xy, UInt2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator <<(UInt2 xy, Int2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator <<(UInt2 xy, UInt2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator &(UInt2 left, Int2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator &(UInt2 left, UInt2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator |(UInt2 left, Int2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator |(UInt2 left, UInt2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator ^(UInt2 left, Int2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2 operator ^(UInt2 left, UInt2 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs index e7afaa1d..8afabad5 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt3.g.cs @@ -1621,6 +1621,106 @@ public unsafe partial struct UInt3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3 operator <=(UInt3 left, UInt3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator ~(UInt3 xyz) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator >>(UInt3 xyz, Int3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator >>(UInt3 xyz, UInt3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator <<(UInt3 xyz, Int3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator <<(UInt3 xyz, UInt3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator &(UInt3 left, Int3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator &(UInt3 left, UInt3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator |(UInt3 left, Int3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator |(UInt3 left, UInt3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator ^(UInt3 left, Int3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3 operator ^(UInt3 left, UInt3 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs index 4ef9a6cf..83db512a 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UInt4.g.cs @@ -4267,6 +4267,106 @@ public unsafe partial struct UInt4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4 operator <=(UInt4 left, UInt4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator ~(UInt4 xyzw) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator >>(UInt4 xyzw, Int4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator >>(UInt4 xyzw, UInt4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator <<(UInt4 xyzw, Int4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator <<(UInt4 xyzw, UInt4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator &(UInt4 left, Int4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator &(UInt4 left, UInt4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator |(UInt4 left, Int4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator |(UInt4 left, UInt4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator ^(UInt4 left, Int4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4 operator ^(UInt4 left, UInt4 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude index 8f52a8e0..e2258729 100644 --- a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude @@ -392,6 +392,115 @@ public unsafe partial struct <#=typeName#> <# } + // Generate the bitwise operators + if (elementTypeName == "Int" || elementTypeName == "UInt") + { + string argumentName = "xyzw".Substring(0, i); + + WriteLine(""); +#> + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator ~(<#=typeName#> <#=argumentName#>) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator >>(<#=typeName#> <#=argumentName#>, Int<#=i#> amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator >>(<#=typeName#> <#=argumentName#>, UInt<#=i#> amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator <<(<#=typeName#> <#=argumentName#>, Int<#=i#> amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator <<(<#=typeName#> <#=argumentName#>, UInt<#=i#> amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator &(<#=typeName#> left, Int<#=i#> right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator &(<#=typeName#> left, UInt<#=i#> right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator |(<#=typeName#> left, Int<#=i#> right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator |(<#=typeName#> left, UInt<#=i#> right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator ^(<#=typeName#> left, Int<#=i#> right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator ^(<#=typeName#> left, UInt<#=i#> right) => default; +<# + } + WriteLine(""); #> /// From 25191af0afa4117da0e70918e13d9f2599597ff6 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Aug 2022 01:11:16 +0200 Subject: [PATCH 4/5] Add bitwise operators to HLSL matrix types --- .../Primitives/Int/IntMxN.g.cs | 1600 +++++++++++++++++ .../Primitives/MatrixType.ttinclude | 107 ++ .../Primitives/UInt/UIntMxN.g.cs | 1600 +++++++++++++++++ 3 files changed, 3307 insertions(+) diff --git a/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs index bb2411c6..d6bde9d3 100644 --- a/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs @@ -170,6 +170,106 @@ public unsafe partial struct Int1x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x1 operator <=(Int1x1 left, Int1x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator ~(Int1x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator >>(Int1x1 matrix, Int1x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator >>(Int1x1 matrix, UInt1x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator <<(Int1x1 matrix, Int1x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator <<(Int1x1 matrix, UInt1x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator &(Int1x1 left, Int1x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator &(Int1x1 left, UInt1x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator |(Int1x1 left, Int1x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator |(Int1x1 left, UInt1x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator ^(Int1x1 left, Int1x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator ^(Int1x1 left, UInt1x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -361,6 +461,106 @@ public unsafe partial struct Int1x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x2 operator <=(Int1x2 left, Int1x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator ~(Int1x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator >>(Int1x2 matrix, Int1x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator >>(Int1x2 matrix, UInt1x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator <<(Int1x2 matrix, Int1x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator <<(Int1x2 matrix, UInt1x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator &(Int1x2 left, Int1x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator &(Int1x2 left, UInt1x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator |(Int1x2 left, Int1x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator |(Int1x2 left, UInt1x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator ^(Int1x2 left, Int1x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator ^(Int1x2 left, UInt1x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -569,6 +769,106 @@ public unsafe partial struct Int1x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x3 operator <=(Int1x3 left, Int1x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator ~(Int1x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator >>(Int1x3 matrix, Int1x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator >>(Int1x3 matrix, UInt1x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator <<(Int1x3 matrix, Int1x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator <<(Int1x3 matrix, UInt1x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator &(Int1x3 left, Int1x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator &(Int1x3 left, UInt1x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator |(Int1x3 left, Int1x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator |(Int1x3 left, UInt1x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator ^(Int1x3 left, Int1x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator ^(Int1x3 left, UInt1x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -788,6 +1088,106 @@ public unsafe partial struct Int1x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x4 operator <=(Int1x4 left, Int1x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator ~(Int1x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator >>(Int1x4 matrix, Int1x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator >>(Int1x4 matrix, UInt1x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator <<(Int1x4 matrix, Int1x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator <<(Int1x4 matrix, UInt1x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator &(Int1x4 left, Int1x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator &(Int1x4 left, UInt1x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator |(Int1x4 left, Int1x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator |(Int1x4 left, UInt1x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator ^(Int1x4 left, Int1x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator ^(Int1x4 left, UInt1x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -985,6 +1385,106 @@ public unsafe partial struct Int2x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x1 operator <=(Int2x1 left, Int2x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator ~(Int2x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator >>(Int2x1 matrix, Int2x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator >>(Int2x1 matrix, UInt2x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator <<(Int2x1 matrix, Int2x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator <<(Int2x1 matrix, UInt2x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator &(Int2x1 left, Int2x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator &(Int2x1 left, UInt2x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator |(Int2x1 left, Int2x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator |(Int2x1 left, UInt2x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator ^(Int2x1 left, Int2x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator ^(Int2x1 left, UInt2x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1217,6 +1717,106 @@ public unsafe partial struct Int2x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x2 operator <=(Int2x2 left, Int2x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator ~(Int2x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator >>(Int2x2 matrix, Int2x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator >>(Int2x2 matrix, UInt2x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator <<(Int2x2 matrix, Int2x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator <<(Int2x2 matrix, UInt2x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator &(Int2x2 left, Int2x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator &(Int2x2 left, UInt2x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator |(Int2x2 left, Int2x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator |(Int2x2 left, UInt2x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator ^(Int2x2 left, Int2x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator ^(Int2x2 left, UInt2x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1467,6 +2067,106 @@ public unsafe partial struct Int2x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x3 operator <=(Int2x3 left, Int2x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator ~(Int2x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator >>(Int2x3 matrix, Int2x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator >>(Int2x3 matrix, UInt2x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator <<(Int2x3 matrix, Int2x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator <<(Int2x3 matrix, UInt2x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator &(Int2x3 left, Int2x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator &(Int2x3 left, UInt2x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator |(Int2x3 left, Int2x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator |(Int2x3 left, UInt2x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator ^(Int2x3 left, Int2x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator ^(Int2x3 left, UInt2x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1741,6 +2441,106 @@ public unsafe partial struct Int2x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x4 operator <=(Int2x4 left, Int2x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator ~(Int2x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator >>(Int2x4 matrix, Int2x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator >>(Int2x4 matrix, UInt2x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator <<(Int2x4 matrix, Int2x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator <<(Int2x4 matrix, UInt2x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator &(Int2x4 left, Int2x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator &(Int2x4 left, UInt2x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator |(Int2x4 left, Int2x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator |(Int2x4 left, UInt2x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator ^(Int2x4 left, Int2x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator ^(Int2x4 left, UInt2x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1943,6 +2743,106 @@ public unsafe partial struct Int3x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x1 operator <=(Int3x1 left, Int3x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator ~(Int3x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator >>(Int3x1 matrix, Int3x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator >>(Int3x1 matrix, UInt3x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator <<(Int3x1 matrix, Int3x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator <<(Int3x1 matrix, UInt3x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator &(Int3x1 left, Int3x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator &(Int3x1 left, UInt3x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator |(Int3x1 left, Int3x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator |(Int3x1 left, UInt3x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator ^(Int3x1 left, Int3x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator ^(Int3x1 left, UInt3x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2200,6 +3100,106 @@ public unsafe partial struct Int3x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x2 operator <=(Int3x2 left, Int3x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator ~(Int3x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator >>(Int3x2 matrix, Int3x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator >>(Int3x2 matrix, UInt3x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator <<(Int3x2 matrix, Int3x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator <<(Int3x2 matrix, UInt3x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator &(Int3x2 left, Int3x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator &(Int3x2 left, UInt3x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator |(Int3x2 left, Int3x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator |(Int3x2 left, UInt3x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator ^(Int3x2 left, Int3x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator ^(Int3x2 left, UInt3x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2487,6 +3487,106 @@ public unsafe partial struct Int3x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x3 operator <=(Int3x3 left, Int3x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator ~(Int3x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator >>(Int3x3 matrix, Int3x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator >>(Int3x3 matrix, UInt3x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator <<(Int3x3 matrix, Int3x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator <<(Int3x3 matrix, UInt3x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator &(Int3x3 left, Int3x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator &(Int3x3 left, UInt3x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator |(Int3x3 left, Int3x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator |(Int3x3 left, UInt3x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator ^(Int3x3 left, Int3x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator ^(Int3x3 left, UInt3x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2810,6 +3910,106 @@ public unsafe partial struct Int3x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x4 operator <=(Int3x4 left, Int3x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator ~(Int3x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator >>(Int3x4 matrix, Int3x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator >>(Int3x4 matrix, UInt3x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator <<(Int3x4 matrix, Int3x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator <<(Int3x4 matrix, UInt3x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator &(Int3x4 left, Int3x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator &(Int3x4 left, UInt3x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator |(Int3x4 left, Int3x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator |(Int3x4 left, UInt3x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator ^(Int3x4 left, Int3x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator ^(Int3x4 left, UInt3x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -3023,6 +4223,106 @@ public unsafe partial struct Int4x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x1 operator <=(Int4x1 left, Int4x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator ~(Int4x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator >>(Int4x1 matrix, Int4x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator >>(Int4x1 matrix, UInt4x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator <<(Int4x1 matrix, Int4x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator <<(Int4x1 matrix, UInt4x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator &(Int4x1 left, Int4x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator &(Int4x1 left, UInt4x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator |(Int4x1 left, Int4x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator |(Int4x1 left, UInt4x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator ^(Int4x1 left, Int4x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator ^(Int4x1 left, UInt4x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -3305,6 +4605,106 @@ public unsafe partial struct Int4x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x2 operator <=(Int4x2 left, Int4x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator ~(Int4x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator >>(Int4x2 matrix, Int4x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator >>(Int4x2 matrix, UInt4x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator <<(Int4x2 matrix, Int4x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator <<(Int4x2 matrix, UInt4x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator &(Int4x2 left, Int4x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator &(Int4x2 left, UInt4x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator |(Int4x2 left, Int4x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator |(Int4x2 left, UInt4x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator ^(Int4x2 left, Int4x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator ^(Int4x2 left, UInt4x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -3629,6 +5029,106 @@ public unsafe partial struct Int4x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x3 operator <=(Int4x3 left, Int4x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator ~(Int4x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator >>(Int4x3 matrix, Int4x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator >>(Int4x3 matrix, UInt4x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator <<(Int4x3 matrix, Int4x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator <<(Int4x3 matrix, UInt4x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator &(Int4x3 left, Int4x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator &(Int4x3 left, UInt4x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator |(Int4x3 left, Int4x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator |(Int4x3 left, UInt4x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator ^(Int4x3 left, Int4x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator ^(Int4x3 left, UInt4x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -4001,6 +5501,106 @@ public unsafe partial struct Int4x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x4 operator <=(Int4x4 left, Int4x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator ~(Int4x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator >>(Int4x4 matrix, Int4x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator >>(Int4x4 matrix, UInt4x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator <<(Int4x4 matrix, Int4x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator <<(Int4x4 matrix, UInt4x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator &(Int4x4 left, Int4x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator &(Int4x4 left, UInt4x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator |(Int4x4 left, Int4x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator |(Int4x4 left, UInt4x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator ^(Int4x4 left, Int4x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator ^(Int4x4 left, UInt4x4 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude index 074a3c70..552b6a55 100644 --- a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude @@ -301,6 +301,113 @@ public unsafe partial struct <#=fullTypeName#> <# } + // Generate the bitwise operators + if (typeName == "Int" || typeName == "UInt") + { + WriteLine(""); +#> + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator ~(<#=fullTypeName#> matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator >>(<#=fullTypeName#> matrix, Int<#=rows#>x<#=columns#> amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator >>(<#=fullTypeName#> matrix, UInt<#=rows#>x<#=columns#> amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator <<(<#=fullTypeName#> matrix, Int<#=rows#>x<#=columns#> amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator <<(<#=fullTypeName#> matrix, UInt<#=rows#>x<#=columns#> amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator &(<#=fullTypeName#> left, Int<#=rows#>x<#=columns#> right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator &(<#=fullTypeName#> left, UInt<#=rows#>x<#=columns#> right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator |(<#=fullTypeName#> left, Int<#=rows#>x<#=columns#> right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator |(<#=fullTypeName#> left, UInt<#=rows#>x<#=columns#> right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator ^(<#=fullTypeName#> left, Int<#=rows#>x<#=columns#> right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator ^(<#=fullTypeName#> left, UInt<#=rows#>x<#=columns#> right) => default; +<# + } + WriteLine(""); #> /// diff --git a/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs index 4527f17f..4a5fefa6 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs @@ -163,6 +163,106 @@ public unsafe partial struct UInt1x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x1 operator <=(UInt1x1 left, UInt1x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator ~(UInt1x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator >>(UInt1x1 matrix, Int1x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator >>(UInt1x1 matrix, UInt1x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator <<(UInt1x1 matrix, Int1x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator <<(UInt1x1 matrix, UInt1x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator &(UInt1x1 left, Int1x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator &(UInt1x1 left, UInt1x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator |(UInt1x1 left, Int1x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator |(UInt1x1 left, UInt1x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator ^(UInt1x1 left, Int1x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x1 operator ^(UInt1x1 left, UInt1x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -347,6 +447,106 @@ public unsafe partial struct UInt1x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x2 operator <=(UInt1x2 left, UInt1x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator ~(UInt1x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator >>(UInt1x2 matrix, Int1x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator >>(UInt1x2 matrix, UInt1x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator <<(UInt1x2 matrix, Int1x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator <<(UInt1x2 matrix, UInt1x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator &(UInt1x2 left, Int1x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator &(UInt1x2 left, UInt1x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator |(UInt1x2 left, Int1x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator |(UInt1x2 left, UInt1x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator ^(UInt1x2 left, Int1x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x2 operator ^(UInt1x2 left, UInt1x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -548,6 +748,106 @@ public unsafe partial struct UInt1x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x3 operator <=(UInt1x3 left, UInt1x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator ~(UInt1x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator >>(UInt1x3 matrix, Int1x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator >>(UInt1x3 matrix, UInt1x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator <<(UInt1x3 matrix, Int1x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator <<(UInt1x3 matrix, UInt1x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator &(UInt1x3 left, Int1x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator &(UInt1x3 left, UInt1x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator |(UInt1x3 left, Int1x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator |(UInt1x3 left, UInt1x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator ^(UInt1x3 left, Int1x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x3 operator ^(UInt1x3 left, UInt1x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -760,6 +1060,106 @@ public unsafe partial struct UInt1x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool1x4 operator <=(UInt1x4 left, UInt1x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator ~(UInt1x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator >>(UInt1x4 matrix, Int1x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator >>(UInt1x4 matrix, UInt1x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator <<(UInt1x4 matrix, Int1x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator <<(UInt1x4 matrix, UInt1x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator &(UInt1x4 left, Int1x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator &(UInt1x4 left, UInt1x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator |(UInt1x4 left, Int1x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator |(UInt1x4 left, UInt1x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator ^(UInt1x4 left, Int1x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt1x4 operator ^(UInt1x4 left, UInt1x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -950,6 +1350,106 @@ public unsafe partial struct UInt2x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x1 operator <=(UInt2x1 left, UInt2x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator ~(UInt2x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator >>(UInt2x1 matrix, Int2x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator >>(UInt2x1 matrix, UInt2x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator <<(UInt2x1 matrix, Int2x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator <<(UInt2x1 matrix, UInt2x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator &(UInt2x1 left, Int2x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator &(UInt2x1 left, UInt2x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator |(UInt2x1 left, Int2x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator |(UInt2x1 left, UInt2x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator ^(UInt2x1 left, Int2x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x1 operator ^(UInt2x1 left, UInt2x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1175,6 +1675,106 @@ public unsafe partial struct UInt2x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x2 operator <=(UInt2x2 left, UInt2x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator ~(UInt2x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator >>(UInt2x2 matrix, Int2x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator >>(UInt2x2 matrix, UInt2x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator <<(UInt2x2 matrix, Int2x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator <<(UInt2x2 matrix, UInt2x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator &(UInt2x2 left, Int2x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator &(UInt2x2 left, UInt2x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator |(UInt2x2 left, Int2x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator |(UInt2x2 left, UInt2x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator ^(UInt2x2 left, Int2x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x2 operator ^(UInt2x2 left, UInt2x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1418,6 +2018,106 @@ public unsafe partial struct UInt2x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x3 operator <=(UInt2x3 left, UInt2x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator ~(UInt2x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator >>(UInt2x3 matrix, Int2x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator >>(UInt2x3 matrix, UInt2x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator <<(UInt2x3 matrix, Int2x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator <<(UInt2x3 matrix, UInt2x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator &(UInt2x3 left, Int2x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator &(UInt2x3 left, UInt2x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator |(UInt2x3 left, Int2x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator |(UInt2x3 left, UInt2x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator ^(UInt2x3 left, Int2x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x3 operator ^(UInt2x3 left, UInt2x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1685,6 +2385,106 @@ public unsafe partial struct UInt2x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool2x4 operator <=(UInt2x4 left, UInt2x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator ~(UInt2x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator >>(UInt2x4 matrix, Int2x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator >>(UInt2x4 matrix, UInt2x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator <<(UInt2x4 matrix, Int2x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator <<(UInt2x4 matrix, UInt2x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator &(UInt2x4 left, Int2x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator &(UInt2x4 left, UInt2x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator |(UInt2x4 left, Int2x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator |(UInt2x4 left, UInt2x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator ^(UInt2x4 left, Int2x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt2x4 operator ^(UInt2x4 left, UInt2x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1880,6 +2680,106 @@ public unsafe partial struct UInt3x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x1 operator <=(UInt3x1 left, UInt3x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator ~(UInt3x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator >>(UInt3x1 matrix, Int3x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator >>(UInt3x1 matrix, UInt3x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator <<(UInt3x1 matrix, Int3x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator <<(UInt3x1 matrix, UInt3x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator &(UInt3x1 left, Int3x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator &(UInt3x1 left, UInt3x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator |(UInt3x1 left, Int3x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator |(UInt3x1 left, UInt3x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator ^(UInt3x1 left, Int3x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x1 operator ^(UInt3x1 left, UInt3x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2130,6 +3030,106 @@ public unsafe partial struct UInt3x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x2 operator <=(UInt3x2 left, UInt3x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator ~(UInt3x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator >>(UInt3x2 matrix, Int3x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator >>(UInt3x2 matrix, UInt3x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator <<(UInt3x2 matrix, Int3x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator <<(UInt3x2 matrix, UInt3x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator &(UInt3x2 left, Int3x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator &(UInt3x2 left, UInt3x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator |(UInt3x2 left, Int3x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator |(UInt3x2 left, UInt3x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator ^(UInt3x2 left, Int3x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x2 operator ^(UInt3x2 left, UInt3x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2410,6 +3410,106 @@ public unsafe partial struct UInt3x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x3 operator <=(UInt3x3 left, UInt3x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator ~(UInt3x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator >>(UInt3x3 matrix, Int3x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator >>(UInt3x3 matrix, UInt3x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator <<(UInt3x3 matrix, Int3x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator <<(UInt3x3 matrix, UInt3x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator &(UInt3x3 left, Int3x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator &(UInt3x3 left, UInt3x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator |(UInt3x3 left, Int3x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator |(UInt3x3 left, UInt3x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator ^(UInt3x3 left, Int3x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x3 operator ^(UInt3x3 left, UInt3x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2726,6 +3826,106 @@ public unsafe partial struct UInt3x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool3x4 operator <=(UInt3x4 left, UInt3x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator ~(UInt3x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator >>(UInt3x4 matrix, Int3x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator >>(UInt3x4 matrix, UInt3x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator <<(UInt3x4 matrix, Int3x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator <<(UInt3x4 matrix, UInt3x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator &(UInt3x4 left, Int3x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator &(UInt3x4 left, UInt3x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator |(UInt3x4 left, Int3x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator |(UInt3x4 left, UInt3x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator ^(UInt3x4 left, Int3x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt3x4 operator ^(UInt3x4 left, UInt3x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2932,6 +4132,106 @@ public unsafe partial struct UInt4x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x1 operator <=(UInt4x1 left, UInt4x1 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator ~(UInt4x1 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator >>(UInt4x1 matrix, Int4x1 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator >>(UInt4x1 matrix, UInt4x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator <<(UInt4x1 matrix, Int4x1 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator <<(UInt4x1 matrix, UInt4x1 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator &(UInt4x1 left, Int4x1 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator &(UInt4x1 left, UInt4x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator |(UInt4x1 left, Int4x1 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator |(UInt4x1 left, UInt4x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator ^(UInt4x1 left, Int4x1 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x1 operator ^(UInt4x1 left, UInt4x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -3207,6 +4507,106 @@ public unsafe partial struct UInt4x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x2 operator <=(UInt4x2 left, UInt4x2 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator ~(UInt4x2 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator >>(UInt4x2 matrix, Int4x2 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator >>(UInt4x2 matrix, UInt4x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator <<(UInt4x2 matrix, Int4x2 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator <<(UInt4x2 matrix, UInt4x2 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator &(UInt4x2 left, Int4x2 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator &(UInt4x2 left, UInt4x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator |(UInt4x2 left, Int4x2 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator |(UInt4x2 left, UInt4x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator ^(UInt4x2 left, Int4x2 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x2 operator ^(UInt4x2 left, UInt4x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -3524,6 +4924,106 @@ public unsafe partial struct UInt4x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x3 operator <=(UInt4x3 left, UInt4x3 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator ~(UInt4x3 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator >>(UInt4x3 matrix, Int4x3 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator >>(UInt4x3 matrix, UInt4x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator <<(UInt4x3 matrix, Int4x3 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator <<(UInt4x3 matrix, UInt4x3 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator &(UInt4x3 left, Int4x3 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator &(UInt4x3 left, UInt4x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator |(UInt4x3 left, Int4x3 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator |(UInt4x3 left, UInt4x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator ^(UInt4x3 left, Int4x3 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x3 operator ^(UInt4x3 left, UInt4x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -3889,6 +5389,106 @@ public unsafe partial struct UInt4x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Bool4x4 operator <=(UInt4x4 left, UInt4x4 right) => default; + /// + /// Bitwise negates a value. + /// + /// The value to bitwise negate. + /// The bitwise negated value of . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator ~(UInt4x4 matrix) => default; + +#if NEEDS_CSHARP_11 + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator >>(UInt4x4 matrix, Int4x4 amount) => default; + + /// + /// Shifts right a value. + /// + /// The value to shift right. + /// The amount to shift each element right by. + /// The result of shifting right by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator >>(UInt4x4 matrix, UInt4x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator <<(UInt4x4 matrix, Int4x4 amount) => default; + + /// + /// Shifts left a value. + /// + /// The value to shift left. + /// The amount to shift each element left by. + /// The result of shifting left by . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator <<(UInt4x4 matrix, UInt4x4 amount) => default; +#endif + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator &(UInt4x4 left, Int4x4 right) => default; + + /// + /// Bitwise ands a value. + /// + /// The value to bitwise and. + /// The value to combine. + /// The result of performing the bitwise and between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator &(UInt4x4 left, UInt4x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator |(UInt4x4 left, Int4x4 right) => default; + + /// + /// Bitwise ors a value. + /// + /// The value to bitwise or. + /// The value to combine. + /// The result of performing the bitwise or between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator |(UInt4x4 left, UInt4x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator ^(UInt4x4 left, Int4x4 right) => default; + + /// + /// Bitwise xors a value. + /// + /// The value to bitwise xor. + /// The value to combine. + /// The result of performing the bitwise xor between and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static UInt4x4 operator ^(UInt4x4 left, UInt4x4 right) => default; + /// /// Compares two values to see if they are equal. /// From 43cc4f8cca6e65251c12ff26c5d8545c858ed36b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Aug 2022 01:34:32 +0200 Subject: [PATCH 5/5] Add unit tests for bitwise HLSL operators --- .../ComputeSharp.Tests/ShaderRewriterTests.cs | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/tests/ComputeSharp.Tests/ShaderRewriterTests.cs b/tests/ComputeSharp.Tests/ShaderRewriterTests.cs index ff9876a1..80dac267 100644 --- a/tests/ComputeSharp.Tests/ShaderRewriterTests.cs +++ b/tests/ComputeSharp.Tests/ShaderRewriterTests.cs @@ -130,6 +130,67 @@ public partial class ShaderRewriterTests } } + // See: https://github.com/Sergio0694/ComputeSharp/issues/361 + [CombinatorialTestMethod] + [AllDevices] + public void BitwiseHlslOperators(Device device) + { + int[] data = { 186456131, 215486738, unchecked((int)416439712738), unchecked((int)1437124371243), 0, 0, 0, 0 }; + + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(data); + + device.Get().For(1, new BitwiseOperatorsShader(buffer)); + + int[] results = buffer.ToArray(); + + int2 a = new(data[0], data[1]); + uint2 b = new((uint)data[2], (uint)data[3]); + + int2 c = new(~a.X, ~a.Y); + int2 d = new(a.X & (int)b.X, a.Y & (int)b.Y); + int2 e = new(a.X | (int)b.X, a.Y | (int)b.Y); + int2 f = new(a.X ^ (int)b.X, a.Y ^ (int)b.Y); + + Assert.AreEqual(results[0], c.X); + Assert.AreEqual(results[1], c.Y); + Assert.AreEqual(results[2], d.X); + Assert.AreEqual(results[3], d.Y); + Assert.AreEqual(results[4], e.X); + Assert.AreEqual(results[5], e.Y); + Assert.AreEqual(results[6], f.X); + Assert.AreEqual(results[7], f.Y); + } + + [AutoConstructor] + internal readonly partial struct BitwiseOperatorsShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + public void Execute() + { + int2 a = new(buffer[0], buffer[1]); + uint2 b = new((uint)buffer[2], (uint)buffer[3]); + + int2 c = ~a; + int2 d = a & b; + int2 e = a | b; + int2 f = a ^ b; + +#if NEEDS_CSHARP_11 + // TODO: add bit shifting tests +#endif + + buffer[0] = c.X; + buffer[1] = c.Y; + buffer[2] = d.X; + buffer[3] = d.Y; + buffer[4] = e.X; + buffer[5] = e.Y; + buffer[6] = f.X; + buffer[7] = f.Y; + } + } + // See: https://github.com/Sergio0694/ComputeSharp/issues/259 [CombinatorialTestMethod] [AllDevices]