Added byref single component properties

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-24 19:03:30 +01:00
1 親 c876a76a4c
コミット 7bac8a5a42
46ファイル変更
+724 -808

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

+2 -47
ファイルの表示
@@ -1,6 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
@@ -8,7 +6,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="bool2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Explicit, Size = sizeof(int) * 2)]
public partial struct Bool2
{
/// <summary>
@@ -38,50 +35,8 @@ namespace ComputeSharp
/// <param name="y">The value to assign to the second vector component.</param>
public Bool2(bool x, bool y)
{
_X = x;
_Y = y;
}
[FieldOffset(0)]
private bool _X;
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public bool X
{
get => _X;
set => _X = value;
}
[FieldOffset(4)]
private bool _Y;
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public bool Y
{
get => _Y;
set => _Y = value;
}
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public bool R
{
get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public bool G
{
get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}");
this.x = x;
this.y = y;
}
/// <summary>
+29 -1
ファイルの表示
@@ -1,16 +1,44 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Bool2"/>
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct Bool2
{
[FieldOffset(0)]
private bool x;
[FieldOffset(4)]
private bool y;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Bool2"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool2)}[int]");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
/// </summary>
public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>Y</c> component.
/// </summary>
public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>R</c> component.
/// </summary>
public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>G</c> component.
/// </summary>
public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Bool2");
GenerateVectorProperties("Bool2", sizeof(int));
#>
+3 -69
ファイルの表示
@@ -1,6 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
@@ -8,7 +6,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="bool3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
[StructLayout(LayoutKind.Explicit, Size = sizeof(int) * 3)]
public partial struct Bool3
{
/// <summary>
@@ -44,72 +41,9 @@ namespace ComputeSharp
/// <param name="z">The value to assign to the third vector component.</param>
public Bool3(bool x, bool y, bool z)
{
_X = x;
_Y = y;
_Z = z;
}
[FieldOffset(0)]
private bool _X;
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public bool X
{
get => _X;
set => _X = value;
}
[FieldOffset(4)]
private bool _Y;
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public bool Y
{
get => _Y;
set => _Y = value;
}
[FieldOffset(8)]
private bool _Z;
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public bool Z
{
get => _Z;
set => _Z = value;
}
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public bool R
{
get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public bool G
{
get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public bool B
{
get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(B)}");
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
+42 -1
ファイルの表示
@@ -1,16 +1,57 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Bool3"/>
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct Bool3
{
[FieldOffset(0)]
private bool x;
[FieldOffset(4)]
private bool y;
[FieldOffset(8)]
private bool z;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Bool3"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool3)}[int]");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
/// </summary>
public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>Y</c> component.
/// </summary>
public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>Z</c> component.
/// </summary>
public ref bool Z => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>R</c> component.
/// </summary>
public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>G</c> component.
/// </summary>
public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>B</c> component.
/// </summary>
public ref bool B => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(B)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Bool3");
GenerateVectorProperties("Bool3", sizeof(int));
#>
+4 -91
ファイルの表示
@@ -1,6 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
@@ -8,7 +6,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="bool4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
[StructLayout(LayoutKind.Explicit, Size = sizeof(int) * 4)]
public partial struct Bool4
{
/// <summary>
@@ -50,94 +47,10 @@ namespace ComputeSharp
/// <param name="w">The value to assign to the fourth vector component.</param>
public Bool4(bool x, bool y, bool z, bool w)
{
_X = x;
_Y = y;
_Z = z;
_W = w;
}
[FieldOffset(0)]
private bool _X;
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public bool X
{
get => _X;
set => _X = value;
}
[FieldOffset(4)]
private bool _Y;
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public bool Y
{
get => _Y;
set => _Y = value;
}
[FieldOffset(8)]
private bool _Z;
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public bool Z
{
get => _Z;
set => _Z = value;
}
[FieldOffset(12)]
private bool _W;
/// <summary>
/// Gets or sets the value of the fourth vector component.
/// </summary>
public bool W
{
get => _W;
set => _W = value;
}
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public bool R
{
get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public bool G
{
get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public bool B
{
get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(B)}");
}
/// <summary>
/// Gets or sets the value of the fourth color component.
/// </summary>
public bool A
{
get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(A)}");
set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(A)}");
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
+55 -1
ファイルの表示
@@ -1,16 +1,70 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Bool4"/>
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct Bool4
{
[FieldOffset(0)]
private bool x;
[FieldOffset(4)]
private bool y;
[FieldOffset(8)]
private bool z;
[FieldOffset(12)]
private bool w;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Bool4"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool4)}[int]");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
/// </summary>
public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>Y</c> component.
/// </summary>
public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>Z</c> component.
/// </summary>
public ref bool Z => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>W</c> component.
/// </summary>
public ref bool W => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(W)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>R</c> component.
/// </summary>
public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>G</c> component.
/// </summary>
public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>B</c> component.
/// </summary>
public ref bool B => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(B)}");
/// <summary>
/// Gets a reference to the <see cref="bool"/> value representing the <c>A</c> component.
/// </summary>
public ref bool A => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(A)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Bool4");
GenerateVectorProperties("Bool4", sizeof(int));
#>
+2 -32
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="double2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 2)]
public partial struct Double2
{
/// <summary>
@@ -38,36 +36,8 @@ namespace ComputeSharp
/// <param name="y">The value to assign to the second vector component.</param>
public Double2(double x, double y)
{
X = x;
Y = y;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public double X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public double Y { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public double R
{
get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public double G
{
get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(G)}");
this.x = x;
this.y = y;
}
/// <summary>
+29 -1
ファイルの表示
@@ -1,16 +1,44 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Double2"/>
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct Double2
{
[FieldOffset(0)]
private double x;
[FieldOffset(8)]
private double y;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Double2"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref double this[int i] => throw new InvalidExecutionContextException($"{nameof(Double2)}[int]");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
/// </summary>
public ref double X => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>Y</c> component.
/// </summary>
public ref double Y => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>R</c> component.
/// </summary>
public ref double R => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>G</c> component.
/// </summary>
public ref double G => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(G)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Double2");
GenerateVectorProperties("Double2", sizeof(double));
#>
+3 -47
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="double3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 3)]
public partial struct Double3
{
/// <summary>
@@ -44,51 +42,9 @@ namespace ComputeSharp
/// <param name="z">The value to assign to the third vector component.</param>
public Double3(double x, double y, double z)
{
X = x;
Y = y;
Z = z;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public double X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public double Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public double Z { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public double R
{
get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public double G
{
get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public double B
{
get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(B)}");
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
+42 -1
ファイルの表示
@@ -1,16 +1,57 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Double3"/>
[StructLayout(LayoutKind.Explicit, Size = 24)]
public partial struct Double3
{
[FieldOffset(0)]
private double x;
[FieldOffset(8)]
private double y;
[FieldOffset(16)]
private double z;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Double3"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref double this[int i] => throw new InvalidExecutionContextException($"{nameof(Double3)}[int]");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
/// </summary>
public ref double X => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>Y</c> component.
/// </summary>
public ref double Y => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>Z</c> component.
/// </summary>
public ref double Z => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>R</c> component.
/// </summary>
public ref double R => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>G</c> component.
/// </summary>
public ref double G => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>B</c> component.
/// </summary>
public ref double B => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(B)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Double3");
GenerateVectorProperties("Double3", sizeof(double));
#>
+4 -62
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="double4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 4)]
public partial struct Double4
{
/// <summary>
@@ -50,66 +48,10 @@ namespace ComputeSharp
/// <param name="w">The value to assign to the fourth vector component.</param>
public Double4(double x, double y, double z, double w)
{
X = x;
Y = y;
Z = z;
W = w;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public double X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public double Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public double Z { get; set; }
/// <summary>
/// Gets or sets the value of the fourth vector component.
/// </summary>
public double W { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public double R
{
get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public double G
{
get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public double B
{
get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(B)}");
}
/// <summary>
/// Gets or sets the value of the fourth color component.
/// </summary>
public double A
{
get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(A)}");
set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(A)}");
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
+55 -1
ファイルの表示
@@ -1,16 +1,70 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Double4"/>
[StructLayout(LayoutKind.Explicit, Size = 32)]
public partial struct Double4
{
[FieldOffset(0)]
private double x;
[FieldOffset(8)]
private double y;
[FieldOffset(16)]
private double z;
[FieldOffset(24)]
private double w;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Double4"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref double this[int i] => throw new InvalidExecutionContextException($"{nameof(Double4)}[int]");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
/// </summary>
public ref double X => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>Y</c> component.
/// </summary>
public ref double Y => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>Z</c> component.
/// </summary>
public ref double Z => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>W</c> component.
/// </summary>
public ref double W => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(W)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>R</c> component.
/// </summary>
public ref double R => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>G</c> component.
/// </summary>
public ref double G => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>B</c> component.
/// </summary>
public ref double B => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(B)}");
/// <summary>
/// Gets a reference to the <see cref="double"/> value representing the <c>A</c> component.
/// </summary>
public ref double A => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(A)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Double4");
GenerateVectorProperties("Double4", sizeof(double));
#>
+2 -32
ファイルの表示
@@ -1,6 +1,5 @@
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -9,7 +8,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="float2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 2)]
public partial struct Float2
{
/// <summary>
@@ -39,36 +37,8 @@ namespace ComputeSharp
/// <param name="y">The value to assign to the second vector component.</param>
public Float2(float x, float y)
{
X = x;
Y = y;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public float X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public float Y { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public float R
{
get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public float G
{
get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(G)}");
this.x = x;
this.y = y;
}
/// <summary>
+29 -1
ファイルの表示
@@ -1,16 +1,44 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Float2"/>
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct Float2
{
[FieldOffset(0)]
private float x;
[FieldOffset(4)]
private float y;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float2"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref float this[int i] => throw new InvalidExecutionContextException($"{nameof(Float2)}[int]");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
/// </summary>
public ref float X => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>Y</c> component.
/// </summary>
public ref float Y => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>R</c> component.
/// </summary>
public ref float R => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>G</c> component.
/// </summary>
public ref float G => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(G)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Float2");
GenerateVectorProperties("Float2", sizeof(float));
#>
+3 -47
ファイルの表示
@@ -1,6 +1,5 @@
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -9,7 +8,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="float3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 3)]
public partial struct Float3
{
/// <summary>
@@ -45,51 +43,9 @@ namespace ComputeSharp
/// <param name="z">The value to assign to the third vector component.</param>
public Float3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public float X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public float Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public float Z { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public float R
{
get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public float G
{
get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public float B
{
get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(B)}");
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
+42 -1
ファイルの表示
@@ -1,16 +1,57 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Float3"/>
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct Float3
{
[FieldOffset(0)]
private float x;
[FieldOffset(4)]
private float y;
[FieldOffset(8)]
private float z;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float3"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref float this[int i] => throw new InvalidExecutionContextException($"{nameof(Float3)}[int]");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
/// </summary>
public ref float X => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>Y</c> component.
/// </summary>
public ref float Y => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>Z</c> component.
/// </summary>
public ref float Z => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>R</c> component.
/// </summary>
public ref float R => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>G</c> component.
/// </summary>
public ref float G => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>B</c> component.
/// </summary>
public ref float B => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(B)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Float3");
GenerateVectorProperties("Float3", sizeof(float));
#>
+4 -62
ファイルの表示
@@ -1,6 +1,5 @@
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -9,7 +8,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="float4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 4)]
public partial struct Float4
{
/// <summary>
@@ -51,66 +49,10 @@ namespace ComputeSharp
/// <param name="w">The value to assign to the fourth vector component.</param>
public Float4(float x, float y, float z, float w)
{
X = x;
Y = y;
Z = z;
W = w;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public float X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public float Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public float Z { get; set; }
/// <summary>
/// Gets or sets the value of the fourth vector component.
/// </summary>
public float W { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public float R
{
get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public float G
{
get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public float B
{
get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(B)}");
}
/// <summary>
/// Gets or sets the value of the fourth color component.
/// </summary>
public float A
{
get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(A)}");
set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(A)}");
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
+55 -1
ファイルの表示
@@ -1,16 +1,70 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Float4"/>
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct Float4
{
[FieldOffset(0)]
private float x;
[FieldOffset(4)]
private float y;
[FieldOffset(8)]
private float z;
[FieldOffset(12)]
private float w;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float4"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref float this[int i] => throw new InvalidExecutionContextException($"{nameof(Float4)}[int]");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
/// </summary>
public ref float X => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>Y</c> component.
/// </summary>
public ref float Y => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>Z</c> component.
/// </summary>
public ref float Z => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>W</c> component.
/// </summary>
public ref float W => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(W)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>R</c> component.
/// </summary>
public ref float R => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>G</c> component.
/// </summary>
public ref float G => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>B</c> component.
/// </summary>
public ref float B => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(B)}");
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>A</c> component.
/// </summary>
public ref float A => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(A)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Float4");
GenerateVectorProperties("Float4", sizeof(float));
#>
+2 -32
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="int2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 2)]
public partial struct Int2
{
/// <summary>
@@ -38,36 +36,8 @@ namespace ComputeSharp
/// <param name="y">The value to assign to the second vector component.</param>
public Int2(int x, int y)
{
X = x;
Y = y;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public int X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public int Y { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public int R
{
get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public int G
{
get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(G)}");
this.x = x;
this.y = y;
}
/// <summary>
+29 -1
ファイルの表示
@@ -1,16 +1,44 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Int2"/>
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct Int2
{
[FieldOffset(0)]
private int x;
[FieldOffset(4)]
private int y;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Int2"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref int this[int i] => throw new InvalidExecutionContextException($"{nameof(Int2)}[int]");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
/// </summary>
public ref int X => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>Y</c> component.
/// </summary>
public ref int Y => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>R</c> component.
/// </summary>
public ref int R => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>G</c> component.
/// </summary>
public ref int G => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(G)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Int2");
GenerateVectorProperties("Int2", sizeof(int));
#>
+3 -45
ファイルの表示
@@ -44,51 +44,9 @@ namespace ComputeSharp
/// <param name="z">The value to assign to the third vector component.</param>
public Int3(int x, int y, int z)
{
X = x;
Y = y;
Z = z;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public int X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public int Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public int Z { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public int R
{
get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public int G
{
get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public int B
{
get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(B)}");
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
+42 -1
ファイルの表示
@@ -1,16 +1,57 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Int3"/>
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct Int3
{
[FieldOffset(0)]
private int x;
[FieldOffset(4)]
private int y;
[FieldOffset(8)]
private int z;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Int3"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref int this[int i] => throw new InvalidExecutionContextException($"{nameof(Int3)}[int]");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
/// </summary>
public ref int X => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>Y</c> component.
/// </summary>
public ref int Y => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>Z</c> component.
/// </summary>
public ref int Z => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>R</c> component.
/// </summary>
public ref int R => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>G</c> component.
/// </summary>
public ref int G => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>B</c> component.
/// </summary>
public ref int B => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(B)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Int3");
GenerateVectorProperties("Int3", sizeof(int));
#>
+4 -62
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="int4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 4)]
public partial struct Int4
{
/// <summary>
@@ -50,66 +48,10 @@ namespace ComputeSharp
/// <param name="w">The value to assign to the fourth vector component.</param>
public Int4(int x, int y, int z, int w)
{
X = x;
Y = y;
Z = z;
W = w;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public int X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public int Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public int Z { get; set; }
/// <summary>
/// Gets or sets the value of the fourth vector component.
/// </summary>
public int W { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public int R
{
get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public int G
{
get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public int B
{
get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(B)}");
}
/// <summary>
/// Gets or sets the value of the fourth color component.
/// </summary>
public int A
{
get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(A)}");
set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(A)}");
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
+55 -1
ファイルの表示
@@ -1,16 +1,70 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="Int4"/>
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct Int4
{
[FieldOffset(0)]
private int x;
[FieldOffset(4)]
private int y;
[FieldOffset(8)]
private int z;
[FieldOffset(12)]
private int w;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Int4"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref int this[int i] => throw new InvalidExecutionContextException($"{nameof(Int4)}[int]");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
/// </summary>
public ref int X => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>Y</c> component.
/// </summary>
public ref int Y => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>Z</c> component.
/// </summary>
public ref int Z => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>W</c> component.
/// </summary>
public ref int W => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(W)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>R</c> component.
/// </summary>
public ref int R => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>G</c> component.
/// </summary>
public ref int G => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>B</c> component.
/// </summary>
public ref int B => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(B)}");
/// <summary>
/// Gets a reference to the <see cref="int"/> value representing the <c>A</c> component.
/// </summary>
public ref int A => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(A)}");
/// <summary>
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("Int4");
GenerateVectorProperties("Int4", sizeof(int));
#>
+2 -32
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="uint2"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 2)]
public partial struct UInt2
{
/// <summary>
@@ -38,36 +36,8 @@ namespace ComputeSharp
/// <param name="y">The value to assign to the second vector component.</param>
public UInt2(uint x, uint y)
{
X = x;
Y = y;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public uint X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public uint Y { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public uint R
{
get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public uint G
{
get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(G)}");
this.x = x;
this.y = y;
}
/// <summary>
+29 -1
ファイルの表示
@@ -1,16 +1,44 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="UInt2"/>
[StructLayout(LayoutKind.Explicit, Size = 8)]
public partial struct UInt2
{
[FieldOffset(0)]
private uint x;
[FieldOffset(4)]
private uint y;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="UInt2"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref uint this[int i] => throw new InvalidExecutionContextException($"{nameof(UInt2)}[int]");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
/// </summary>
public ref uint X => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>Y</c> component.
/// </summary>
public ref uint Y => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>R</c> component.
/// </summary>
public ref uint R => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>G</c> component.
/// </summary>
public ref uint G => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(G)}");
/// <summary>
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("UInt2");
GenerateVectorProperties("UInt2", sizeof(uint));
#>
+3 -47
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="uint3"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 3)]
public partial struct UInt3
{
/// <summary>
@@ -44,51 +42,9 @@ namespace ComputeSharp
/// <param name="z">The value to assign to the third vector component.</param>
public UInt3(uint x, uint y, uint z)
{
X = x;
Y = y;
Z = z;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public uint X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public uint Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public uint Z { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public uint R
{
get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public uint G
{
get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public uint B
{
get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(B)}");
this.x = x;
this.y = y;
this.z = z;
}
/// <summary>
+42 -1
ファイルの表示
@@ -1,16 +1,57 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="UInt3"/>
[StructLayout(LayoutKind.Explicit, Size = 12)]
public partial struct UInt3
{
[FieldOffset(0)]
private uint x;
[FieldOffset(4)]
private uint y;
[FieldOffset(8)]
private uint z;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="UInt3"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref uint this[int i] => throw new InvalidExecutionContextException($"{nameof(UInt3)}[int]");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
/// </summary>
public ref uint X => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>Y</c> component.
/// </summary>
public ref uint Y => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>Z</c> component.
/// </summary>
public ref uint Z => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>R</c> component.
/// </summary>
public ref uint R => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>G</c> component.
/// </summary>
public ref uint G => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>B</c> component.
/// </summary>
public ref uint B => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(B)}");
/// <summary>
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("UInt3");
GenerateVectorProperties("UInt3", sizeof(uint));
#>
+4 -62
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
@@ -8,7 +7,6 @@ namespace ComputeSharp
/// A <see langword="struct"/> that maps the <see langword="uint4"/> HLSL type.
/// </summary>
[DebuggerDisplay("({X}, {Y}, {Z}, {W})")]
[StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 4)]
public partial struct UInt4
{
/// <summary>
@@ -50,66 +48,10 @@ namespace ComputeSharp
/// <param name="w">The value to assign to the fourth vector component.</param>
public UInt4(uint x, uint y, uint z, uint w)
{
X = x;
Y = y;
Z = z;
W = w;
}
/// <summary>
/// Gets or sets the value of the first vector component.
/// </summary>
public uint X { get; set; }
/// <summary>
/// Gets or sets the value of the second vector component.
/// </summary>
public uint Y { get; set; }
/// <summary>
/// Gets or sets the value of the third vector component.
/// </summary>
public uint Z { get; set; }
/// <summary>
/// Gets or sets the value of the fourth vector component.
/// </summary>
public uint W { get; set; }
/// <summary>
/// Gets or sets the value of the first color component.
/// </summary>
public uint R
{
get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(R)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(R)}");
}
/// <summary>
/// Gets or sets the value of the second color component.
/// </summary>
public uint G
{
get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(G)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(G)}");
}
/// <summary>
/// Gets or sets the value of the third color component.
/// </summary>
public uint B
{
get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(B)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(B)}");
}
/// <summary>
/// Gets or sets the value of the fourth color component.
/// </summary>
public uint A
{
get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(A)}");
set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(A)}");
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/// <summary>
+55 -1
ファイルの表示
@@ -1,16 +1,70 @@
using ComputeSharp.Exceptions;
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="UInt4"/>
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct UInt4
{
[FieldOffset(0)]
private uint x;
[FieldOffset(4)]
private uint y;
[FieldOffset(8)]
private uint z;
[FieldOffset(12)]
private uint w;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="UInt4"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref uint this[int i] => throw new InvalidExecutionContextException($"{nameof(UInt4)}[int]");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
/// </summary>
public ref uint X => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(X)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>Y</c> component.
/// </summary>
public ref uint Y => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(Y)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>Z</c> component.
/// </summary>
public ref uint Z => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(Z)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>W</c> component.
/// </summary>
public ref uint W => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(W)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>R</c> component.
/// </summary>
public ref uint R => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(R)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>G</c> component.
/// </summary>
public ref uint G => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(G)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>B</c> component.
/// </summary>
public ref uint B => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(B)}");
/// <summary>
/// Gets a reference to the <see cref="uint"/> value representing the <c>A</c> component.
/// </summary>
public ref uint A => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(A)}");
/// <summary>
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
<#@include file="..\VectorType.ttinclude" #>
<#
GenerateVectorProperties("UInt4");
GenerateVectorProperties("UInt4", sizeof(uint));
#>
+34 -9
ファイルの表示
@@ -20,36 +20,54 @@ IEnumerable<string> EnumerateCombinations(string text)
}
// Generates all vector access properties for a specified type
void GenerateVectorProperties(string typeName)
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);
#>
using System.Runtime.InteropServices;
using ComputeSharp.Exceptions;
namespace ComputeSharp
{
/// <inheritdoc cref="<#=typeName#>"/>
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>)]
public partial struct <#=typeName#>
{
<#
PushIndent(" ");
PushIndent(" ");
// Generate the private fields
foreach (char name in "xyzw".Substring(0, i))
{
WriteLine($"[FieldOffset({"xyzw".IndexOf(name) * elementSize})]");
WriteLine($"private {hlslElementTypeName} {name};");
WriteLine("");
}
PopIndent();
PopIndent();
#>
/// <summary>
/// Gets a reference to a specific component in the current <see cref="<#=typeName#>"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
public ref <#=hlslElementTypeName#> this[int i] => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}[int]");
<#
PushIndent(" ");
PushIndent(" ");
// Generate the combinatorial swizzling properties
foreach (
var property in
(string Name, int Length) property in
"XYZW".Substring(0, i).Select(c => (c.ToString(), 1)).Concat(
"RGBA".Substring(0, i).Select(c => (c.ToString(), 1))).Concat(
from j in Enumerable.Range(2, i - 1)
from source in new[] { "XYZW", "RGBA" }
from name in EnumerateCombinations(source.Substring(0, j))
select (Name: name, Length: j))
select (name, j)))
{
WriteLine("");
@@ -59,11 +77,18 @@ namespace ComputeSharp
// XML docs
WriteLine("/// <summary>");
Write("/// Gets a ");
if (isReadonly) Write("readonly ");
Write($"reference to the <see cref=\"{propertyType}\"/> value with the components ");
Write(string.Join(", ", property.Name.Select(c => $"<see cref=\"{c}\"/>")));
WriteLine(".");
if (property.Length == 1)
{
WriteLine($"/// Gets a reference to the <see cref=\"{propertyType}\"/> value representing the <c>{property.Name}</c> component.");
}
else
{
Write("/// Gets a ");
if (isReadonly) Write("readonly ");
Write($"reference to the <see cref=\"{propertyType}\"/> value with the components ");
Write(string.Join(", ", property.Name.Select(c => $"<see cref=\"{c}\"/>")));
WriteLine(".");
}
WriteLine("/// </summary>");
// Property