diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.Casts.g.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.Casts.g.cs
new file mode 100644
index 00000000..ce787c2b
--- /dev/null
+++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.Casts.g.cs
@@ -0,0 +1,724 @@
+using ComputeSharp.Core.Intrinsics.Attributes;
+
+namespace ComputeSharp;
+
+///
+partial class Hlsl
+{
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool")]
+ public static bool FloatToBool(float x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2")]
+ public static Bool2 FloatToBool(Float2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3")]
+ public static Bool3 FloatToBool(Float3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4")]
+ public static Bool4 FloatToBool(Float4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x1")]
+ public static Bool1x1 FloatToBool(Float1x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x2")]
+ public static Bool1x2 FloatToBool(Float1x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x3")]
+ public static Bool1x3 FloatToBool(Float1x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x4")]
+ public static Bool1x4 FloatToBool(Float1x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x1")]
+ public static Bool2x1 FloatToBool(Float2x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x2")]
+ public static Bool2x2 FloatToBool(Float2x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x3")]
+ public static Bool2x3 FloatToBool(Float2x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x4")]
+ public static Bool2x4 FloatToBool(Float2x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x1")]
+ public static Bool3x1 FloatToBool(Float3x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x2")]
+ public static Bool3x2 FloatToBool(Float3x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x3")]
+ public static Bool3x3 FloatToBool(Float3x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x4")]
+ public static Bool3x4 FloatToBool(Float3x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x1")]
+ public static Bool4x1 FloatToBool(Float4x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x2")]
+ public static Bool4x2 FloatToBool(Float4x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x3")]
+ public static Bool4x3 FloatToBool(Float4x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x4")]
+ public static Bool4x4 FloatToBool(Float4x4 x) => default;
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool")]
+ public static bool DoubleToBool(double x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2")]
+ public static Bool2 DoubleToBool(Double2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3")]
+ public static Bool3 DoubleToBool(Double3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4")]
+ public static Bool4 DoubleToBool(Double4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x1")]
+ public static Bool1x1 DoubleToBool(Double1x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x2")]
+ public static Bool1x2 DoubleToBool(Double1x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x3")]
+ public static Bool1x3 DoubleToBool(Double1x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x4")]
+ public static Bool1x4 DoubleToBool(Double1x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x1")]
+ public static Bool2x1 DoubleToBool(Double2x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x2")]
+ public static Bool2x2 DoubleToBool(Double2x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x3")]
+ public static Bool2x3 DoubleToBool(Double2x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x4")]
+ public static Bool2x4 DoubleToBool(Double2x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x1")]
+ public static Bool3x1 DoubleToBool(Double3x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x2")]
+ public static Bool3x2 DoubleToBool(Double3x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x3")]
+ public static Bool3x3 DoubleToBool(Double3x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x4")]
+ public static Bool3x4 DoubleToBool(Double3x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x1")]
+ public static Bool4x1 DoubleToBool(Double4x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x2")]
+ public static Bool4x2 DoubleToBool(Double4x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x3")]
+ public static Bool4x3 DoubleToBool(Double4x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x4")]
+ public static Bool4x4 DoubleToBool(Double4x4 x) => default;
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool")]
+ public static bool IntToBool(int x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2")]
+ public static Bool2 IntToBool(Int2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3")]
+ public static Bool3 IntToBool(Int3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4")]
+ public static Bool4 IntToBool(Int4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x1")]
+ public static Bool1x1 IntToBool(Int1x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x2")]
+ public static Bool1x2 IntToBool(Int1x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x3")]
+ public static Bool1x3 IntToBool(Int1x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x4")]
+ public static Bool1x4 IntToBool(Int1x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x1")]
+ public static Bool2x1 IntToBool(Int2x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x2")]
+ public static Bool2x2 IntToBool(Int2x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x3")]
+ public static Bool2x3 IntToBool(Int2x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x4")]
+ public static Bool2x4 IntToBool(Int2x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x1")]
+ public static Bool3x1 IntToBool(Int3x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x2")]
+ public static Bool3x2 IntToBool(Int3x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x3")]
+ public static Bool3x3 IntToBool(Int3x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x4")]
+ public static Bool3x4 IntToBool(Int3x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x1")]
+ public static Bool4x1 IntToBool(Int4x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x2")]
+ public static Bool4x2 IntToBool(Int4x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x3")]
+ public static Bool4x3 IntToBool(Int4x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x4")]
+ public static Bool4x4 IntToBool(Int4x4 x) => default;
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool")]
+ public static bool UIntToBool(uint x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2")]
+ public static Bool2 UIntToBool(UInt2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3")]
+ public static Bool3 UIntToBool(UInt3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4")]
+ public static Bool4 UIntToBool(UInt4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x1")]
+ public static Bool1x1 UIntToBool(UInt1x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x2")]
+ public static Bool1x2 UIntToBool(UInt1x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x3")]
+ public static Bool1x3 UIntToBool(UInt1x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool1x4")]
+ public static Bool1x4 UIntToBool(UInt1x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x1")]
+ public static Bool2x1 UIntToBool(UInt2x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x2")]
+ public static Bool2x2 UIntToBool(UInt2x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x3")]
+ public static Bool2x3 UIntToBool(UInt2x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool2x4")]
+ public static Bool2x4 UIntToBool(UInt2x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x1")]
+ public static Bool3x1 UIntToBool(UInt3x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x2")]
+ public static Bool3x2 UIntToBool(UInt3x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x3")]
+ public static Bool3x3 UIntToBool(UInt3x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool3x4")]
+ public static Bool3x4 UIntToBool(UInt3x4 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x1")]
+ public static Bool4x1 UIntToBool(UInt4x1 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x2")]
+ public static Bool4x2 UIntToBool(UInt4x2 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x3")]
+ public static Bool4x3 UIntToBool(UInt4x3 x) => default;
+
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("bool4x4")]
+ public static Bool4x4 UIntToBool(UInt4x4 x) => default;
+}
diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.Casts.tt b/src/ComputeSharp.Core/Intrinsics/Hlsl.Casts.tt
new file mode 100644
index 00000000..0d96cfda
--- /dev/null
+++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.Casts.tt
@@ -0,0 +1,54 @@
+<#@ template debug="false" hostspecific="false" language="C#" #>
+<#@ assembly name="System.Core" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ output extension=".g.cs"#>
+using ComputeSharp.Core.Intrinsics.Attributes;
+
+namespace ComputeSharp;
+
+///
+partial class Hlsl
+{
+<#
+foreach (var type in new[] { "Float", "Double", "Int", "UInt" })
+{
+ int index = 0;
+
+ List<(string Source, string Target)> typeNames = new List<(string, string)>();
+
+ typeNames.Add((type.ToLower(), "bool"));
+
+ // Vector types
+ for (int i = 2; i <= 4; i++)
+ {
+ typeNames.Add(($"{type}{i}", $"Bool{i}"));
+ }
+
+ // Matrix types
+ for (int i = 1; i <= 4; i++)
+ {
+ for (int j = 1; j <= 4; j++)
+ {
+ typeNames.Add(($"{type}{i}x{j}", $"Bool{i}x{j}"));
+ }
+ }
+
+ // Produce the intrinsics
+ foreach (var pair in typeNames)
+ {
+ if (index++ != 0) WriteLine("");
+
+#>
+ ///
+ /// Converts the input value into a value (non-zero elements map to , zero elements map to ).
+ ///
+ /// The input value.
+ /// The converted value.
+ /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.
+ [HlslIntrinsicName("<#=pair.Target.ToLower()#>")]
+ public static <#=pair.Target#> <#=type#>ToBool(<#=pair.Source#> x) => default;
+<#
+ }
+}
+#>
+}