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