diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.g.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.g.cs index a58bc20b..50f404e4 100644 --- a/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.g.cs +++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.g.cs @@ -6,6 +6,16 @@ namespace ComputeSharp; /// partial class Hlsl { + /// + /// Submits an error message to the information queue and terminates the current draw or dispatch call being executed. + /// + /// + /// This operation does nothing on rasterizers that do not support it. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + /// + [HlslIntrinsicName("abort")] + public static void Abort() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abort)}()"); + /// /// Discards the current pixel if the specified value is less than zero. /// diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.tt b/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.tt index aedffb22..51214841 100644 --- a/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.tt +++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.tt @@ -23,7 +23,7 @@ foreach (var intrinsic in Intrinsics) WriteLine($"/// {intrinsic.Summary}"); WriteLine("/// "); - foreach (var param in intrinsic.Parameters) + foreach (var param in intrinsic.Parameters.Where(p => p.Name is not "")) { WriteLine($"/// {param.Info}"); } @@ -55,12 +55,12 @@ foreach (var intrinsic in Intrinsics) WriteLine($"[HlslIntrinsicName(\"{intrinsic.HlslName}\")]"); Write($"public static void {intrinsic.Name}("); - Write(string.Join(", ", intrinsic.Parameters.Zip(overload, (a, b) => $"{(a.IsOut ? "out " : "")}{b} {a.Name}"))); + Write(string.Join(", ", intrinsic.Parameters.Where(p => p.Name is not "").Zip(overload, (a, b) => $"{(a.IsOut ? "out " : "")}{b} {a.Name}"))); Write(")"); Write(" => throw new InvalidExecutionContextException("); - var parameters = string.Join(", ", overload.Select(t => $"{{typeof({t})}}")); + var parameters = string.Join(", ", overload.Where(o => o.Length > 0).Select(t => $"{{typeof({t})}}")); WriteLine($"$\"{{typeof(Hlsl)}}.{{nameof({intrinsic.Name})}}({parameters})\");"); } diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.ttinclude b/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.ttinclude index 90dc8adf..897fc410 100644 --- a/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.ttinclude +++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.Void.ttinclude @@ -8,6 +8,21 @@ <# var Intrinsics = new[] { + new + { + Name = "Abort", + HlslName = "abort", + Summary = "Submits an error message to the information queue and terminates the current draw or dispatch call being executed.", + Remarks = "This operation does nothing on rasterizers that do not support it.", + Parameters = new[] + { + new { IsOut = false, IsRef = false, Name = "", Info = "" } + }, + Overloads = new[] + { + new string[0] + } + }, new { Name = "Clip", diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.cs index a09a054b..08285f00 100644 --- a/src/ComputeSharp.Core/Intrinsics/Hlsl.cs +++ b/src/ComputeSharp.Core/Intrinsics/Hlsl.cs @@ -8,13 +8,6 @@ namespace ComputeSharp; /// public static partial class Hlsl { - /// - /// Submits an error message to the information queue and terminates the current draw or dispatch call being executed. - /// - /// This operation does nothing on rasterizers that do not support it. - [HlslIntrinsicName("abort")] - public static void Abort() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abort)}()"); - /// /// Blocks execution of all threads in a group until all memory accesses have been completed. ///