using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#if !NET6_0_OR_GREATER
using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers;
using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal;
#endif
#nullable enable
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
///
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
public unsafe partial struct Int2
#if NET6_0_OR_GREATER
: ISpanFormattable
#endif
{
///
/// A private buffer to which the undefined properties will point to.
///
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2), sizeof(Int4));
[FieldOffset(0)]
private int x;
[FieldOffset(4)]
private int y;
///
/// Gets a reference to a specific component in the current instance.
///
/// The index of the component to access.
/// 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 readonly ref int this[int i] => ref *(int*)UndefinedData;
///
/// Gets a value with all components set to 0.
///
public static Int2 Zero => 0;
///
/// Gets a value with all components set to 1.
///
public static Int2 One => 1;
///
/// Gets a value with the component set to 1, and the others to 0.
///
public static Int2 UnitX => new(1, 0);
///
/// Gets a value with the component set to 1, and the others to 0.
///
public static Int2 UnitY => new(0, 1);
///
/// Gets a reference to the value representing the X component.
///
public readonly ref int X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.x), 1));
///
/// Gets a reference to the value representing the Y component.
///
public readonly ref int Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1));
///
/// Gets a readonly reference to the value with the components , .
///
/// 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 readonly ref readonly Int2 XX => ref *(Int2*)UndefinedData;
///
/// Gets a reference to the value with the components , .
///
/// 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 readonly ref Int2 XY => ref *(Int2*)UndefinedData;
///
/// Gets a reference to the value with the components , .
///
/// 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 readonly ref Int2 YX => ref *(Int2*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , .
///
/// 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 readonly ref readonly Int2 YY => ref *(Int2*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 XXX => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 XXY => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 XYX => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 XYY => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 YXX => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 YXY => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 YYX => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 YYY => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XXXX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XXXY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XXYX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XXYY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XYXX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XYXY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XYYX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 XYYY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YXXX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YXXY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YXYX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YXYY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YYXX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YYXY => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YYYX => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 YYYY => ref *(Int4*)UndefinedData;
///
/// Gets a reference to the value representing the R component.
///
public readonly ref int R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.x), 1));
///
/// Gets a reference to the value representing the G component.
///
public readonly ref int G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1));
///
/// Gets a readonly reference to the value with the components , .
///
/// 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 readonly ref readonly Int2 RR => ref *(Int2*)UndefinedData;
///
/// Gets a reference to the value with the components , .
///
/// 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 readonly ref Int2 RG => ref *(Int2*)UndefinedData;
///
/// Gets a reference to the value with the components , .
///
/// 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 readonly ref Int2 GR => ref *(Int2*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , .
///
/// 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 readonly ref readonly Int2 GG => ref *(Int2*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 RRR => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 RRG => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 RGR => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 RGG => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 GRR => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 GRG => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 GGR => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , .
///
/// 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 readonly ref readonly Int3 GGG => ref *(Int3*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RRRR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RRRG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RRGR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RRGG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RGRR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RGRG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RGGR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 RGGG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GRRR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GRRG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GRGR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GRGG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GGRR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GGRG => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GGGR => ref *(Int4*)UndefinedData;
///
/// Gets a readonly reference to the value with the components , , , .
///
/// 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 readonly ref readonly Int4 GGGG => ref *(Int4*)UndefinedData;
#if !SOURCE_GENERATOR
///
public override readonly string ToString()
{
string separator = NumberFormatInfo.CurrentInfo.NumberGroupSeparator;
#if NET6_0_OR_GREATER
return string.Create(null, stackalloc char[64], $"<{this.x}{separator} {this.y}>");
#else
return $"<{this.x}{separator} {this.y}>";
#endif
}
///
public readonly string ToString(string? format, IFormatProvider? formatProvider)
{
string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
return FormatInterpolatedStringHandler.Create(
format,
formatProvider,
stackalloc char[64],
$"<{this.x}{separator} {this.y}>");
}
///
public readonly bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider? provider)
{
string separator = NumberFormatInfo.GetInstance(provider).NumberGroupSeparator;
return TryWriteFormatInterpolatedStringHandler.TryWrite(
destination,
format,
provider,
$"<{this.x}{separator} {this.y}>",
out charsWritten);
}
#endif
///
/// Negates a value.
///
/// The value to negate.
/// The negated value of .
/// 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 xy) => default;
///
/// Sums two values.
///
/// The first value to sum.
/// The second value to sum.
/// The result of adding 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, Int2 right) => default;
///
/// Divides two values.
///
/// The first value to divide.
/// The second value to divide.
/// The result of dividing 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, Int2 right) => default;
///
/// Calculates the remainder of the division between two values.
///
/// The first value to divide.
/// The second value to divide.
/// The remainder of dividing 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, Int2 right) => default;
///
/// Multiplies two values.
///
/// The first value to multiply.
/// The second 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, Int2 right) => default;
///
/// Multiplies two values using matrix math.
///
/// The first int input value.
/// The second Int2 input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 x, Int2 y) => default;
///
/// Multiplies two values using matrix math.
///
/// The first Int2 input value.
/// The second int input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 x, int y) => default;
///
/// Multiplies two values using matrix math.
///
/// The first Int2 input value.
/// The second Int2x1 input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 int operator *(Int2 x, Int2x1 y) => default;
///
/// Multiplies two values using matrix math.
///
/// The first Int2 input value.
/// The second Int2x2 input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 x, Int2x2 y) => default;
///
/// Multiplies two values using matrix math.
///
/// The first Int2 input value.
/// The second Int2x3 input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 *(Int2 x, Int2x3 y) => default;
///
/// Multiplies two values using matrix math.
///
/// The first Int2 input value.
/// The second Int2x4 input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 *(Int2 x, Int2x4 y) => default;
///
/// Multiplies two values using matrix math.
///
/// The first Int2x2 input value.
/// The second Int2 input value.
/// The result of times . The result has the dimension -rows by -columns.
///
/// This operator is equivalent to using with the same input arguments.
/// For more info, see .
/// 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 *(Int2x2 x, Int2 y) => default;
///
/// Subtracts two values.
///
/// The first value to subtract.
/// The second value to subtract.
/// The result of subtracting 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, Int2 right) => default;
///
/// Compares two values to see if the first is greater than the second.
///
/// The first value to compare.
/// The second value to compare.
/// The result of comparing 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 Bool2 operator >(Int2 left, Int2 right) => default;
///
/// Compares two values to see if the first is greater than or equal to the second.
///
/// The first value to compare.
/// The second value to compare.
/// The result of comparing 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 Bool2 operator >=(Int2 left, Int2 right) => default;
///
/// Compares two values to see if the first is lower than the second.
///
/// The first value to compare.
/// The second value to compare.
/// The result of comparing 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 Bool2 operator <(Int2 left, Int2 right) => default;
///
/// Compares two values to see if the first is lower than or equal to the second.
///
/// The first value to compare.
/// The second value to compare.
/// The result of comparing 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 Bool2 operator <=(Int2 left, Int2 right) => default;
///
/// Bitwise negates a value.
///
/// The value to bitwise negate.
/// The bitwise negated value of .
/// 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 xy) => default;
#if NEEDS_CSHARP_11
///
/// Shifts right a value.
///
/// The value to shift right.
/// The amount to shift each element right by.
/// The result of shifting right by .
/// 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 xy, Int2 amount) => default;
///
/// Shifts right a value.
///
/// The value to shift right.
/// The amount to shift each element right by.
/// The result of shifting right by .
/// 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 xy, UInt2 amount) => default;
///
/// Shifts left a value.
///
/// The value to shift left.
/// The amount to shift each element left by.
/// The result of shifting left by .
/// 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 xy, Int2 amount) => default;
///
/// Shifts left a value.
///
/// The value to shift left.
/// The amount to shift each element left by.
/// The result of shifting left by .
/// 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 xy, UInt2 amount) => default;
#endif
///
/// Bitwise ands a value.
///
/// The value to bitwise and.
/// The value to combine.
/// The result of performing the bitwise and between 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, Int2 right) => default;
///
/// Bitwise ands a value.
///
/// The value to bitwise and.
/// The value to combine.
/// The result of performing the bitwise and between 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, UInt2 right) => default;
///
/// Bitwise ors a value.
///
/// The value to bitwise or.
/// The value to combine.
/// The result of performing the bitwise or between 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, Int2 right) => default;
///
/// Bitwise ors a value.
///
/// The value to bitwise or.
/// The value to combine.
/// The result of performing the bitwise or between 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, UInt2 right) => default;
///
/// Bitwise xors a value.
///
/// The value to bitwise xor.
/// The value to combine.
/// The result of performing the bitwise xor between 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, Int2 right) => default;
///
/// Bitwise xors a value.
///
/// The value to bitwise xor.
/// The value to combine.
/// The result of performing the bitwise xor between 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, UInt2 right) => default;
///
/// Compares two values to see if they are equal.
///
/// The first value to compare.
/// The second value to compare.
/// The result of comparing 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 Bool2 operator ==(Int2 left, Int2 right) => default;
///
/// Compares two values to see if they are not equal.
///
/// The first value to compare.
/// The second value to compare.
/// The result of comparing 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 Bool2 operator !=(Int2 left, Int2 right) => default;
}