using System.Runtime.InteropServices; using ComputeSharp.Exceptions; namespace ComputeSharp { /// [StructLayout(LayoutKind.Explicit, Size = 8)] public partial struct Bool2 { [FieldOffset(0)] private bool x; [FieldOffset(4)] private bool y; /// /// Gets a reference to a specific component in the current instance. /// /// The index of the component to access. public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool2)}[int]"); /// /// Gets a reference to the value representing the X component. /// public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(X)}"); /// /// Gets a reference to the value representing the Y component. /// public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(Y)}"); /// /// Gets a reference to the value representing the R component. /// public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}"); /// /// Gets a reference to the value representing the G component. /// public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}"); /// /// Gets a readonly reference to the value with the components , . /// public ref readonly Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XX)}"); /// /// Gets a reference to the value with the components , . /// public ref Bool2 XY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XY)}"); /// /// Gets a reference to the value with the components , . /// public ref Bool2 YX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YX)}"); /// /// Gets a readonly reference to the value with the components , . /// public ref readonly Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YY)}"); /// /// Gets a readonly reference to the value with the components , . /// public ref readonly Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RR)}"); /// /// Gets a reference to the value with the components , . /// public ref Bool2 RG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RG)}"); /// /// Gets a reference to the value with the components , . /// public ref Bool2 GR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GR)}"); /// /// Gets a readonly reference to the value with the components , . /// public ref readonly Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GG)}"); } }