From 80a300c8d9463a00c5e6c4ce50ac04e0b0f9f9b3 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Aug 2022 03:12:07 +0200 Subject: [PATCH] Add bitwise operators to bool HLSL types --- .../Primitives/Bool/Bool2.g.cs | 27 ++ .../Primitives/Bool/Bool3.g.cs | 27 ++ .../Primitives/Bool/Bool4.g.cs | 27 ++ .../Primitives/Bool/BoolMxN.g.cs | 432 ++++++++++++++++++ .../Primitives/MatrixType.ttinclude | 32 ++ .../Primitives/VectorType.ttinclude | 34 ++ 6 files changed, 579 insertions(+) diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs index 34d874b1..d4e42c00 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool2.g.cs @@ -430,6 +430,33 @@ 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 static Bool2 operator !(Bool2 xy) => default; + /// + /// Ands two values. + /// + /// The value to 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 Bool2 operator &(Bool2 left, Bool2 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool2 operator |(Bool2 left, Bool2 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool2 operator ^(Bool2 left, Bool2 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs index 43b366c4..1818699b 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool3.g.cs @@ -1516,6 +1516,33 @@ 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 static Bool3 operator !(Bool3 xyz) => default; + /// + /// Ands two values. + /// + /// The value to 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 Bool3 operator &(Bool3 left, Bool3 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool3 operator |(Bool3 left, Bool3 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool3 operator ^(Bool3 left, Bool3 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs index 13e9c565..84270626 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/Bool4.g.cs @@ -4162,6 +4162,33 @@ 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 static Bool4 operator !(Bool4 xyzw) => default; + /// + /// Ands two values. + /// + /// The value to 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 Bool4 operator &(Bool4 left, Bool4 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool4 operator |(Bool4 left, Bool4 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool4 operator ^(Bool4 left, Bool4 right) => default; + /// /// Compares two values to see if they are equal. /// diff --git a/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs index e6160738..941c3221 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs @@ -89,6 +89,33 @@ public unsafe partial struct Bool1x1 /// This method 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 !(Bool1x1 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool1x1 operator &(Bool1x1 left, Bool1x1 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool1x1 operator |(Bool1x1 left, Bool1x1 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool1x1 operator ^(Bool1x1 left, Bool1x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -199,6 +226,33 @@ public unsafe partial struct Bool1x2 /// This method 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 !(Bool1x2 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool1x2 operator &(Bool1x2 left, Bool1x2 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool1x2 operator |(Bool1x2 left, Bool1x2 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool1x2 operator ^(Bool1x2 left, Bool1x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -326,6 +380,33 @@ public unsafe partial struct Bool1x3 /// This method 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 !(Bool1x3 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool1x3 operator &(Bool1x3 left, Bool1x3 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool1x3 operator |(Bool1x3 left, Bool1x3 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool1x3 operator ^(Bool1x3 left, Bool1x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -464,6 +545,33 @@ public unsafe partial struct Bool1x4 /// This method 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 !(Bool1x4 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool1x4 operator &(Bool1x4 left, Bool1x4 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool1x4 operator |(Bool1x4 left, Bool1x4 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool1x4 operator ^(Bool1x4 left, Bool1x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -580,6 +688,33 @@ public unsafe partial struct Bool2x1 /// This method 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 !(Bool2x1 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool2x1 operator &(Bool2x1 left, Bool2x1 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool2x1 operator |(Bool2x1 left, Bool2x1 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool2x1 operator ^(Bool2x1 left, Bool2x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -731,6 +866,33 @@ public unsafe partial struct Bool2x2 /// This method 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 !(Bool2x2 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool2x2 operator &(Bool2x2 left, Bool2x2 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool2x2 operator |(Bool2x2 left, Bool2x2 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool2x2 operator ^(Bool2x2 left, Bool2x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -900,6 +1062,33 @@ public unsafe partial struct Bool2x3 /// This method 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 !(Bool2x3 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool2x3 operator &(Bool2x3 left, Bool2x3 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool2x3 operator |(Bool2x3 left, Bool2x3 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool2x3 operator ^(Bool2x3 left, Bool2x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1093,6 +1282,33 @@ public unsafe partial struct Bool2x4 /// This method 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 !(Bool2x4 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool2x4 operator &(Bool2x4 left, Bool2x4 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool2x4 operator |(Bool2x4 left, Bool2x4 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool2x4 operator ^(Bool2x4 left, Bool2x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1214,6 +1430,33 @@ public unsafe partial struct Bool3x1 /// This method 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 !(Bool3x1 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool3x1 operator &(Bool3x1 left, Bool3x1 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool3x1 operator |(Bool3x1 left, Bool3x1 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool3x1 operator ^(Bool3x1 left, Bool3x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1390,6 +1633,33 @@ public unsafe partial struct Bool3x2 /// This method 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 !(Bool3x2 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool3x2 operator &(Bool3x2 left, Bool3x2 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool3x2 operator |(Bool3x2 left, Bool3x2 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool3x2 operator ^(Bool3x2 left, Bool3x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1596,6 +1866,33 @@ public unsafe partial struct Bool3x3 /// This method 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 !(Bool3x3 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool3x3 operator &(Bool3x3 left, Bool3x3 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool3x3 operator |(Bool3x3 left, Bool3x3 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool3x3 operator ^(Bool3x3 left, Bool3x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1838,6 +2135,33 @@ public unsafe partial struct Bool3x4 /// This method 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 !(Bool3x4 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool3x4 operator &(Bool3x4 left, Bool3x4 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool3x4 operator |(Bool3x4 left, Bool3x4 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool3x4 operator ^(Bool3x4 left, Bool3x4 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -1970,6 +2294,33 @@ public unsafe partial struct Bool4x1 /// This method 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 !(Bool4x1 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool4x1 operator &(Bool4x1 left, Bool4x1 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool4x1 operator |(Bool4x1 left, Bool4x1 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool4x1 operator ^(Bool4x1 left, Bool4x1 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2171,6 +2522,33 @@ public unsafe partial struct Bool4x2 /// This method 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 !(Bool4x2 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool4x2 operator &(Bool4x2 left, Bool4x2 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool4x2 operator |(Bool4x2 left, Bool4x2 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool4x2 operator ^(Bool4x2 left, Bool4x2 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2414,6 +2792,33 @@ public unsafe partial struct Bool4x3 /// This method 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 !(Bool4x3 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool4x3 operator &(Bool4x3 left, Bool4x3 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool4x3 operator |(Bool4x3 left, Bool4x3 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool4x3 operator ^(Bool4x3 left, Bool4x3 right) => default; + /// /// Compares two values to see if they are equal. /// @@ -2705,6 +3110,33 @@ public unsafe partial struct Bool4x4 /// This method 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 !(Bool4x4 matrix) => default; + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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 Bool4x4 operator &(Bool4x4 left, Bool4x4 right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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 Bool4x4 operator |(Bool4x4 left, Bool4x4 right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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 Bool4x4 operator ^(Bool4x4 left, Bool4x4 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 552b6a55..0802a8df 100644 --- a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude @@ -407,6 +407,38 @@ public unsafe partial struct <#=fullTypeName#> public static <#=fullTypeName#> operator ^(<#=fullTypeName#> left, UInt<#=rows#>x<#=columns#> right) => default; <# } + else if (typeName == "Bool") + { + WriteLine(""); +#> + /// + /// Ands two values. + /// + /// The value to and. + /// The value to combine. + /// The result of performing the 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, <#=fullTypeName#> right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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, <#=fullTypeName#> right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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, <#=fullTypeName#> right) => default; +<# + } WriteLine(""); #> diff --git a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude index e2258729..12ab6988 100644 --- a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude @@ -500,6 +500,40 @@ public unsafe partial struct <#=typeName#> public static <#=typeName#> operator ^(<#=typeName#> left, UInt<#=i#> right) => default; <# } + else if (elementTypeName == "Bool") + { + string argumentName = "xyzw".Substring(0, i); + + WriteLine(""); +#> + /// + /// Ands two values. + /// + /// The value to 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, <#=typeName#> right) => default; + + /// + /// Ors two values. + /// + /// The value to or. + /// The value to combine. + /// The result of performing the 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, <#=typeName#> right) => default; + + /// + /// Xors two values. + /// + /// The value to xor. + /// The value to combine. + /// The result of performing the 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, <#=typeName#> right) => default; +<# + } WriteLine(""); #>