Move Abort() intrinsic to T4 template

このコミットが含まれているのは:
Sergio Pedri committed 2022-05-01 10:23:11 +02:00
1 親 1fcac94a9a
コミット 6362bf4df7
4ファイル変更
+28 -10

検索条件に一致するファイルはありません

+10
ファイルの表示
@@ -6,6 +6,16 @@ namespace ComputeSharp;
/// <inheritdoc cref="Hlsl"/>
partial class Hlsl
{
/// <summary>
/// Submits an error message to the information queue and terminates the current draw or dispatch call being executed.
/// </summary>
/// <remarks>
/// This operation does nothing on rasterizers that do not support it.
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
/// </remarks>
[HlslIntrinsicName("abort")]
public static void Abort() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abort)}()");
/// <summary>
/// Discards the current pixel if the specified value is less than zero.
/// </summary>
+3 -3
ファイルの表示
@@ -23,7 +23,7 @@ foreach (var intrinsic in Intrinsics)
WriteLine($"/// {intrinsic.Summary}");
WriteLine("/// </summary>");
foreach (var param in intrinsic.Parameters)
foreach (var param in intrinsic.Parameters.Where(p => p.Name is not ""))
{
WriteLine($"/// <param name=\"{param.Name}\">{param.Info}</param>");
}
@@ -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})\");");
}
+15
ファイルの表示
@@ -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",
-7
ファイルの表示
@@ -8,13 +8,6 @@ namespace ComputeSharp;
/// </summary>
public static partial class Hlsl
{
/// <summary>
/// Submits an error message to the information queue and terminates the current draw or dispatch call being executed.
/// </summary>
/// <remarks>This operation does nothing on rasterizers that do not support it.</remarks>
[HlslIntrinsicName("abort")]
public static void Abort() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abort)}()");
/// <summary>
/// Blocks execution of all threads in a group until all memory accesses have been completed.
/// </summary>