diff --git a/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs index 2ba0ec72..0d57e369 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs @@ -499,6 +499,24 @@ public unsafe partial struct Float2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float2 operator *(Float2 left, Float2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2 operator *(Float2 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2 operator *(float left, Float2 right) => default; + /// /// Multiplies two values using matrix math. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs index 95d0c277..fcc3c0d8 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float3.g.cs @@ -1585,6 +1585,24 @@ public unsafe partial struct Float3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float3 operator *(Float3 left, Float3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3 operator *(Float3 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3 operator *(float left, Float3 right) => default; + /// /// Multiplies two values using matrix math. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs index 73593b57..199d5dd2 100644 --- a/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/Float4.g.cs @@ -4231,6 +4231,24 @@ public unsafe partial struct Float4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float4 operator *(Float4 left, Float4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4 operator *(Float4 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4 operator *(float left, Float4 right) => default; + /// /// Multiplies two values using matrix math. /// diff --git a/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs index 6d8010e5..026093b4 100644 --- a/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs @@ -126,6 +126,24 @@ public unsafe partial struct Float1x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float1x1 operator *(Float1x1 left, Float1x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x1 operator *(Float1x1 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x1 operator *(float left, Float1x1 right) => default; + /// /// Subtracts two values. /// @@ -317,6 +335,24 @@ public unsafe partial struct Float1x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float1x2 operator *(Float1x2 left, Float1x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x2 operator *(Float1x2 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x2 operator *(float left, Float1x2 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -609,6 +645,24 @@ public unsafe partial struct Float1x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float1x3 operator *(Float1x3 left, Float1x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x3 operator *(Float1x3 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x3 operator *(float left, Float1x3 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -912,6 +966,24 @@ public unsafe partial struct Float1x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float1x4 operator *(Float1x4 left, Float1x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x4 operator *(Float1x4 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float1x4 operator *(float left, Float1x4 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -1193,6 +1265,24 @@ public unsafe partial struct Float2x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float2x1 operator *(Float2x1 left, Float2x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x1 operator *(Float2x1 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x1 operator *(float left, Float2x1 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -1495,6 +1585,24 @@ public unsafe partial struct Float2x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float2x2 operator *(Float2x2 left, Float2x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x2 operator *(Float2x2 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x2 operator *(float left, Float2x2 right) => default; + /// /// Subtracts two values. /// @@ -1745,6 +1853,24 @@ public unsafe partial struct Float2x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float2x3 operator *(Float2x3 left, Float2x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x3 operator *(Float2x3 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x3 operator *(float left, Float2x3 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -2103,6 +2229,24 @@ public unsafe partial struct Float2x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float2x4 operator *(Float2x4 left, Float2x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x4 operator *(Float2x4 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float2x4 operator *(float left, Float2x4 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -2389,6 +2533,24 @@ public unsafe partial struct Float3x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float3x1 operator *(Float3x1 left, Float3x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x1 operator *(Float3x1 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x1 operator *(float left, Float3x1 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -2716,6 +2878,24 @@ public unsafe partial struct Float3x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float3x2 operator *(Float3x2 left, Float3x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x2 operator *(Float3x2 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x2 operator *(float left, Float3x2 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -3087,6 +3267,24 @@ public unsafe partial struct Float3x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float3x3 operator *(Float3x3 left, Float3x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x3 operator *(Float3x3 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x3 operator *(float left, Float3x3 right) => default; + /// /// Subtracts two values. /// @@ -3410,6 +3608,24 @@ public unsafe partial struct Float3x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float3x4 operator *(Float3x4 left, Float3x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x4 operator *(Float3x4 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float3x4 operator *(float left, Float3x4 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -3707,6 +3923,24 @@ public unsafe partial struct Float4x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float4x1 operator *(Float4x1 left, Float4x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x1 operator *(Float4x1 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x1 operator *(float left, Float4x1 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -4059,6 +4293,24 @@ public unsafe partial struct Float4x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float4x2 operator *(Float4x2 left, Float4x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x2 operator *(Float4x2 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x2 operator *(float left, Float4x2 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -4467,6 +4719,24 @@ public unsafe partial struct Float4x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float4x3 operator *(Float4x3 left, Float4x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x3 operator *(Float4x3 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x3 operator *(float left, Float4x3 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -4923,6 +5193,24 @@ public unsafe partial struct Float4x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Float4x4 operator *(Float4x4 left, Float4x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x4 operator *(Float4x4 left, float right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Float4x4 operator *(float left, Float4x4 right) => default; + /// /// Subtracts two values. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs index 107c4a56..9066df25 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int2.g.cs @@ -499,6 +499,24 @@ public unsafe partial struct Int2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int2 operator *(Int2 left, Int2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator *(Int2 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2 operator *(int left, Int2 right) => default; + /// /// Multiplies two values using matrix math. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs index b0ffbf82..8dfad0ef 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int3.g.cs @@ -1585,6 +1585,24 @@ public unsafe partial struct Int3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int3 operator *(Int3 left, Int3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator *(Int3 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3 operator *(int left, Int3 right) => default; + /// /// Multiplies two values using matrix math. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs index 362c31ce..d7e64606 100644 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/Int4.g.cs @@ -4231,6 +4231,24 @@ public unsafe partial struct Int4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int4 operator *(Int4 left, Int4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator *(Int4 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4 operator *(int left, Int4 right) => default; + /// /// Multiplies two values using matrix math. /// diff --git a/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs index f1b62349..03b54736 100644 --- a/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs @@ -126,6 +126,24 @@ public unsafe partial struct Int1x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int1x1 operator *(Int1x1 left, Int1x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator *(Int1x1 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x1 operator *(int left, Int1x1 right) => default; + /// /// Subtracts two values. /// @@ -417,6 +435,24 @@ public unsafe partial struct Int1x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int1x2 operator *(Int1x2 left, Int1x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator *(Int1x2 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x2 operator *(int left, Int1x2 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -809,6 +845,24 @@ public unsafe partial struct Int1x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int1x3 operator *(Int1x3 left, Int1x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator *(Int1x3 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x3 operator *(int left, Int1x3 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -1212,6 +1266,24 @@ public unsafe partial struct Int1x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int1x4 operator *(Int1x4 left, Int1x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator *(Int1x4 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int1x4 operator *(int left, Int1x4 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -1593,6 +1665,24 @@ public unsafe partial struct Int2x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int2x1 operator *(Int2x1 left, Int2x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator *(Int2x1 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x1 operator *(int left, Int2x1 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -1995,6 +2085,24 @@ public unsafe partial struct Int2x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int2x2 operator *(Int2x2 left, Int2x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator *(Int2x2 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x2 operator *(int left, Int2x2 right) => default; + /// /// Subtracts two values. /// @@ -2345,6 +2453,24 @@ public unsafe partial struct Int2x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int2x3 operator *(Int2x3 left, Int2x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator *(Int2x3 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x3 operator *(int left, Int2x3 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -2803,6 +2929,24 @@ public unsafe partial struct Int2x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int2x4 operator *(Int2x4 left, Int2x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator *(Int2x4 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int2x4 operator *(int left, Int2x4 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -3189,6 +3333,24 @@ public unsafe partial struct Int3x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int3x1 operator *(Int3x1 left, Int3x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator *(Int3x1 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x1 operator *(int left, Int3x1 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -3616,6 +3778,24 @@ public unsafe partial struct Int3x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int3x2 operator *(Int3x2 left, Int3x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator *(Int3x2 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x2 operator *(int left, Int3x2 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -4087,6 +4267,24 @@ public unsafe partial struct Int3x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int3x3 operator *(Int3x3 left, Int3x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator *(Int3x3 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x3 operator *(int left, Int3x3 right) => default; + /// /// Subtracts two values. /// @@ -4510,6 +4708,24 @@ public unsafe partial struct Int3x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int3x4 operator *(Int3x4 left, Int3x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator *(Int3x4 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int3x4 operator *(int left, Int3x4 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -4907,6 +5123,24 @@ public unsafe partial struct Int4x1 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int4x1 operator *(Int4x1 left, Int4x1 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator *(Int4x1 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x1 operator *(int left, Int4x1 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -5359,6 +5593,24 @@ public unsafe partial struct Int4x2 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int4x2 operator *(Int4x2 left, Int4x2 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator *(Int4x2 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x2 operator *(int left, Int4x2 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -5867,6 +6119,24 @@ public unsafe partial struct Int4x3 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int4x3 operator *(Int4x3 left, Int4x3 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator *(Int4x3 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x3 operator *(int left, Int4x3 right) => default; + /// /// Multiplies two values using matrix math. /// @@ -6423,6 +6693,24 @@ public unsafe partial struct Int4x4 /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static Int4x4 operator *(Int4x4 left, Int4x4 right) => default; + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator *(Int4x4 left, int right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static Int4x4 operator *(int left, Int4x4 right) => default; + /// /// Subtracts two values. /// diff --git a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude index 63d6265b..a4134dcd 100644 --- a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude @@ -297,15 +297,39 @@ public unsafe partial struct <#=fullTypeName#> /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static <#=fullTypeName#> operator *(<#=fullTypeName#> left, <#=fullTypeName#> right) => default; <# - // Process all operators for the mul() intrinsic (see comments in VectorType.ttinclude for info on the filters below) - foreach (var mulOverload in MulOverloads.Where(overload => - !(overload.Params[0] == fullTypeName && overload.Params[1] == fullTypeName) && - Regex.IsMatch(overload.Params[0], @"\d") && - Regex.IsMatch(overload.Params[1], @"\d") && - (overload.Return == fullTypeName && overload.Params.Contains(fullTypeName) || - !overload.Params.Contains(overload.Return) && overload.Params[0] == fullTypeName))) + if (typeName == "Float" || typeName == "Int") { + // Add explicit operators when needed, see notes in VectorType.ttinclude for info WriteLine(""); +#> + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator *(<#=fullTypeName#> left, <#=elementTypeName#> right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=fullTypeName#> operator *(<#=elementTypeName#> left, <#=fullTypeName#> right) => default; +<# + + // Process all operators for the mul() intrinsic (see comments in VectorType.ttinclude for info on the filters below) + foreach (var mulOverload in MulOverloads.Where(overload => + !(overload.Params[0] == fullTypeName && overload.Params[1] == fullTypeName) && + Regex.IsMatch(overload.Params[0], @"\d") && + Regex.IsMatch(overload.Params[1], @"\d") && + (overload.Return == fullTypeName && overload.Params.Contains(fullTypeName) || + !overload.Params.Contains(overload.Return) && overload.Params[0] == fullTypeName))) + { + WriteLine(""); #> /// /// Multiplies two values using matrix math. @@ -321,6 +345,7 @@ public unsafe partial struct <#=fullTypeName#> [HlslIntrinsicName("mul", RequiresParametersMatching = true)] public static <#=mulOverload.Return#> operator *(<#=mulOverload.Params[0]#> x, <#=mulOverload.Params[1]#> y) => default; <# + } } WriteLine(""); diff --git a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude index 295c6e1a..6b75ac34 100644 --- a/src/ComputeSharp.Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/VectorType.ttinclude @@ -360,31 +360,56 @@ public unsafe partial struct <#=typeName#> /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static <#=typeName#> operator *(<#=typeName#> left, <#=typeName#> right) => default; <# - // Process all operators for the mul() intrinsic. We apply the following filtering: - // 1) Operators where both arguments are of the containing type are skipped. This is because - // this operation is already defined as an elementwise product for all vector/matrix types. - // Defining the operator would cause a conflict, plus it would alter the semantics anyway. - // 2) Operators where either parameter is a primitive type (ie. not a vector) are skipped. This - // is because such operation is already implicitly defined (it's an elementwise product where - // the scalar is auto-promoted to the same vector/matrix type of the other argument). Again, - // defining the operator would cause the semantics of such expressions to change to a cross - // product, so these operators are intentionally skipped to keep code consistent with HLSL. - // 3) Among all available overloads, only either of these two cases are selected: - // - The containing type matches the return type and the first parameter type of the operator. - // This ensures that all overloads where the return type matches the containing type and the - // first parameter are generated inside the containing type, as one would do manually as well. - // - The return type is unlike both parameter types, but the containing type matches the type of - // the first parameter. This is the case when the operator (ie. the cross product) produces a - // result that's of a completely different type. In this case, the overload maps to a generated - // operator declared in the type that matches the type of the first parameter, as a convention. - foreach (var mulOverload in MulOverloads.Where(overload => - !(overload.Params[0] == typeName && overload.Params[1] == typeName) && - Regex.IsMatch(overload.Params[0], @"\d") && - Regex.IsMatch(overload.Params[1], @"\d") && - (overload.Return == typeName && overload.Params.Contains(typeName) || - !overload.Params.Contains(overload.Return) && overload.Params[0] == typeName))) + if (elementTypeName == "Float" || elementTypeName == "Int") { + // Note: for Float and Int vector types, we need to also add explicit operators doing scalar promotion, + // otherwise there would be an overload issue trying to resolve the right overload when just multiplying + // by a scalar (which is not using the mul() intrinsic, but just doing elementwise product with promotion). WriteLine(""); +#> + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator *(<#=typeName#> left, <#=hlslElementTypeName#> right) => default; + + /// + /// Multiplies a pair of and values. + /// + /// The value to multiply. + /// The value to multiply. + /// The result of multiplying and . + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + public static <#=typeName#> operator *(<#=hlslElementTypeName#> left, <#=typeName#> right) => default; +<# + // Process all operators for the mul() intrinsic. We apply the following filtering: + // 1) Operators where both arguments are of the containing type are skipped. This is because + // this operation is already defined as an elementwise product for all vector/matrix types. + // Defining the operator would cause a conflict, plus it would alter the semantics anyway. + // 2) Operators where either parameter is a primitive type (ie. not a vector) are skipped. This + // is because such operation is already implicitly defined (it's an elementwise product where + // the scalar is auto-promoted to the same vector/matrix type of the other argument). Again, + // defining the operator would cause the semantics of such expressions to change to a cross + // product, so these operators are intentionally skipped to keep code consistent with HLSL. + // 3) Among all available overloads, only either of these two cases are selected: + // - The containing type matches the return type and the first parameter type of the operator. + // This ensures that all overloads where the return type matches the containing type and the + // first parameter are generated inside the containing type, as one would do manually as well. + // - The return type is unlike both parameter types, but the containing type matches the type of + // the first parameter. This is the case when the operator (ie. the cross product) produces a + // result that's of a completely different type. In this case, the overload maps to a generated + // operator declared in the type that matches the type of the first parameter, as a convention. + foreach (var mulOverload in MulOverloads.Where(overload => + !(overload.Params[0] == typeName && overload.Params[1] == typeName) && + Regex.IsMatch(overload.Params[0], @"\d") && + Regex.IsMatch(overload.Params[1], @"\d") && + (overload.Return == typeName && overload.Params.Contains(typeName) || + !overload.Params.Contains(overload.Return) && overload.Params[0] == typeName))) + { + WriteLine(""); #> /// /// Multiplies two values using matrix math. @@ -400,6 +425,7 @@ public unsafe partial struct <#=typeName#> [HlslIntrinsicName("mul", RequiresParametersMatching = true)] public static <#=mulOverload.Return#> operator *(<#=mulOverload.Params[0]#> x, <#=mulOverload.Params[1]#> y) => default; <# + } } WriteLine("");