diff --git a/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs b/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs index c74b10fb..75687207 100644 --- a/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs +++ b/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs @@ -17,6 +17,30 @@ namespace ComputeSharp [Pure] public static int Abs(in int x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(int)"); + /// + /// Returns the absolute value of the specified value + /// + /// The specified value + /// The absolute value of the parameter + [Pure] + public static Int2 Abs(in Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Int2)})"); + + /// + /// Returns the absolute value of the specified value + /// + /// The specified value + /// The absolute value of the parameter + [Pure] + public static Int3 Abs(in Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Int3)})"); + + /// + /// Returns the absolute value of the specified value + /// + /// The specified value + /// The absolute value of the parameter + [Pure] + public static Int4 Abs(in Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Int4)})"); + /// /// Returns the absolute value of the specified value /// @@ -81,6 +105,30 @@ namespace ComputeSharp [Pure] public static Vector3 Acos(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector4)})"); + /// + /// Determines if all components of the specified value are non-zero + /// + /// The specified value + /// if all components of the parameter are non-zero; otherwise, + [Pure] + public static bool All(in Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Int2)})"); + + /// + /// Determines if all components of the specified value are non-zero + /// + /// The specified value + /// if all components of the parameter are non-zero; otherwise, + [Pure] + public static bool All(in Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Int3)})"); + + /// + /// Determines if all components of the specified value are non-zero + /// + /// The specified value + /// if all components of the parameter are non-zero; otherwise, + [Pure] + public static bool All(in Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Int4)})"); + /// /// Determines if all components of the specified value are non-zero /// @@ -105,6 +153,30 @@ namespace ComputeSharp [Pure] public static bool All(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector4)})"); + /// + /// Determines if any components of the specified value are non-zero + /// + /// The specified value + /// if any components of the parameter are non-zero; otherwise, + [Pure] + public static bool Any(in Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Int2)})"); + + /// + /// Determines if any components of the specified value are non-zero + /// + /// The specified value + /// if any components of the parameter are non-zero; otherwise, + [Pure] + public static bool Any(in Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Int3)})"); + + /// + /// Determines if any components of the specified value are non-zero + /// + /// The specified value + /// if any components of the parameter are non-zero; otherwise, + [Pure] + public static bool Any(in Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Int4)})"); + /// /// Determines if any components of the specified value are non-zero /// @@ -272,6 +344,39 @@ namespace ComputeSharp [Pure] public static int Clamp(in int x, in int min, in int max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}(int,int,int)"); + /// + /// Clamps the specified value to the specified minimum and maximum range + /// + /// A value to clamp + /// The specified minimum range + /// The specified maximum range + /// The clamped value for the x parameter + /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined + [Pure] + public static Int2 Clamp(in Int2 x, in Int2 min, in Int2 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Int2)},{nameof(Int2)},{nameof(Int2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range + /// + /// A value to clamp + /// The specified minimum range + /// The specified maximum range + /// The clamped value for the x parameter + /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined + [Pure] + public static Int3 Clamp(in Int3 x, in Int3 min, in Int3 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Int3)},{nameof(Int3)},{nameof(Int3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range + /// + /// A value to clamp + /// The specified minimum range + /// The specified maximum range + /// The clamped value for the x parameter + /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined + [Pure] + public static Int4 Clamp(in Int4 x, in Int4 min, in Int4 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Int4)},{nameof(Int4)},{nameof(Int4)})"); + /// /// Clamps the specified value to the specified minimum and maximum range ///