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="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));
#>