Added operators to HLSL vector types

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-26 03:36:26 +02:00
1 親 fb1fb9a3a1
コミット 40aa965c63
12ファイル変更
+336

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

+28
ファイルの表示
@@ -139,5 +139,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Double2"/> instance</param>
public static implicit operator Double2(double x) => new Double2(x, x);
/// <summary>
/// Sums two <see cref="Double2"/> values
/// </summary>
/// <param name="left">The first <see cref="Double2"/> value to sum</param>
/// <param name="right">The second <see cref="Double2"/> value to sum</param>
public static Double2 operator +(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.+");
/// <summary>
/// Divides two <see cref="Double2"/> values
/// </summary>
/// <param name="left">The first <see cref="Double2"/> value to divide</param>
/// <param name="right">The second <see cref="Double2"/> value to divide</param>
public static Double2 operator /(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}./");
/// <summary>
/// Multiplies two <see cref="Double2"/> values
/// </summary>
/// <param name="left">The first <see cref="Double2"/> value to multiply</param>
/// <param name="right">The second <see cref="Double2"/> value to multiply</param>
public static Double2 operator *(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.*");
/// <summary>
/// Subtracts two <see cref="Double2"/> values
/// </summary>
/// <param name="left">The first <see cref="Double2"/> value to subtract</param>
/// <param name="right">The second <see cref="Double2"/> value to subtract</param>
public static Double2 operator -(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.-");
}
}
+28
ファイルの表示
@@ -560,5 +560,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Double3"/> instance</param>
public static implicit operator Double3(double x) => new Double3(x, x, x);
/// <summary>
/// Sums two <see cref="Double3"/> values
/// </summary>
/// <param name="left">The first <see cref="Double3"/> value to sum</param>
/// <param name="right">The second <see cref="Double3"/> value to sum</param>
public static Double3 operator +(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.+");
/// <summary>
/// Divides two <see cref="Double3"/> values
/// </summary>
/// <param name="left">The first <see cref="Double3"/> value to divide</param>
/// <param name="right">The second <see cref="Double3"/> value to divide</param>
public static Double3 operator /(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}./");
/// <summary>
/// Multiplies two <see cref="Double3"/> values
/// </summary>
/// <param name="left">The first <see cref="Double3"/> value to multiply</param>
/// <param name="right">The second <see cref="Double3"/> value to multiply</param>
public static Double3 operator *(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.*");
/// <summary>
/// Subtracts two <see cref="Double3"/> values
/// </summary>
/// <param name="left">The first <see cref="Double3"/> value to subtract</param>
/// <param name="right">The second <see cref="Double3"/> value to subtract</param>
public static Double3 operator -(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.-");
}
}
+28
ファイルの表示
@@ -3965,5 +3965,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Double4"/> instance</param>
public static implicit operator Double4(double x) => new Double4(x, x, x, x);
/// <summary>
/// Sums two <see cref="Double4"/> values
/// </summary>
/// <param name="left">The first <see cref="Double4"/> value to sum</param>
/// <param name="right">The second <see cref="Double4"/> value to sum</param>
public static Double4 operator +(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.+");
/// <summary>
/// Divides two <see cref="Double4"/> values
/// </summary>
/// <param name="left">The first <see cref="Double4"/> value to divide</param>
/// <param name="right">The second <see cref="Double4"/> value to divide</param>
public static Double4 operator /(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}./");
/// <summary>
/// Multiplies two <see cref="Double4"/> values
/// </summary>
/// <param name="left">The first <see cref="Double4"/> value to multiply</param>
/// <param name="right">The second <see cref="Double4"/> value to multiply</param>
public static Double4 operator *(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.*");
/// <summary>
/// Subtracts two <see cref="Double4"/> values
/// </summary>
/// <param name="left">The first <see cref="Double4"/> value to subtract</param>
/// <param name="right">The second <see cref="Double4"/> value to subtract</param>
public static Double4 operator -(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.-");
}
}
+28
ファイルの表示
@@ -139,5 +139,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Float2"/> instance</param>
public static implicit operator Float2(float x) => new Float2(x, x);
/// <summary>
/// Sums two <see cref="Float2"/> values
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to sum</param>
/// <param name="right">The second <see cref="Float2"/> value to sum</param>
public static Float2 operator +(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.+");
/// <summary>
/// Divides two <see cref="Float2"/> values
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to divide</param>
/// <param name="right">The second <see cref="Float2"/> value to divide</param>
public static Float2 operator /(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}./");
/// <summary>
/// Multiplies two <see cref="Float2"/> values
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to multiply</param>
/// <param name="right">The second <see cref="Float2"/> value to multiply</param>
public static Float2 operator *(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.*");
/// <summary>
/// Subtracts two <see cref="Float2"/> values
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to subtract</param>
/// <param name="right">The second <see cref="Float2"/> value to subtract</param>
public static Float2 operator -(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.-");
}
}
+28
ファイルの表示
@@ -560,5 +560,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Float3"/> instance</param>
public static implicit operator Float3(float x) => new Float3(x, x, x);
/// <summary>
/// Sums two <see cref="Float3"/> values
/// </summary>
/// <param name="left">The first <see cref="Float3"/> value to sum</param>
/// <param name="right">The second <see cref="Float3"/> value to sum</param>
public static Float3 operator +(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.+");
/// <summary>
/// Divides two <see cref="Float3"/> values
/// </summary>
/// <param name="left">The first <see cref="Float3"/> value to divide</param>
/// <param name="right">The second <see cref="Float3"/> value to divide</param>
public static Float3 operator /(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}./");
/// <summary>
/// Multiplies two <see cref="Float3"/> values
/// </summary>
/// <param name="left">The first <see cref="Float3"/> value to multiply</param>
/// <param name="right">The second <see cref="Float3"/> value to multiply</param>
public static Float3 operator *(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.*");
/// <summary>
/// Subtracts two <see cref="Float3"/> values
/// </summary>
/// <param name="left">The first <see cref="Float3"/> value to subtract</param>
/// <param name="right">The second <see cref="Float3"/> value to subtract</param>
public static Float3 operator -(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.-");
}
}
+28
ファイルの表示
@@ -3965,5 +3965,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Float4"/> instance</param>
public static implicit operator Float4(float x) => new Float4(x, x, x, x);
/// <summary>
/// Sums two <see cref="Float4"/> values
/// </summary>
/// <param name="left">The first <see cref="Float4"/> value to sum</param>
/// <param name="right">The second <see cref="Float4"/> value to sum</param>
public static Float4 operator +(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.+");
/// <summary>
/// Divides two <see cref="Float4"/> values
/// </summary>
/// <param name="left">The first <see cref="Float4"/> value to divide</param>
/// <param name="right">The second <see cref="Float4"/> value to divide</param>
public static Float4 operator /(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}./");
/// <summary>
/// Multiplies two <see cref="Float4"/> values
/// </summary>
/// <param name="left">The first <see cref="Float4"/> value to multiply</param>
/// <param name="right">The second <see cref="Float4"/> value to multiply</param>
public static Float4 operator *(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.*");
/// <summary>
/// Subtracts two <see cref="Float4"/> values
/// </summary>
/// <param name="left">The first <see cref="Float4"/> value to subtract</param>
/// <param name="right">The second <see cref="Float4"/> value to subtract</param>
public static Float4 operator -(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.-");
}
}
+28
ファイルの表示
@@ -139,5 +139,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Int2"/> instance</param>
public static implicit operator Int2(int x) => new Int2(x, x);
/// <summary>
/// Sums two <see cref="Int2"/> values
/// </summary>
/// <param name="left">The first <see cref="Int2"/> value to sum</param>
/// <param name="right">The second <see cref="Int2"/> value to sum</param>
public static Int2 operator +(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.+");
/// <summary>
/// Divides two <see cref="Int2"/> values
/// </summary>
/// <param name="left">The first <see cref="Int2"/> value to divide</param>
/// <param name="right">The second <see cref="Int2"/> value to divide</param>
public static Int2 operator /(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}./");
/// <summary>
/// Multiplies two <see cref="Int2"/> values
/// </summary>
/// <param name="left">The first <see cref="Int2"/> value to multiply</param>
/// <param name="right">The second <see cref="Int2"/> value to multiply</param>
public static Int2 operator *(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.*");
/// <summary>
/// Subtracts two <see cref="Int2"/> values
/// </summary>
/// <param name="left">The first <see cref="Int2"/> value to subtract</param>
/// <param name="right">The second <see cref="Int2"/> value to subtract</param>
public static Int2 operator -(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.-");
}
}
+28
ファイルの表示
@@ -560,5 +560,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Int3"/> instance</param>
public static implicit operator Int3(int x) => new Int3(x, x, x);
/// <summary>
/// Sums two <see cref="Int3"/> values
/// </summary>
/// <param name="left">The first <see cref="Int3"/> value to sum</param>
/// <param name="right">The second <see cref="Int3"/> value to sum</param>
public static Int3 operator +(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.+");
/// <summary>
/// Divides two <see cref="Int3"/> values
/// </summary>
/// <param name="left">The first <see cref="Int3"/> value to divide</param>
/// <param name="right">The second <see cref="Int3"/> value to divide</param>
public static Int3 operator /(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}./");
/// <summary>
/// Multiplies two <see cref="Int3"/> values
/// </summary>
/// <param name="left">The first <see cref="Int3"/> value to multiply</param>
/// <param name="right">The second <see cref="Int3"/> value to multiply</param>
public static Int3 operator *(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.*");
/// <summary>
/// Subtracts two <see cref="Int3"/> values
/// </summary>
/// <param name="left">The first <see cref="Int3"/> value to subtract</param>
/// <param name="right">The second <see cref="Int3"/> value to subtract</param>
public static Int3 operator -(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.-");
}
}
+28
ファイルの表示
@@ -3965,5 +3965,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="Int4"/> instance</param>
public static implicit operator Int4(int x) => new Int4(x, x, x, x);
/// <summary>
/// Sums two <see cref="Int4"/> values
/// </summary>
/// <param name="left">The first <see cref="Int4"/> value to sum</param>
/// <param name="right">The second <see cref="Int4"/> value to sum</param>
public static Int4 operator +(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.+");
/// <summary>
/// Divides two <see cref="Int4"/> values
/// </summary>
/// <param name="left">The first <see cref="Int4"/> value to divide</param>
/// <param name="right">The second <see cref="Int4"/> value to divide</param>
public static Int4 operator /(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}./");
/// <summary>
/// Multiplies two <see cref="Int4"/> values
/// </summary>
/// <param name="left">The first <see cref="Int4"/> value to multiply</param>
/// <param name="right">The second <see cref="Int4"/> value to multiply</param>
public static Int4 operator *(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.*");
/// <summary>
/// Subtracts two <see cref="Int4"/> values
/// </summary>
/// <param name="left">The first <see cref="Int4"/> value to subtract</param>
/// <param name="right">The second <see cref="Int4"/> value to subtract</param>
public static Int4 operator -(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.-");
}
}
+28
ファイルの表示
@@ -3965,5 +3965,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="UInt4"/> instance</param>
public static implicit operator UInt4(uint x) => new UInt4(x, x, x, x);
/// <summary>
/// Sums two <see cref="UInt4"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt4"/> value to sum</param>
/// <param name="right">The second <see cref="UInt4"/> value to sum</param>
public static UInt4 operator +(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.+");
/// <summary>
/// Divides two <see cref="UInt4"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt4"/> value to divide</param>
/// <param name="right">The second <see cref="UInt4"/> value to divide</param>
public static UInt4 operator /(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}./");
/// <summary>
/// Multiplies two <see cref="UInt4"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt4"/> value to multiply</param>
/// <param name="right">The second <see cref="UInt4"/> value to multiply</param>
public static UInt4 operator *(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.*");
/// <summary>
/// Subtracts two <see cref="UInt4"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt4"/> value to subtract</param>
/// <param name="right">The second <see cref="UInt4"/> value to subtract</param>
public static UInt4 operator -(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.-");
}
}
+28
ファイルの表示
@@ -139,5 +139,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="UInt2"/> instance</param>
public static implicit operator UInt2(uint x) => new UInt2(x, x);
/// <summary>
/// Sums two <see cref="UInt2"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt2"/> value to sum</param>
/// <param name="right">The second <see cref="UInt2"/> value to sum</param>
public static UInt2 operator +(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.+");
/// <summary>
/// Divides two <see cref="UInt2"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt2"/> value to divide</param>
/// <param name="right">The second <see cref="UInt2"/> value to divide</param>
public static UInt2 operator /(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}./");
/// <summary>
/// Multiplies two <see cref="UInt2"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt2"/> value to multiply</param>
/// <param name="right">The second <see cref="UInt2"/> value to multiply</param>
public static UInt2 operator *(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.*");
/// <summary>
/// Subtracts two <see cref="UInt2"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt2"/> value to subtract</param>
/// <param name="right">The second <see cref="UInt2"/> value to subtract</param>
public static UInt2 operator -(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.-");
}
}
+28
ファイルの表示
@@ -560,5 +560,33 @@ namespace ComputeSharp
/// </summary>
/// <param name="x">The value to use for the components of the new <see cref="UInt3"/> instance</param>
public static implicit operator UInt3(uint x) => new UInt3(x, x, x);
/// <summary>
/// Sums two <see cref="UInt3"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt3"/> value to sum</param>
/// <param name="right">The second <see cref="UInt3"/> value to sum</param>
public static UInt3 operator +(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.+");
/// <summary>
/// Divides two <see cref="UInt3"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt3"/> value to divide</param>
/// <param name="right">The second <see cref="UInt3"/> value to divide</param>
public static UInt3 operator /(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}./");
/// <summary>
/// Multiplies two <see cref="UInt3"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt3"/> value to multiply</param>
/// <param name="right">The second <see cref="UInt3"/> value to multiply</param>
public static UInt3 operator *(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.*");
/// <summary>
/// Subtracts two <see cref="UInt3"/> values
/// </summary>
/// <param name="left">The first <see cref="UInt3"/> value to subtract</param>
/// <param name="right">The second <see cref="UInt3"/> value to subtract</param>
public static UInt3 operator -(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.-");
}
}