ファイル
ComputeSharp/src/ComputeSharp.Core/Primitives/Float/Float2.g.cs
T

714 行
40 KiB
C#

using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Core.Intrinsics.Attributes;
#if !NET6_0_OR_GREATER
using RuntimeHelpers = ComputeSharp.NetStandard.RuntimeHelpers;
#endif
#nullable enable
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
/// <inheritdoc cref="Float2"/>
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
public unsafe partial struct Float2
#if NET6_0_OR_GREATER
: ISpanFormattable
#endif
{
/// <summary>
/// A private buffer to which the undefined properties will point to.
/// </summary>
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2), sizeof(Float4));
[FieldOffset(0)]
private float x;
[FieldOffset(4)]
private float y;
/// <summary>
/// Gets a reference to a specific component in the current <see cref="Float2"/> instance.
/// </summary>
/// <param name="i">The index of the component to access.</param>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public ref float this[int i] => ref *(float*)UndefinedData;
/// <summary>
/// Gets a <see cref="Float2"/> value with all components set to 0.
/// </summary>
public static Float2 Zero => 0;
/// <summary>
/// Gets a <see cref="Float2"/> value with all components set to 1.
/// </summary>
public static Float2 One => 1;
/// <summary>
/// Gets a <see cref="Float2"/> value with the <see cref="X"/> component set to 1, and the others to 0.
/// </summary>
public static Float2 UnitX => new(1, 0);
/// <summary>
/// Gets a <see cref="Float2"/> value with the <see cref="Y"/> component set to 1, and the others to 0.
/// </summary>
public static Float2 UnitY => new(0, 1);
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
/// </summary>
[UnscopedRef]
public ref float X => ref this.x;
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>Y</c> component.
/// </summary>
[UnscopedRef]
public ref float Y => ref this.y;
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float2 XX => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public ref Float2 XY => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public ref Float2 YX => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float2 YY => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 XXX => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 XXY => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 XYX => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 XYY => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 YXX => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 YXY => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 YYX => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 YYY => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XXXX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XXXY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XXYX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XXYY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XYXX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XYXY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XYYX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 XYYY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YXXX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YXXY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YXYX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YXYY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YYXX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YYXY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YYYX => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 YYYY => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>R</c> component.
/// </summary>
[UnscopedRef]
public ref float R => ref this.x;
/// <summary>
/// Gets a reference to the <see cref="float"/> value representing the <c>G</c> component.
/// </summary>
[UnscopedRef]
public ref float G => ref this.y;
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float2 RR => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public ref Float2 RG => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public ref Float2 GR => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float2 GG => ref *(Float2*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 RRR => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 RRG => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 RGR => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 RGG => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 GRR => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 GRG => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 GGR => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float3 GGG => ref *(Float3*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RRRR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RRRG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RRGR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RRGG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RGRR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RGRG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RGGR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 RGGG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GRRR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GRRG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GRGR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GRGG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GGRR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GGRG => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GGGR => ref *(Float4*)UndefinedData;
/// <summary>
/// Gets a readonly reference to the <see cref="Float4"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
/// </summary>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
[UnscopedRef]
public readonly ref readonly Float4 GGGG => ref *(Float4*)UndefinedData;
#if !SOURCE_GENERATOR
/// <inheritdoc/>
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
}
/// <inheritdoc/>
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}>");
}
/// <inheritdoc/>
public readonly bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
{
string separator = NumberFormatInfo.GetInstance(provider).NumberGroupSeparator;
return TryWriteFormatInterpolatedStringHandler.TryWrite(
destination,
format,
provider,
$"<{this.x}{separator} {this.y}>",
out charsWritten);
}
#endif
/// <summary>
/// Negates a <see cref="Float2"/> value.
/// </summary>
/// <param name="xy">The <see cref="Float2"/> value to negate.</param>
/// <returns>The negated value of <paramref name="xy"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator -(Float2 xy) => default;
/// <summary>
/// Sums two <see cref="Float2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to sum.</param>
/// <param name="right">The second <see cref="Float2"/> value to sum.</param>
/// <returns>The result of adding <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator +(Float2 left, Float2 right) => default;
/// <summary>
/// Divides two <see cref="Float2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to divide.</param>
/// <param name="right">The second <see cref="Float2"/> value to divide.</param>
/// <returns>The result of dividing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator /(Float2 left, Float2 right) => default;
/// <summary>
/// Calculates the remainder of the division between two <see cref="Float2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to divide.</param>
/// <param name="right">The second <see cref="Float2"/> value to divide.</param>
/// <returns>The remainder of dividing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator %(Float2 left, Float2 right) => default;
/// <summary>
/// Multiplies two <see cref="Float2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to multiply.</param>
/// <param name="right">The second <see cref="Float2"/> value to multiply.</param>
/// <returns>The result of multiplying <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator *(Float2 left, Float2 right) => default;
/// <summary>
/// Multiplies a pair of <see cref="Float2"/> and <see cref="float"/> values.
/// </summary>
/// <param name="left">The <see cref="Float2"/> value to multiply.</param>
/// <param name="right">The <see cref="float"/> value to multiply.</param>
/// <returns>The result of multiplying <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator *(Float2 left, float right) => default;
/// <summary>
/// Multiplies a pair of <see cref="float"/> and <see cref="Float2"/> values.
/// </summary>
/// <param name="left">The <see cref="float"/> value to multiply.</param>
/// <param name="right">The <see cref="Float2"/> value to multiply.</param>
/// <returns>The result of multiplying <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator *(float left, Float2 right) => default;
/// <summary>
/// Multiplies two values using matrix math.
/// </summary>
/// <param name="x">The first Float2 input value.</param>
/// <param name="y">The second Float2x1 input value.</param>
/// <returns>The result of <paramref name="x"/> times <paramref name="y"/>. The result has the dimension <paramref name="x"/>-rows by <paramref name="y"/>-columns.</returns>
/// <remarks>
/// <para>This operator is equivalent to using <see cref="Hlsl.Mul(Float2, Float2x1)"/> with the same input arguments.</para>
/// <para>For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-mul"/>.</para>
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
/// </remarks>
[HlslIntrinsicName("mul", RequiresParametersMatching = true)]
public static float operator *(Float2 x, Float2x1 y) => default;
/// <summary>
/// Multiplies two values using matrix math.
/// </summary>
/// <param name="x">The first Float2 input value.</param>
/// <param name="y">The second Float2x2 input value.</param>
/// <returns>The result of <paramref name="x"/> times <paramref name="y"/>. The result has the dimension <paramref name="x"/>-rows by <paramref name="y"/>-columns.</returns>
/// <remarks>
/// <para>This operator is equivalent to using <see cref="Hlsl.Mul(Float2, Float2x2)"/> with the same input arguments.</para>
/// <para>For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-mul"/>.</para>
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
/// </remarks>
[HlslIntrinsicName("mul", RequiresParametersMatching = true)]
public static Float2 operator *(Float2 x, Float2x2 y) => default;
/// <summary>
/// Multiplies two values using matrix math.
/// </summary>
/// <param name="x">The first Float2 input value.</param>
/// <param name="y">The second Float2x3 input value.</param>
/// <returns>The result of <paramref name="x"/> times <paramref name="y"/>. The result has the dimension <paramref name="x"/>-rows by <paramref name="y"/>-columns.</returns>
/// <remarks>
/// <para>This operator is equivalent to using <see cref="Hlsl.Mul(Float2, Float2x3)"/> with the same input arguments.</para>
/// <para>For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-mul"/>.</para>
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
/// </remarks>
[HlslIntrinsicName("mul", RequiresParametersMatching = true)]
public static Float3 operator *(Float2 x, Float2x3 y) => default;
/// <summary>
/// Multiplies two values using matrix math.
/// </summary>
/// <param name="x">The first Float2 input value.</param>
/// <param name="y">The second Float2x4 input value.</param>
/// <returns>The result of <paramref name="x"/> times <paramref name="y"/>. The result has the dimension <paramref name="x"/>-rows by <paramref name="y"/>-columns.</returns>
/// <remarks>
/// <para>This operator is equivalent to using <see cref="Hlsl.Mul(Float2, Float2x4)"/> with the same input arguments.</para>
/// <para>For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-mul"/>.</para>
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
/// </remarks>
[HlslIntrinsicName("mul", RequiresParametersMatching = true)]
public static Float4 operator *(Float2 x, Float2x4 y) => default;
/// <summary>
/// Multiplies two values using matrix math.
/// </summary>
/// <param name="x">The first Float2x2 input value.</param>
/// <param name="y">The second Float2 input value.</param>
/// <returns>The result of <paramref name="x"/> times <paramref name="y"/>. The result has the dimension <paramref name="x"/>-rows by <paramref name="y"/>-columns.</returns>
/// <remarks>
/// <para>This operator is equivalent to using <see cref="Hlsl.Mul(Float2x2, Float2)"/> with the same input arguments.</para>
/// <para>For more info, see <see href="https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-mul"/>.</para>
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
/// </remarks>
[HlslIntrinsicName("mul", RequiresParametersMatching = true)]
public static Float2 operator *(Float2x2 x, Float2 y) => default;
/// <summary>
/// Subtracts two <see cref="Float2"/> values.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to subtract.</param>
/// <param name="right">The second <see cref="Float2"/> value to subtract.</param>
/// <returns>The result of subtracting <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Float2 operator -(Float2 left, Float2 right) => default;
/// <summary>
/// Compares two <see cref="Float2"/> values to see if the first is greater than the second.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to compare.</param>
/// <param name="right">The second <see cref="Float2"/> value to compare.</param>
/// <returns>The result of comparing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator >(Float2 left, Float2 right) => default;
/// <summary>
/// Compares two <see cref="Float2"/> values to see if the first is greater than or equal to the second.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to compare.</param>
/// <param name="right">The second <see cref="Float2"/> value to compare.</param>
/// <returns>The result of comparing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator >=(Float2 left, Float2 right) => default;
/// <summary>
/// Compares two <see cref="Float2"/> values to see if the first is lower than the second.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to compare.</param>
/// <param name="right">The second <see cref="Float2"/> value to compare.</param>
/// <returns>The result of comparing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator <(Float2 left, Float2 right) => default;
/// <summary>
/// Compares two <see cref="Float2"/> values to see if the first is lower than or equal to the second.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to compare.</param>
/// <param name="right">The second <see cref="Float2"/> value to compare.</param>
/// <returns>The result of comparing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator <=(Float2 left, Float2 right) => default;
/// <summary>
/// Compares two <see cref="Float2"/> values to see if they are equal.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to compare.</param>
/// <param name="right">The second <see cref="Float2"/> value to compare.</param>
/// <returns>The result of comparing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator ==(Float2 left, Float2 right) => default;
/// <summary>
/// Compares two <see cref="Float2"/> values to see if they are not equal.
/// </summary>
/// <param name="left">The first <see cref="Float2"/> value to compare.</param>
/// <param name="right">The second <see cref="Float2"/> value to compare.</param>
/// <returns>The result of comparing <paramref name="left"/> and <paramref name="right"/>.</returns>
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
public static Bool2 operator !=(Float2 left, Float2 right) => default;
}