Added byref single component properties

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

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

+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));
#>