diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs
index c5935638..55dc22ab 100644
--- a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs
+++ b/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs
@@ -115,5 +115,12 @@ namespace ComputeSharp
return sb.ToString();
}
+
+ ///
+ /// 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 Bool2 operator !(Bool2 xy) => default;
}
}
diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs
index 42a59fa3..1c4a4eb6 100644
--- a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs
+++ b/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs
@@ -514,5 +514,12 @@ namespace ComputeSharp
return sb.ToString();
}
+
+ ///
+ /// 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 Bool3 operator !(Bool3 xyz) => default;
}
}
diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs
index f54edec5..208fd259 100644
--- a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs
+++ b/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs
@@ -4129,5 +4129,12 @@ namespace ComputeSharp
return sb.ToString();
}
+
+ ///
+ /// 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 Bool4 operator !(Bool4 xyzw) => default;
}
}
diff --git a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude b/src/ComputeSharp/Core/Primitives/VectorType.ttinclude
index c248b560..6ed15886 100644
--- a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude
+++ b/src/ComputeSharp/Core/Primitives/VectorType.ttinclude
@@ -242,18 +242,19 @@ namespace ComputeSharp
}
// Generate the negation operator
- if (elementTypeName != "Bool" && elementTypeName != "UInt")
+ if (elementTypeName != "UInt")
{
WriteLine("");
string argumentName = "xyzw".Substring(0, i);
+ string operatorName = elementTypeName == "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 <#=typeName#> operator -(<#=typeName#> <#=argumentName#>) => default;
+ public static <#=typeName#> operator <#=operatorName#>(<#=typeName#> <#=argumentName#>) => default;
<#
}