Added bool negation operator to vector types

このコミットが含まれているのは:
Sergio Pedri committed 2021-03-15 23:17:25 +01:00
1 親 f636eb590e
コミット ac76fc3268
4ファイル変更
+24 -2

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

+7
ファイルの表示
@@ -115,5 +115,12 @@ namespace ComputeSharp
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Bool2"/> value.
/// </summary>
/// <param name="xy">The <see cref="Bool2"/> value to negate.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator !(Bool2 xy) => default;
}
}
+7
ファイルの表示
@@ -514,5 +514,12 @@ namespace ComputeSharp
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Bool3"/> value.
/// </summary>
/// <param name="xyz">The <see cref="Bool3"/> value to negate.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool3 operator !(Bool3 xyz) => default;
}
}
+7
ファイルの表示
@@ -4129,5 +4129,12 @@ namespace ComputeSharp
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Bool4"/> value.
/// </summary>
/// <param name="xyzw">The <see cref="Bool4"/> value to negate.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool4 operator !(Bool4 xyzw) => default;
}
}
+3 -2
ファイルの表示
@@ -242,18 +242,19 @@ namespace ComputeSharp
}
// Generate the negation operator
if (elementTypeName != "Bool" && elementTypeName != "UInt")
if (elementTypeName != "UInt")
{
WriteLine("");
string argumentName = "xyzw".Substring(0, i);
string operatorName = elementTypeName == "Bool" ? "!" : "-";
#>
/// <summary>
/// Negates a <see cref="<#=typeName#>"/> value.
/// </summary>
/// <param name="<#=argumentName#>">The <see cref="<#=typeName#>"/> value to negate.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static <#=typeName#> operator -(<#=typeName#> <#=argumentName#>) => default;
public static <#=typeName#> operator <#=operatorName#>(<#=typeName#> <#=argumentName#>) => default;
<#
}