Added static properties to the HLSL vector structs

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-25 23:33:16 +02:00
1 親 93bf73f259
コミット e9367f5953
12ファイル変更
+300

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

+20
ファイルの表示
@@ -9,6 +9,26 @@ namespace ComputeSharp.Shaders.Primitives.Double
[StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 2)]
public struct Double2
{
/// <summary>
/// Gets an <see cref="Double2"/> value with all components set to 0
/// </summary>
public static Double2 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Double2"/> value with all components set to 1
/// </summary>
public static Double2 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Double2"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Double2 UnitX { get; } = new Double2(1, 0);
/// <summary>
/// Gets an <see cref="Double2"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Double2 UnitY { get; } = new Double2(0, 1);
/// <summary>
/// Creates a new <see cref="Double2"/> instance with the specified parameters
/// </summary>
+25
ファイルの表示
@@ -9,6 +9,31 @@ namespace ComputeSharp.Shaders.Primitives.Double
[StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 3)]
public struct Double3
{
/// <summary>
/// Gets an <see cref="Double3"/> value with all components set to 0
/// </summary>
public static Double3 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Double3"/> value with all components set to 1
/// </summary>
public static Double3 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Double3"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Double3 UnitX { get; } = new Double3(1, 0, 0);
/// <summary>
/// Gets an <see cref="Double3"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Double3 UnitY { get; } = new Double3(0, 1, 0);
/// <summary>
/// Gets an <see cref="Double3"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static Double3 UnitZ { get; } = new Double3(0, 0, 1);
/// <summary>
/// Creates a new <see cref="Double3"/> instance with the specified parameters
/// </summary>
+30
ファイルの表示
@@ -9,6 +9,36 @@ namespace ComputeSharp.Shaders.Primitives.Double
[StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 4)]
public struct Double4
{
/// <summary>
/// Gets an <see cref="Double4"/> value with all components set to 0
/// </summary>
public static Double4 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Double4"/> value with all components set to 1
/// </summary>
public static Double4 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Double4"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Double4 UnitX { get; } = new Double4(1, 0, 0, 0);
/// <summary>
/// Gets an <see cref="Double4"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Double4 UnitY { get; } = new Double4(0, 1, 0, 0);
/// <summary>
/// Gets an <see cref="Double4"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static Double4 UnitZ { get; } = new Double4(0, 0, 1, 0);
/// <summary>
/// Gets an <see cref="Double4"/> value with the <see cref="W"/> component set to 1, and the others to 0
/// </summary>
public static Double4 UnitW { get; } = new Double4(0, 0, 0, 1);
/// <summary>
/// Creates a new <see cref="Double4"/> instance with the specified parameters
/// </summary>
+20
ファイルの表示
@@ -9,6 +9,26 @@ namespace ComputeSharp.Shaders.Primitives.Float
[StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 2)]
public struct Float2
{
/// <summary>
/// Gets an <see cref="Float2"/> value with all components set to 0
/// </summary>
public static Float2 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Float2"/> value with all components set to 1
/// </summary>
public static Float2 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Float2"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Float2 UnitX { get; } = new Float2(1, 0);
/// <summary>
/// Gets an <see cref="Float2"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Float2 UnitY { get; } = new Float2(0, 1);
/// <summary>
/// Creates a new <see cref="Float2"/> instance with the specified parameters
/// </summary>
+25
ファイルの表示
@@ -9,6 +9,31 @@ namespace ComputeSharp.Shaders.Primitives.Float
[StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 3)]
public struct Float3
{
/// <summary>
/// Gets an <see cref="Float3"/> value with all components set to 0
/// </summary>
public static Float3 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Float3"/> value with all components set to 1
/// </summary>
public static Float3 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Float3"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Float3 UnitX { get; } = new Float3(1, 0, 0);
/// <summary>
/// Gets an <see cref="Float3"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Float3 UnitY { get; } = new Float3(0, 1, 0);
/// <summary>
/// Gets an <see cref="Float3"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static Float3 UnitZ { get; } = new Float3(0, 0, 1);
/// <summary>
/// Creates a new <see cref="Float3"/> instance with the specified parameters
/// </summary>
+30
ファイルの表示
@@ -9,6 +9,36 @@ namespace ComputeSharp.Shaders.Primitives.Float
[StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 4)]
public struct Float4
{
/// <summary>
/// Gets an <see cref="Float4"/> value with all components set to 0
/// </summary>
public static Float4 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Float4"/> value with all components set to 1
/// </summary>
public static Float4 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Float4"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Float4 UnitX { get; } = new Float4(1, 0, 0, 0);
/// <summary>
/// Gets an <see cref="Float4"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Float4 UnitY { get; } = new Float4(0, 1, 0, 0);
/// <summary>
/// Gets an <see cref="Float4"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static Float4 UnitZ { get; } = new Float4(0, 0, 1, 0);
/// <summary>
/// Gets an <see cref="Float4"/> value with the <see cref="W"/> component set to 1, and the others to 0
/// </summary>
public static Float4 UnitW { get; } = new Float4(0, 0, 0, 1);
/// <summary>
/// Creates a new <see cref="Float4"/> instance with the specified parameters
/// </summary>
+20
ファイルの表示
@@ -9,6 +9,26 @@ namespace ComputeSharp.Shaders.Primitives.Int
[StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 2)]
public struct Int2
{
/// <summary>
/// Gets an <see cref="Int2"/> value with all components set to 0
/// </summary>
public static Int2 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Int2"/> value with all components set to 1
/// </summary>
public static Int2 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Int2"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Int2 UnitX { get; } = new Int2(1, 0);
/// <summary>
/// Gets an <see cref="Int2"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Int2 UnitY { get; } = new Int2(0, 1);
/// <summary>
/// Creates a new <see cref="Int2"/> instance with the specified parameters
/// </summary>
+25
ファイルの表示
@@ -9,6 +9,31 @@ namespace ComputeSharp.Shaders.Primitives.Int
[StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 3)]
public struct Int3
{
/// <summary>
/// Gets an <see cref="Int3"/> value with all components set to 0
/// </summary>
public static Int3 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Int3"/> value with all components set to 1
/// </summary>
public static Int3 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Int3"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Int3 UnitX { get; } = new Int3(1, 0, 0);
/// <summary>
/// Gets an <see cref="Int3"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Int3 UnitY { get; } = new Int3(0, 1, 0);
/// <summary>
/// Gets an <see cref="Int3"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static Int3 UnitZ { get; } = new Int3(0, 0, 1);
/// <summary>
/// Creates a new <see cref="Int3"/> instance with the specified parameters
/// </summary>
+30
ファイルの表示
@@ -9,6 +9,36 @@ namespace ComputeSharp.Shaders.Primitives.Int
[StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 4)]
public struct Int4
{
/// <summary>
/// Gets an <see cref="Int4"/> value with all components set to 0
/// </summary>
public static Int4 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="Int4"/> value with all components set to 1
/// </summary>
public static Int4 One { get; } = 1;
/// <summary>
/// Gets an <see cref="Int4"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static Int4 UnitX { get; } = new Int4(1, 0, 0, 0);
/// <summary>
/// Gets an <see cref="Int4"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static Int4 UnitY { get; } = new Int4(0, 1, 0, 0);
/// <summary>
/// Gets an <see cref="Int4"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static Int4 UnitZ { get; } = new Int4(0, 0, 1, 0);
/// <summary>
/// Gets an <see cref="Int4"/> value with the <see cref="W"/> component set to 1, and the others to 0
/// </summary>
public static Int4 UnitW { get; } = new Int4(0, 0, 0, 1);
/// <summary>
/// Creates a new <see cref="Int4"/> instance with the specified parameters
/// </summary>
+30
ファイルの表示
@@ -9,6 +9,36 @@ namespace ComputeSharp.Shaders.Primitives.UInt
[StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 4)]
public struct UInt4
{
/// <summary>
/// Gets an <see cref="UInt4"/> value with all components set to 0
/// </summary>
public static UInt4 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="UInt4"/> value with all components set to 1
/// </summary>
public static UInt4 One { get; } = 1;
/// <summary>
/// Gets an <see cref="UInt4"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static UInt4 UnitX { get; } = new UInt4(1, 0, 0, 0);
/// <summary>
/// Gets an <see cref="UInt4"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static UInt4 UnitY { get; } = new UInt4(0, 1, 0, 0);
/// <summary>
/// Gets an <see cref="UInt4"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static UInt4 UnitZ { get; } = new UInt4(0, 0, 1, 0);
/// <summary>
/// Gets an <see cref="UInt4"/> value with the <see cref="W"/> component set to 1, and the others to 0
/// </summary>
public static UInt4 UnitW { get; } = new UInt4(0, 0, 0, 1);
/// <summary>
/// Creates a new <see cref="UInt4"/> instance with the specified parameters
/// </summary>
+20
ファイルの表示
@@ -9,6 +9,26 @@ namespace ComputeSharp.Shaders.Primitives.UInt
[StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 2)]
public struct UInt2
{
/// <summary>
/// Gets an <see cref="UInt2"/> value with all components set to 0
/// </summary>
public static UInt2 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="UInt2"/> value with all components set to 1
/// </summary>
public static UInt2 One { get; } = 1;
/// <summary>
/// Gets an <see cref="UInt2"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static UInt2 UnitX { get; } = new UInt2(1, 0);
/// <summary>
/// Gets an <see cref="UInt2"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static UInt2 UnitY { get; } = new UInt2(0, 1);
/// <summary>
/// Creates a new <see cref="UInt2"/> instance with the specified parameters
/// </summary>
+25
ファイルの表示
@@ -9,6 +9,31 @@ namespace ComputeSharp.Shaders.Primitives.UInt
[StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 3)]
public struct UInt3
{
/// <summary>
/// Gets an <see cref="UInt3"/> value with all components set to 0
/// </summary>
public static UInt3 Zero { get; } = 0;
/// <summary>
/// Gets an <see cref="UInt3"/> value with all components set to 1
/// </summary>
public static UInt3 One { get; } = 1;
/// <summary>
/// Gets an <see cref="UInt3"/> value with the <see cref="X"/> component set to 1, and the others to 0
/// </summary>
public static UInt3 UnitX { get; } = new UInt3(1, 0, 0);
/// <summary>
/// Gets an <see cref="UInt3"/> value with the <see cref="Y"/> component set to 1, and the others to 0
/// </summary>
public static UInt3 UnitY { get; } = new UInt3(0, 1, 0);
/// <summary>
/// Gets an <see cref="UInt3"/> value with the <see cref="Z"/> component set to 1, and the others to 0
/// </summary>
public static UInt3 UnitZ { get; } = new UInt3(0, 0, 1);
/// <summary>
/// Creates a new <see cref="UInt3"/> instance with the specified parameters
/// </summary>