From 97d023387d3701343851dc6b05abd0aaa09797ce Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 23 Feb 2021 02:04:28 +0100 Subject: [PATCH] Added missing length HLSL intrinsic methods --- src/ComputeSharp.Core/Intrinsics/Hlsl.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.cs index 3d757637..dc8e838c 100644 --- a/src/ComputeSharp.Core/Intrinsics/Hlsl.cs +++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.cs @@ -1240,6 +1240,30 @@ namespace ComputeSharp [Pure] public static Float4 Ldexp(Float4 x, Float4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Float4)},{nameof(Float4)})"); + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the x parameter. + [Pure] + public static float Length(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Length)}({nameof(Float2)})"); + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the x parameter. + [Pure] + public static float Length(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Length)}({nameof(Float3)})"); + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the x parameter. + [Pure] + public static float Length(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Length)}({nameof(Float4)})"); + /// /// Performs a linear interpolation. ///