Move TrueN and OneN properties to T4 templates
このコミットが含まれているのは:
1 親
f5c4e6aacd
コミット
97447fbc68
31ファイル変更
+259
-225
検索条件に一致するファイルはありません
@@ -7,16 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Bool2
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool2"/> value with the <see cref="X"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool2 TrueX => new(true, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool2"/> value with the <see cref="Y"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool2 TrueY => new(false, true);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Bool2"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -42,6 +42,16 @@ public unsafe partial struct Bool2
|
||||
/// </summary>
|
||||
public static Bool2 True => true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool2"/> value with the <see cref="X"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool2 TrueX => new(true, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool2"/> value with the <see cref="Y"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool2 TrueY => new(false, true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,21 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Bool3
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool3"/> value with the <see cref="X"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool3 TrueX => new(true, false, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool3"/> value with the <see cref="Y"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool3 TrueY => new(false, true, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool3"/> value with the <see cref="Z"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool3 TrueZ => new(false, false, true);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Bool3"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -45,6 +45,21 @@ public unsafe partial struct Bool3
|
||||
/// </summary>
|
||||
public static Bool3 True => true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool3"/> value with the <see cref="X"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool3 TrueX => new(true, false, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool3"/> value with the <see cref="Y"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool3 TrueY => new(false, true, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool3"/> value with the <see cref="Z"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool3 TrueZ => new(false, false, true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,26 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Bool4
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool4"/> value with the <see cref="X"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueX => new(true, false, false, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool4"/> value with the <see cref="Y"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueY => new(false, true, false, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool4"/> value with the <see cref="Z"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueZ => new(false, false, true, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Bool4"/> value with the <see cref="W"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueW => new(false, false, false, true);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Bool4"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -48,6 +48,26 @@ public unsafe partial struct Bool4
|
||||
/// </summary>
|
||||
public static Bool4 True => true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool4"/> value with the <see cref="X"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueX => new(true, false, false, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool4"/> value with the <see cref="Y"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueY => new(false, true, false, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool4"/> value with the <see cref="Z"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueZ => new(false, false, true, false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Bool4"/> value with the <see cref="W"/> component set to <see langword="true"/>, and the others to <see langword="false"/>.
|
||||
/// </summary>
|
||||
public static Bool4 TrueW => new(false, false, false, true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,16 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Double2
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Double2"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,6 +47,16 @@ public unsafe partial struct Double2
|
||||
/// </summary>
|
||||
public static Double2 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,21 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Double3
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Double3"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -50,6 +50,21 @@ public unsafe partial struct Double3
|
||||
/// </summary>
|
||||
public static Double3 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,26 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Double4
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Double4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Double4"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -53,6 +53,26 @@ public unsafe partial struct Double4
|
||||
/// </summary>
|
||||
public static Double4 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Double4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Double4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -9,16 +9,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Float2
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Float2"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,6 +47,16 @@ public unsafe partial struct Float2
|
||||
/// </summary>
|
||||
public static Float2 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -9,21 +9,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Float3
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Float3"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -50,6 +50,21 @@ public unsafe partial struct Float3
|
||||
/// </summary>
|
||||
public static Float3 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -9,26 +9,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Float4
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Float4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Float4"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -53,6 +53,26 @@ public unsafe partial struct Float4
|
||||
/// </summary>
|
||||
public static Float4 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Float4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Float4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,16 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Int2
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Int2"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,6 +47,16 @@ public unsafe partial struct Int2
|
||||
/// </summary>
|
||||
public static Int2 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,21 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Int3
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Int3"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -50,6 +50,21 @@ public unsafe partial struct Int3
|
||||
/// </summary>
|
||||
public static Int3 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,26 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct Int4
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="Int4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Int4"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -53,6 +53,26 @@ public unsafe partial struct Int4
|
||||
/// </summary>
|
||||
public static Int4 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Int4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static Int4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,16 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct UInt2
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="UInt2"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,6 +47,16 @@ public unsafe partial struct UInt2
|
||||
/// </summary>
|
||||
public static UInt2 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt2 UnitX => new(1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt2 UnitY => new(0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,21 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct UInt3
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="UInt3"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -50,6 +50,21 @@ public unsafe partial struct UInt3
|
||||
/// </summary>
|
||||
public static UInt3 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt3"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt3 UnitX => new(1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt3"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt3 UnitY => new(0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt3"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt3 UnitZ => new(0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,26 +7,6 @@ namespace ComputeSharp;
|
||||
/// </summary>
|
||||
public partial struct UInt4
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="UInt4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="UInt4"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -53,6 +53,26 @@ public unsafe partial struct UInt4
|
||||
/// </summary>
|
||||
public static UInt4 One => 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt4"/> value with the <see cref="X"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitX => new(1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt4"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitY => new(0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt4"/> value with the <see cref="Z"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitZ => new(0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="UInt4"/> value with the <see cref="W"/> component set to 1, and the others to 0.
|
||||
/// </summary>
|
||||
public static UInt4 UnitW => new(0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
|
||||
@@ -140,6 +140,40 @@ public unsafe partial struct <#=typeName#>
|
||||
<#
|
||||
}
|
||||
|
||||
string unitName, unitOne, unitZero, unitOneXmlName, unitZeroXmlName;
|
||||
|
||||
if (elementTypeName == "Bool")
|
||||
{
|
||||
unitName = "True";
|
||||
unitOne = "true";
|
||||
unitZero = "false";
|
||||
unitOneXmlName = "<see langword=\"true\"/>";
|
||||
unitZeroXmlName = "<see langword=\"false\"/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
unitName = "Unit";
|
||||
unitOne = "1";
|
||||
unitZero = "0";
|
||||
unitOneXmlName = "1";
|
||||
unitZeroXmlName = "0";
|
||||
}
|
||||
|
||||
// Generate the True<N> and Unit<N> properties
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
string unitComponentName = ("XYZW"[j]).ToString();
|
||||
string[] unitArguments = Enumerable.Range(0, i).Select(x => x == j ? unitOne : unitZero).ToArray();
|
||||
string unitArgumentExpression = string.Join(", ", unitArguments);
|
||||
#>
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="<#=typeName#>"/> value with the <see cref="<#=unitComponentName#>"/> component set to <#=unitOneXmlName#>, and the others to <#=unitZeroXmlName#>.
|
||||
/// </summary>
|
||||
public static <#=typeName#> <#=unitName#><#=unitComponentName#> => new(<#=unitArgumentExpression#>);
|
||||
<#
|
||||
}
|
||||
|
||||
PushIndent(" ");
|
||||
|
||||
// Generate the combinatorial swizzling properties
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする