Merge pull request #113 from Sergio0694/feature/primitive-types-apis

HLSL vector type formatting
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2021-03-16 00:11:29 +01:00
コミット 2dddf1101d
35ファイル変更
+609 -733

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

+1 -3
ファイルの表示
@@ -1,12 +1,10 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices;
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that can be used in place of the <see cref="bool"/> type in HLSL shaders.
/// </summary>
[DebuggerDisplay("{Value}")]
[StructLayout(LayoutKind.Explicit, Size = sizeof(int), Pack = 4)]
public readonly struct Bool
{
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="bool2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
public partial struct Bool2
{
/// <summary>
+27 -1
ファイルの表示
@@ -1,10 +1,15 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Bool2"/>
@@ -96,5 +101,26 @@ namespace ComputeSharp
/// </summary>
/// <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 readonly ref readonly Bool2 GG => ref *(Bool2*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
StringBuilder sb = new();
sb.Append('<');
sb.Append(this.x);
sb.Append(", ");
sb.Append(this.y);
sb.Append('>');
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;
}
}
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="bool3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
public partial struct Bool3
{
/// <summary>
+29 -1
ファイルの表示
@@ -1,10 +1,15 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Bool3"/>
@@ -493,5 +498,28 @@ namespace ComputeSharp
/// </summary>
/// <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 readonly ref readonly Bool3 BBB => ref *(Bool3*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
StringBuilder sb = new();
sb.Append('<');
sb.Append(this.x);
sb.Append(", ");
sb.Append(this.y);
sb.Append(", ");
sb.Append(this.z);
sb.Append('>');
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;
}
}
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="bool4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
public partial struct Bool4
{
/// <summary>
+31 -1
ファイルの表示
@@ -1,10 +1,15 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Bool4"/>
@@ -4106,5 +4111,30 @@ namespace ComputeSharp
/// </summary>
/// <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 readonly ref readonly Bool4 AAAA => ref *(Bool4*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
StringBuilder sb = new();
sb.Append('<');
sb.Append(this.x);
sb.Append(", ");
sb.Append(this.y);
sb.Append(", ");
sb.Append(this.z);
sb.Append(", ");
sb.Append(this.w);
sb.Append('>');
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;
}
}
+16 -528
ファイルの表示
@@ -85,39 +85,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool1x1"/> 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 Bool1x1 operator -(Bool1x1 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool1x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x1"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool1x1"/> value to sum.</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 Bool1x1 operator +(Bool1x1 left, Bool1x1 right) => default;
/// <summary>
/// Divides two <see cref="Bool1x1"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool1x1"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool1x1"/> value to divide.</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 Bool1x1 operator /(Bool1x1 left, Bool1x1 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool1x1"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool1x1"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool1x1"/> value to multiply.</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 Bool1x1 operator *(Bool1x1 left, Bool1x1 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool1x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x1"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool1x1"/> value to subtract.</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 Bool1x1 operator -(Bool1x1 left, Bool1x1 right) => default;
public static Bool1x1 operator !(Bool1x1 matrix) => default;
}
/// <inheritdoc cref="Bool1x2"/>
@@ -209,39 +177,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool1x2"/> 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 Bool1x2 operator -(Bool1x2 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool1x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x2"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool1x2"/> value to sum.</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 Bool1x2 operator +(Bool1x2 left, Bool1x2 right) => default;
/// <summary>
/// Divides two <see cref="Bool1x2"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool1x2"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool1x2"/> value to divide.</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 Bool1x2 operator /(Bool1x2 left, Bool1x2 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool1x2"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool1x2"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool1x2"/> value to multiply.</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 Bool1x2 operator *(Bool1x2 left, Bool1x2 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool1x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x2"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool1x2"/> value to subtract.</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 Bool1x2 operator -(Bool1x2 left, Bool1x2 right) => default;
public static Bool1x2 operator !(Bool1x2 matrix) => default;
/// <summary>
/// Casts a <see cref="Bool2"/> value to a <see cref="Bool1x2"/> one.
@@ -350,39 +286,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool1x3"/> 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 Bool1x3 operator -(Bool1x3 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool1x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x3"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool1x3"/> value to sum.</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 Bool1x3 operator +(Bool1x3 left, Bool1x3 right) => default;
/// <summary>
/// Divides two <see cref="Bool1x3"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool1x3"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool1x3"/> value to divide.</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 Bool1x3 operator /(Bool1x3 left, Bool1x3 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool1x3"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool1x3"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool1x3"/> value to multiply.</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 Bool1x3 operator *(Bool1x3 left, Bool1x3 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool1x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x3"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool1x3"/> value to subtract.</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 Bool1x3 operator -(Bool1x3 left, Bool1x3 right) => default;
public static Bool1x3 operator !(Bool1x3 matrix) => default;
/// <summary>
/// Casts a <see cref="Bool3"/> value to a <see cref="Bool1x3"/> one.
@@ -502,39 +406,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool1x4"/> 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 Bool1x4 operator -(Bool1x4 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool1x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x4"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool1x4"/> value to sum.</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 Bool1x4 operator +(Bool1x4 left, Bool1x4 right) => default;
/// <summary>
/// Divides two <see cref="Bool1x4"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool1x4"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool1x4"/> value to divide.</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 Bool1x4 operator /(Bool1x4 left, Bool1x4 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool1x4"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool1x4"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool1x4"/> value to multiply.</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 Bool1x4 operator *(Bool1x4 left, Bool1x4 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool1x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool1x4"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool1x4"/> value to subtract.</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 Bool1x4 operator -(Bool1x4 left, Bool1x4 right) => default;
public static Bool1x4 operator !(Bool1x4 matrix) => default;
/// <summary>
/// Casts a <see cref="Bool4"/> value to a <see cref="Bool1x4"/> one.
@@ -632,39 +504,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool2x1"/> 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 Bool2x1 operator -(Bool2x1 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool2x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x1"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool2x1"/> value to sum.</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 Bool2x1 operator +(Bool2x1 left, Bool2x1 right) => default;
/// <summary>
/// Divides two <see cref="Bool2x1"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool2x1"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool2x1"/> value to divide.</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 Bool2x1 operator /(Bool2x1 left, Bool2x1 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool2x1"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool2x1"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool2x1"/> value to multiply.</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 Bool2x1 operator *(Bool2x1 left, Bool2x1 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool2x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x1"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool2x1"/> value to subtract.</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 Bool2x1 operator -(Bool2x1 left, Bool2x1 right) => default;
public static Bool2x1 operator !(Bool2x1 matrix) => default;
/// <summary>
/// Casts a <see cref="Bool2x1"/> value to a <see cref="Bool2"/> one.
@@ -797,39 +637,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool2x2"/> 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 Bool2x2 operator -(Bool2x2 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool2x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x2"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool2x2"/> value to sum.</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 Bool2x2 operator +(Bool2x2 left, Bool2x2 right) => default;
/// <summary>
/// Divides two <see cref="Bool2x2"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool2x2"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool2x2"/> value to divide.</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 Bool2x2 operator /(Bool2x2 left, Bool2x2 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool2x2"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool2x2"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool2x2"/> value to multiply.</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 Bool2x2 operator *(Bool2x2 left, Bool2x2 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool2x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x2"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool2x2"/> value to subtract.</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 Bool2x2 operator -(Bool2x2 left, Bool2x2 right) => default;
public static Bool2x2 operator !(Bool2x2 matrix) => default;
}
/// <inheritdoc cref="Bool2x3"/>
@@ -980,39 +788,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool2x3"/> 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 Bool2x3 operator -(Bool2x3 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool2x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x3"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool2x3"/> value to sum.</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 Bool2x3 operator +(Bool2x3 left, Bool2x3 right) => default;
/// <summary>
/// Divides two <see cref="Bool2x3"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool2x3"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool2x3"/> value to divide.</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 Bool2x3 operator /(Bool2x3 left, Bool2x3 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool2x3"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool2x3"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool2x3"/> value to multiply.</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 Bool2x3 operator *(Bool2x3 left, Bool2x3 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool2x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x3"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool2x3"/> value to subtract.</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 Bool2x3 operator -(Bool2x3 left, Bool2x3 right) => default;
public static Bool2x3 operator !(Bool2x3 matrix) => default;
}
/// <inheritdoc cref="Bool2x4"/>
@@ -1187,39 +963,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool2x4"/> 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 Bool2x4 operator -(Bool2x4 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool2x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x4"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool2x4"/> value to sum.</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 Bool2x4 operator +(Bool2x4 left, Bool2x4 right) => default;
/// <summary>
/// Divides two <see cref="Bool2x4"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool2x4"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool2x4"/> value to divide.</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 Bool2x4 operator /(Bool2x4 left, Bool2x4 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool2x4"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool2x4"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool2x4"/> value to multiply.</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 Bool2x4 operator *(Bool2x4 left, Bool2x4 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool2x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool2x4"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool2x4"/> value to subtract.</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 Bool2x4 operator -(Bool2x4 left, Bool2x4 right) => default;
public static Bool2x4 operator !(Bool2x4 matrix) => default;
}
/// <inheritdoc cref="Bool3x1"/>
@@ -1322,39 +1066,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool3x1"/> 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 Bool3x1 operator -(Bool3x1 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool3x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x1"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool3x1"/> value to sum.</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 Bool3x1 operator +(Bool3x1 left, Bool3x1 right) => default;
/// <summary>
/// Divides two <see cref="Bool3x1"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool3x1"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool3x1"/> value to divide.</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 Bool3x1 operator /(Bool3x1 left, Bool3x1 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool3x1"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool3x1"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool3x1"/> value to multiply.</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 Bool3x1 operator *(Bool3x1 left, Bool3x1 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool3x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x1"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool3x1"/> value to subtract.</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 Bool3x1 operator -(Bool3x1 left, Bool3x1 right) => default;
public static Bool3x1 operator !(Bool3x1 matrix) => default;
/// <summary>
/// Casts a <see cref="Bool3x1"/> value to a <see cref="Bool3"/> one.
@@ -1512,39 +1224,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool3x2"/> 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 Bool3x2 operator -(Bool3x2 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool3x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x2"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool3x2"/> value to sum.</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 Bool3x2 operator +(Bool3x2 left, Bool3x2 right) => default;
/// <summary>
/// Divides two <see cref="Bool3x2"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool3x2"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool3x2"/> value to divide.</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 Bool3x2 operator /(Bool3x2 left, Bool3x2 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool3x2"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool3x2"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool3x2"/> value to multiply.</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 Bool3x2 operator *(Bool3x2 left, Bool3x2 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool3x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x2"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool3x2"/> value to subtract.</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 Bool3x2 operator -(Bool3x2 left, Bool3x2 right) => default;
public static Bool3x2 operator !(Bool3x2 matrix) => default;
}
/// <inheritdoc cref="Bool3x3"/>
@@ -1732,39 +1412,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool3x3"/> 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 Bool3x3 operator -(Bool3x3 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool3x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x3"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool3x3"/> value to sum.</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 Bool3x3 operator +(Bool3x3 left, Bool3x3 right) => default;
/// <summary>
/// Divides two <see cref="Bool3x3"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool3x3"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool3x3"/> value to divide.</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 Bool3x3 operator /(Bool3x3 left, Bool3x3 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool3x3"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool3x3"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool3x3"/> value to multiply.</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 Bool3x3 operator *(Bool3x3 left, Bool3x3 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool3x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x3"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool3x3"/> value to subtract.</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 Bool3x3 operator -(Bool3x3 left, Bool3x3 right) => default;
public static Bool3x3 operator !(Bool3x3 matrix) => default;
}
/// <inheritdoc cref="Bool3x4"/>
@@ -1988,39 +1636,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool3x4"/> 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 Bool3x4 operator -(Bool3x4 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool3x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x4"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool3x4"/> value to sum.</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 Bool3x4 operator +(Bool3x4 left, Bool3x4 right) => default;
/// <summary>
/// Divides two <see cref="Bool3x4"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool3x4"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool3x4"/> value to divide.</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 Bool3x4 operator /(Bool3x4 left, Bool3x4 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool3x4"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool3x4"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool3x4"/> value to multiply.</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 Bool3x4 operator *(Bool3x4 left, Bool3x4 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool3x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool3x4"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool3x4"/> value to subtract.</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 Bool3x4 operator -(Bool3x4 left, Bool3x4 right) => default;
public static Bool3x4 operator !(Bool3x4 matrix) => default;
}
/// <inheritdoc cref="Bool4x1"/>
@@ -2134,39 +1750,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool4x1"/> 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 Bool4x1 operator -(Bool4x1 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool4x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x1"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool4x1"/> value to sum.</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 Bool4x1 operator +(Bool4x1 left, Bool4x1 right) => default;
/// <summary>
/// Divides two <see cref="Bool4x1"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool4x1"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool4x1"/> value to divide.</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 Bool4x1 operator /(Bool4x1 left, Bool4x1 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool4x1"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool4x1"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool4x1"/> value to multiply.</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 Bool4x1 operator *(Bool4x1 left, Bool4x1 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool4x1"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x1"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool4x1"/> value to subtract.</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 Bool4x1 operator -(Bool4x1 left, Bool4x1 right) => default;
public static Bool4x1 operator !(Bool4x1 matrix) => default;
/// <summary>
/// Casts a <see cref="Bool4x1"/> value to a <see cref="Bool4"/> one.
@@ -2349,39 +1933,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool4x2"/> 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 Bool4x2 operator -(Bool4x2 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool4x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x2"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool4x2"/> value to sum.</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 Bool4x2 operator +(Bool4x2 left, Bool4x2 right) => default;
/// <summary>
/// Divides two <see cref="Bool4x2"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool4x2"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool4x2"/> value to divide.</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 Bool4x2 operator /(Bool4x2 left, Bool4x2 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool4x2"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool4x2"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool4x2"/> value to multiply.</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 Bool4x2 operator *(Bool4x2 left, Bool4x2 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool4x2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x2"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool4x2"/> value to subtract.</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 Bool4x2 operator -(Bool4x2 left, Bool4x2 right) => default;
public static Bool4x2 operator !(Bool4x2 matrix) => default;
}
/// <inheritdoc cref="Bool4x3"/>
@@ -2606,39 +2158,7 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool4x3"/> 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 Bool4x3 operator -(Bool4x3 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool4x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x3"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool4x3"/> value to sum.</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 Bool4x3 operator +(Bool4x3 left, Bool4x3 right) => default;
/// <summary>
/// Divides two <see cref="Bool4x3"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool4x3"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool4x3"/> value to divide.</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 Bool4x3 operator /(Bool4x3 left, Bool4x3 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool4x3"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool4x3"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool4x3"/> value to multiply.</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 Bool4x3 operator *(Bool4x3 left, Bool4x3 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool4x3"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x3"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool4x3"/> value to subtract.</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 Bool4x3 operator -(Bool4x3 left, Bool4x3 right) => default;
public static Bool4x3 operator !(Bool4x3 matrix) => default;
}
/// <inheritdoc cref="Bool4x4"/>
@@ -2911,38 +2431,6 @@ namespace ComputeSharp
/// </summary>
/// <param name="matrix">The <see cref="Bool4x4"/> 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 Bool4x4 operator -(Bool4x4 matrix) => default;
/// <summary>
/// Sums two <see cref="Bool4x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x4"/> value to sum.</param>
/// <param name="right">The second <see cref="Bool4x4"/> value to sum.</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 Bool4x4 operator +(Bool4x4 left, Bool4x4 right) => default;
/// <summary>
/// Divides two <see cref="Bool4x4"/> values (elementwise division).
/// </summary>
/// <param name="left">The first <see cref="Bool4x4"/> value to divide.</param>
/// <param name="right">The second <see cref="Bool4x4"/> value to divide.</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 Bool4x4 operator /(Bool4x4 left, Bool4x4 right) => default;
/// <summary>
/// Multiplies two <see cref="Bool4x4"/> values (elementwise product).
/// </summary>
/// <param name="left">The first <see cref="Bool4x4"/> value to multiply.</param>
/// <param name="right">The second <see cref="Bool4x4"/> value to multiply.</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 Bool4x4 operator *(Bool4x4 left, Bool4x4 right) => default;
/// <summary>
/// Subtracts two <see cref="Bool4x4"/> values.
/// </summary>
/// <param name="left">The first <see cref="Bool4x4"/> value to subtract.</param>
/// <param name="right">The second <see cref="Bool4x4"/> value to subtract.</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 Bool4x4 operator -(Bool4x4 left, Bool4x4 right) => default;
public static Bool4x4 operator !(Bool4x4 matrix) => default;
}
}
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="double2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
public partial struct Double2
{
/// <summary>
+30 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Double2"/>
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public unsafe partial struct Double2
public unsafe partial struct Double2 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -97,6 +102,29 @@ namespace ComputeSharp
/// <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 readonly ref readonly Double2 GG => ref *(Double2*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Double2"/> value.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="double3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
public partial struct Double3
{
/// <summary>
+33 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Double3"/>
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)]
public unsafe partial struct Double3
public unsafe partial struct Double3 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -494,6 +499,32 @@ namespace ComputeSharp
/// <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 readonly ref readonly Double3 BBB => ref *(Double3*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Double3"/> value.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="double4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
public partial struct Double4
{
/// <summary>
+36 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Double4"/>
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)]
public unsafe partial struct Double4
public unsafe partial struct Double4 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -4107,6 +4112,35 @@ namespace ComputeSharp
/// <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 readonly ref readonly Double4 AAAA => ref *(Double4*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.w.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Double4"/> value.
/// </summary>
+1 -3
ファイルの表示
@@ -1,12 +1,10 @@
using System.Diagnostics;
using System.Numerics;
using System.Numerics;
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="float2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
public partial struct Float2
{
/// <summary>
+30 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Float2"/>
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
public unsafe partial struct Float2
public unsafe partial struct Float2 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -97,6 +102,29 @@ namespace ComputeSharp
/// <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 readonly ref readonly Float2 GG => ref *(Float2*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Float2"/> value.
/// </summary>
+1 -3
ファイルの表示
@@ -1,12 +1,10 @@
using System.Diagnostics;
using System.Numerics;
using System.Numerics;
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="float3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
public partial struct Float3
{
/// <summary>
+33 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Float3"/>
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
public unsafe partial struct Float3
public unsafe partial struct Float3 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -494,6 +499,32 @@ namespace ComputeSharp
/// <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 readonly ref readonly Float3 BBB => ref *(Float3*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Float3"/> value.
/// </summary>
+1 -3
ファイルの表示
@@ -1,12 +1,10 @@
using System.Diagnostics;
using System.Numerics;
using System.Numerics;
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="float4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
public partial struct Float4
{
/// <summary>
+36 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Float4"/>
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
public unsafe partial struct Float4
public unsafe partial struct Float4 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -4107,6 +4112,35 @@ namespace ComputeSharp
/// <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 readonly ref readonly Float4 AAAA => ref *(Float4*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.w.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Float4"/> value.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="int2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
public partial struct Int2
{
/// <summary>
+30 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Int2"/>
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
public unsafe partial struct Int2
public unsafe partial struct Int2 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -97,6 +102,29 @@ namespace ComputeSharp
/// <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 readonly ref readonly Int2 GG => ref *(Int2*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Int2"/> value.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="int3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
public partial struct Int3
{
/// <summary>
+33 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Int3"/>
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
public unsafe partial struct Int3
public unsafe partial struct Int3 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -494,6 +499,32 @@ namespace ComputeSharp
/// <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 readonly ref readonly Int3 BBB => ref *(Int3*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Int3"/> value.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="int4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
public partial struct Int4
{
/// <summary>
+36 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="Int4"/>
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
public unsafe partial struct Int4
public unsafe partial struct Int4 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -4107,6 +4112,35 @@ namespace ComputeSharp
/// <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 readonly ref readonly Int4 AAAA => ref *(Int4*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.w.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Negates a <see cref="Int4"/> value.
/// </summary>
+5 -3
ファイルの表示
@@ -203,21 +203,23 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
PopIndent();
// Generate the negation operator
if (elementTypeName != "Bool" && elementTypeName != "UInt")
if (typeName != "UInt")
{
WriteLine("");
string operatorName = typeName == "Bool" ? "!" : "-";
#>
/// <summary>
/// Negates a <see cref="<#=fullTypeName#>"/> value.
/// </summary>
/// <param name="matrix">The <see cref="<#=fullTypeName#>"/> 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 <#=fullTypeName#> operator -(<#=fullTypeName#> matrix) => default;
public static <#=fullTypeName#> operator <#=operatorName#>(<#=fullTypeName#> matrix) => default;
<#
}
// Generate the numerical operators
if (elementTypeName != "Bool")
if (typeName != "Bool")
{
WriteLine("");
#>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="uint2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
public partial struct UInt2
{
/// <summary>
+30 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="UInt2"/>
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
public unsafe partial struct UInt2
public unsafe partial struct UInt2 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -97,6 +102,29 @@ namespace ComputeSharp
/// <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 readonly ref readonly UInt2 GG => ref *(UInt2*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Sums two <see cref="UInt2"/> values.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="uint3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
public partial struct UInt3
{
/// <summary>
+33 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="UInt3"/>
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
public unsafe partial struct UInt3
public unsafe partial struct UInt3 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -494,6 +499,32 @@ namespace ComputeSharp
/// <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 readonly ref readonly UInt3 BBB => ref *(UInt3*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Sums two <see cref="UInt3"/> values.
/// </summary>
+1 -4
ファイルの表示
@@ -1,11 +1,8 @@
using System.Diagnostics;
namespace ComputeSharp
namespace ComputeSharp
{
/// <summary>
/// A <see langword="struct"/> that maps the <see langword="uint4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
public partial struct UInt4
{
/// <summary>
+36 -2
ファイルの表示
@@ -1,15 +1,20 @@
using System.Runtime.CompilerServices;
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="UInt4"/>
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
public unsafe partial struct UInt4
public unsafe partial struct UInt4 : IFormattable
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -4107,6 +4112,35 @@ namespace ComputeSharp
/// <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 readonly ref readonly UInt4 AAAA => ref *(UInt4*)UndefinedData;
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
sb.Append(this.x.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.y.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.z.ToString(format, formatProvider));
sb.Append(separator);
sb.Append(' ');
sb.Append(this.w.ToString(format, formatProvider));
sb.Append('>');
return sb.ToString();
}
/// <summary>
/// Sums two <see cref="UInt4"/> values.
/// </summary>
-112
ファイルの表示
@@ -80,13 +80,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt1x1"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt1x1"/> 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 UInt1x1 operator -(UInt1x1 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt1x1"/> values.
/// </summary>
@@ -204,13 +197,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt1x2"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt1x2"/> 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 UInt1x2 operator -(UInt1x2 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt1x2"/> values.
/// </summary>
@@ -345,13 +331,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt1x3"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt1x3"/> 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 UInt1x3 operator -(UInt1x3 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt1x3"/> values.
/// </summary>
@@ -497,13 +476,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt1x4"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt1x4"/> 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 UInt1x4 operator -(UInt1x4 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt1x4"/> values.
/// </summary>
@@ -627,13 +599,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt2x1"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt2x1"/> 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 UInt2x1 operator -(UInt2x1 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt2x1"/> values.
/// </summary>
@@ -792,13 +757,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt2x2"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt2x2"/> 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 UInt2x2 operator -(UInt2x2 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt2x2"/> values.
/// </summary>
@@ -975,13 +933,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt2x3"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt2x3"/> 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 UInt2x3 operator -(UInt2x3 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt2x3"/> values.
/// </summary>
@@ -1182,13 +1133,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt2x4"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt2x4"/> 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 UInt2x4 operator -(UInt2x4 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt2x4"/> values.
/// </summary>
@@ -1317,13 +1261,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt3x1"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt3x1"/> 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 UInt3x1 operator -(UInt3x1 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt3x1"/> values.
/// </summary>
@@ -1507,13 +1444,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt3x2"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt3x2"/> 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 UInt3x2 operator -(UInt3x2 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt3x2"/> values.
/// </summary>
@@ -1727,13 +1657,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt3x3"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt3x3"/> 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 UInt3x3 operator -(UInt3x3 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt3x3"/> values.
/// </summary>
@@ -1983,13 +1906,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt3x4"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt3x4"/> 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 UInt3x4 operator -(UInt3x4 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt3x4"/> values.
/// </summary>
@@ -2129,13 +2045,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt4x1"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt4x1"/> 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 UInt4x1 operator -(UInt4x1 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt4x1"/> values.
/// </summary>
@@ -2344,13 +2253,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt4x2"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt4x2"/> 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 UInt4x2 operator -(UInt4x2 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt4x2"/> values.
/// </summary>
@@ -2601,13 +2503,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt4x3"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt4x3"/> 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 UInt4x3 operator -(UInt4x3 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt4x3"/> values.
/// </summary>
@@ -2906,13 +2801,6 @@ namespace ComputeSharp
return matrix;
}
/// <summary>
/// Negates a <see cref="UInt4x4"/> value.
/// </summary>
/// <param name="matrix">The <see cref="UInt4x4"/> 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 UInt4x4 operator -(UInt4x4 matrix) => default;
/// <summary>
/// Sums two <see cref="UInt4x4"/> values.
/// </summary>
+89 -3
ファイルの表示
@@ -65,19 +65,25 @@ void GenerateVectorProperties(string typeName, int elementSize)
string elementTypeName = Regex.Match(typeName, @"^[A-Za-z]+").Value;
string hlslElementTypeName = elementTypeName.ToLower();
int i = int.Parse(Regex.Match(typeName, @"\d+$").Value);
string formattable = elementTypeName == "Bool" ? "" : " : IFormattable";
#>
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
#if !NET5_0
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
#endif
#nullable enable
namespace ComputeSharp
{
/// <inheritdoc cref="<#=typeName#>"/>
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>, Pack = <#=elementSize#>)]
public unsafe partial struct <#=typeName#>
public unsafe partial struct <#=typeName#><#=formattable#>
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
@@ -155,20 +161,100 @@ namespace ComputeSharp
PopIndent();
PopIndent();
WriteLine("");
if (elementTypeName == "Bool")
{
#>
/// <inheritdoc/>
public override readonly string ToString()
{
StringBuilder sb = new();
sb.Append('<');
<#
PushIndent(" ");
PushIndent(" ");
PushIndent(" ");
for (int j = 0; j < i; j++)
{
WriteLine($"sb.Append(this.{"xyzw"[j]});");
if (j < i - 1)
{
WriteLine("sb.Append(\", \");");
}
}
PopIndent();
PopIndent();
PopIndent();
#>
sb.Append('>');
return sb.ToString();
}
<#
}
else
{
#>
/// <inheritdoc/>
public override readonly string ToString()
{
return ToString("G", CultureInfo.CurrentCulture);
}
/// <inheritdoc/>
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
StringBuilder sb = new();
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
sb.Append('<');
<#
PushIndent(" ");
PushIndent(" ");
PushIndent(" ");
for (int j = 0; j < i; j++)
{
WriteLine($"sb.Append(this.{"xyzw"[j]}.ToString(format, formatProvider));");
if (j < i - 1)
{
WriteLine("sb.Append(separator);");
WriteLine("sb.Append(' ');");
}
}
PopIndent();
PopIndent();
PopIndent();
#>
sb.Append('>');
return sb.ToString();
}
<#
}
// 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;
<#
}