using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
#nullable enable
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
///
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
public unsafe partial struct Bool2
{
[FieldOffset(0)]
private int x;
[FieldOffset(4)]
private int y;
///
/// Creates a new instance with the specified parameters.
///
/// The value to assign to the first vector component.
/// The value to assign to the second vector component.
public Bool2(bool x, bool y)
{
this.x = x ? 1 : 0;
this.y = y ? 1 : 0;
}
///
/// 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.
[UnscopedRef]
public ref bool this[int i] => ref *(bool*)UndefinedData.Memory;
///
/// Gets a value with all components set to .
///
public static Bool2 False => false;
///
/// Gets a value with all components set to .
///
public static Bool2 True => true;
///
/// Gets a value with the component set to , and the others to .
///
public static Bool2 TrueX => new(true, false);
///
/// Gets a value with the component set to , and the others to .
///
public static Bool2 TrueY => new(false, true);
///
/// Gets a reference to the value representing the X component.
///
[UnscopedRef]
public ref bool X => ref Unsafe.As(ref this.x);
///
/// Gets a reference to the value representing the Y component.
///
[UnscopedRef]
public ref bool Y => ref Unsafe.As(ref this.y);
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool2 XX => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public ref Bool2 XY => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public ref Bool2 YX => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool2 YY => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 XXX => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 XXY => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 XYX => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 XYY => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 YXX => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 YXY => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 YYX => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 YYY => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XXXX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XXXY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XXYX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XXYY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XYXX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XYXY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XYYX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 XYYY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YXXX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YXXY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YXYX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YXYY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YYXX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YYXY => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YYYX => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 YYYY => ref *(Bool4*)UndefinedData.Memory;
///
/// Gets a reference to the value representing the R component.
///
[UnscopedRef]
public ref bool R => ref Unsafe.As(ref this.x);
///
/// Gets a reference to the value representing the G component.
///
[UnscopedRef]
public ref bool G => ref Unsafe.As(ref this.y);
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool2 RR => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public ref Bool2 RG => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public ref Bool2 GR => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool2 GG => ref *(Bool2*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 RRR => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 RRG => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 RGR => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 RGG => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 GRR => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 GRG => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 GGR => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool3 GGG => ref *(Bool3*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RRRR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RRRG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RRGR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RRGG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RGRR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RGRG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RGGR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 RGGG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GRRR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GRRG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GRGR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GRGG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GGRR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GGRG => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GGGR => ref *(Bool4*)UndefinedData.Memory;
///
/// 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.
[UnscopedRef]
public readonly ref readonly Bool4 GGGG => ref *(Bool4*)UndefinedData.Memory;
///
public override readonly string ToString()
{
return $"<{this.x != 0}, {this.y != 0}>";
}
///
/// Creates a new value with the same value for all its components.
///
/// The value to use for the components of the new instance.
public static implicit operator Bool2(bool x) => new(x, x);
///
/// 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 Bool2 operator !(Bool2 xy) => default;
///
/// Ands two values.
///
/// The value to 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 Bool2 operator &(Bool2 left, Bool2 right) => default;
///
/// Ors two values.
///
/// The value to or.
/// The value to combine.
/// The result of performing the 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 Bool2 operator |(Bool2 left, Bool2 right) => default;
///
/// Xors two values.
///
/// The value to xor.
/// The value to combine.
/// The result of performing the 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 Bool2 operator ^(Bool2 left, Bool2 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 ==(Bool2 left, Bool2 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 !=(Bool2 left, Bool2 right) => default;
}