From 56c5273116df3e6dcdfbd9672c4d6d44fdf9673d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 24 Aug 2019 23:22:50 +0200 Subject: [PATCH 1/6] Added code to refactor inline out expressions --- .../Translation/MethodDecompiler.cs | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs b/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs index 3046b64f..8a8c37f2 100644 --- a/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs +++ b/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Reflection.Metadata; using System.Text; using System.Text.RegularExpressions; +using ComputeSharp.Shaders.Mappings; using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.CSharp; using ICSharpCode.Decompiler.Metadata; @@ -170,10 +171,13 @@ namespace ComputeSharp.Shaders.Translation } // Unwrap the nested fields - string unwrappedCode = UnwrapSyntaxTree(methodFixedCode); + string unwrappedSourceCode = UnwrapSyntaxTree(methodFixedCode); + + // Tweak the out declarations + string outFixedSourceCode = RefactorInlineOutDeclarations(unwrappedSourceCode, methodInfo.Name); // Load the type syntax tree - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(unwrappedCode); + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(outFixedSourceCode); // Get the root node to return rootNode = syntaxTree.GetRoot().DescendantNodes().OfType().First(node => node.GetLeadingTrivia().ToFullString().Contains(methodInfo.Name)); @@ -255,5 +259,43 @@ namespace ComputeSharp.Shaders.Translation return source; } + + /// + /// Refactors all the inline out expressions with a variable declaration + /// + /// The input source code to process + /// The name of the shader method being processed + [Pure] + private string RefactorInlineOutDeclarations(string source, string entryPoint) + { + // Replace the discards + source = Regex.Replace(source, @"(? $"out {m.Groups[1].Value} {new string(Guid.NewGuid().ToByteArray().Select(b => (char)('a' + b % 26)).ToArray())}"); + + // Load the syntax tree and the entry node + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); + MethodDeclarationSyntax rootNode = syntaxTree.GetRoot().DescendantNodes().OfType().First(node => node.GetLeadingTrivia().ToFullString().Contains(entryPoint)); + + // Get the out declarations to replace + var outs = ( + from argument in rootNode.DescendantNodes().OfType() + where argument.RefKindKeyword.IsKind(SyntaxKind.OutKeyword) && + argument.Expression.IsKind(SyntaxKind.DeclarationExpression) + let match = Regex.Match(argument.Expression.ToFullString(), @"([\w.]+) ([\w_]+)") + let mappedType = HlslKnownTypes.GetMappedName(match.Groups[1].Value) + let declatation = $"{mappedType} {match.Groups[2].Value} = ({mappedType})0;" + select (match.Groups[1].Value, match.Groups[2].Value, declatation)).ToArray(); + + // Insert the explicit declarations at the start of the method + int start = rootNode.Body.ChildNodes().First().SpanStart; + foreach (var item in outs.Reverse()) + { + source = source.Insert(start, $"{item.declatation}{Environment.NewLine} "); + } + + // Remove the out keyword from the source + source = Regex.Replace(source, @"(? Date: Sat, 24 Aug 2019 23:38:21 +0200 Subject: [PATCH 2/6] Added HLSL intrinsics with out parameters --- src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs | 113 ++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs b/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs index 6d4fa9a9..1479ac71 100644 --- a/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs +++ b/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs @@ -647,6 +647,42 @@ namespace ComputeSharp [Pure] public static Vector4 Frac(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector4)})"); + /// + /// Returns the mantissa and exponent of the specified floating-point value + /// + /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) + /// The returned exponent of the parameter + /// The fractional part of the parameter + [Pure] + public static float Frexp(float x, out float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}(float,float)"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value + /// + /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) + /// The returned exponent of the parameter + /// The fractional part of the parameter + [Pure] + public static Vector2 Frexp(Vector2 x, out Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector2)},{nameof(Vector2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value + /// + /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) + /// The returned exponent of the parameter + /// The fractional part of the parameter + [Pure] + public static Vector3 Frexp(Vector3 x, out Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector3)},{nameof(Vector3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value + /// + /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) + /// The returned exponent of the parameter + /// The fractional part of the parameter + [Pure] + public static Vector4 Frexp(Vector4 x, out Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector4)},{nameof(Vector4)})"); + /// /// Determines if the specified floating-point value is finite /// @@ -943,6 +979,51 @@ namespace ComputeSharp [Pure] public static Vector4 Min(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector4)},{nameof(Vector4)})"); + /// + /// Splits the value into fractional and integer parts, each of which has the same sign as + /// + /// The input value + /// The integer portion of + /// The signed-fractional portion of + [Pure] + public static int Modf(int x, int ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(int,int)"); + + /// + /// Splits the value into fractional and integer parts, each of which has the same sign as + /// + /// The input value + /// The integer portion of + /// The signed-fractional portion of + [Pure] + public static float Modf(float x, float ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(float,float)"); + + /// + /// Splits the value into fractional and integer parts, each of which has the same sign as + /// + /// The input value + /// The integer portion of + /// The signed-fractional portion of + [Pure] + public static Vector2 Modf(Vector2 x, Vector2 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector2)},{nameof(Vector2)})"); + + /// + /// Splits the value into fractional and integer parts, each of which has the same sign as + /// + /// The input value + /// The integer portion of + /// The signed-fractional portion of + [Pure] + public static Vector3 Modf(Vector3 x, Vector3 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector3)},{nameof(Vector3)})"); + + /// + /// Splits the value into fractional and integer parts, each of which has the same sign as + /// + /// The input value + /// The integer portion of + /// The signed-fractional portion of + [Pure] + public static Vector4 Modf(Vector4 x, Vector4 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector4)},{nameof(Vector4)})"); + /// /// Multiplies and using matrix math /// @@ -1316,6 +1397,38 @@ namespace ComputeSharp [Pure] public static Vector4 Sin(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector4)})"); + /// + /// Returns the sine and cosine of + /// + /// The specified value, in radians + /// Returns the sine of + /// Returns the cosine of + public static void SinCos(float x, out float s, out float c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}(float,float,float)"); + + /// + /// Returns the sine and cosine of + /// + /// The specified value, in radians + /// Returns the sine of + /// Returns the cosine of + public static void SinCos(Vector2 x, out Vector2 s, out Vector2 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); + + /// + /// Returns the sine and cosine of + /// + /// The specified value, in radians + /// Returns the sine of + /// Returns the cosine of + public static void SinCos(Vector3 x, out Vector3 s, out Vector3 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); + + /// + /// Returns the sine and cosine of + /// + /// The specified value, in radians + /// Returns the sine of + /// Returns the cosine of + public static void SinCos(Vector4 x, out Vector4 s, out Vector4 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); + /// /// Returns the hyperbolic sine of the specified value /// From 63623f4d92bd34c0b31d5eec56d6b82e8d2cf692 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 24 Aug 2019 23:49:44 +0200 Subject: [PATCH 3/6] Added in parameters to HLSL intrinsics --- src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs | 408 ++++++++++---------- 1 file changed, 204 insertions(+), 204 deletions(-) diff --git a/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs b/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs index 1479ac71..c74b10fb 100644 --- a/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs +++ b/src/ComputeSharp.Shaders/Intrinsics/Hlsl.cs @@ -15,7 +15,7 @@ namespace ComputeSharp /// The specified value /// The absolute value of the parameter [Pure] - public static int Abs(int x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(int)"); + public static int Abs(in int x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(int)"); /// /// Returns the absolute value of the specified value @@ -23,7 +23,7 @@ namespace ComputeSharp /// The specified value /// The absolute value of the parameter [Pure] - public static float Abs(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(float)"); + public static float Abs(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(float)"); /// /// Returns the absolute value of the specified value @@ -31,7 +31,7 @@ namespace ComputeSharp /// The specified value /// The absolute value of the parameter [Pure] - public static Vector2 Abs(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector2)})"); + public static Vector2 Abs(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector2)})"); /// /// Returns the absolute value of the specified value @@ -39,7 +39,7 @@ namespace ComputeSharp /// The specified value /// The absolute value of the parameter [Pure] - public static Vector3 Abs(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector3)})"); + public static Vector3 Abs(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector3)})"); /// /// Returns the absolute value of the specified value @@ -47,7 +47,7 @@ namespace ComputeSharp /// The specified value /// The absolute value of the parameter [Pure] - public static Vector4 Abs(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector4)})"); + public static Vector4 Abs(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector4)})"); /// /// Returns the arccosine of the specified value @@ -55,7 +55,7 @@ namespace ComputeSharp /// The specified value, which should be within the range [-1 to 1] /// The arccosine of the parameter [Pure] - public static float Acos(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}(float)"); + public static float Acos(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}(float)"); /// /// Returns the arccosine of the specified value @@ -63,7 +63,7 @@ namespace ComputeSharp /// The specified value, where each component should be within the range [-1 to 1] /// The arccosine of the parameter [Pure] - public static Vector2 Acos(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector2)})"); + public static Vector2 Acos(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector2)})"); /// /// Returns the arccosine of the specified value @@ -71,7 +71,7 @@ namespace ComputeSharp /// The specified value, where each component should be within the range [-1 to 1] /// The arccosine of the parameter [Pure] - public static Vector3 Acos(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector3)})"); + public static Vector3 Acos(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector3)})"); /// /// Returns the arccosine of the specified value @@ -79,7 +79,7 @@ namespace ComputeSharp /// The specified value, where each component should be within the range [-1 to 1] /// The arccosine of the parameter [Pure] - public static Vector3 Acos(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector4)})"); + 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 @@ -87,7 +87,7 @@ namespace ComputeSharp /// The specified value /// if all components of the parameter are non-zero; otherwise, [Pure] - public static bool All(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector2)})"); + public static bool All(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector2)})"); /// /// Determines if all components of the specified value are non-zero @@ -95,7 +95,7 @@ namespace ComputeSharp /// The specified value /// if all components of the parameter are non-zero; otherwise, [Pure] - public static bool All(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector3)})"); + public static bool All(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector3)})"); /// /// Determines if all components of the specified value are non-zero @@ -103,7 +103,7 @@ namespace ComputeSharp /// The specified value /// if all components of the parameter are non-zero; otherwise, [Pure] - public static bool All(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector4)})"); + 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 @@ -111,7 +111,7 @@ namespace ComputeSharp /// The specified value /// if any components of the parameter are non-zero; otherwise, [Pure] - public static bool Any(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector2)})"); + public static bool Any(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector2)})"); /// /// Determines if any components of the specified value are non-zero @@ -119,7 +119,7 @@ namespace ComputeSharp /// The specified value /// if any components of the parameter are non-zero; otherwise, [Pure] - public static bool Any(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector3)})"); + public static bool Any(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector3)})"); /// /// Determines if any components of the specified value are non-zero @@ -127,7 +127,7 @@ namespace ComputeSharp /// The specified value /// if any components of the parameter are non-zero; otherwise, [Pure] - public static bool Any(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector4)})"); + public static bool Any(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector4)})"); /// /// Returns the arcsine of the specified value @@ -135,7 +135,7 @@ namespace ComputeSharp /// The specified value, which should be within the range [-1 to 1] /// The arcsine of the parameter [Pure] - public static float Asin(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}(float)"); + public static float Asin(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}(float)"); /// /// Returns the arcsine of the specified value @@ -143,7 +143,7 @@ namespace ComputeSharp /// The specified value, where each component should be within the range [-1 to 1] /// The arcsine of the parameter [Pure] - public static Vector2 Asin(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector2)})"); + public static Vector2 Asin(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector2)})"); /// /// Returns the arcsine of the specified value @@ -151,7 +151,7 @@ namespace ComputeSharp /// The specified value, where each component should be within the range [-1 to 1] /// The arcsine of the parameter [Pure] - public static Vector3 Asin(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector3)})"); + public static Vector3 Asin(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector3)})"); /// /// Returns the arcsine of the specified value @@ -159,7 +159,7 @@ namespace ComputeSharp /// The specified value, where each component should be within the range [-1 to 1] /// The arcsine of the parameter [Pure] - public static Vector3 Asin(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector4)})"); + public static Vector3 Asin(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector4)})"); /// /// Returns the arctangent of the specified value @@ -167,7 +167,7 @@ namespace ComputeSharp /// The specified value /// The arctangent of the parameter [Pure] - public static float Atan(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}(float)"); + public static float Atan(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}(float)"); /// /// Returns the arctangent of the specified value @@ -175,7 +175,7 @@ namespace ComputeSharp /// The specified value /// The arctangent of the parameter [Pure] - public static Vector2 Atan(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector2)})"); + public static Vector2 Atan(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector2)})"); /// /// Returns the arctangent of the specified value @@ -183,7 +183,7 @@ namespace ComputeSharp /// The specified value /// The arctangent of the parameter [Pure] - public static Vector3 Atan(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector3)})"); + public static Vector3 Atan(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector3)})"); /// /// Returns the arctangent of the specified value @@ -191,7 +191,7 @@ namespace ComputeSharp /// The specified value /// The arctangent of the parameter [Pure] - public static Vector3 Atan(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector4)})"); + public static Vector3 Atan(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector4)})"); /// /// Returns the arctangent of two values (,) @@ -200,7 +200,7 @@ namespace ComputeSharp /// The value /// The arctangent of (,) [Pure] - public static float Atan2(float y, float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}(float,float)"); + public static float Atan2(in float y, in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}(float,float)"); /// /// Returns the arctangent of two values (,) @@ -209,7 +209,7 @@ namespace ComputeSharp /// The value /// The arctangent of (,) [Pure] - public static Vector2 Atan2(Vector2 y, Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Atan2(in Vector2 y, in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the arctangent of two values (,) @@ -218,7 +218,7 @@ namespace ComputeSharp /// The value /// The arctangent of (,) [Pure] - public static Vector3 Atan2(Vector3 y, Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Atan2(in Vector3 y, in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the arctangent of two values (,) @@ -227,7 +227,7 @@ namespace ComputeSharp /// The value /// The arctangent of (,) [Pure] - public static Vector3 Atan2(Vector4 y, Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector3 Atan2(in Vector4 y, in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the smallest integer value that is greater than or equal to the specified value @@ -235,7 +235,7 @@ namespace ComputeSharp /// The specified value /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter [Pure] - public static float Ceil(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}(float)"); + public static float Ceil(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}(float)"); /// /// Returns the smallest integer value that is greater than or equal to the specified value @@ -243,7 +243,7 @@ namespace ComputeSharp /// The specified value /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter [Pure] - public static Vector2 Ceil(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector2)})"); + public static Vector2 Ceil(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector2)})"); /// /// Returns the smallest integer value that is greater than or equal to the specified value @@ -251,7 +251,7 @@ namespace ComputeSharp /// The specified value /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter [Pure] - public static Vector3 Ceil(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector3)})"); + public static Vector3 Ceil(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector3)})"); /// /// Returns the smallest integer value that is greater than or equal to the specified value @@ -259,7 +259,7 @@ namespace ComputeSharp /// The specified value /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter [Pure] - public static Vector3 Ceil(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector4)})"); + public static Vector3 Ceil(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector4)})"); /// /// Clamps the specified value to the specified minimum and maximum range @@ -270,7 +270,7 @@ namespace ComputeSharp /// 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 int Clamp(int x, int min, int max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}(int,int,int)"); + 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 @@ -281,7 +281,7 @@ namespace ComputeSharp /// 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 float Clamp(float x, float min, float max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}(float,float,float)"); + public static float Clamp(in float x, in float min, in float max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}(float,float,float)"); /// /// Clamps the specified value to the specified minimum and maximum range @@ -292,7 +292,7 @@ namespace ComputeSharp /// 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 Vector2 Clamp(Vector2 x, Vector2 min, Vector2 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Clamp(in Vector2 x, in Vector2 min, in Vector2 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); /// /// Clamps the specified value to the specified minimum and maximum range @@ -303,7 +303,7 @@ namespace ComputeSharp /// 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 Vector3 Clamp(Vector3 x, Vector3 min, Vector3 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Clamp(in Vector3 x, in Vector3 min, in Vector3 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); /// /// Clamps the specified value to the specified minimum and maximum range @@ -314,7 +314,7 @@ namespace ComputeSharp /// 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 Vector4 Clamp(Vector4 x, Vector4 min, Vector4 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Clamp(in Vector4 x, in Vector4 min, in Vector4 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the cosine of the specified value @@ -322,7 +322,7 @@ namespace ComputeSharp /// The specified value, in radians /// The cosine of the parameter [Pure] - public static float Cos(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}(float)"); + public static float Cos(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}(float)"); /// /// Returns the cosine of the specified value @@ -330,7 +330,7 @@ namespace ComputeSharp /// The specified value, in radians /// The cosine of the parameter [Pure] - public static Vector2 Cos(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector2)})"); + public static Vector2 Cos(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector2)})"); /// /// Returns the cosine of the specified value @@ -338,7 +338,7 @@ namespace ComputeSharp /// The specified value, in radians /// The cosine of the parameter [Pure] - public static Vector3 Cos(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector3)})"); + public static Vector3 Cos(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector3)})"); /// /// Returns the cosine of the specified value @@ -346,7 +346,7 @@ namespace ComputeSharp /// The specified value, in radians /// The cosine of the parameter [Pure] - public static Vector3 Cos(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector4)})"); + public static Vector3 Cos(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector4)})"); /// /// Returns the hyperbolic cosine of the specified value @@ -354,7 +354,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic cosine of the parameter [Pure] - public static float Cosh(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}(float)"); + public static float Cosh(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}(float)"); /// /// Returns the hyperbolic cosine of the specified value @@ -362,7 +362,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic cosine of the parameter [Pure] - public static Vector2 Cosh(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector2)})"); + public static Vector2 Cosh(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector2)})"); /// /// Returns the hyperbolic cosine of the specified value @@ -370,7 +370,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic cosine of the parameter [Pure] - public static Vector3 Cosh(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector3)})"); + public static Vector3 Cosh(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector3)})"); /// /// Returns the hyperbolic cosine of the specified value @@ -378,7 +378,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic cosine of the parameter [Pure] - public static Vector3 Cosh(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector4)})"); + public static Vector3 Cosh(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector4)})"); /// /// Counts the number of bits in the input value @@ -386,7 +386,7 @@ namespace ComputeSharp /// The input value /// The number of bits [Pure] - public static uint CountBits(uint x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(CountBits)}({nameof(Vector4)})"); + public static uint CountBits(in uint x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(CountBits)}({nameof(Vector4)})"); /// /// Returns the cross product of two values @@ -395,7 +395,7 @@ namespace ComputeSharp /// The second vector /// The cross product of the parameter and the parameter [Pure] - public static Vector3 Cross(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cross)}({nameof(Vector3)})"); + public static Vector3 Cross(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cross)}({nameof(Vector3)})"); /// /// Converts the specified value from radians to degrees @@ -403,7 +403,7 @@ namespace ComputeSharp /// The specified value /// The result of converting the parameter from radians to degrees [Pure] - public static float Degrees(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}(float)"); + public static float Degrees(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}(float)"); /// /// Converts the specified value from radians to degrees @@ -411,7 +411,7 @@ namespace ComputeSharp /// The specified value /// The result of converting the parameter from radians to degrees [Pure] - public static Vector2 Degrees(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector2)})"); + public static Vector2 Degrees(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector2)})"); /// /// Converts the specified value from radians to degrees @@ -419,7 +419,7 @@ namespace ComputeSharp /// The specified value /// The result of converting the parameter from radians to degrees [Pure] - public static Vector3 Degrees(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector3)})"); + public static Vector3 Degrees(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector3)})"); /// /// Converts the specified value from radians to degrees @@ -427,7 +427,7 @@ namespace ComputeSharp /// The specified value /// The result of converting the parameter from radians to degrees [Pure] - public static Vector3 Degrees(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector4)})"); + public static Vector3 Degrees(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector4)})"); /// /// Returns a distance scalar between two values @@ -436,7 +436,7 @@ namespace ComputeSharp /// The second value to compare /// A scalar value that represents the distance between the parameter and the parameter [Pure] - public static float Distance(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector2)},{nameof(Vector2)})"); + public static float Distance(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns a distance scalar between two values @@ -445,7 +445,7 @@ namespace ComputeSharp /// The second value to compare /// A scalar value that represents the distance between the parameter and the parameter [Pure] - public static float Distance(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector3)},{nameof(Vector3)})"); + public static float Distance(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns a distance scalar between two values @@ -454,7 +454,7 @@ namespace ComputeSharp /// The second value to compare /// A scalar value that represents the distance between the parameter and the parameter [Pure] - public static float Distance(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector4)},{nameof(Vector4)})"); + public static float Distance(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the dot product of two values @@ -463,7 +463,7 @@ namespace ComputeSharp /// The second vector /// The dot product of the parameter and the parameter [Pure] - public static float Dot(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector2)},{nameof(Vector2)})"); + public static float Dot(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the dot product of two values @@ -472,7 +472,7 @@ namespace ComputeSharp /// The second vector /// The dot product of the parameter and the parameter [Pure] - public static float Dot(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector3)},{nameof(Vector3)})"); + public static float Dot(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the dot product of two values @@ -481,7 +481,7 @@ namespace ComputeSharp /// The second vector /// The dot product of the parameter and the parameter [Pure] - public static float Dot(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector4)},{nameof(Vector4)})"); + public static float Dot(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the base-e exponential of the specified value @@ -489,7 +489,7 @@ namespace ComputeSharp /// The specified value /// The base-e exponential of the parameter [Pure] - public static float Exp(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}(float)"); + public static float Exp(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}(float)"); /// /// Returns the base-e exponential of the specified value @@ -497,7 +497,7 @@ namespace ComputeSharp /// The specified value /// The base-e exponential of the parameter [Pure] - public static Vector2 Exp(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector2)})"); + public static Vector2 Exp(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector2)})"); /// /// Returns the base-e exponential of the specified value @@ -505,7 +505,7 @@ namespace ComputeSharp /// The specified value /// The base-e exponential of the parameter [Pure] - public static Vector3 Exp(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector3)})"); + public static Vector3 Exp(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector3)})"); /// /// Returns the base-e exponential of the specified value @@ -513,7 +513,7 @@ namespace ComputeSharp /// The specified value /// The base-e exponential of the parameter [Pure] - public static Vector4 Exp(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector4)})"); + public static Vector4 Exp(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector4)})"); /// /// Returns the base-2 exponential of the specified value @@ -521,7 +521,7 @@ namespace ComputeSharp /// The specified value /// The base-2 exponential of the parameter [Pure] - public static float Exp2(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}(float)"); + public static float Exp2(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}(float)"); /// /// Returns the base-2 exponential of the specified value @@ -529,7 +529,7 @@ namespace ComputeSharp /// The specified value /// The base-2 exponential of the parameter [Pure] - public static Vector2 Exp2(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector2)})"); + public static Vector2 Exp2(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector2)})"); /// /// Returns the base-2 exponential of the specified value @@ -537,7 +537,7 @@ namespace ComputeSharp /// The specified value /// The base-2 exponential of the parameter [Pure] - public static Vector3 Exp2(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector3)})"); + public static Vector3 Exp2(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector3)})"); /// /// Returns the base-2 exponential of the specified value @@ -545,7 +545,7 @@ namespace ComputeSharp /// The specified value /// The base-2 exponential of the parameter [Pure] - public static Vector4 Exp2(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector4)})"); + public static Vector4 Exp2(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector4)})"); /// /// Returns the largest integer that is less than or equal to the specified value @@ -553,7 +553,7 @@ namespace ComputeSharp /// The specified value /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter [Pure] - public static float Floor(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}(float)"); + public static float Floor(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}(float)"); /// /// Returns the largest integer that is less than or equal to the specified value @@ -561,7 +561,7 @@ namespace ComputeSharp /// The specified value /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter [Pure] - public static Vector2 Floor(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector2)})"); + public static Vector2 Floor(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector2)})"); /// /// Returns the largest integer that is less than or equal to the specified value @@ -569,7 +569,7 @@ namespace ComputeSharp /// The specified value /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter [Pure] - public static Vector3 Floor(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector3)})"); + public static Vector3 Floor(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector3)})"); /// /// Returns the largest integer that is less than or equal to the specified value @@ -577,7 +577,7 @@ namespace ComputeSharp /// The specified value /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter [Pure] - public static Vector4 Floor(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector4)})"); + public static Vector4 Floor(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector4)})"); /// /// Returns the floating-point remainder of / @@ -586,7 +586,7 @@ namespace ComputeSharp /// The divisor /// The floating-point remainder of the parameter divided by the parameter [Pure] - public static float Fmod(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}(float)"); + public static float Fmod(in float x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}(float)"); /// /// Returns the floating-point remainder of / @@ -595,7 +595,7 @@ namespace ComputeSharp /// The divisor /// The floating-point remainder of the parameter divided by the parameter [Pure] - public static Vector2 Fmod(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Fmod(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the floating-point remainder of / @@ -604,7 +604,7 @@ namespace ComputeSharp /// The divisor /// The floating-point remainder of the parameter divided by the parameter [Pure] - public static Vector3 Fmod(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Fmod(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the floating-point remainder of / @@ -613,7 +613,7 @@ namespace ComputeSharp /// The divisor /// The floating-point remainder of the parameter divided by the parameter [Pure] - public static Vector4 Fmod(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Fmod(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 @@ -621,7 +621,7 @@ namespace ComputeSharp /// The specified value /// The fractional part of the parameter [Pure] - public static float Frac(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}(float)"); + public static float Frac(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}(float)"); /// /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 @@ -629,7 +629,7 @@ namespace ComputeSharp /// The specified value /// The fractional part of the parameter [Pure] - public static Vector2 Frac(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector2)})"); + public static Vector2 Frac(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector2)})"); /// /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 @@ -637,7 +637,7 @@ namespace ComputeSharp /// The specified value /// The fractional part of the parameter [Pure] - public static Vector3 Frac(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector3)})"); + public static Vector3 Frac(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector3)})"); /// /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 @@ -645,7 +645,7 @@ namespace ComputeSharp /// The specified value /// The fractional part of the parameter [Pure] - public static Vector4 Frac(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector4)})"); + public static Vector4 Frac(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector4)})"); /// /// Returns the mantissa and exponent of the specified floating-point value @@ -654,7 +654,7 @@ namespace ComputeSharp /// The returned exponent of the parameter /// The fractional part of the parameter [Pure] - public static float Frexp(float x, out float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}(float,float)"); + public static float Frexp(in float x, out float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}(float,float)"); /// /// Returns the mantissa and exponent of the specified floating-point value @@ -663,7 +663,7 @@ namespace ComputeSharp /// The returned exponent of the parameter /// The fractional part of the parameter [Pure] - public static Vector2 Frexp(Vector2 x, out Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Frexp(in Vector2 x, out Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the mantissa and exponent of the specified floating-point value @@ -672,7 +672,7 @@ namespace ComputeSharp /// The returned exponent of the parameter /// The fractional part of the parameter [Pure] - public static Vector3 Frexp(Vector3 x, out Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Frexp(in Vector3 x, out Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the mantissa and exponent of the specified floating-point value @@ -681,7 +681,7 @@ namespace ComputeSharp /// The returned exponent of the parameter /// The fractional part of the parameter [Pure] - public static Vector4 Frexp(Vector4 x, out Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Frexp(in Vector4 x, out Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Determines if the specified floating-point value is finite @@ -689,7 +689,7 @@ namespace ComputeSharp /// The specified value /// Returns if the parameter is finite, otherwise [Pure] - public static bool IsFinite(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsFinite)}(float)"); + public static bool IsFinite(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsFinite)}(float)"); /// /// Determines if the specified floating-point value is infinite @@ -697,7 +697,7 @@ namespace ComputeSharp /// The specified value /// Returns if the parameter is infinite, otherwise [Pure] - public static float IsInfinite(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsInfinite)}(float)"); + public static float IsInfinite(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsInfinite)}(float)"); /// /// Determines if the specified floating-point value is @@ -705,7 +705,7 @@ namespace ComputeSharp /// The specified value /// Returns if the parameter is , otherwise [Pure] - public static float IsNaN(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsNaN)}(float)"); + public static float IsNaN(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsNaN)}(float)"); /// /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent @@ -714,7 +714,7 @@ namespace ComputeSharp /// The specified exponent /// The result of multiplying the parameter by two, raised to the power of the parameter [Pure] - public static float Ldexp(float x, float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}(float)"); + public static float Ldexp(in float x, in float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}(float)"); /// /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent @@ -723,7 +723,7 @@ namespace ComputeSharp /// The specified exponent /// The result of multiplying the parameter by two, raised to the power of the parameter [Pure] - public static Vector2 Ldexp(Vector2 x, Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Ldexp(in Vector2 x, in Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent @@ -732,7 +732,7 @@ namespace ComputeSharp /// The specified exponent /// The result of multiplying the parameter by two, raised to the power of the parameter [Pure] - public static Vector3 Ldexp(Vector3 x, Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Ldexp(in Vector3 x, in Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent @@ -741,7 +741,7 @@ namespace ComputeSharp /// The specified exponent /// The result of multiplying the parameter by two, raised to the power of the parameter [Pure] - public static Vector4 Ldexp(Vector4 x, Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Ldexp(in Vector4 x, in Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Performs a linear interpolation @@ -751,7 +751,7 @@ namespace ComputeSharp /// A value that linearly interpolates between the parameter and the parameter /// The result of the linear interpolation [Pure] - public static float Lerp(float x, float y, float s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}(float,float,float)"); + public static float Lerp(in float x, in float y, in float s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}(float,float,float)"); /// /// Performs a linear interpolation @@ -761,7 +761,7 @@ namespace ComputeSharp /// A value that linearly interpolates between the parameter and the parameter /// The result of the linear interpolation [Pure] - public static Vector2 Lerp(Vector2 x, Vector2 y, Vector2 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Lerp(in Vector2 x, in Vector2 y, in Vector2 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); /// /// Performs a linear interpolation @@ -771,7 +771,7 @@ namespace ComputeSharp /// A value that linearly interpolates between the parameter and the parameter /// The result of the linear interpolation [Pure] - public static Vector3 Lerp(Vector3 x, Vector3 y, Vector3 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Lerp(in Vector3 x, in Vector3 y, in Vector3 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); /// /// Performs a linear interpolation @@ -781,7 +781,7 @@ namespace ComputeSharp /// A value that linearly interpolates between the parameter and the parameter /// The result of the linear interpolation [Pure] - public static Vector2 Lerp(Vector4 x, Vector4 y, Vector4 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); + public static Vector2 Lerp(in Vector4 x, in Vector4 y, in Vector4 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the base-e logarithm of the specified value @@ -789,7 +789,7 @@ namespace ComputeSharp /// The specified value /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static float Log(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}(float)"); + public static float Log(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}(float)"); /// /// Returns the base-e logarithm of the specified value @@ -797,7 +797,7 @@ namespace ComputeSharp /// The specified value /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector2 Log(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector2)})"); + public static Vector2 Log(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector2)})"); /// /// Returns the base-e logarithm of the specified value @@ -805,7 +805,7 @@ namespace ComputeSharp /// The specified value /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector3 Log(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector3)})"); + public static Vector3 Log(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector3)})"); /// /// Returns the base-e logarithm of the specified value @@ -813,7 +813,7 @@ namespace ComputeSharp /// The specified value /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector4 Log(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector4)})"); + public static Vector4 Log(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector4)})"); /// /// Returns the base-10 logarithm of the specified value @@ -821,7 +821,7 @@ namespace ComputeSharp /// The specified value /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static float Log10(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}(float)"); + public static float Log10(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}(float)"); /// /// Returns the base-10 logarithm of the specified value @@ -829,7 +829,7 @@ namespace ComputeSharp /// The specified value /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector2 Log10(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector2)})"); + public static Vector2 Log10(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector2)})"); /// /// Returns the base-10 logarithm of the specified value @@ -837,7 +837,7 @@ namespace ComputeSharp /// The specified value /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector3 Log10(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector3)})"); + public static Vector3 Log10(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector3)})"); /// /// Returns the base-10 logarithm of the specified value @@ -845,7 +845,7 @@ namespace ComputeSharp /// The specified value /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector4 Log10(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector4)})"); + public static Vector4 Log10(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector4)})"); /// /// Returns the base-2 logarithm of the specified value @@ -853,7 +853,7 @@ namespace ComputeSharp /// The specified value /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static float Log2(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}(float)"); + public static float Log2(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}(float)"); /// /// Returns the base-2 logarithm of the specified value @@ -861,7 +861,7 @@ namespace ComputeSharp /// The specified value /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector2 Log2(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector2)})"); + public static Vector2 Log2(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector2)})"); /// /// Returns the base-2 logarithm of the specified value @@ -869,7 +869,7 @@ namespace ComputeSharp /// The specified value /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector3 Log2(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector3)})"); + public static Vector3 Log2(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector3)})"); /// /// Returns the base-2 logarithm of the specified value @@ -877,7 +877,7 @@ namespace ComputeSharp /// The specified value /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) [Pure] - public static Vector4 Log2(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector4)})"); + public static Vector4 Log2(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector4)})"); /// /// Selects the greater of and @@ -885,9 +885,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected + /// For values of -INF or INF, will behave as expected [Pure] - public static int Max(int x, int y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}(int,int)"); + public static int Max(in int x, in int y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}(int,int)"); /// /// Selects the greater of and @@ -895,9 +895,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static float Max(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}(float,float)"); + public static float Max(in float x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}(float,float)"); /// /// Selects the greater of and @@ -905,9 +905,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static Vector2 Max(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Max(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Selects the greater of and @@ -915,9 +915,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static Vector3 Max(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Max(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Selects the greater of and @@ -925,9 +925,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static Vector4 Max(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Max(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Selects the lesser of and @@ -935,9 +935,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected + /// For values of -INF or INF, will behave as expected [Pure] - public static int Min(int x, int y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}(int,int)"); + public static int Min(in int x, in int y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}(int,int)"); /// /// Selects the lesser of and @@ -945,9 +945,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static float Min(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}(float,float)"); + public static float Min(in float x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}(float,float)"); /// /// Selects the lesser of and @@ -955,9 +955,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static Vector2 Min(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Min(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Selects the lesser of and @@ -965,9 +965,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static Vector3 Min(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Min(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Selects the lesser of and @@ -975,9 +975,9 @@ namespace ComputeSharp /// The first specified value /// The second specified exponent /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined + /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined [Pure] - public static Vector4 Min(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Min(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Splits the value into fractional and integer parts, each of which has the same sign as @@ -986,7 +986,7 @@ namespace ComputeSharp /// The integer portion of /// The signed-fractional portion of [Pure] - public static int Modf(int x, int ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(int,int)"); + public static int Modf(in int x, out int ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(int,int)"); /// /// Splits the value into fractional and integer parts, each of which has the same sign as @@ -995,7 +995,7 @@ namespace ComputeSharp /// The integer portion of /// The signed-fractional portion of [Pure] - public static float Modf(float x, float ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(float,float)"); + public static float Modf(in float x, out float ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(float,float)"); /// /// Splits the value into fractional and integer parts, each of which has the same sign as @@ -1004,7 +1004,7 @@ namespace ComputeSharp /// The integer portion of /// The signed-fractional portion of [Pure] - public static Vector2 Modf(Vector2 x, Vector2 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Modf(in Vector2 x, out Vector2 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Splits the value into fractional and integer parts, each of which has the same sign as @@ -1013,7 +1013,7 @@ namespace ComputeSharp /// The integer portion of /// The signed-fractional portion of [Pure] - public static Vector3 Modf(Vector3 x, Vector3 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Modf(in Vector3 x, out Vector3 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Splits the value into fractional and integer parts, each of which has the same sign as @@ -1022,7 +1022,7 @@ namespace ComputeSharp /// The integer portion of /// The signed-fractional portion of [Pure] - public static Vector4 Modf(Vector4 x, Vector4 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Modf(in Vector4 x, out Vector4 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Multiplies and using matrix math @@ -1031,7 +1031,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static Vector2 Mul(float x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector2)})"); + public static Vector2 Mul(in float x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector2)})"); /// /// Multiplies and using matrix math @@ -1040,7 +1040,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static Vector3 Mul(float x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector3)})"); + public static Vector3 Mul(in float x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector3)})"); /// /// Multiplies and using matrix math @@ -1049,7 +1049,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static Vector3 Mul(float x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector4)})"); + public static Vector3 Mul(in float x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector4)})"); /// /// Multiplies and using matrix math @@ -1058,7 +1058,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static Vector2 Mul(Vector2 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector2)},float)"); + public static Vector2 Mul(in Vector2 x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector2)},float)"); /// /// Multiplies and using matrix math @@ -1067,7 +1067,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static Vector3 Mul(Vector3 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector3)},float)"); + public static Vector3 Mul(in Vector3 x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector3)},float)"); /// /// Multiplies and using matrix math @@ -1076,7 +1076,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static Vector4 Mul(Vector4 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector4)},float)"); + public static Vector4 Mul(in Vector4 x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector4)},float)"); /// /// Multiplies and using matrix math @@ -1085,7 +1085,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static float Mul(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector2)},{nameof(Vector2)})"); + public static float Mul(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Multiplies and using matrix math @@ -1094,7 +1094,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static float Mul(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector3)},{nameof(Vector3)})"); + public static float Mul(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Multiplies and using matrix math @@ -1103,7 +1103,7 @@ namespace ComputeSharp /// The second input value (if is a vector, it treated as a column vector) /// The result of times [Pure] - public static float Mul(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector4)},{nameof(Vector4)})"); + public static float Mul(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Normalizes the specified floating-point vector according to / length() @@ -1111,7 +1111,7 @@ namespace ComputeSharp /// The specified value /// The normalized parameter [Pure] - public static Vector2 Normalize(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector2)})"); + public static Vector2 Normalize(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector2)})"); /// /// Normalizes the specified floating-point vector according to / length() @@ -1119,7 +1119,7 @@ namespace ComputeSharp /// The specified value /// The normalized parameter [Pure] - public static Vector3 Normalize(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector3)})"); + public static Vector3 Normalize(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector3)})"); /// /// Normalizes the specified floating-point vector according to / length() @@ -1127,7 +1127,7 @@ namespace ComputeSharp /// The specified value /// The normalized parameter [Pure] - public static Vector4 Normalize(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector4)})"); + public static Vector4 Normalize(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector4)})"); /// /// Returns the specified value raised to the specified power @@ -1137,7 +1137,7 @@ namespace ComputeSharp /// The parameter raised to the power of the parameter /// See for details on special cases [Pure] - public static float Pow(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}(float,float)"); + public static float Pow(in float x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}(float,float)"); /// /// Returns the specified value raised to the specified power @@ -1147,7 +1147,7 @@ namespace ComputeSharp /// The parameter raised to the power of the parameter /// See for details on special cases [Pure] - public static Vector2 Pow(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Pow(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the specified value raised to the specified power @@ -1157,7 +1157,7 @@ namespace ComputeSharp /// The parameter raised to the power of the parameter /// See for details on special cases [Pure] - public static Vector3 Pow(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Pow(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the specified value raised to the specified power @@ -1167,7 +1167,7 @@ namespace ComputeSharp /// The parameter raised to the power of the parameter /// See for details on special cases [Pure] - public static Vector4 Pow(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Pow(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Converts the specified value from degrees to radians @@ -1175,7 +1175,7 @@ namespace ComputeSharp /// The specified value /// The parameter converted from degrees to radians [Pure] - public static float Radians(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}(float)"); + public static float Radians(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}(float)"); /// /// Converts the specified value from degrees to radians @@ -1183,7 +1183,7 @@ namespace ComputeSharp /// The specified value /// The parameter converted from degrees to radians [Pure] - public static Vector2 Radians(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector2)})"); + public static Vector2 Radians(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector2)})"); /// /// Converts the specified value from degrees to radians @@ -1191,7 +1191,7 @@ namespace ComputeSharp /// The specified value /// The parameter converted from degrees to radians [Pure] - public static Vector3 Radians(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector3)})"); + public static Vector3 Radians(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector3)})"); /// /// Converts the specified value from degrees to radians @@ -1199,7 +1199,7 @@ namespace ComputeSharp /// The specified value /// The parameter converted from degrees to radians [Pure] - public static Vector4 Radians(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector4)})"); + public static Vector4 Radians(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector4)})"); /// /// Calculates a fast, approximate reciprocal of a given value @@ -1207,7 +1207,7 @@ namespace ComputeSharp /// The specified value /// The reciprocal of the parameter [Pure] - public static float Rcp(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}(float)"); + public static float Rcp(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}(float)"); /// /// Calculates a fast, approximate, per-component reciprocal @@ -1215,7 +1215,7 @@ namespace ComputeSharp /// The specified value /// The reciprocal of the parameter [Pure] - public static Vector2 Rcp(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector2)})"); + public static Vector2 Rcp(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector2)})"); /// /// Calculates a fast, approximate, per-component reciprocal @@ -1223,7 +1223,7 @@ namespace ComputeSharp /// The specified value /// The reciprocal of the parameter [Pure] - public static Vector3 Rcp(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector3)})"); + public static Vector3 Rcp(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector3)})"); /// /// Calculates a fast, approximate, per-component reciprocal @@ -1231,7 +1231,7 @@ namespace ComputeSharp /// The specified value /// The reciprocal of the parameter [Pure] - public static Vector4 Rcp(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector4)})"); + public static Vector4 Rcp(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector4)})"); /// /// Rounds the specified value to the nearest integer @@ -1239,7 +1239,7 @@ namespace ComputeSharp /// The specified value /// The parameter, rounded to the nearest integer within a floating-point type [Pure] - public static float Round(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}(float)"); + public static float Round(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}(float)"); /// /// Rounds the specified value to the nearest integer @@ -1247,7 +1247,7 @@ namespace ComputeSharp /// The specified value /// The parameter, rounded to the nearest integer within a floating-point type [Pure] - public static Vector2 Round(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector2)})"); + public static Vector2 Round(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector2)})"); /// /// Rounds the specified value to the nearest integer @@ -1255,7 +1255,7 @@ namespace ComputeSharp /// The specified value /// The parameter, rounded to the nearest integer within a floating-point type [Pure] - public static Vector3 Round(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector3)})"); + public static Vector3 Round(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector3)})"); /// /// Rounds the specified value to the nearest integer @@ -1263,7 +1263,7 @@ namespace ComputeSharp /// The specified value /// The parameter, rounded to the nearest integer within a floating-point type [Pure] - public static Vector4 Round(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector4)})"); + public static Vector4 Round(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector4)})"); /// /// Returns the reciprocal of the square root of the specified value @@ -1272,7 +1272,7 @@ namespace ComputeSharp /// The reciprocal of the square root of the parameter /// This function uses the following formula: 1 / sqrt() [Pure] - public static float Rsqrt(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}(float)"); + public static float Rsqrt(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}(float)"); /// /// Returns the reciprocal of the square root of the specified value @@ -1281,7 +1281,7 @@ namespace ComputeSharp /// The reciprocal of the square root of the parameter /// This function uses the following formula: 1 / sqrt() [Pure] - public static Vector2 Rsqrt(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector2)})"); + public static Vector2 Rsqrt(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector2)})"); /// /// Returns the reciprocal of the square root of the specified value @@ -1290,7 +1290,7 @@ namespace ComputeSharp /// The reciprocal of the square root of the parameter /// This function uses the following formula: 1 / sqrt() [Pure] - public static Vector3 Rsqrt(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector3)})"); + public static Vector3 Rsqrt(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector3)})"); /// /// Returns the reciprocal of the square root of the specified value @@ -1299,7 +1299,7 @@ namespace ComputeSharp /// The reciprocal of the square root of the parameter /// This function uses the following formula: 1 / sqrt() [Pure] - public static Vector4 Rsqrt(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector4)})"); + public static Vector4 Rsqrt(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector4)})"); /// /// Clamps the specified value within the range [0,1] @@ -1307,7 +1307,7 @@ namespace ComputeSharp /// The specified value /// The parameter, clamped within the range [0,1] [Pure] - public static float Saturate(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}(float)"); + public static float Saturate(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}(float)"); /// /// Clamps the specified value within the range [0,1] @@ -1315,7 +1315,7 @@ namespace ComputeSharp /// The specified value /// The parameter, clamped within the range [0,1] [Pure] - public static Vector2 Saturate(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector2)})"); + public static Vector2 Saturate(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector2)})"); /// /// Clamps the specified value within the range [0,1] @@ -1323,7 +1323,7 @@ namespace ComputeSharp /// The specified value /// The parameter, clamped within the range [0,1] [Pure] - public static Vector3 Saturate(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector3)})"); + public static Vector3 Saturate(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector3)})"); /// /// Clamps the specified value within the range [0,1] @@ -1331,7 +1331,7 @@ namespace ComputeSharp /// The specified value /// The parameter, clamped within the range [0,1] [Pure] - public static Vector4 Saturate(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector4)})"); + public static Vector4 Saturate(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector4)})"); /// /// Returns the sign of @@ -1339,7 +1339,7 @@ namespace ComputeSharp /// The input value /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero [Pure] - public static float Sign(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}(float)"); + public static float Sign(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}(float)"); /// /// Returns the sign of @@ -1347,7 +1347,7 @@ namespace ComputeSharp /// The input value /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero [Pure] - public static Vector2 Sign(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector2)})"); + public static Vector2 Sign(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector2)})"); /// /// Returns the sign of @@ -1355,7 +1355,7 @@ namespace ComputeSharp /// The input value /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero [Pure] - public static Vector3 Sign(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector3)})"); + public static Vector3 Sign(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector3)})"); /// /// Returns the sign of @@ -1363,7 +1363,7 @@ namespace ComputeSharp /// The input value /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero [Pure] - public static Vector4 Sign(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector4)})"); + public static Vector4 Sign(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector4)})"); /// /// Returns the sine of the specified value @@ -1371,7 +1371,7 @@ namespace ComputeSharp /// The specified value, in radians /// The sine of the parameter [Pure] - public static float Sin(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}(float)"); + public static float Sin(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}(float)"); /// /// Returns the sine of the specified value @@ -1379,7 +1379,7 @@ namespace ComputeSharp /// The specified value, in radians /// The sine of the parameter [Pure] - public static Vector2 Sin(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector2)})"); + public static Vector2 Sin(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector2)})"); /// /// Returns the sine of the specified value @@ -1387,7 +1387,7 @@ namespace ComputeSharp /// The specified value, in radians /// The sine of the parameter [Pure] - public static Vector3 Sin(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector3)})"); + public static Vector3 Sin(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector3)})"); /// /// Returns the sine of the specified value @@ -1395,7 +1395,7 @@ namespace ComputeSharp /// The specified value, in radians /// The sine of the parameter [Pure] - public static Vector4 Sin(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector4)})"); + public static Vector4 Sin(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector4)})"); /// /// Returns the sine and cosine of @@ -1403,7 +1403,7 @@ namespace ComputeSharp /// The specified value, in radians /// Returns the sine of /// Returns the cosine of - public static void SinCos(float x, out float s, out float c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}(float,float,float)"); + public static void SinCos(in float x, out float s, out float c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}(float,float,float)"); /// /// Returns the sine and cosine of @@ -1411,7 +1411,7 @@ namespace ComputeSharp /// The specified value, in radians /// Returns the sine of /// Returns the cosine of - public static void SinCos(Vector2 x, out Vector2 s, out Vector2 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); + public static void SinCos(in Vector2 x, out Vector2 s, out Vector2 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns the sine and cosine of @@ -1419,7 +1419,7 @@ namespace ComputeSharp /// The specified value, in radians /// Returns the sine of /// Returns the cosine of - public static void SinCos(Vector3 x, out Vector3 s, out Vector3 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); + public static void SinCos(in Vector3 x, out Vector3 s, out Vector3 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns the sine and cosine of @@ -1427,7 +1427,7 @@ namespace ComputeSharp /// The specified value, in radians /// Returns the sine of /// Returns the cosine of - public static void SinCos(Vector4 x, out Vector4 s, out Vector4 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); + public static void SinCos(in Vector4 x, out Vector4 s, out Vector4 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the hyperbolic sine of the specified value @@ -1435,7 +1435,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic sine of the parameter [Pure] - public static float Sinh(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}(float)"); + public static float Sinh(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}(float)"); /// /// Returns the hyperbolic sine of the specified value @@ -1443,7 +1443,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic sine of the parameter [Pure] - public static Vector2 Sinh(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector2)})"); + public static Vector2 Sinh(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector2)})"); /// /// Returns the hyperbolic sine of the specified value @@ -1451,7 +1451,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic sine of the parameter [Pure] - public static Vector3 Sinh(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector3)})"); + public static Vector3 Sinh(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector3)})"); /// /// Returns the hyperbolic sine of the specified value @@ -1459,7 +1459,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic sine of the parameter [Pure] - public static Vector4 Sinh(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector4)})"); + public static Vector4 Sinh(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector4)})"); /// /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] @@ -1469,7 +1469,7 @@ namespace ComputeSharp /// The specified value to be interpolated /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] [Pure] - public static float SmoothStep(float min, float max, float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}(float,float,float)"); + public static float SmoothStep(in float min, in float max, in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}(float,float,float)"); /// /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] @@ -1479,7 +1479,7 @@ namespace ComputeSharp /// The specified value to be interpolated /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] [Pure] - public static Vector2 SmoothStep(Vector2 min, Vector2 max, Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 SmoothStep(in Vector2 min, in Vector2 max, in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); /// /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] @@ -1489,7 +1489,7 @@ namespace ComputeSharp /// The specified value to be interpolated /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] [Pure] - public static Vector3 SmoothStep(Vector3 min, Vector3 max, Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 SmoothStep(in Vector3 min, in Vector3 max, in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); /// /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] @@ -1499,7 +1499,7 @@ namespace ComputeSharp /// The specified value to be interpolated /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] [Pure] - public static Vector4 SmoothStep(Vector4 min, Vector4 max, Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 SmoothStep(in Vector4 min, in Vector4 max, in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the square root of the specified floating-point value @@ -1507,7 +1507,7 @@ namespace ComputeSharp /// The specified value /// The square root of the parameter [Pure] - public static float Sqrt(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}(float)"); + public static float Sqrt(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}(float)"); /// /// Returns the square root of the specified floating-point value, per component @@ -1515,7 +1515,7 @@ namespace ComputeSharp /// The specified value /// The square root of the parameter, per component [Pure] - public static Vector2 Sqrt(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector2)})"); + public static Vector2 Sqrt(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector2)})"); /// /// Returns the square root of the specified floating-point value, per component @@ -1523,7 +1523,7 @@ namespace ComputeSharp /// The specified value /// The square root of the parameter, per component [Pure] - public static Vector3 Sqrt(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector3)})"); + public static Vector3 Sqrt(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector3)})"); /// /// Returns the square root of the specified floating-point value, per component @@ -1531,7 +1531,7 @@ namespace ComputeSharp /// The specified value /// The square root of the parameter, per component [Pure] - public static Vector4 Sqrt(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector4)})"); + public static Vector4 Sqrt(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector4)})"); /// /// Compares two values, returning 0 or 1 based on which value is greater @@ -1541,7 +1541,7 @@ namespace ComputeSharp /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 /// This function uses the following formula: (x >= y) ? 1 : 0 [Pure] - public static float Step(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}(float,float)"); + public static float Step(in float x, in float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}(float,float)"); /// /// Compares two values, returning 0 or 1 based on which value is greater @@ -1551,7 +1551,7 @@ namespace ComputeSharp /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 /// This function uses the following formula: (x >= y) ? 1 : 0 [Pure] - public static Vector2 Step(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector2)},{nameof(Vector2)})"); + public static Vector2 Step(in Vector2 x, in Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector2)},{nameof(Vector2)})"); /// /// Compares two values, returning 0 or 1 based on which value is greater @@ -1561,7 +1561,7 @@ namespace ComputeSharp /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 /// This function uses the following formula: (x >= y) ? 1 : 0 [Pure] - public static Vector3 Step(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector3)},{nameof(Vector3)})"); + public static Vector3 Step(in Vector3 x, in Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector3)},{nameof(Vector3)})"); /// /// Compares two values, returning 0 or 1 based on which value is greater @@ -1571,7 +1571,7 @@ namespace ComputeSharp /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 /// This function uses the following formula: (x >= y) ? 1 : 0 [Pure] - public static Vector4 Step(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector4)},{nameof(Vector4)})"); + public static Vector4 Step(in Vector4 x, in Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector4)},{nameof(Vector4)})"); /// /// Returns the tangent of the specified value @@ -1579,7 +1579,7 @@ namespace ComputeSharp /// The specified value, in radians /// The tangent of the parameter [Pure] - public static float Tan(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}(float)"); + public static float Tan(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}(float)"); /// /// Returns the tangent of the specified value @@ -1587,7 +1587,7 @@ namespace ComputeSharp /// The specified value, in radians /// The tangent of the parameter [Pure] - public static Vector2 Tan(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector2)})"); + public static Vector2 Tan(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector2)})"); /// /// Returns the tangent of the specified value @@ -1595,7 +1595,7 @@ namespace ComputeSharp /// The specified value, in radians /// The tangent of the parameter [Pure] - public static Vector3 Tan(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector3)})"); + public static Vector3 Tan(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector3)})"); /// /// Returns the tangent of the specified value @@ -1603,7 +1603,7 @@ namespace ComputeSharp /// The specified value, in radians /// The tangent of the parameter [Pure] - public static Vector4 Tan(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector4)})"); + public static Vector4 Tan(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector4)})"); /// /// Returns the hyperbolic tangent of the specified value @@ -1611,7 +1611,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic tangent of the parameter [Pure] - public static float Tanh(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}(float)"); + public static float Tanh(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}(float)"); /// /// Returns the hyperbolic tangent of the specified value @@ -1619,7 +1619,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic tangent of the parameter [Pure] - public static Vector2 Tanh(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector2)})"); + public static Vector2 Tanh(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector2)})"); /// /// Returns the hyperbolic tangent of the specified value @@ -1627,7 +1627,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic tangent of the parameter [Pure] - public static Vector3 Tanh(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector3)})"); + public static Vector3 Tanh(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector3)})"); /// /// Returns the hyperbolic tangent of the specified value @@ -1635,7 +1635,7 @@ namespace ComputeSharp /// The specified value, in radians /// The hyperbolic tangent of the parameter [Pure] - public static Vector4 Tanh(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector4)})"); + public static Vector4 Tanh(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector4)})"); /// /// Truncates a floating-point value to the integer component @@ -1643,7 +1643,7 @@ namespace ComputeSharp /// The specified value, in radians /// The parameter truncated to an integer component [Pure] - public static float Trunc(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}(float)"); + public static float Trunc(in float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}(float)"); /// /// Truncates a floating-point value to the integer component @@ -1651,7 +1651,7 @@ namespace ComputeSharp /// The specified value, in radians /// The parameter truncated to an integer component [Pure] - public static Vector2 Trunc(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector2)})"); + public static Vector2 Trunc(in Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector2)})"); /// /// Truncates a floating-point value to the integer component @@ -1659,7 +1659,7 @@ namespace ComputeSharp /// The specified value, in radians /// The parameter truncated to an integer component [Pure] - public static Vector3 Trunc(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector3)})"); + public static Vector3 Trunc(in Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector3)})"); /// /// Truncates a floating-point value to the integer component @@ -1667,6 +1667,6 @@ namespace ComputeSharp /// The specified value, in radians /// The parameter truncated to an integer component [Pure] - public static Vector4 Trunc(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector4)})"); + public static Vector4 Trunc(in Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector4)})"); } } From 8f05db321e3dd22bfb8eb6f0868fe32fb3cdbe80 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 24 Aug 2019 23:57:06 +0200 Subject: [PATCH 4/6] Fixed buffer accessors to support the new APIs --- src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs | 4 ++-- src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs index 1b4e1073..d3ad9052 100644 --- a/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs +++ b/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs @@ -18,9 +18,9 @@ namespace ComputeSharp.Graphics.Buffers internal ReadOnlyBuffer(GraphicsDevice device, int size) : base(device, size, BufferType.ReadOnly) { } /// - /// Gets or sets a single value from the current read write buffer + /// Gets a single value from the current read write buffer /// - /// The index of the value to get or set + /// The index of the value to get /// This API can only be used from a compute shader, and will always throw if used anywhere else public T this[uint i] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyBuffer)}[uint i]"); } diff --git a/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs index def4e799..9e71a9c3 100644 --- a/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs +++ b/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs @@ -22,10 +22,6 @@ namespace ComputeSharp.Graphics.Buffers /// /// The index of the value to get or set /// This API can only be used from a compute shader, and will always throw if used anywhere else - public T this[uint i] - { - get => throw new InvalidExecutionContextException($"{nameof(ReadWriteBuffer)}[uint i]"); - set => throw new InvalidExecutionContextException($"{nameof(ReadWriteBuffer)}[uint i]"); - } + public ref T this[uint i] => throw new InvalidExecutionContextException($"{nameof(ReadWriteBuffer)}[uint i]"); } } From a4fc88b9309b84d8e9eae1bbcc1c4624c74fa731 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 24 Aug 2019 23:57:17 +0200 Subject: [PATCH 5/6] Removed in keyword from shader body --- src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs b/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs index 8a8c37f2..050e8c69 100644 --- a/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs +++ b/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs @@ -173,8 +173,11 @@ namespace ComputeSharp.Shaders.Translation // Unwrap the nested fields string unwrappedSourceCode = UnwrapSyntaxTree(methodFixedCode); + // Remove the in keyword from the source + string inFixedSourceCode = Regex.Replace(unwrappedSourceCode, @"(? Date: Sat, 24 Aug 2019 23:57:25 +0200 Subject: [PATCH 6/6] Added tests for the new intrinsics --- tests/ComputeSharp.Tests/IntrinsicTests.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/ComputeSharp.Tests/IntrinsicTests.cs diff --git a/tests/ComputeSharp.Tests/IntrinsicTests.cs b/tests/ComputeSharp.Tests/IntrinsicTests.cs new file mode 100644 index 00000000..6a3bfc0b --- /dev/null +++ b/tests/ComputeSharp.Tests/IntrinsicTests.cs @@ -0,0 +1,32 @@ +using System; +using ComputeSharp.Graphics.Buffers; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("IntrinsicTests")] + public class IntrinsicTests + { + [TestMethod] + public void LocalScalarAssignToBuffer() + { + float angle = 80; + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(4); + + Action action = id => + { + buffer[0] = Hlsl.Sin(angle); + buffer[1] = Hlsl.Cos(angle); + Hlsl.SinCos(angle, out buffer[2], out buffer[3]); + }; + + Gpu.Default.For(1, action); + + float[] result = buffer.GetData(); + + Assert.IsTrue(MathF.Abs(result[0] - result[2]) < 0.0001f); + Assert.IsTrue(MathF.Abs(result[1] - result[3]) < 0.0001f); + } + } +}