Add Hlsl.Or intrinsic

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-28 02:23:44 +01:00
1 親 10bf8c92d3
コミット 2d5d229b43
3ファイル変更
+298

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

+247
ファイルの表示
@@ -18210,6 +18210,253 @@ partial class Hlsl
[HlslIntrinsicName("normalize")]
public static Float4 Normalize(Float4 x) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool2 Or(Bool2 left, Bool2 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool3 Or(Bool3 left, Bool3 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool4 Or(Bool4 left, Bool4 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool1x1 Or(Bool1x1 left, Bool1x1 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool1x2 Or(Bool1x2 left, Bool1x2 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool1x3 Or(Bool1x3 left, Bool1x3 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool1x4 Or(Bool1x4 left, Bool1x4 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool2x1 Or(Bool2x1 left, Bool2x1 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool2x2 Or(Bool2x2 left, Bool2x2 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool2x3 Or(Bool2x3 left, Bool2x3 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool2x4 Or(Bool2x4 left, Bool2x4 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool3x1 Or(Bool3x1 left, Bool3x1 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool3x2 Or(Bool3x2 left, Bool3x2 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool3x3 Or(Bool3x3 left, Bool3x3 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool3x4 Or(Bool3x4 left, Bool3x4 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool4x1 Or(Bool4x1 left, Bool4x1 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool4x2 Or(Bool4x2 left, Bool4x2 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool4x3 Or(Bool4x3 left, Bool4x3 right) => default;
/// <summary>
/// Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.
/// </summary>
/// <param name="left">The first input vector or matrix value.</param>
/// <param name="right">The second input vector or matrix value.</param>
/// <returns>The new vector or matrix value with elements resulting from the boolean operation.</returns>
/// <remarks>
/// For more info, see <see href="https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators"/>.
/// <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("__Or")]
public static Bool4x4 Or(Bool4x4 left, Bool4x4 right) => default;
/// <summary>
/// Returns the specified value raised to the specified power.
/// </summary>
+35
ファイルの表示
@@ -2317,6 +2317,41 @@ var Intrinsics = new[]
}
},
new
{
Name = "Or",
HlslName = "__Or",
Summary = "Performs a vectorized, non short-circuiting boolean 'OR' operation between two operands.",
Url = "https://learn.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#boolean-math-operators",
Parameters = new[]
{
new { IsOut = false, Name = "left", Info = "The first input vector or matrix value." },
new { IsOut = false, Name = "right", Info = "The second input vector or matrix value." }
},
Returns = "The new vector or matrix value with elements resulting from the boolean operation.",
Overloads = new[]
{
new { Return = "Bool2", Params = new[] { "Bool2", "Bool2" } },
new { Return = "Bool3", Params = new[] { "Bool3", "Bool3" } },
new { Return = "Bool4", Params = new[] { "Bool4", "Bool4" } },
new { Return = "Bool1x1", Params = new[] { "Bool1x1", "Bool1x1" } },
new { Return = "Bool1x2", Params = new[] { "Bool1x2", "Bool1x2" } },
new { Return = "Bool1x3", Params = new[] { "Bool1x3", "Bool1x3" } },
new { Return = "Bool1x4", Params = new[] { "Bool1x4", "Bool1x4" } },
new { Return = "Bool2x1", Params = new[] { "Bool2x1", "Bool2x1" } },
new { Return = "Bool2x2", Params = new[] { "Bool2x2", "Bool2x2" } },
new { Return = "Bool2x3", Params = new[] { "Bool2x3", "Bool2x3" } },
new { Return = "Bool2x4", Params = new[] { "Bool2x4", "Bool2x4" } },
new { Return = "Bool3x1", Params = new[] { "Bool3x1", "Bool3x1" } },
new { Return = "Bool3x2", Params = new[] { "Bool3x2", "Bool3x2" } },
new { Return = "Bool3x3", Params = new[] { "Bool3x3", "Bool3x3" } },
new { Return = "Bool3x4", Params = new[] { "Bool3x4", "Bool3x4" } },
new { Return = "Bool4x1", Params = new[] { "Bool4x1", "Bool4x1" } },
new { Return = "Bool4x2", Params = new[] { "Bool4x2", "Bool4x2" } },
new { Return = "Bool4x3", Params = new[] { "Bool4x3", "Bool4x3" } },
new { Return = "Bool4x4", Params = new[] { "Bool4x4", "Bool4x4" } }
}
},
new
{
Name = "Pow",
HlslName = "pow",
+16
ファイルの表示
@@ -480,6 +480,22 @@ internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter
SyntaxKind.LogicalAndExpression,
updatedNode.ArgumentList.Arguments[0].Expression,
updatedNode.ArgumentList.Arguments[1].Expression));
#endif
// 'Or' invocations are rewritten as follows:
//
// C#: Hlsl.Or(left, right)
// HLSL (DX12): or(left, right)
// HLSL (D2D1): (left || right)
case "Or":
#if D3D12_SOURCE_GENERATOR
return updatedNode.WithExpression(IdentifierName("or"));
#else
return
ParenthesizedExpression(
BinaryExpression(
SyntaxKind.LogicalOrExpression,
updatedNode.ArgumentList.Arguments[0].Expression,
updatedNode.ArgumentList.Arguments[1].Expression));
#endif
// 'Select' invocations are rewritten as follows:
//