From 6a144aad1f8601ad1a49b5e2e6f5d3e4d0909fad Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 15 Mar 2021 22:14:16 +0100 Subject: [PATCH] Added BoolNxM negation operator, fixed operators generation --- .../Core/Primitives/Bool/BoolMxN.g.cs | 544 +----------------- .../Core/Primitives/MatrixType.ttinclude | 8 +- .../Core/Primitives/UInt/UIntMxN.g.cs | 112 ---- 3 files changed, 21 insertions(+), 643 deletions(-) diff --git a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs index 91d6293b..47bead26 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs @@ -85,39 +85,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool1x1 operator !(Bool1x1 matrix) => default; } /// @@ -209,39 +177,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool1x2 operator !(Bool1x2 matrix) => default; /// /// Casts a value to a one. @@ -350,39 +286,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool1x3 operator !(Bool1x3 matrix) => default; /// /// Casts a value to a one. @@ -502,39 +406,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool1x4 operator !(Bool1x4 matrix) => default; /// /// Casts a value to a one. @@ -632,39 +504,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool2x1 operator !(Bool2x1 matrix) => default; /// /// Casts a value to a one. @@ -797,39 +637,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool2x2 operator !(Bool2x2 matrix) => default; } /// @@ -980,39 +788,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool2x3 operator !(Bool2x3 matrix) => default; } /// @@ -1187,39 +963,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool2x4 operator !(Bool2x4 matrix) => default; } /// @@ -1322,39 +1066,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool3x1 operator !(Bool3x1 matrix) => default; /// /// Casts a value to a one. @@ -1512,39 +1224,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool3x2 operator !(Bool3x2 matrix) => default; } /// @@ -1732,39 +1412,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool3x3 operator !(Bool3x3 matrix) => default; } /// @@ -1988,39 +1636,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool3x4 operator !(Bool3x4 matrix) => default; } /// @@ -2134,39 +1750,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool4x1 operator !(Bool4x1 matrix) => default; /// /// Casts a value to a one. @@ -2349,39 +1933,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool4x2 operator !(Bool4x2 matrix) => default; } /// @@ -2606,39 +2158,7 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool4x3 operator !(Bool4x3 matrix) => default; } /// @@ -2911,38 +2431,6 @@ namespace ComputeSharp /// /// The value to negate. /// This method 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; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// This method 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// This method 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; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// This method 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// This method 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; + public static Bool4x4 operator !(Bool4x4 matrix) => default; } } diff --git a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude index f9cfabb6..4ab82478 100644 --- a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude @@ -203,21 +203,23 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen PopIndent(); // Generate the negation operator - if (elementTypeName != "Bool" && elementTypeName != "UInt") + if (typeName != "UInt") { WriteLine(""); + + string operatorName = typeName == "Bool" ? "!" : "-"; #> /// /// Negates a value. /// /// The value to negate. /// This method 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; + public static <#=fullTypeName#> operator <#=operatorName#>(<#=fullTypeName#> matrix) => default; <# } // Generate the numerical operators - if (elementTypeName != "Bool") + if (typeName != "Bool") { WriteLine(""); #> diff --git a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs index e43e9d7e..0dae3973 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs @@ -80,13 +80,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -204,13 +197,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -345,13 +331,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -497,13 +476,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -627,13 +599,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -792,13 +757,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -975,13 +933,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -1182,13 +1133,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -1317,13 +1261,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -1507,13 +1444,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -1727,13 +1657,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -1983,13 +1906,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -2129,13 +2045,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -2344,13 +2253,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -2601,13 +2503,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. /// @@ -2906,13 +2801,6 @@ namespace ComputeSharp return matrix; } - /// - /// Negates a value. - /// - /// The value to negate. - /// This method 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; - /// /// Sums two values. ///