Add mul() operators to Float/Int intrinsic matrix types

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-28 22:32:49 +02:00
1 親 9e16f9a7e2
コミット 5b00df867b
3ファイル変更
+2652 -2

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

ファイル差分が大きすぎるため表示されません。 差分を読み込み
ファイル差分が大きすぎるため表示されません。 差分を読み込み
+26 -2
ファイルの表示
@@ -1,5 +1,4 @@
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@include file="..\Intrinsics\Hlsl.MulOverloads.ttinclude" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Text.RegularExpressions" #>
@@ -291,7 +290,32 @@ public unsafe partial struct <#=fullTypeName#>
/// <returns>The result of multiplying <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <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 <#=fullTypeName#> operator *(<#=fullTypeName#> left, <#=fullTypeName#> right) => default;
<#
// Process all operators for the mul() intrinsic
foreach (var mulOverload in MulOverloads.Where(overload =>
!(overload.Params[0] == fullTypeName && overload.Params[1] == fullTypeName) &&
(overload.Return == fullTypeName && overload.Params.Contains(fullTypeName) ||
!overload.Params.Contains(overload.Return) && overload.Params[0] == fullTypeName)))
{
WriteLine("");
#>
/// <summary>
/// Multiplies two values using matrix math.
/// </summary>
/// <param name="x">The first <#=mulOverload.Params[0]#> input value.</param>
/// <param name="y">The second <#=mulOverload.Params[1]#> input value.</param>
/// <returns>The result of <paramref name="x"/> times <paramref name="y"/>. The result has the dimension <paramref name="x"/>-rows by <paramref name="y"/>-columns.</returns>
/// <remarks>
/// <para>This operator is equivalent to using <see cref="Hlsl.Mul(<#=mulOverload.Params[0]#>, <#=mulOverload.Params[1]#>)"/> with the same input arguments.</para>
/// <para>For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-mul"/>.</para>
/// <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>
public static <#=mulOverload.Return#> operator *(<#=mulOverload.Params[0]#> x, <#=mulOverload.Params[1]#> y) => default;
<#
}
WriteLine("");
#>
/// <summary>
/// Subtracts two <see cref="<#=fullTypeName#>"/> values.
/// </summary>