Added byref single component properties
このコミットが含まれているのは:
1 親
c876a76a4c
コミット
7bac8a5a42
46ファイル変更
+724
-808
検索条件に一致するファイルはありません
@@ -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>
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
<#@include file="..\VectorType.ttinclude" #>
|
||||
<#
|
||||
GenerateVectorProperties("Double2");
|
||||
GenerateVectorProperties("Double2", sizeof(double));
|
||||
#>
|
||||
@@ -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>
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
<#@include file="..\VectorType.ttinclude" #>
|
||||
<#
|
||||
GenerateVectorProperties("Double3");
|
||||
GenerateVectorProperties("Double3", sizeof(double));
|
||||
#>
|
||||
@@ -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>
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
<#@include file="..\VectorType.ttinclude" #>
|
||||
<#
|
||||
GenerateVectorProperties("Double4");
|
||||
GenerateVectorProperties("Double4", sizeof(double));
|
||||
#>
|
||||
新しいイシューから参照
ユーザーをブロックする