diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs index 5282758b..f58bdece 100644 --- a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs +++ b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs @@ -3,160 +3,159 @@ using System.Buffers; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; -namespace ComputeSharp.Benchmark.Blas +namespace ComputeSharp.Benchmark.Blas; + +/// +/// A that benchmarks the APIs in the class, on both CPU and GPU. +/// +[SimpleJob(RunStrategy.Monitoring)] +public class BlasBenchmark : IDisposable { /// - /// A that benchmarks the APIs in the class, on both CPU and GPU. + /// The number of samples. /// - [SimpleJob(RunStrategy.Monitoring)] - public class BlasBenchmark : IDisposable + private const int C = 128; + + /// + /// The nummber of rows in the matrix. + /// + private const int N = 512; + + /// + /// The number of columns in the matrix (same as the number of rows in the matrix) + /// + private const int M = 512; + + /// + /// The number of columns in the matrix. + /// + private const int P = 256; + + /// + /// The input tensor. + /// + private float[]? X; + + /// + /// The weights tensor. + /// + private float[]? W; + + /// + /// The bias tensor. + /// + private float[]? B; + + /// + /// The result tensor. + /// + private float[]? Y; + + /// + /// The input tensor (GPU). + /// + private ReadOnlyBuffer? BufferX; + + /// + /// The weights tensor (GPU). + /// + private ReadOnlyBuffer? BufferW; + + /// + /// The bias tensor (GPU). + /// + private ReadOnlyBuffer? BufferB; + + /// + /// The result tensor (GPU). + /// + private ReadWriteBuffer? BufferY; + + /// + /// A instance to initialize the tensors. + /// + private readonly Random Random = new Random(); + + /// + /// Initial setup for a benchmarking session. + /// + [GlobalSetup] + public void Setup() { - /// - /// The number of samples. - /// - private const int C = 128; - - /// - /// The nummber of rows in the matrix. - /// - private const int N = 512; - - /// - /// The number of columns in the matrix (same as the number of rows in the matrix) - /// - private const int M = 512; - - /// - /// The number of columns in the matrix. - /// - private const int P = 256; - - /// - /// The input tensor. - /// - private float[]? X; - - /// - /// The weights tensor. - /// - private float[]? W; - - /// - /// The bias tensor. - /// - private float[]? B; - - /// - /// The result tensor. - /// - private float[]? Y; - - /// - /// The input tensor (GPU). - /// - private ReadOnlyBuffer? BufferX; - - /// - /// The weights tensor (GPU). - /// - private ReadOnlyBuffer? BufferW; - - /// - /// The bias tensor (GPU). - /// - private ReadOnlyBuffer? BufferB; - - /// - /// The result tensor (GPU). - /// - private ReadWriteBuffer? BufferY; - - /// - /// A instance to initialize the tensors. - /// - private readonly Random Random = new Random(); - - /// - /// Initial setup for a benchmarking session. - /// - [GlobalSetup] - public void Setup() + // Creates a new random normalized float[] array of a given size + float[] CreateRandomArray(int size) { - // Creates a new random normalized float[] array of a given size - float[] CreateRandomArray(int size) + float[] array = ArrayPool.Shared.Rent(size); + + foreach (ref float x in array.AsSpan()) { - float[] array = ArrayPool.Shared.Rent(size); - - foreach (ref float x in array.AsSpan()) - { - x = (float)Random.NextDouble(); - } - - return array; + x = (float)Random.NextDouble(); } - X = CreateRandomArray(C * N * M); - W = CreateRandomArray(M * P); - B = CreateRandomArray(P); - Y = CreateRandomArray(C * N * P); - - BufferX = Gpu.Default.AllocateReadOnlyBuffer(X); - BufferW = Gpu.Default.AllocateReadOnlyBuffer(W); - BufferB = Gpu.Default.AllocateReadOnlyBuffer(B); - BufferY = Gpu.Default.AllocateReadWriteBuffer(Y); - - Cpu(); - GpuWithNoTemporaryBuffers(); - GpuWithTemporaryBuffers(); + return array; } - /// - [GlobalCleanup] - public void Dispose() - { - ArrayPool.Shared.Return(X!); - ArrayPool.Shared.Return(W!); - ArrayPool.Shared.Return(B!); - ArrayPool.Shared.Return(Y!); + X = CreateRandomArray(C * N * M); + W = CreateRandomArray(M * P); + B = CreateRandomArray(P); + Y = CreateRandomArray(C * N * P); - BufferX!.Dispose(); - BufferW!.Dispose(); - BufferB!.Dispose(); - BufferY!.Dispose(); - } + BufferX = Gpu.Default.AllocateReadOnlyBuffer(X); + BufferW = Gpu.Default.AllocateReadOnlyBuffer(W); + BufferB = Gpu.Default.AllocateReadOnlyBuffer(B); + BufferY = Gpu.Default.AllocateReadWriteBuffer(Y); - /// - /// Runs a fully connected forward operation on the CPU. - /// - [Benchmark(Baseline = true)] - public void Cpu() - { - BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, X!, W!, B!, Y!); - } + Cpu(); + GpuWithNoTemporaryBuffers(); + GpuWithTemporaryBuffers(); + } - /// - /// Runs a fully connected forward operation on the GPU. - /// - [Benchmark] - public void GpuWithNoTemporaryBuffers() - { - BlasHelpers.FullyConnectedForwardGpu(Gpu.Default, C, N, M, P, BufferX!, BufferW!, BufferB!, BufferY!); - } + /// + [GlobalCleanup] + public void Dispose() + { + ArrayPool.Shared.Return(X!); + ArrayPool.Shared.Return(W!); + ArrayPool.Shared.Return(B!); + ArrayPool.Shared.Return(Y!); - /// - /// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations. - /// - [Benchmark] - public void GpuWithTemporaryBuffers() - { - using ReadOnlyBuffer x = Gpu.Default.AllocateReadOnlyBuffer(X!); - using ReadOnlyBuffer w = Gpu.Default.AllocateReadOnlyBuffer(W!); - using ReadOnlyBuffer b = Gpu.Default.AllocateReadOnlyBuffer(B!); - using ReadWriteBuffer y = Gpu.Default.AllocateReadWriteBuffer(Y!.Length); + BufferX!.Dispose(); + BufferW!.Dispose(); + BufferB!.Dispose(); + BufferY!.Dispose(); + } - BlasHelpers.FullyConnectedForwardGpu(Gpu.Default, C, N, M, P, x, w, b, y); + /// + /// Runs a fully connected forward operation on the CPU. + /// + [Benchmark(Baseline = true)] + public void Cpu() + { + BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, X!, W!, B!, Y!); + } - y.CopyTo(Y); - } + /// + /// Runs a fully connected forward operation on the GPU. + /// + [Benchmark] + public void GpuWithNoTemporaryBuffers() + { + BlasHelpers.FullyConnectedForwardGpu(Gpu.Default, C, N, M, P, BufferX!, BufferW!, BufferB!, BufferY!); + } + + /// + /// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations. + /// + [Benchmark] + public void GpuWithTemporaryBuffers() + { + using ReadOnlyBuffer x = Gpu.Default.AllocateReadOnlyBuffer(X!); + using ReadOnlyBuffer w = Gpu.Default.AllocateReadOnlyBuffer(W!); + using ReadOnlyBuffer b = Gpu.Default.AllocateReadOnlyBuffer(B!); + using ReadWriteBuffer y = Gpu.Default.AllocateReadWriteBuffer(Y!.Length); + + BlasHelpers.FullyConnectedForwardGpu(Gpu.Default, C, N, M, P, x, w, b, y); + + y.CopyTo(Y); } } diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs index d1e3df0a..b58acb8e 100644 --- a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs +++ b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs @@ -1,109 +1,108 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; -namespace ComputeSharp.Benchmark.Blas +namespace ComputeSharp.Benchmark.Blas; + +/// +/// A that contains primitives to run certain operations of a neural network. +/// +internal static partial class BlasHelpers { /// - /// A that contains primitives to run certain operations of a neural network. + /// Executes the forward pass on a fully connected layer on the CPU. /// - internal static partial class BlasHelpers + /// The number of samples in the input tensor. + /// The number of rows in the input matrix. + /// The number of columns in the input matrix. + /// The number of columns in the output matrix. + /// The input tensor. + /// The weights tensor. + /// The bias tensor. + /// The result tensor. + public static void FullyConnectedForwardCpu(int c, int n, int m, int p, float[] x, float[] w, float[] b, float[] y) { - /// - /// Executes the forward pass on a fully connected layer on the CPU. - /// - /// The number of samples in the input tensor. - /// The number of rows in the input matrix. - /// The number of columns in the input matrix. - /// The number of columns in the output matrix. - /// The input tensor. - /// The weights tensor. - /// The bias tensor. - /// The result tensor. - public static void FullyConnectedForwardCpu(int c, int n, int m, int p, float[] x, float[] w, float[] b, float[] y) + void Kernel(int s) { - void Kernel(int s) + ref float rx = ref x[s * n * m]; + ref float rw = ref w[0]; + ref float rb = ref b[0]; + ref float ry = ref y[s * n * p]; + + for (int i = 0; i < n; i++) { - ref float rx = ref x[s * n * m]; - ref float rw = ref w[0]; - ref float rb = ref b[0]; - ref float ry = ref y[s * n * p]; + int x_offset = i * m; + int y_offset = i * p; - for (int i = 0; i < n; i++) + for (int j = 0; j < p; j++) { - int x_offset = i * m; - int y_offset = i * p; + float result = 0f; - for (int j = 0; j < p; j++) + for (int k = 0; k < m; k++) { - float result = 0f; - - for (int k = 0; k < m; k++) - { - result += Unsafe.Add(ref rx, x_offset + k) * Unsafe.Add(ref rw, k * p + j); - } - - Unsafe.Add(ref ry, y_offset + j) = result + Unsafe.Add(ref rb, j); + result += Unsafe.Add(ref rx, x_offset + k) * Unsafe.Add(ref rw, k * p + j); } + + Unsafe.Add(ref ry, y_offset + j) = result + Unsafe.Add(ref rb, j); } } - - Parallel.For(0, c, Kernel); } - /// - /// Executes the forward pass on a fully connected layer on the GPU. - /// - /// The device to run the computation on. - /// The number of samples in the input tensor. - /// The number of rows in the input matrix. - /// The number of columns in the input matrix. - /// The number of columns in the output matrix. - /// The input tensor. - /// The weights tensor. - /// The bias tensor. - /// The result tensor. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void FullyConnectedForwardGpu( - GraphicsDevice device, - int c, - int n, - int m, - int p, - ReadOnlyBuffer x, - ReadOnlyBuffer w, - ReadOnlyBuffer b, - ReadWriteBuffer y) - { - device.For(c, n, p, new FullyConnectedForwardKernel(n, m, p, x, w, b, y)); - } + Parallel.For(0, c, Kernel); + } - /// - /// Kernel for . - /// - [AutoConstructor] - public readonly partial struct FullyConnectedForwardKernel : IComputeShader - { - public readonly int n; - public readonly int m; - public readonly int p; - public readonly ReadOnlyBuffer x; - public readonly ReadOnlyBuffer w; - public readonly ReadOnlyBuffer b; - public readonly ReadWriteBuffer y; + /// + /// Executes the forward pass on a fully connected layer on the GPU. + /// + /// The device to run the computation on. + /// The number of samples in the input tensor. + /// The number of rows in the input matrix. + /// The number of columns in the input matrix. + /// The number of columns in the output matrix. + /// The input tensor. + /// The weights tensor. + /// The bias tensor. + /// The result tensor. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void FullyConnectedForwardGpu( + GraphicsDevice device, + int c, + int n, + int m, + int p, + ReadOnlyBuffer x, + ReadOnlyBuffer w, + ReadOnlyBuffer b, + ReadWriteBuffer y) + { + device.For(c, n, p, new FullyConnectedForwardKernel(n, m, p, x, w, b, y)); + } - /// - public void Execute() + /// + /// Kernel for . + /// + [AutoConstructor] + public readonly partial struct FullyConnectedForwardKernel : IComputeShader + { + public readonly int n; + public readonly int m; + public readonly int p; + public readonly ReadOnlyBuffer x; + public readonly ReadOnlyBuffer w; + public readonly ReadOnlyBuffer b; + public readonly ReadWriteBuffer y; + + /// + public void Execute() + { + int x_offset = ThreadIds.X * n * p + ThreadIds.Y * m; + float result = 0f; + + for (int k = 0; k < m; k++) { - int x_offset = ThreadIds.X * n * p + ThreadIds.Y * m; - float result = 0f; - - for (int k = 0; k < m; k++) - { - result += x[x_offset + k] * w[k * p + ThreadIds.Z]; - } - - y[ThreadIds.X * n * p + ThreadIds.Y * p + ThreadIds.Z] = result + b[ThreadIds.Z]; + result += x[x_offset + k] * w[k * p + ThreadIds.Z]; } + + y[ThreadIds.X * n * p + ThreadIds.Y * p + ThreadIds.Z] = result + b[ThreadIds.Z]; } } } diff --git a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs index ef208625..72f57439 100644 --- a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs +++ b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs @@ -10,82 +10,81 @@ using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors.Convolution; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.Benchmark.Imaging +namespace ComputeSharp.Benchmark.Imaging; + +/// +/// A that benchmarks the image processors against the reference in ImageSharp. +/// +[SimpleJob(RunStrategy.Monitoring)] +[CategoriesColumn] +[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] +public class ImagingBenchmark : IDisposable { /// - /// A that benchmarks the image processors against the reference in ImageSharp. + /// The loaded image. /// - [SimpleJob(RunStrategy.Monitoring)] - [CategoriesColumn] - [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] - public class ImagingBenchmark : IDisposable + private Image? image; + + /// + /// Initial setup for a benchmarking session. + /// + [GlobalSetup] + public void Setup() { - /// - /// The loaded image. - /// - private Image? image; + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); - /// - /// Initial setup for a benchmarking session. - /// - [GlobalSetup] - public void Setup() - { - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + this.image = Image.Load(path); - this.image = Image.Load(path); + Bokeh_Cpu(); + Bokeh_Gpu(); + Gaussian_Cpu(); + Gaussian_Gpu(); + } - Bokeh_Cpu(); - Bokeh_Gpu(); - Gaussian_Cpu(); - Gaussian_Gpu(); - } + /// + [GlobalCleanup] + public void Dispose() + { + this.image!.Dispose(); + } - /// - [GlobalCleanup] - public void Dispose() - { - this.image!.Dispose(); - } + /// + /// Runs a bokeh blur effect on the CPU. + /// + [Benchmark(Baseline = true)] + [BenchmarkCategory("BOKEH")] + public void Bokeh_Cpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new BokehBlurProcessor(80, 2, 3))); + } - /// - /// Runs a bokeh blur effect on the CPU. - /// - [Benchmark(Baseline = true)] - [BenchmarkCategory("BOKEH")] - public void Bokeh_Cpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new BokehBlurProcessor(80, 2, 3))); - } + /// + /// Runs a bokeh blur effect on the GPU. + /// + [Benchmark] + [BenchmarkCategory("BOKEH")] + public void Bokeh_Gpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new HlslBokehBlurProcessor(80, 2))); + } - /// - /// Runs a bokeh blur effect on the GPU. - /// - [Benchmark] - [BenchmarkCategory("BOKEH")] - public void Bokeh_Gpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new HlslBokehBlurProcessor(80, 2))); - } + /// + /// Runs a gaussian blur effect on the CPU. + /// + [Benchmark(Baseline = true)] + [BenchmarkCategory("GAUSSIAN")] + public void Gaussian_Cpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new GaussianBlurProcessor(80))); + } - /// - /// Runs a gaussian blur effect on the CPU. - /// - [Benchmark(Baseline = true)] - [BenchmarkCategory("GAUSSIAN")] - public void Gaussian_Cpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new GaussianBlurProcessor(80))); - } - - /// - /// Runs a gaussian blur effect on the GPU. - /// - [Benchmark] - [BenchmarkCategory("GAUSSIAN")] - public void Gaussian_Gpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(80))); - } + /// + /// Runs a gaussian blur effect on the GPU. + /// + [Benchmark] + [BenchmarkCategory("GAUSSIAN")] + public void Gaussian_Gpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(80))); } } diff --git a/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs b/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs index e14516c1..37aeea99 100644 --- a/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs +++ b/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs @@ -3,44 +3,43 @@ using System.Runtime.CompilerServices; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp; + +/// +/// Represents a complex number, where the real and imaginary parts are stored as values. +/// +/// +/// This is a more efficient version of the type. +/// +internal readonly struct Complex64 { /// - /// Represents a complex number, where the real and imaginary parts are stored as values. + /// The real part of the complex number. /// - /// - /// This is a more efficient version of the type. - /// - internal readonly struct Complex64 + public readonly float Real; + + /// + /// The imaginary part of the complex number. + /// + public readonly float Imaginary; + + /// + /// Initializes a new instance of the struct. + /// + /// The real part in the complex number. + /// The imaginary part in the complex number. + public Complex64(float real, float imaginary) { - /// - /// The real part of the complex number. - /// - public readonly float Real; - - /// - /// The imaginary part of the complex number. - /// - public readonly float Imaginary; - - /// - /// Initializes a new instance of the struct. - /// - /// The real part in the complex number. - /// The imaginary part in the complex number. - public Complex64(float real, float imaginary) - { - this.Real = real; - this.Imaginary = imaginary; - } - - /// - /// Performs the multiplication operation between a instance and a scalar. - /// - /// The value to multiply. - /// The scalar to use to multiply the value. - /// The result. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Complex64 operator *(Complex64 value, float scalar) => new Complex64(value.Real * scalar, value.Imaginary * scalar); + this.Real = real; + this.Imaginary = imaginary; } -} \ No newline at end of file + + /// + /// Performs the multiplication operation between a instance and a scalar. + /// + /// The value to multiply. + /// The scalar to use to multiply the value. + /// The result. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Complex64 operator *(Complex64 value, float scalar) => new Complex64(value.Real * scalar, value.Imaginary * scalar); +} diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs index 25e9dfc9..75c601bd 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs @@ -5,81 +5,80 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.BokehBlur.Processors +namespace ComputeSharp.BokehBlur.Processors; + +/// +/// Applies bokeh blur processing to the image. +/// +public sealed partial class HlslBokehBlurProcessor : IImageProcessor { /// - /// Applies bokeh blur processing to the image. + /// The default radius used by the parameterless constructor. /// - public sealed partial class HlslBokehBlurProcessor : IImageProcessor + public const int DefaultRadius = 32; + + /// + /// The default component count used by the parameterless constructor. + /// + public const int DefaultComponents = 2; + + /// + /// Initializes a new instance of the class. + /// + public HlslBokehBlurProcessor() + : this(Gpu.Default, DefaultRadius, DefaultComponents) { - /// - /// The default radius used by the parameterless constructor. - /// - public const int DefaultRadius = 32; + } - /// - /// The default component count used by the parameterless constructor. - /// - public const int DefaultComponents = 2; + /// + /// Initializes a new instance of the class. + /// + /// The size of the area to sample. + /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. + public HlslBokehBlurProcessor(int radius, int components) + : this(Gpu.Default, radius, components) + { + } - /// - /// Initializes a new instance of the class. - /// - public HlslBokehBlurProcessor() - : this(Gpu.Default, DefaultRadius, DefaultComponents) + /// + /// Initializes a new instance of the class. + /// + /// The associated with the current instance. + /// The size of the area to sample. + /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. + public HlslBokehBlurProcessor(GraphicsDevice device, int radius, int components) + { + GraphicsDevice = device; + Radius = radius; + Components = components; + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the radius. + /// + public int Radius { get; } + + /// + /// Gets the number of components. + /// + public int Components { get; } + + /// + public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) + where TPixel : unmanaged, IPixel + { + if (typeof(TPixel) != typeof(ImageSharpRgba32)) { + ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); } - /// - /// Initializes a new instance of the class. - /// - /// The size of the area to sample. - /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. - public HlslBokehBlurProcessor(int radius, int components) - : this(Gpu.Default, radius, components) - { - } + var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); - /// - /// Initializes a new instance of the class. - /// - /// The associated with the current instance. - /// The size of the area to sample. - /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. - public HlslBokehBlurProcessor(GraphicsDevice device, int radius, int components) - { - GraphicsDevice = device; - Radius = radius; - Components = components; - } - - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } - - /// - /// Gets the radius. - /// - public int Radius { get; } - - /// - /// Gets the number of components. - /// - public int Components { get; } - - /// - public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) - where TPixel : unmanaged, IPixel - { - if (typeof(TPixel) != typeof(ImageSharpRgba32)) - { - ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); - } - - var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); - - return Unsafe.As>(processor); - } + return Unsafe.As>(processor); } } diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs index 11f87db4..9bc7c664 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs @@ -9,417 +9,416 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing.Processors; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.BokehBlur.Processors +namespace ComputeSharp.BokehBlur.Processors; + +/// +public sealed partial class HlslBokehBlurProcessor { - /// - public sealed partial class HlslBokehBlurProcessor + /// + /// Applies bokeh blur processing to the image. + /// + /// This processor is based on the code from Mike Pound, see github.com/mikepound/convolve. + public sealed partial class Implementation : ImageProcessor { /// - /// Applies bokeh blur processing to the image. + /// The instance in use. /// - /// This processor is based on the code from Mike Pound, see github.com/mikepound/convolve. - public sealed partial class Implementation : ImageProcessor + private readonly GraphicsDevice GraphicsDevice; + + /// + /// The kernel radius. + /// + private readonly int Radius; + + /// + /// The maximum size of the kernel in either direction. + /// + private readonly int KernelSize; + + /// + /// The number of components to use when applying the bokeh blur. + /// + private readonly int ComponentsCount; + + /// + /// The kernel parameters to use for the current instance (a: X, b: Y, A: Z, B: W) + /// + private readonly Vector4[] KernelParameters; + + /// + /// The kernel components for the current instance. + /// + private readonly Complex64[][] Kernels; + + /// + /// The scaling factor for kernel values. + /// + private readonly float KernelsScale; + + /// + /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances. + /// + private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new(); + + /// + /// Initializes a new instance of the class. + /// + /// The defining the processor parameters. + /// The configuration which allows altering default behaviour or extending the library. + /// The source instance to modify. + /// The source that indicates the area to edit. + public Implementation(HlslBokehBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) + : base(configuration, source, sourceRectangle) { - /// - /// The instance in use. - /// - private readonly GraphicsDevice GraphicsDevice; + GraphicsDevice = definition.GraphicsDevice; + Radius = definition.Radius; + KernelSize = Radius * 2 + 1; + ComponentsCount = definition.Components; - /// - /// The kernel radius. - /// - private readonly int Radius; - - /// - /// The maximum size of the kernel in either direction. - /// - private readonly int KernelSize; - - /// - /// The number of components to use when applying the bokeh blur. - /// - private readonly int ComponentsCount; - - /// - /// The kernel parameters to use for the current instance (a: X, b: Y, A: Z, B: W) - /// - private readonly Vector4[] KernelParameters; - - /// - /// The kernel components for the current instance. - /// - private readonly Complex64[][] Kernels; - - /// - /// The scaling factor for kernel values. - /// - private readonly float KernelsScale; - - /// - /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances. - /// - private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new(); - - /// - /// Initializes a new instance of the class. - /// - /// The defining the processor parameters. - /// The configuration which allows altering default behaviour or extending the library. - /// The source instance to modify. - /// The source that indicates the area to edit. - public Implementation(HlslBokehBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) - : base(configuration, source, sourceRectangle) + // Reuse the initialized values from the cache, if possible + var parameters = (Radius, ComponentsCount); + if (Cache.TryGetValue(parameters, out var info)) { - GraphicsDevice = definition.GraphicsDevice; - Radius = definition.Radius; - KernelSize = Radius * 2 + 1; - ComponentsCount = definition.Components; + KernelParameters = info.Parameters; + KernelsScale = info.Scale; + Kernels = info.Kernels; + } + else + { + // Initialize the complex kernels and parameters with the current arguments + (KernelParameters, KernelsScale) = GetParameters(); + Kernels = CreateComplexKernels(); + NormalizeKernels(); - // Reuse the initialized values from the cache, if possible - var parameters = (Radius, ComponentsCount); - if (Cache.TryGetValue(parameters, out var info)) - { - KernelParameters = info.Parameters; - KernelsScale = info.Scale; - Kernels = info.Kernels; - } - else - { - // Initialize the complex kernels and parameters with the current arguments - (KernelParameters, KernelsScale) = GetParameters(); - Kernels = CreateComplexKernels(); - NormalizeKernels(); + // Store them in the cache for future use + Cache.TryAdd(parameters, (KernelParameters, KernelsScale, Kernels)); + } + } - // Store them in the cache for future use - Cache.TryAdd(parameters, (KernelParameters, KernelsScale, Kernels)); - } + /// + /// Gets the kernel scales to adjust the component values in each kernel. + /// + private static IReadOnlyList KernelScales { get; } = new[] { 1.4f, 1.2f, 1.2f, 1.2f, 1.2f, 1.2f }; + + /// + /// Gets the available bokeh blur kernel parameters. + /// + private static IReadOnlyList KernelComponents { get; } = new[] + { + // 1 component + new[] { new Vector4(0.862325f, 1.624835f, 0.767583f, 1.862321f) }, + + // 2 components + new[] + { + new Vector4(0.886528f, 5.268909f, 0.411259f, -0.548794f), + new Vector4(1.960518f, 1.558213f, 0.513282f, 4.56111f) + }, + + // 3 components + new[] + { + new Vector4(2.17649f, 5.043495f, 1.621035f, -2.105439f), + new Vector4(1.019306f, 9.027613f, -0.28086f, -0.162882f), + new Vector4(2.81511f, 1.597273f, -0.366471f, 10.300301f) + }, + + // 4 components + new[] + { + new Vector4(4.338459f, 1.553635f, -5.767909f, 46.164397f), + new Vector4(3.839993f, 4.693183f, 9.795391f, -15.227561f), + new Vector4(2.791880f, 8.178137f, -3.048324f, 0.302959f), + new Vector4(1.342190f, 12.328289f, 0.010001f, 0.244650f) + }, + + // 5 components + new[] + { + new Vector4(4.892608f, 1.685979f, -22.356787f, 85.91246f), + new Vector4(4.71187f, 4.998496f, 35.918936f, -28.875618f), + new Vector4(4.052795f, 8.244168f, -13.212253f, -1.578428f), + new Vector4(2.929212f, 11.900859f, 0.507991f, 1.816328f), + new Vector4(1.512961f, 16.116382f, 0.138051f, -0.01f) + }, + + // 6 components + new[] + { + new Vector4(5.143778f, 2.079813f, -82.326596f, 111.231024f), + new Vector4(5.612426f, 6.153387f, 113.878661f, 58.004879f), + new Vector4(5.982921f, 9.802895f, 39.479083f, -162.028887f), + new Vector4(6.505167f, 11.059237f, -71.286026f, 95.027069f), + new Vector4(3.869579f, 14.81052f, 1.405746f, -3.704914f), + new Vector4(2.201904f, 19.032909f, -0.152784f, -0.107988f) + } + }; + + /// + /// Gets the kernel parameters and scaling factor for the current count value in the current instance. + /// + private (Vector4[] Parameters, float Scale) GetParameters() + { + // Prepare the kernel components + int index = Math.Max(0, Math.Min(ComponentsCount - 1, KernelComponents.Count)); + return (KernelComponents[index], KernelScales[index]); + } + + /// + /// Creates the collection of complex 1D kernels with the specified parameters. + /// + private Complex64[][] CreateComplexKernels() + { + var kernels = new Complex64[KernelParameters.Length][]; + ref Vector4 baseRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); + for (int i = 0; i < KernelParameters.Length; i++) + { + ref Vector4 paramsRef = ref Unsafe.Add(ref baseRef, i); + kernels[i] = CreateComplex1DKernel(paramsRef.X, paramsRef.Y); } - /// - /// Gets the kernel scales to adjust the component values in each kernel. - /// - private static IReadOnlyList KernelScales { get; } = new[] { 1.4f, 1.2f, 1.2f, 1.2f, 1.2f, 1.2f }; + return kernels; + } - /// - /// Gets the available bokeh blur kernel parameters. - /// - private static IReadOnlyList KernelComponents { get; } = new[] + /// + /// Creates a complex 1D kernel with the specified parameters. + /// + /// The exponential parameter for each complex component. + /// The angle component for each complex component. + private Complex64[] CreateComplex1DKernel(float a, float b) + { + var kernel = new Complex64[KernelSize]; + ref Complex64 baseRef = ref MemoryMarshal.GetReference(kernel.AsSpan()); + int r = Radius, n = -r; + + for (int i = 0; i < KernelSize; i++, n++) { - // 1 component - new[] { new Vector4(0.862325f, 1.624835f, 0.767583f, 1.862321f) }, + // Incrementally compute the range values + float value = n * KernelsScale * (1f / r); + value *= value; - // 2 components - new[] - { - new Vector4(0.886528f, 5.268909f, 0.411259f, -0.548794f), - new Vector4(1.960518f, 1.558213f, 0.513282f, 4.56111f) - }, - - // 3 components - new[] - { - new Vector4(2.17649f, 5.043495f, 1.621035f, -2.105439f), - new Vector4(1.019306f, 9.027613f, -0.28086f, -0.162882f), - new Vector4(2.81511f, 1.597273f, -0.366471f, 10.300301f) - }, - - // 4 components - new[] - { - new Vector4(4.338459f, 1.553635f, -5.767909f, 46.164397f), - new Vector4(3.839993f, 4.693183f, 9.795391f, -15.227561f), - new Vector4(2.791880f, 8.178137f, -3.048324f, 0.302959f), - new Vector4(1.342190f, 12.328289f, 0.010001f, 0.244650f) - }, - - // 5 components - new[] - { - new Vector4(4.892608f, 1.685979f, -22.356787f, 85.91246f), - new Vector4(4.71187f, 4.998496f, 35.918936f, -28.875618f), - new Vector4(4.052795f, 8.244168f, -13.212253f, -1.578428f), - new Vector4(2.929212f, 11.900859f, 0.507991f, 1.816328f), - new Vector4(1.512961f, 16.116382f, 0.138051f, -0.01f) - }, - - // 6 components - new[] - { - new Vector4(5.143778f, 2.079813f, -82.326596f, 111.231024f), - new Vector4(5.612426f, 6.153387f, 113.878661f, 58.004879f), - new Vector4(5.982921f, 9.802895f, 39.479083f, -162.028887f), - new Vector4(6.505167f, 11.059237f, -71.286026f, 95.027069f), - new Vector4(3.869579f, 14.81052f, 1.405746f, -3.704914f), - new Vector4(2.201904f, 19.032909f, -0.152784f, -0.107988f) - } - }; - - /// - /// Gets the kernel parameters and scaling factor for the current count value in the current instance. - /// - private (Vector4[] Parameters, float Scale) GetParameters() - { - // Prepare the kernel components - int index = Math.Max(0, Math.Min(ComponentsCount - 1, KernelComponents.Count)); - return (KernelComponents[index], KernelScales[index]); + // Fill in the complex kernel values + Unsafe.Add(ref baseRef, i) = new Complex64( + MathF.Exp(-a * value) * MathF.Cos(b * value), + MathF.Exp(-a * value) * MathF.Sin(b * value)); } - /// - /// Creates the collection of complex 1D kernels with the specified parameters. - /// - private Complex64[][] CreateComplexKernels() + return kernel; + } + + /// + /// Normalizes the kernels with respect to A * real + B * imaginary. + /// + private void NormalizeKernels() + { + // Calculate the complex weighted sum + float total = 0; + Span kernelsSpan = Kernels.AsSpan(); + ref Complex64[] baseKernelsRef = ref MemoryMarshal.GetReference(kernelsSpan); + ref Vector4 baseParamsRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); + + for (int i = 0; i < KernelParameters.Length; i++) { - var kernels = new Complex64[KernelParameters.Length][]; - ref Vector4 baseRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); - for (int i = 0; i < KernelParameters.Length; i++) + ref Complex64[] kernelRef = ref Unsafe.Add(ref baseKernelsRef, i); + int length = kernelRef.Length; + ref Complex64 valueRef = ref kernelRef[0]; + ref Vector4 paramsRef = ref Unsafe.Add(ref baseParamsRef, i); + + for (int j = 0; j < length; j++) { - ref Vector4 paramsRef = ref Unsafe.Add(ref baseRef, i); - kernels[i] = CreateComplex1DKernel(paramsRef.X, paramsRef.Y); - } - - return kernels; - } - - /// - /// Creates a complex 1D kernel with the specified parameters. - /// - /// The exponential parameter for each complex component. - /// The angle component for each complex component. - private Complex64[] CreateComplex1DKernel(float a, float b) - { - var kernel = new Complex64[KernelSize]; - ref Complex64 baseRef = ref MemoryMarshal.GetReference(kernel.AsSpan()); - int r = Radius, n = -r; - - for (int i = 0; i < KernelSize; i++, n++) - { - // Incrementally compute the range values - float value = n * KernelsScale * (1f / r); - value *= value; - - // Fill in the complex kernel values - Unsafe.Add(ref baseRef, i) = new Complex64( - MathF.Exp(-a * value) * MathF.Cos(b * value), - MathF.Exp(-a * value) * MathF.Sin(b * value)); - } - - return kernel; - } - - /// - /// Normalizes the kernels with respect to A * real + B * imaginary. - /// - private void NormalizeKernels() - { - // Calculate the complex weighted sum - float total = 0; - Span kernelsSpan = Kernels.AsSpan(); - ref Complex64[] baseKernelsRef = ref MemoryMarshal.GetReference(kernelsSpan); - ref Vector4 baseParamsRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); - - for (int i = 0; i < KernelParameters.Length; i++) - { - ref Complex64[] kernelRef = ref Unsafe.Add(ref baseKernelsRef, i); - int length = kernelRef.Length; - ref Complex64 valueRef = ref kernelRef[0]; - ref Vector4 paramsRef = ref Unsafe.Add(ref baseParamsRef, i); - - for (int j = 0; j < length; j++) + for (int k = 0; k < length; k++) { - for (int k = 0; k < length; k++) - { - ref Complex64 jRef = ref Unsafe.Add(ref valueRef, j); - ref Complex64 kRef = ref Unsafe.Add(ref valueRef, k); - total += - paramsRef.Z * (jRef.Real * kRef.Real - jRef.Imaginary * kRef.Imaginary) - + paramsRef.W * (jRef.Real * kRef.Imaginary + jRef.Imaginary * kRef.Real); - } - } - } - - // Normalize the kernels - float scalar = 1f / MathF.Sqrt(total); - for (int i = 0; i < kernelsSpan.Length; i++) - { - ref Complex64[] kernelsRef = ref Unsafe.Add(ref baseKernelsRef, i); - int length = kernelsRef.Length; - ref Complex64 valueRef = ref kernelsRef[0]; - - for (int j = 0; j < length; j++) - { - Unsafe.Add(ref valueRef, j) *= scalar; + ref Complex64 jRef = ref Unsafe.Add(ref valueRef, j); + ref Complex64 kRef = ref Unsafe.Add(ref valueRef, k); + total += + paramsRef.Z * (jRef.Real * kRef.Real - jRef.Imaginary * kRef.Imaginary) + + paramsRef.W * (jRef.Real * kRef.Imaginary + jRef.Imaginary * kRef.Real); } } } + // Normalize the kernels + float scalar = 1f / MathF.Sqrt(total); + for (int i = 0; i < kernelsSpan.Length; i++) + { + ref Complex64[] kernelsRef = ref Unsafe.Add(ref baseKernelsRef, i); + int length = kernelsRef.Length; + ref Complex64 valueRef = ref kernelsRef[0]; + + for (int j = 0; j < length; j++) + { + Unsafe.Add(ref valueRef, j) *= scalar; + } + } + } + + /// + protected override void OnFrameApply(ImageFrame source) + { + if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) + { + ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); + } + + Span span = MemoryMarshal.Cast(pixelSpan); + + using ReadWriteTexture2D texture = GraphicsDevice.AllocateReadWriteTexture2D(span, source.Width, source.Height); + using ReadWriteTexture2D temporary = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height, AllocationMode.Clear); + using ReadWriteTexture2D reals = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); + using ReadWriteTexture2D imaginaries = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); + using ReadOnlyBuffer kernel = GraphicsDevice.AllocateReadOnlyBuffer(KernelSize); + + // Preliminary gamma highlight pass + GraphicsDevice.For(source.Height, new(texture)); + + // Perform two 1D convolutions for each component in the current instance + for (int j = 0; j < Kernels.Length; j++) + { + Vector4 parameters = KernelParameters[j]; + + kernel.CopyFrom(Kernels[j]); + + GraphicsDevice.For( + source.Width, + source.Height, + new(texture, reals, imaginaries, kernel)); + + GraphicsDevice.For( + source.Width, + source.Height, + new(parameters.Z, parameters.W, reals, imaginaries, temporary, kernel)); + } + + // Apply the inverse gamma exposure pass + GraphicsDevice.For(source.Height, new(temporary, texture)); + + // Write the final pixel data + texture.CopyTo(span); + } + + /// + /// Kernel for the vertical convolution pass. + /// + [AutoConstructor] + internal partial struct VerticalConvolutionProcessor : IComputeShader + { + public IReadWriteTexture2D source; + public ReadWriteTexture2D reals; + public ReadWriteTexture2D imaginaries; + public ReadOnlyBuffer kernel; + /// - protected override void OnFrameApply(ImageFrame source) + public void Execute() { - if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) + Vector4 real = Vector4.Zero; + Vector4 imaginary = Vector4.Zero; + int maxY = source.Height; + int maxX = source.Width; + int kernelLength = kernel.Length; + int radiusY = kernelLength >> 1; + + for (int i = 0; i < kernelLength; i++) { - ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); + int offsetY = Hlsl.Clamp(ThreadIds.Y + i - radiusY, 0, maxY); + int offsetX = Hlsl.Clamp(ThreadIds.X, 0, maxX); + Vector4 color = source[offsetX, offsetY]; + Complex64 factors = kernel[i]; + + real += factors.Real * color; + imaginary += factors.Imaginary * color; } - Span span = MemoryMarshal.Cast(pixelSpan); - - using ReadWriteTexture2D texture = GraphicsDevice.AllocateReadWriteTexture2D(span, source.Width, source.Height); - using ReadWriteTexture2D temporary = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height, AllocationMode.Clear); - using ReadWriteTexture2D reals = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); - using ReadWriteTexture2D imaginaries = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); - using ReadOnlyBuffer kernel = GraphicsDevice.AllocateReadOnlyBuffer(KernelSize); - - // Preliminary gamma highlight pass - GraphicsDevice.For(source.Height, new(texture)); - - // Perform two 1D convolutions for each component in the current instance - for (int j = 0; j < Kernels.Length; j++) - { - Vector4 parameters = KernelParameters[j]; - - kernel.CopyFrom(Kernels[j]); - - GraphicsDevice.For( - source.Width, - source.Height, - new(texture, reals, imaginaries, kernel)); - - GraphicsDevice.For( - source.Width, - source.Height, - new(parameters.Z, parameters.W, reals, imaginaries, temporary, kernel)); - } - - // Apply the inverse gamma exposure pass - GraphicsDevice.For(source.Height, new(temporary, texture)); - - // Write the final pixel data - texture.CopyTo(span); + reals[ThreadIds.XY] = real; + imaginaries[ThreadIds.XY] = imaginary; } + } - /// - /// Kernel for the vertical convolution pass. - /// - [AutoConstructor] - internal partial struct VerticalConvolutionProcessor : IComputeShader + /// + /// Kernel for the horizontal convolution pass. + /// + [AutoConstructor] + internal partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader + { + public float z; + public float w; + + public ReadWriteTexture2D reals; + public ReadWriteTexture2D imaginaries; + public ReadWriteTexture2D target; + public ReadOnlyBuffer kernel; + + /// + public void Execute() { - public IReadWriteTexture2D source; - public ReadWriteTexture2D reals; - public ReadWriteTexture2D imaginaries; - public ReadOnlyBuffer kernel; + Vector4 real = Vector4.Zero; + Vector4 imaginary = Vector4.Zero; + int maxY = target.Height; + int maxX = target.Width; + int kernelLength = kernel.Length; + int radiusX = kernelLength >> 1; + int offsetY = Hlsl.Clamp(ThreadIds.Y, 0, maxY); - /// - public void Execute() + for (int i = 0; i < kernelLength; i++) { - Vector4 real = Vector4.Zero; - Vector4 imaginary = Vector4.Zero; - int maxY = source.Height; - int maxX = source.Width; - int kernelLength = kernel.Length; - int radiusY = kernelLength >> 1; + int offsetX = Hlsl.Clamp(ThreadIds.X + i - radiusX, 0, maxX); + Vector4 sourceReal = reals[offsetX, offsetY]; + Vector4 sourceImaginary = imaginaries[offsetX, offsetY]; + Complex64 factors = kernel[i]; - for (int i = 0; i < kernelLength; i++) - { - int offsetY = Hlsl.Clamp(ThreadIds.Y + i - radiusY, 0, maxY); - int offsetX = Hlsl.Clamp(ThreadIds.X, 0, maxX); - Vector4 color = source[offsetX, offsetY]; - Complex64 factors = kernel[i]; + real += factors.Real * sourceReal - factors.Imaginary * sourceImaginary; + imaginary += factors.Real * sourceImaginary + factors.Imaginary * sourceReal; + } - real += factors.Real * color; - imaginary += factors.Imaginary * color; - } + target[ThreadIds.XY] += real * z + imaginary * w; + } + } - reals[ThreadIds.XY] = real; - imaginaries[ThreadIds.XY] = imaginary; + /// + /// Kernel for the gamma highlight pass. + /// + [AutoConstructor] + internal readonly partial struct GammaHighlightProcessor : IComputeShader + { + public readonly IReadWriteTexture2D source; + + /// + public void Execute() + { + int width = source.Width; + + for (int i = 0; i < width; i++) + { + float4 v = source[i, ThreadIds.X]; + + v.XYZ = v.XYZ * v.XYZ * v.XYZ; + + source[i, ThreadIds.X] = v; } } + } - /// - /// Kernel for the horizontal convolution pass. - /// - [AutoConstructor] - internal partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader + /// + /// Kernel for the inverse gamma highlight pass. + /// + [AutoConstructor] + internal readonly partial struct InverseGammaHighlightProcessor : IComputeShader + { + public readonly ReadWriteTexture2D source; + public readonly IReadWriteTexture2D target; + + /// + public void Execute() { - public float z; - public float w; + int width = source.Width; - public ReadWriteTexture2D reals; - public ReadWriteTexture2D imaginaries; - public ReadWriteTexture2D target; - public ReadOnlyBuffer kernel; - - /// - public void Execute() + for (int i = 0; i < width; i++) { - Vector4 real = Vector4.Zero; - Vector4 imaginary = Vector4.Zero; - int maxY = target.Height; - int maxX = target.Width; - int kernelLength = kernel.Length; - int radiusX = kernelLength >> 1; - int offsetY = Hlsl.Clamp(ThreadIds.Y, 0, maxY); + float4 v = source[i, ThreadIds.X]; - for (int i = 0; i < kernelLength; i++) - { - int offsetX = Hlsl.Clamp(ThreadIds.X + i - radiusX, 0, maxX); - Vector4 sourceReal = reals[offsetX, offsetY]; - Vector4 sourceImaginary = imaginaries[offsetX, offsetY]; - Complex64 factors = kernel[i]; + v = Hlsl.Clamp(v, 0, float.MaxValue); + v.XYZ = Hlsl.Pow(v.XYZ, 1 / 3f); - real += factors.Real * sourceReal - factors.Imaginary * sourceImaginary; - imaginary += factors.Real * sourceImaginary + factors.Imaginary * sourceReal; - } - - target[ThreadIds.XY] += real * z + imaginary * w; - } - } - - /// - /// Kernel for the gamma highlight pass. - /// - [AutoConstructor] - internal readonly partial struct GammaHighlightProcessor : IComputeShader - { - public readonly IReadWriteTexture2D source; - - /// - public void Execute() - { - int width = source.Width; - - for (int i = 0; i < width; i++) - { - float4 v = source[i, ThreadIds.X]; - - v.XYZ = v.XYZ * v.XYZ * v.XYZ; - - source[i, ThreadIds.X] = v; - } - } - } - - /// - /// Kernel for the inverse gamma highlight pass. - /// - [AutoConstructor] - internal readonly partial struct InverseGammaHighlightProcessor : IComputeShader - { - public readonly ReadWriteTexture2D source; - public readonly IReadWriteTexture2D target; - - /// - public void Execute() - { - int width = source.Width; - - for (int i = 0; i < width; i++) - { - float4 v = source[i, ThreadIds.X]; - - v = Hlsl.Clamp(v, 0, float.MaxValue); - v.XYZ = Hlsl.Pow(v.XYZ, 1 / 3f); - - target[i, ThreadIds.X] = v; - } + target[i, ThreadIds.X] = v; } } } diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs index 159e1965..545c3e48 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs @@ -5,85 +5,84 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.BokehBlur.Processors +namespace ComputeSharp.BokehBlur.Processors; + +/// +/// Defines Gaussian blur by a (Sigma, Radius) pair. +/// +public sealed partial class HlslGaussianBlurProcessor : IImageProcessor { /// - /// Defines Gaussian blur by a (Sigma, Radius) pair. + /// The default value for . /// - public sealed partial class HlslGaussianBlurProcessor : IImageProcessor + public const float DefaultSigma = 3f; + + /// + /// Initializes a new instance of the class. + /// + public HlslGaussianBlurProcessor() + : this(Gpu.Default, DefaultSigma, 9) { - /// - /// The default value for . - /// - public const float DefaultSigma = 3f; + } - /// - /// Initializes a new instance of the class. - /// - public HlslGaussianBlurProcessor() - : this(Gpu.Default, DefaultSigma, 9) + /// + /// Initializes a new instance of the class. + /// + /// The radius value representing the size of the area to sample. + public HlslGaussianBlurProcessor(int radius) + : this(Gpu.Default, radius / 3F, radius) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The associated with the current instance. + /// The radius value representing the size of the area to sample. + public HlslGaussianBlurProcessor(GraphicsDevice device, int radius) + : this(device, radius / 3F, radius) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The associated with the current instance. + /// The sigma value representing the weight of the blur. + /// The radius value representing the size of the area to sample (this should be at least twice the sigma value) + public HlslGaussianBlurProcessor(GraphicsDevice device, float sigma, int radius) + { + GraphicsDevice = device; + Sigma = sigma; + Radius = radius; + } + + /// + /// The instance in use. + /// + private readonly GraphicsDevice GraphicsDevice; + + /// + /// Gets the sigma value representing the weight of the blur. + /// + public float Sigma { get; } + + /// + /// Gets the radius defining the size of the area to sample. + /// + public int Radius { get; } + + /// + public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) + where TPixel : unmanaged, IPixel + { + if (typeof(TPixel) != typeof(ImageSharpRgba32)) { + ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); } - /// - /// Initializes a new instance of the class. - /// - /// The radius value representing the size of the area to sample. - public HlslGaussianBlurProcessor(int radius) - : this(Gpu.Default, radius / 3F, radius) - { - } + var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); - /// - /// Initializes a new instance of the class. - /// - /// The associated with the current instance. - /// The radius value representing the size of the area to sample. - public HlslGaussianBlurProcessor(GraphicsDevice device, int radius) - : this(device, radius / 3F, radius) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The associated with the current instance. - /// The sigma value representing the weight of the blur. - /// The radius value representing the size of the area to sample (this should be at least twice the sigma value) - public HlslGaussianBlurProcessor(GraphicsDevice device, float sigma, int radius) - { - GraphicsDevice = device; - Sigma = sigma; - Radius = radius; - } - - /// - /// The instance in use. - /// - private readonly GraphicsDevice GraphicsDevice; - - /// - /// Gets the sigma value representing the weight of the blur. - /// - public float Sigma { get; } - - /// - /// Gets the radius defining the size of the area to sample. - /// - public int Radius { get; } - - /// - public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) - where TPixel : unmanaged, IPixel - { - if (typeof(TPixel) != typeof(ImageSharpRgba32)) - { - ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); - } - - var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); - - return Unsafe.As>(processor); - } + return Unsafe.As>(processor); } } diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs index e3b5a7c4..5176edea 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs @@ -7,172 +7,171 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing.Processors; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.BokehBlur.Processors +namespace ComputeSharp.BokehBlur.Processors; + +/// +public sealed partial class HlslGaussianBlurProcessor { - /// - public sealed partial class HlslGaussianBlurProcessor + /// + /// Applies Gaussian blur processing to an image. + /// + internal sealed partial class Implementation : ImageProcessor { /// - /// Applies Gaussian blur processing to an image. + /// The instance in use. /// - internal sealed partial class Implementation : ImageProcessor + private readonly GraphicsDevice GraphicsDevice; + + /// + /// The 1D kernel to apply. + /// + private readonly float[] Kernel; + + /// + /// Initializes a new instance of the class. + /// + /// The defining the processor parameters. + /// The configuration which allows altering default behaviour or extending the library. + /// The source for the current processor instance. + /// The source area to process for the current processor instance. + public Implementation(HlslGaussianBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) + : base(configuration, source, sourceRectangle) { - /// - /// The instance in use. - /// - private readonly GraphicsDevice GraphicsDevice; + int kernelSize = definition.Radius * 2 + 1; - /// - /// The 1D kernel to apply. - /// - private readonly float[] Kernel; + GraphicsDevice = definition.GraphicsDevice; + Kernel = CreateGaussianBlurKernel(kernelSize, definition.Sigma); + } - /// - /// Initializes a new instance of the class. - /// - /// The defining the processor parameters. - /// The configuration which allows altering default behaviour or extending the library. - /// The source for the current processor instance. - /// The source area to process for the current processor instance. - public Implementation(HlslGaussianBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) - : base(configuration, source, sourceRectangle) + /// + /// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function. + /// + private static float[] CreateGaussianBlurKernel(int size, float weight) + { + float[] kernel = new float[size]; + ref float rKernel = ref kernel[0]; + + float sum = 0F; + float midpoint = (size - 1) / 2F; + + for (int i = 0; i < size; i++) { - int kernelSize = definition.Radius * 2 + 1; - - GraphicsDevice = definition.GraphicsDevice; - Kernel = CreateGaussianBlurKernel(kernelSize, definition.Sigma); + float x = i - midpoint; + float gx = Gaussian(x, weight); + sum += gx; + Unsafe.Add(ref rKernel, i) = gx; } - /// - /// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function. - /// - private static float[] CreateGaussianBlurKernel(int size, float weight) + // Normalize kernel so that the sum of all weights equals 1 + for (int i = 0; i < size; i++) { - float[] kernel = new float[size]; - ref float rKernel = ref kernel[0]; - - float sum = 0F; - float midpoint = (size - 1) / 2F; - - for (int i = 0; i < size; i++) - { - float x = i - midpoint; - float gx = Gaussian(x, weight); - sum += gx; - Unsafe.Add(ref rKernel, i) = gx; - } - - // Normalize kernel so that the sum of all weights equals 1 - for (int i = 0; i < size; i++) - { - Unsafe.Add(ref rKernel, i) /= sum; - } - - return kernel; + Unsafe.Add(ref rKernel, i) /= sum; } - /// - /// Implementation of 1D Gaussian G(x) function. - /// - /// The x provided to G(x) - /// The spread of the blur. - /// The Gaussian G(x) - private static float Gaussian(float x, float sigma) + return kernel; + } + + /// + /// Implementation of 1D Gaussian G(x) function. + /// + /// The x provided to G(x) + /// The spread of the blur. + /// The Gaussian G(x) + private static float Gaussian(float x, float sigma) + { + const float Numerator = 1.0f; + float denominator = MathF.Sqrt(2 * MathF.PI) * sigma; + + float exponentNumerator = -x * x; + float exponentDenominator = 2 * sigma * sigma; + + float left = Numerator / denominator; + float right = MathF.Exp(exponentNumerator / exponentDenominator); + + return left * right; + } + + /// + protected override void OnFrameApply(ImageFrame source) + { + if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) { - const float Numerator = 1.0f; - float denominator = MathF.Sqrt(2 * MathF.PI) * sigma; - - float exponentNumerator = -x * x; - float exponentDenominator = 2 * sigma * sigma; - - float left = Numerator / denominator; - float right = MathF.Exp(exponentNumerator / exponentDenominator); - - return left * right; + ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); } + Span span = MemoryMarshal.Cast(pixelSpan); + + using ReadWriteTexture2D sourceTexture = GraphicsDevice.AllocateReadWriteTexture2D(span, source.Width, source.Height); + using ReadWriteTexture2D firstPassTexture = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); + using ReadOnlyBuffer kernelBuffer = GraphicsDevice.AllocateReadOnlyBuffer(Kernel); + + GraphicsDevice.For(source.Width, source.Height, new(sourceTexture, firstPassTexture, kernelBuffer)); + GraphicsDevice.For(source.Width, source.Height, new(firstPassTexture, sourceTexture, kernelBuffer)); + + sourceTexture.CopyTo(span); + } + + /// + /// Kernel for the vertical convolution pass. + /// + [AutoConstructor] + internal readonly partial struct VerticalConvolutionProcessor : IComputeShader + { + public readonly IReadWriteTexture2D source; + public readonly IReadWriteTexture2D target; + public readonly ReadOnlyBuffer kernel; + /// - protected override void OnFrameApply(ImageFrame source) + public void Execute() { - if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) + Vector4 result = Vector4.Zero; + int maxY = source.Height - 1; + int maxX = source.Width - 1; + int kernelLength = kernel.Length; + int radiusY = kernelLength >> 1; + + for (int i = 0; i < kernelLength; i++) { - ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); + int offsetY = Hlsl.Clamp(ThreadIds.Y + i - radiusY, 0, maxY); + int offsetX = Hlsl.Clamp(ThreadIds.X, 0, maxX); + Vector4 color = source[offsetX, offsetY]; + + result += kernel[i] * color; } - Span span = MemoryMarshal.Cast(pixelSpan); - - using ReadWriteTexture2D sourceTexture = GraphicsDevice.AllocateReadWriteTexture2D(span, source.Width, source.Height); - using ReadWriteTexture2D firstPassTexture = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); - using ReadOnlyBuffer kernelBuffer = GraphicsDevice.AllocateReadOnlyBuffer(Kernel); - - GraphicsDevice.For(source.Width, source.Height, new(sourceTexture, firstPassTexture, kernelBuffer)); - GraphicsDevice.For(source.Width, source.Height, new(firstPassTexture, sourceTexture, kernelBuffer)); - - sourceTexture.CopyTo(span); + target[ThreadIds.XY] = result; } + } - /// - /// Kernel for the vertical convolution pass. - /// - [AutoConstructor] - internal readonly partial struct VerticalConvolutionProcessor : IComputeShader + /// + /// Kernel for the horizontal convolution pass. + /// + [AutoConstructor] + internal readonly partial struct HorizontalConvolutionProcessor : IComputeShader + { + public readonly IReadWriteTexture2D source; + public readonly IReadWriteTexture2D target; + public readonly ReadOnlyBuffer kernel; + + /// + public void Execute() { - public readonly IReadWriteTexture2D source; - public readonly IReadWriteTexture2D target; - public readonly ReadOnlyBuffer kernel; + Vector4 result = Vector4.Zero; + int maxY = source.Height - 1; + int maxX = source.Width - 1; + int kernelLength = kernel.Length; + int radiusX = kernelLength >> 1; + int offsetY = Hlsl.Clamp(ThreadIds.Y, 0, maxY); - /// - public void Execute() + for (int i = 0; i < kernelLength; i++) { - Vector4 result = Vector4.Zero; - int maxY = source.Height - 1; - int maxX = source.Width - 1; - int kernelLength = kernel.Length; - int radiusY = kernelLength >> 1; + int offsetX = Hlsl.Clamp(ThreadIds.X + i - radiusX, 0, maxX); + Vector4 color = source[offsetX, offsetY]; - for (int i = 0; i < kernelLength; i++) - { - int offsetY = Hlsl.Clamp(ThreadIds.Y + i - radiusY, 0, maxY); - int offsetX = Hlsl.Clamp(ThreadIds.X, 0, maxX); - Vector4 color = source[offsetX, offsetY]; - - result += kernel[i] * color; - } - - target[ThreadIds.XY] = result; + result += kernel[i] * color; } - } - /// - /// Kernel for the horizontal convolution pass. - /// - [AutoConstructor] - internal readonly partial struct HorizontalConvolutionProcessor : IComputeShader - { - public readonly IReadWriteTexture2D source; - public readonly IReadWriteTexture2D target; - public readonly ReadOnlyBuffer kernel; - - /// - public void Execute() - { - Vector4 result = Vector4.Zero; - int maxY = source.Height - 1; - int maxX = source.Width - 1; - int kernelLength = kernel.Length; - int radiusX = kernelLength >> 1; - int offsetY = Hlsl.Clamp(ThreadIds.Y, 0, maxY); - - for (int i = 0; i < kernelLength; i++) - { - int offsetX = Hlsl.Clamp(ThreadIds.X + i - radiusX, 0, maxX); - Vector4 color = source[offsetX, offsetY]; - - result += kernel[i] * color; - } - - target[ThreadIds.XY] = result; - } + target[ThreadIds.XY] = result; } } } diff --git a/samples/ComputeSharp.ImageProcessing/Program.cs b/samples/ComputeSharp.ImageProcessing/Program.cs index ded812cd..2487916f 100644 --- a/samples/ComputeSharp.ImageProcessing/Program.cs +++ b/samples/ComputeSharp.ImageProcessing/Program.cs @@ -7,32 +7,31 @@ using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.ImageProcessing +namespace ComputeSharp.ImageProcessing; + +class Program { - class Program + static void Main() { - static void Main() + Console.WriteLine(">> Loading image"); + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "city.jpg"); + using Image image = Image.Load(path); + + // Apply a series of processors and save the results + foreach (var effect in new (string Name, IImageProcessor Processor)[] { - Console.WriteLine(">> Loading image"); - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "city.jpg"); - using Image image = Image.Load(path); + ("bokeh", new HlslBokehBlurProcessor(80, 2)), + ("gaussian", new HlslGaussianBlurProcessor(80)) + }) + { + Console.WriteLine($">> Applying {effect.Name}"); + using Image copy = image.Clone(c => c.ApplyProcessor(effect.Processor)); - // Apply a series of processors and save the results - foreach (var effect in new (string Name, IImageProcessor Processor)[] - { - ("bokeh", new HlslBokehBlurProcessor(80, 2)), - ("gaussian", new HlslGaussianBlurProcessor(80)) - }) - { - Console.WriteLine($">> Applying {effect.Name}"); - using Image copy = image.Clone(c => c.ApplyProcessor(effect.Processor)); - - Console.WriteLine($">> Saving {effect.Name} to disk"); - string targetPath = Path.Combine( - Path.GetRelativePath(Path.GetDirectoryName(path)!, @"..\..\..\"), - $"{Path.GetFileNameWithoutExtension(path)}_{effect.Name}{Path.GetExtension(path)}"); - copy.Save(targetPath); - } + Console.WriteLine($">> Saving {effect.Name} to disk"); + string targetPath = Path.Combine( + Path.GetRelativePath(Path.GetDirectoryName(path)!, @"..\..\..\"), + $"{Path.GetFileNameWithoutExtension(path)}_{effect.Name}{Path.GetExtension(path)}"); + copy.Save(targetPath); } } } diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs b/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs index 747bd11b..4d20dfb6 100644 --- a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs +++ b/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs @@ -1,17 +1,16 @@ -namespace ComputeSharp.Sample.FSharp.Shaders -{ - /// - /// A sample shader thaat just multiplies items in a buffer by two. - /// - [AutoConstructor] - public readonly partial struct MultiplyByTwo : IComputeShader - { - public readonly ReadWriteBuffer buffer; +namespace ComputeSharp.Sample.FSharp.Shaders; - /// - public void Execute() - { - buffer[ThreadIds.X] *= 2; - } +/// +/// A sample shader thaat just multiplies items in a buffer by two. +/// +[AutoConstructor] +public readonly partial struct MultiplyByTwo : IComputeShader +{ + public readonly ReadWriteBuffer buffer; + + /// + public void Execute() + { + buffer[ThreadIds.X] *= 2; } } diff --git a/samples/ComputeSharp.Sample.Shared/Program.cs b/samples/ComputeSharp.Sample.Shared/Program.cs index f87c1678..3fc4ead9 100644 --- a/samples/ComputeSharp.Sample.Shared/Program.cs +++ b/samples/ComputeSharp.Sample.Shared/Program.cs @@ -2,71 +2,69 @@ using System.Globalization; using System.Linq; -namespace ComputeSharp.Sample +namespace ComputeSharp.Sample; + +partial class Program { - partial class Program + static void Main() { - static void Main() + float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray(); + + // Create the graphics buffer + using ReadWriteBuffer gpuBuffer = Gpu.Default.AllocateReadWriteBuffer(array); + + // Run the shader + Gpu.Default.For(100, new MainKernel(gpuBuffer)); + + // Print the initial matrix + PrintMatrix(array, 10, 10, "BEFORE"); + + // Get the data back + gpuBuffer.CopyTo(array); + + // Print the updated matrix + PrintMatrix(array, 10, 10, "AFTER"); + } + + /// + /// Kernel for . + /// + [AutoConstructor] + internal readonly partial struct MainKernel : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + /// + public void Execute() { - float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray(); - - // Create the graphics buffer - using ReadWriteBuffer gpuBuffer = Gpu.Default.AllocateReadWriteBuffer(array); - - // Run the shader - Gpu.Default.For(100, new MainKernel(gpuBuffer)); - - // Print the initial matrix - PrintMatrix(array, 10, 10, "BEFORE"); - - // Get the data back - gpuBuffer.CopyTo(array); - - // Print the updated matrix - PrintMatrix(array, 10, 10, "AFTER"); - } - - /// - /// Kernel for . - /// - [AutoConstructor] - internal readonly partial struct MainKernel : IComputeShader - { - public readonly ReadWriteBuffer buffer; - - /// - public void Execute() - { - buffer[ThreadIds.X] *= 2; - } - } - - /// - /// Prints a matrix in a properly formatted way. - /// - /// The input array representing the matrix to print. - /// The width of the array to print. - /// The height of the array to print. - /// The name of the matrix to print. - private static void PrintMatrix(float[] array, int width, int height, string name) - { - int pad = 48 - name.Length; - string title = $"{new string('=', pad / 2)} {name} {new string('=', (pad + 1) / 2)}"; - - Console.WriteLine(title); - - int numberWidth = Math.Max(array.Max().ToString(CultureInfo.InvariantCulture).Length, 4); - - for (int i = 0; i < height; i++) - { - var row = array[(i * width)..((i + 1) * width)]; - var text = string.Join(",", row.Select(x => x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth))); - - Console.WriteLine(text); - } - - Console.WriteLine(new string('=', 50)); + buffer[ThreadIds.X] *= 2; } } -} + /// + /// Prints a matrix in a properly formatted way. + /// + /// The input array representing the matrix to print. + /// The width of the array to print. + /// The height of the array to print. + /// The name of the matrix to print. + private static void PrintMatrix(float[] array, int width, int height, string name) + { + int pad = 48 - name.Length; + string title = $"{new string('=', pad / 2)} {name} {new string('=', (pad + 1) / 2)}"; + + Console.WriteLine(title); + + int numberWidth = Math.Max(array.Max().ToString(CultureInfo.InvariantCulture).Length, 4); + + for (int i = 0; i < height; i++) + { + var row = array[(i * width)..((i + 1) * width)]; + var text = string.Join(",", row.Select(x => x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth))); + + Console.WriteLine(text); + } + + Console.WriteLine(new string('=', 50)); + } +} diff --git a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs index 93c3c2ea..26ddb260 100644 --- a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs +++ b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs @@ -3,301 +3,300 @@ using ComputeSharp.Interop; using TerraFX.Interop; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.SwapChain.Backend +namespace ComputeSharp.SwapChain.Backend; + +internal sealed class SwapChainApplication : Win32Application + where T : struct, IPixelShader { - internal sealed class SwapChainApplication : Win32Application - where T : struct, IPixelShader + /// + /// The instance used to create shaders to run. + /// + private readonly Func shaderFactory; + + /// + /// The pointer for the device currently in use. + /// + private ComPtr d3D12Device; + + /// + /// The instance to use for graphics operations. + /// + private ComPtr d3D12CommandQueue; + + /// + /// The instance used for graphics operations. + /// + private ComPtr d3D12Fence; + + /// + /// The next fence value for graphics operations using . + /// + private ulong nextD3D12FenceValue = 1; + + /// + /// The object to create command lists. + /// + private ComPtr d3D12CommandAllocator; + + /// + /// The instance used to copy data to the back buffers. + /// + private ComPtr d3D12GraphicsCommandList; + + /// + /// The instance used to display content onto the target window. + /// + private ComPtr dxgiSwapChain1; + + /// + /// The first buffer within . + /// + private ComPtr d3D12Resource0; + + /// + /// The second buffer within . + /// + private ComPtr d3D12Resource1; + + /// + /// The index of the next buffer that can be used to present content. + /// + private uint currentBufferIndex; + + /// + /// The instance used to prepare frames to display. + /// + private ReadWriteTexture2D? texture; + + /// + /// Whether or not the window has been resized and requires the buffers to be updated. + /// + private bool isResizePending; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance used to create shaders to run. + public SwapChainApplication(Func shaderFactory) { - /// - /// The instance used to create shaders to run. - /// - private readonly Func shaderFactory; + this.shaderFactory = shaderFactory; + } - /// - /// The pointer for the device currently in use. - /// - private ComPtr d3D12Device; - - /// - /// The instance to use for graphics operations. - /// - private ComPtr d3D12CommandQueue; - - /// - /// The instance used for graphics operations. - /// - private ComPtr d3D12Fence; - - /// - /// The next fence value for graphics operations using . - /// - private ulong nextD3D12FenceValue = 1; - - /// - /// The object to create command lists. - /// - private ComPtr d3D12CommandAllocator; - - /// - /// The instance used to copy data to the back buffers. - /// - private ComPtr d3D12GraphicsCommandList; - - /// - /// The instance used to display content onto the target window. - /// - private ComPtr dxgiSwapChain1; - - /// - /// The first buffer within . - /// - private ComPtr d3D12Resource0; - - /// - /// The second buffer within . - /// - private ComPtr d3D12Resource1; - - /// - /// The index of the next buffer that can be used to present content. - /// - private uint currentBufferIndex; - - /// - /// The instance used to prepare frames to display. - /// - private ReadWriteTexture2D? texture; - - /// - /// Whether or not the window has been resized and requires the buffers to be updated. - /// - private bool isResizePending; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance used to create shaders to run. - public SwapChainApplication(Func shaderFactory) + /// + public override unsafe void OnInitialize(HWND hwnd) + { + // Get the underlying ID3D12Device in use + fixed (ID3D12Device** d3D12Device = this.d3D12Device) { - this.shaderFactory = shaderFactory; + _ = InteropServices.TryGetID3D12Device(Gpu.Default, FX.__uuidof(), (void**)d3D12Device); } - /// - public override unsafe void OnInitialize(HWND hwnd) + // Create the direct command queue to use + fixed (ID3D12CommandQueue** d3D12CommandQueue = this.d3D12CommandQueue) { - // Get the underlying ID3D12Device in use - fixed (ID3D12Device** d3D12Device = this.d3D12Device) - { - _ = InteropServices.TryGetID3D12Device(Gpu.Default, FX.__uuidof(), (void**)d3D12Device); - } + D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; + d3D12CommandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT; + d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY.D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; + d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAGS.D3D12_COMMAND_QUEUE_FLAG_NONE; + d3D12CommandQueueDesc.NodeMask = 0; - // Create the direct command queue to use - fixed (ID3D12CommandQueue** d3D12CommandQueue = this.d3D12CommandQueue) - { - D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; - d3D12CommandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT; - d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY.D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; - d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAGS.D3D12_COMMAND_QUEUE_FLAG_NONE; - d3D12CommandQueueDesc.NodeMask = 0; - - _ = d3D12Device.Get()->CreateCommandQueue( - &d3D12CommandQueueDesc, - FX.__uuidof(), - (void**)d3D12CommandQueue); - } - - // Create the direct fence - fixed (ID3D12Fence** d3D12Fence = this.d3D12Fence) - { - _ = this.d3D12Device.Get()->CreateFence( - 0, - D3D12_FENCE_FLAGS.D3D12_FENCE_FLAG_NONE, - FX.__uuidof(), - (void**)d3D12Fence); - } - - // Create the swap chain to display frames - fixed (IDXGISwapChain1** dxgiSwapChain1 = this.dxgiSwapChain1) - { - using ComPtr dxgiFactory2 = default; - - _ = FX.CreateDXGIFactory2(FX.DXGI_CREATE_FACTORY_DEBUG, FX.__uuidof(), (void**)dxgiFactory2.GetAddressOf()); - - DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default; - dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; - dxgiSwapChainDesc1.BufferCount = 2; - dxgiSwapChainDesc1.Flags = 0; - dxgiSwapChainDesc1.Format = DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM; - dxgiSwapChainDesc1.Width = 0; - dxgiSwapChainDesc1.Height = 0; - dxgiSwapChainDesc1.SampleDesc = new DXGI_SAMPLE_DESC(count: 1, quality: 0); - dxgiSwapChainDesc1.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH; - dxgiSwapChainDesc1.Stereo = 0; - dxgiSwapChainDesc1.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - - _ = dxgiFactory2.Get()->CreateSwapChainForHwnd( - (IUnknown*)d3D12CommandQueue.Get(), - hwnd, - &dxgiSwapChainDesc1, - null, - null, - dxgiSwapChain1); - } - - // Create the command allocator to use - fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator) - { - this.d3D12Device.Get()->CreateCommandAllocator( - D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, - FX.__uuidof(), - (void**)d3D12CommandAllocator); - } - - // Create the reusable command list to copy data to the back buffers - fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) - { - this.d3D12Device.Get()->CreateCommandList( - 0, - D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, - d3D12CommandAllocator, - null, - FX.__uuidof(), - (void**)d3D12GraphicsCommandList); - } - - // Close the command list to prepare it for future use - this.d3D12GraphicsCommandList.Get()->Close(); + _ = d3D12Device.Get()->CreateCommandQueue( + &d3D12CommandQueueDesc, + FX.__uuidof(), + (void**)d3D12CommandQueue); } - /// - public override unsafe void OnResize() + // Create the direct fence + fixed (ID3D12Fence** d3D12Fence = this.d3D12Fence) { - this.isResizePending = true; + _ = this.d3D12Device.Get()->CreateFence( + 0, + D3D12_FENCE_FLAGS.D3D12_FENCE_FLAG_NONE, + FX.__uuidof(), + (void**)d3D12Fence); } - /// - /// Applies the actual resize logic that was scheduled from . - /// - private unsafe void ApplyResize() + // Create the swap chain to display frames + fixed (IDXGISwapChain1** dxgiSwapChain1 = this.dxgiSwapChain1) { - this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); + using ComPtr dxgiFactory2 = default; - // Wait for the fence again to ensure there are no pending operations - this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); + _ = FX.CreateDXGIFactory2(FX.DXGI_CREATE_FACTORY_DEBUG, FX.__uuidof(), (void**)dxgiFactory2.GetAddressOf()); - this.nextD3D12FenceValue++; + DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default; + dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; + dxgiSwapChainDesc1.BufferCount = 2; + dxgiSwapChainDesc1.Flags = 0; + dxgiSwapChainDesc1.Format = DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM; + dxgiSwapChainDesc1.Width = 0; + dxgiSwapChainDesc1.Height = 0; + dxgiSwapChainDesc1.SampleDesc = new DXGI_SAMPLE_DESC(count: 1, quality: 0); + dxgiSwapChainDesc1.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH; + dxgiSwapChainDesc1.Stereo = 0; + dxgiSwapChainDesc1.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - // Dispose the old buffers before resizing the buffer - this.d3D12Resource0.Dispose(); - this.d3D12Resource1.Dispose(); - - // Resize the swap chain buffers - this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0); - - // Get the index of the initial back buffer - using (ComPtr dxgiSwapChain3 = default) - { - _ = this.dxgiSwapChain1.CopyTo(dxgiSwapChain3.GetAddressOf()); - - this.currentBufferIndex = dxgiSwapChain3.Get()->GetCurrentBackBufferIndex(); - } - - // Retrieve the back buffers for the swap chain - fixed (ID3D12Resource** d3D12Resource0 = this.d3D12Resource0) - fixed (ID3D12Resource** d3D12Resource1 = this.d3D12Resource1) - { - _ = dxgiSwapChain1.Get()->GetBuffer(0, FX.__uuidof(), (void**)d3D12Resource0); - _ = dxgiSwapChain1.Get()->GetBuffer(1, FX.__uuidof(), (void**)d3D12Resource1); - } - - this.texture?.Dispose(); - - D3D12_RESOURCE_DESC d3D12Resource0Description = this.d3D12Resource0.Get()->GetDesc(); - - // Create the 2D texture to use to generate frames to display - this.texture = Gpu.Default.AllocateReadWriteTexture2D( - (int)d3D12Resource0Description.Width, - (int)d3D12Resource0Description.Height); + _ = dxgiFactory2.Get()->CreateSwapChainForHwnd( + (IUnknown*)d3D12CommandQueue.Get(), + hwnd, + &dxgiSwapChainDesc1, + null, + null, + dxgiSwapChain1); } - /// - public override unsafe void OnUpdate(TimeSpan time) + // Create the command allocator to use + fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator) { - if (this.isResizePending) - { - ApplyResize(); + this.d3D12Device.Get()->CreateCommandAllocator( + D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, + FX.__uuidof(), + (void**)d3D12CommandAllocator); + } - this.isResizePending = false; - } + // Create the reusable command list to copy data to the back buffers + fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) + { + this.d3D12Device.Get()->CreateCommandList( + 0, + D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, + d3D12CommandAllocator, + null, + FX.__uuidof(), + (void**)d3D12GraphicsCommandList); + } - // Generate the new frame - Gpu.Default.ForEach(this.texture!, this.shaderFactory(time)); + // Close the command list to prepare it for future use + this.d3D12GraphicsCommandList.Get()->Close(); + } - using ComPtr d3D12Resource = default; + /// + public override unsafe void OnResize() + { + this.isResizePending = true; + } - // Get the underlying ID3D12Resource pointer for the texture - _ = InteropServices.TryGetID3D12Resource(this.texture!, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + /// + /// Applies the actual resize logic that was scheduled from . + /// + private unsafe void ApplyResize() + { + this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); - // Get the target back buffer to update - ID3D12Resource* d3D12ResourceBackBuffer = this.currentBufferIndex switch - { - 0 => this.d3D12Resource0.Get(), - 1 => this.d3D12Resource1.Get(), - _ => null - }; + // Wait for the fence again to ensure there are no pending operations + this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); - this.currentBufferIndex ^= 1; + this.nextD3D12FenceValue++; - // Reset the command list and command allocator - this.d3D12CommandAllocator.Get()->Reset(); - this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null); + // Dispose the old buffers before resizing the buffer + this.d3D12Resource0.Dispose(); + this.d3D12Resource1.Dispose(); - D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[] - { - D3D12_RESOURCE_BARRIER.InitTransition( - d3D12Resource.Get(), - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE), - D3D12_RESOURCE_BARRIER.InitTransition( - d3D12ResourceBackBuffer, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST) - }; + // Resize the swap chain buffers + this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0); - // Transition the resources to COPY_DEST and COPY_SOURCE respectively - d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); + // Get the index of the initial back buffer + using (ComPtr dxgiSwapChain3 = default) + { + _ = this.dxgiSwapChain1.CopyTo(dxgiSwapChain3.GetAddressOf()); - // Copy the generated frame to the target back buffer - d3D12GraphicsCommandList.Get()->CopyResource(d3D12ResourceBackBuffer, d3D12Resource.Get()); + this.currentBufferIndex = dxgiSwapChain3.Get()->GetCurrentBackBufferIndex(); + } - d3D12ResourceBarriers[0] = D3D12_RESOURCE_BARRIER.InitTransition( + // Retrieve the back buffers for the swap chain + fixed (ID3D12Resource** d3D12Resource0 = this.d3D12Resource0) + fixed (ID3D12Resource** d3D12Resource1 = this.d3D12Resource1) + { + _ = dxgiSwapChain1.Get()->GetBuffer(0, FX.__uuidof(), (void**)d3D12Resource0); + _ = dxgiSwapChain1.Get()->GetBuffer(1, FX.__uuidof(), (void**)d3D12Resource1); + } + + this.texture?.Dispose(); + + D3D12_RESOURCE_DESC d3D12Resource0Description = this.d3D12Resource0.Get()->GetDesc(); + + // Create the 2D texture to use to generate frames to display + this.texture = Gpu.Default.AllocateReadWriteTexture2D( + (int)d3D12Resource0Description.Width, + (int)d3D12Resource0Description.Height); + } + + /// + public override unsafe void OnUpdate(TimeSpan time) + { + if (this.isResizePending) + { + ApplyResize(); + + this.isResizePending = false; + } + + // Generate the new frame + Gpu.Default.ForEach(this.texture!, this.shaderFactory(time)); + + using ComPtr d3D12Resource = default; + + // Get the underlying ID3D12Resource pointer for the texture + _ = InteropServices.TryGetID3D12Resource(this.texture!, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + + // Get the target back buffer to update + ID3D12Resource* d3D12ResourceBackBuffer = this.currentBufferIndex switch + { + 0 => this.d3D12Resource0.Get(), + 1 => this.d3D12Resource1.Get(), + _ => null + }; + + this.currentBufferIndex ^= 1; + + // Reset the command list and command allocator + this.d3D12CommandAllocator.Get()->Reset(); + this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null); + + D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[] + { + D3D12_RESOURCE_BARRIER.InitTransition( d3D12Resource.Get(), - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS); - - d3D12ResourceBarriers[1] = D3D12_RESOURCE_BARRIER.InitTransition( + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE), + D3D12_RESOURCE_BARRIER.InitTransition( d3D12ResourceBackBuffer, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON); + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST) + }; - // Transition the resources back to COMMON and UNORDERED_ACCESS respectively - d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); + // Transition the resources to COPY_DEST and COPY_SOURCE respectively + d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); - d3D12GraphicsCommandList.Get()->Close(); + // Copy the generated frame to the target back buffer + d3D12GraphicsCommandList.Get()->CopyResource(d3D12ResourceBackBuffer, d3D12Resource.Get()); - // Execute the command list to perform the copy - this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)d3D12GraphicsCommandList.GetAddressOf()); - this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); + d3D12ResourceBarriers[0] = D3D12_RESOURCE_BARRIER.InitTransition( + d3D12Resource.Get(), + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS); - // Present the new frame - this.dxgiSwapChain1.Get()->Present(0, 0); + d3D12ResourceBarriers[1] = D3D12_RESOURCE_BARRIER.InitTransition( + d3D12ResourceBackBuffer, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON); - if (this.nextD3D12FenceValue > this.d3D12Fence.Get()->GetCompletedValue()) - { - this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); - } + // Transition the resources back to COMMON and UNORDERED_ACCESS respectively + d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); - this.nextD3D12FenceValue++; + d3D12GraphicsCommandList.Get()->Close(); + + // Execute the command list to perform the copy + this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)d3D12GraphicsCommandList.GetAddressOf()); + this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); + + // Present the new frame + this.dxgiSwapChain1.Get()->Present(0, 0); + + if (this.nextD3D12FenceValue > this.d3D12Fence.Get()->GetCompletedValue()) + { + this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); } + + this.nextD3D12FenceValue++; } } diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs index af15cf6b..2dfe60da 100644 --- a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs +++ b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs @@ -1,28 +1,27 @@ using System; using TerraFX.Interop; -namespace ComputeSharp.SwapChain.Backend +namespace ComputeSharp.SwapChain.Backend; + +/// +/// A class representing a simple Win32 application. +/// +internal abstract class Win32Application { /// - /// A class representing a simple Win32 application. + /// Initializes the current application. /// - internal abstract class Win32Application - { - /// - /// Initializes the current application. - /// - /// The handle for the window. - public abstract void OnInitialize(HWND hwnd); + /// The handle for the window. + public abstract void OnInitialize(HWND hwnd); - /// - /// Resizes the current application. - /// - public abstract void OnResize(); + /// + /// Resizes the current application. + /// + public abstract void OnResize(); - /// - /// Updates the current application. - /// - /// The current time since the start of the application. - public abstract void OnUpdate(TimeSpan time); - } + /// + /// Updates the current application. + /// + /// The current time since the start of the application. + public abstract void OnUpdate(TimeSpan time); } diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs index 4cb84dac..3b002576 100644 --- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs +++ b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs @@ -7,95 +7,291 @@ using System.Threading; using TerraFX.Interop; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.SwapChain.Backend +namespace ComputeSharp.SwapChain.Backend; + +/// +/// A helper class to manage the creation and execution of Win32 applications. +/// +internal unsafe static class Win32ApplicationRunner { /// - /// A helper class to manage the creation and execution of Win32 applications. + /// Whether or not a resize operation is in progress. /// - internal unsafe static class Win32ApplicationRunner + private static bool isResizing = false; + + /// + /// Whether or not the application is currently paused. + /// + private static bool isPaused = false; + + /// + /// The for the application window. + /// + private static HWND hwnd; + + /// + /// The application being run. + /// + private static Win32Application application = null!; + + /// + /// The thread running the render loop. + /// + private static Thread renderThread = null!; + + /// + /// Runs a specified application and starts the main loop to update its state. + /// This is the entry point for a given application of type , and it should be + /// called as soon as the process is launched, excluding any other additional initialization needed. + /// To launch an application, simply add this line to the project being used: + /// Win32ApplicationRunner.Run<MyApplication>(); + /// + /// The type of application being launched. + /// The exit code for the application. + public static int Run(Win32Application application) { - /// - /// Whether or not a resize operation is in progress. - /// - private static bool isResizing = false; + Win32ApplicationRunner.application = application; - /// - /// Whether or not the application is currently paused. - /// - private static bool isPaused = false; + IntPtr hInstance = FX.GetModuleHandleW(null); - /// - /// The for the application window. - /// - private static HWND hwnd; - - /// - /// The application being run. - /// - private static Win32Application application = null!; - - /// - /// The thread running the render loop. - /// - private static Thread renderThread = null!; - - /// - /// Runs a specified application and starts the main loop to update its state. - /// This is the entry point for a given application of type , and it should be - /// called as soon as the process is launched, excluding any other additional initialization needed. - /// To launch an application, simply add this line to the project being used: - /// Win32ApplicationRunner.Run<MyApplication>(); - /// - /// The type of application being launched. - /// The exit code for the application. - public static int Run(Win32Application application) + fixed (char* name = Assembly.GetExecutingAssembly().FullName) + fixed (char* windowTitle = application.GetType().ToString()) { - Win32ApplicationRunner.application = application; - - IntPtr hInstance = FX.GetModuleHandleW(null); - - fixed (char* name = Assembly.GetExecutingAssembly().FullName) - fixed (char* windowTitle = application.GetType().ToString()) + // Initialize the window class + WNDCLASSEXW windowClassEx = new() { - // Initialize the window class - WNDCLASSEXW windowClassEx = new() + cbSize = (uint)sizeof(WNDCLASSEXW), + style = FX.CS_HREDRAW | FX.CS_VREDRAW, + lpfnWndProc = &WindowProc, + hInstance = hInstance, + hCursor = FX.LoadCursorW(IntPtr.Zero, FX.MAKEINTRESOURCE(32512)), + lpszClassName = (ushort*)name + }; + + // Register the window class + _ = FX.RegisterClassExW(&windowClassEx); + + Rectangle windowRect = new(0, 0, 1280, 720); + + // Set the target window size + _ = FX.AdjustWindowRect((RECT*)&windowRect, FX.WS_OVERLAPPEDWINDOW, FX.FALSE); + + uint + height = (uint)(windowRect.Bottom - windowRect.Top), + width = (uint)(windowRect.Right - windowRect.Left); + + // Create the window and store a handle to it + hwnd = FX.CreateWindowExW( + 0, + windowClassEx.lpszClassName, + (ushort*)windowTitle, + FX.WS_OVERLAPPEDWINDOW, + FX.CW_USEDEFAULT, + FX.CW_USEDEFAULT, + (int)width, + (int)height, + HWND.NULL, + HMENU.NULL, + hInstance, + (void*)GCHandle.ToIntPtr(GCHandle.Alloc(application)) + ); + + MARGINS margins = default; + margins.cxLeftWidth = -1; + margins.cxRightWidth = -1; + margins.cyTopHeight = -1; + margins.cyBottomHeight = -1; + + _ = FX.DwmExtendFrameIntoClientArea(hwnd, &margins); + } + + // Initialize the application + application.OnInitialize(hwnd); + + // Display the window + _ = FX.ShowWindow(hwnd, FX.SW_SHOWDEFAULT); + + MSG msg = default; + + // Setup the render thread that enables smooth resizing of the window + renderThread = new Thread(static args => + { + (Win32Application application, CancellationToken token) = ((Win32Application, CancellationToken))args!; + + Stopwatch + startStopwatch = Stopwatch.StartNew(), + frameStopwatch = Stopwatch.StartNew(); + + const long targetFrameTimeInTicksFor60fps = 166666; + + while (!token.IsCancellationRequested) + { + if (frameStopwatch.ElapsedTicks >= targetFrameTimeInTicksFor60fps) { - cbSize = (uint)sizeof(WNDCLASSEXW), - style = FX.CS_HREDRAW | FX.CS_VREDRAW, - lpfnWndProc = &WindowProc, - hInstance = hInstance, - hCursor = FX.LoadCursorW(IntPtr.Zero, FX.MAKEINTRESOURCE(32512)), - lpszClassName = (ushort*)name - }; + frameStopwatch.Restart(); - // Register the window class - _ = FX.RegisterClassExW(&windowClassEx); + application.OnUpdate(startStopwatch.Elapsed); + } + } + }); - Rectangle windowRect = new(0, 0, 1280, 720); + CancellationTokenSource tokenSource = new(); - // Set the target window size - _ = FX.AdjustWindowRect((RECT*)&windowRect, FX.WS_OVERLAPPEDWINDOW, FX.FALSE); + renderThread.Start((application, tokenSource.Token)); - uint - height = (uint)(windowRect.Bottom - windowRect.Top), - width = (uint)(windowRect.Right - windowRect.Left); + // Process any messages in the queue + while (msg.message != FX.WM_QUIT) + { + if (FX.PeekMessageW(&msg, HWND.NULL, 0, 0, FX.PM_REMOVE) != 0) + { + _ = FX.TranslateMessage(&msg); + _ = FX.DispatchMessageW(&msg); + } + else if (isPaused) + { + Thread.Sleep(100); + } + } - // Create the window and store a handle to it - hwnd = FX.CreateWindowExW( - 0, - windowClassEx.lpszClassName, - (ushort*)windowTitle, - FX.WS_OVERLAPPEDWINDOW, - FX.CW_USEDEFAULT, - FX.CW_USEDEFAULT, - (int)width, - (int)height, - HWND.NULL, - HMENU.NULL, - hInstance, - (void*)GCHandle.ToIntPtr(GCHandle.Alloc(application)) - ); + tokenSource.Cancel(); + renderThread.Join(); + + // Return this part of the WM_QUIT message to Windows + return (int)msg.wParam; + } + + /// + /// Processes incoming messages for a window. + /// + /// A handle to the window. + /// The message. + /// Additional message information (the contents depend on the value of ). + /// Additional message information (the contents depend on the value of ). + /// The result of the message processing for the input message. + [UnmanagedCallersOnly] + private static nint WindowProc(IntPtr hwnd, uint uMsg, nuint wParam, nint lParam) + { + switch (uMsg) + { + // Change the paused state on window activation + case FX.WM_ACTIVATE: + { + if (FX.LOWORD(wParam) == FX.WA_INACTIVE) + { + isPaused = true; + } + else + { + isPaused = false; + } + return 0; + } + + // Change the paused state when ESC is pressed + case FX.WM_KEYDOWN: + { + if ((ConsoleKey)wParam == ConsoleKey.Escape) + { + + if (isPaused) + { + FX.SetCapture(hwnd); + } + else + { + FX.ReleaseCapture(); + } + + isPaused = !isPaused; + } + + return 0; + } + + // Window resize started + case FX.WM_ENTERSIZEMOVE: + { + isResizing = true; + + return 0; + } + + // Window resize completed + case FX.WM_EXITSIZEMOVE: + { + isResizing = false; + application.OnResize(); + + return 0; + } + + // Size update + case FX.WM_SIZE: + { + if (!isResizing && wParam != FX.SIZE_MINIMIZED) + { + application.OnResize(); + } + + return 0; + } + + // Size and position of the window (needed to enable the borderless mode) + case FX.WM_NCCALCSIZE: + { + return 0; + } + + // Enable dragging the window + case FX.WM_NCHITTEST: + { + POINT point; + RECT rect; + + _ = FX.GetCursorPos(&point); + _ = FX.GetWindowRect(hwnd, &rect); + + bool + isAtTop = Math.Abs(point.y - rect.top) < 12, + isAtRight = Math.Abs(point.x - rect.right) < 12, + isAtBottom = Math.Abs(point.y - rect.bottom) < 12, + isAtLeft = Math.Abs(point.x - rect.left) < 12; + + if (isAtTop) + { + if (isAtRight) return FX.HTTOPRIGHT; + if (isAtLeft) return FX.HTTOPLEFT; + return FX.HTTOP; + } + + if (isAtRight) + { + if (isAtTop) return FX.HTTOPRIGHT; + if (isAtBottom) return FX.HTBOTTOMRIGHT; + return FX.HTRIGHT; + } + + if (isAtBottom) + { + if (isAtRight) return FX.HTBOTTOMRIGHT; + if (isAtLeft) return FX.HTBOTTOMLEFT; + return FX.HTBOTTOM; + } + + if (isAtLeft) + { + if (isAtTop) return FX.HTTOPLEFT; + if (isAtBottom) return FX.HTBOTTOMLEFT; + return FX.HTLEFT; + } + + return FX.HTCAPTION; + } + + // Restore the drop shadow + case FX.WM_DWMCOMPOSITIONCHANGED: + { MARGINS margins = default; margins.cxLeftWidth = -1; margins.cxRightWidth = -1; @@ -103,215 +299,18 @@ namespace ComputeSharp.SwapChain.Backend margins.cyBottomHeight = -1; _ = FX.DwmExtendFrameIntoClientArea(hwnd, &margins); + + return 0; } - // Initialize the application - application.OnInitialize(hwnd); - - // Display the window - _ = FX.ShowWindow(hwnd, FX.SW_SHOWDEFAULT); - - MSG msg = default; - - // Setup the render thread that enables smooth resizing of the window - renderThread = new Thread(static args => + // Shutdown + case FX.WM_DESTROY: { - (Win32Application application, CancellationToken token) = ((Win32Application, CancellationToken))args!; - - Stopwatch - startStopwatch = Stopwatch.StartNew(), - frameStopwatch = Stopwatch.StartNew(); - - const long targetFrameTimeInTicksFor60fps = 166666; - - while (!token.IsCancellationRequested) - { - if (frameStopwatch.ElapsedTicks >= targetFrameTimeInTicksFor60fps) - { - frameStopwatch.Restart(); - - application.OnUpdate(startStopwatch.Elapsed); - } - } - }); - - CancellationTokenSource tokenSource = new(); - - renderThread.Start((application, tokenSource.Token)); - - // Process any messages in the queue - while (msg.message != FX.WM_QUIT) - { - if (FX.PeekMessageW(&msg, HWND.NULL, 0, 0, FX.PM_REMOVE) != 0) - { - _ = FX.TranslateMessage(&msg); - _ = FX.DispatchMessageW(&msg); - } - else if (isPaused) - { - Thread.Sleep(100); - } + FX.PostQuitMessage(0); + return 0; } - - tokenSource.Cancel(); - - renderThread.Join(); - - // Return this part of the WM_QUIT message to Windows - return (int)msg.wParam; } - /// - /// Processes incoming messages for a window. - /// - /// A handle to the window. - /// The message. - /// Additional message information (the contents depend on the value of ). - /// Additional message information (the contents depend on the value of ). - /// The result of the message processing for the input message. - [UnmanagedCallersOnly] - private static nint WindowProc(IntPtr hwnd, uint uMsg, nuint wParam, nint lParam) - { - switch (uMsg) - { - // Change the paused state on window activation - case FX.WM_ACTIVATE: - { - if (FX.LOWORD(wParam) == FX.WA_INACTIVE) - { - isPaused = true; - } - else - { - isPaused = false; - } - return 0; - } - - // Change the paused state when ESC is pressed - case FX.WM_KEYDOWN: - { - if ((ConsoleKey)wParam == ConsoleKey.Escape) - { - - if (isPaused) - { - FX.SetCapture(hwnd); - } - else - { - FX.ReleaseCapture(); - } - - isPaused = !isPaused; - } - - return 0; - } - - // Window resize started - case FX.WM_ENTERSIZEMOVE: - { - isResizing = true; - - return 0; - } - - // Window resize completed - case FX.WM_EXITSIZEMOVE: - { - isResizing = false; - application.OnResize(); - - return 0; - } - - // Size update - case FX.WM_SIZE: - { - if (!isResizing && wParam != FX.SIZE_MINIMIZED) - { - application.OnResize(); - } - - return 0; - } - - // Size and position of the window (needed to enable the borderless mode) - case FX.WM_NCCALCSIZE: - { - return 0; - } - - // Enable dragging the window - case FX.WM_NCHITTEST: - { - POINT point; - RECT rect; - - _ = FX.GetCursorPos(&point); - _ = FX.GetWindowRect(hwnd, &rect); - - bool - isAtTop = Math.Abs(point.y - rect.top) < 12, - isAtRight = Math.Abs(point.x - rect.right) < 12, - isAtBottom = Math.Abs(point.y - rect.bottom) < 12, - isAtLeft = Math.Abs(point.x - rect.left) < 12; - - if (isAtTop) - { - if (isAtRight) return FX.HTTOPRIGHT; - if (isAtLeft) return FX.HTTOPLEFT; - return FX.HTTOP; - } - - if (isAtRight) - { - if (isAtTop) return FX.HTTOPRIGHT; - if (isAtBottom) return FX.HTBOTTOMRIGHT; - return FX.HTRIGHT; - } - - if (isAtBottom) - { - if (isAtRight) return FX.HTBOTTOMRIGHT; - if (isAtLeft) return FX.HTBOTTOMLEFT; - return FX.HTBOTTOM; - } - - if (isAtLeft) - { - if (isAtTop) return FX.HTTOPLEFT; - if (isAtBottom) return FX.HTBOTTOMLEFT; - return FX.HTLEFT; - } - - return FX.HTCAPTION; - } - - // Restore the drop shadow - case FX.WM_DWMCOMPOSITIONCHANGED: - { - MARGINS margins = default; - margins.cxLeftWidth = -1; - margins.cxRightWidth = -1; - margins.cyTopHeight = -1; - margins.cyBottomHeight = -1; - - _ = FX.DwmExtendFrameIntoClientArea(hwnd, &margins); - - return 0; - } - - // Shutdown - case FX.WM_DESTROY: - { - FX.PostQuitMessage(0); - return 0; - } - } - - return FX.DefWindowProcW(hwnd, uMsg, wParam, lParam); - } + return FX.DefWindowProcW(hwnd, uMsg, wParam, lParam); } -} \ No newline at end of file +} diff --git a/samples/ComputeSharp.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs index 3019f673..a680b0f5 100644 --- a/samples/ComputeSharp.SwapChain/Program.cs +++ b/samples/ComputeSharp.SwapChain/Program.cs @@ -6,70 +6,69 @@ using System.Runtime.CompilerServices; using ComputeSharp.SwapChain.Backend; using ComputeSharp.SwapChain.Shaders; -namespace ComputeSharp.SwapChain +namespace ComputeSharp.SwapChain; + +class Program { - class Program + /// + /// A texture for \Textures\RustyMetal.png. + /// + private static readonly IReadOnlyTexture2D RustyMetal = LoadTexture(); + + /// + /// The mapping of available samples to choose from. + /// + private static readonly Win32Application[] Samples = new Win32Application[] { - /// - /// A texture for \Textures\RustyMetal.png. - /// - private static readonly IReadOnlyTexture2D RustyMetal = LoadTexture(); + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds)), + new SwapChainApplication(static time => new((float)time.TotalSeconds, RustyMetal)) + }; - /// - /// The mapping of available samples to choose from. - /// - private static readonly Win32Application[] Samples = new Win32Application[] + static void Main() + { + Console.WriteLine("Available samples:"); + Console.WriteLine(); + + for (int i = 0; i < Samples.Length; i++) { - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds)), - new SwapChainApplication(static time => new((float)time.TotalSeconds, RustyMetal)) - }; - - static void Main() - { - Console.WriteLine("Available samples:"); - Console.WriteLine(); - - for (int i = 0; i < Samples.Length; i++) - { - Console.WriteLine($"{i}: {Samples[i].GetType().GenericTypeArguments[0].Name}"); - } - - Console.WriteLine(); - - int index; - - do - { - Console.Write("Enter the index of the sample to run: "); - } - while (!int.TryParse(Console.ReadLine(), out index)); - - Console.WriteLine(); - Console.WriteLine($"Starting {Samples[index].GetType().GenericTypeArguments[0].Name}..."); - - Win32ApplicationRunner.Run(Samples[index]); + Console.WriteLine($"{i}: {Samples[i].GetType().GenericTypeArguments[0].Name}"); } - /// - /// Allocates a new instance with the specified texture data. - /// - /// The name of the texture to load. - /// A texture with the data from the image at the specified name. - [Pure] - private static ReadOnlyTexture2D LoadTexture([CallerMemberName] string name = null!) - { - string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Textures", $"{name}.png"); + Console.WriteLine(); - return Gpu.Default.LoadReadOnlyTexture2D(filename); + int index; + + do + { + Console.Write("Enter the index of the sample to run: "); } + while (!int.TryParse(Console.ReadLine(), out index)); + + Console.WriteLine(); + Console.WriteLine($"Starting {Samples[index].GetType().GenericTypeArguments[0].Name}..."); + + Win32ApplicationRunner.Run(Samples[index]); + } + + /// + /// Allocates a new instance with the specified texture data. + /// + /// The name of the texture to load. + /// A texture with the data from the image at the specified name. + [Pure] + private static ReadOnlyTexture2D LoadTexture([CallerMemberName] string name = null!) + { + string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Textures", $"{name}.png"); + + return Gpu.Default.LoadReadOnlyTexture2D(filename); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs index 64ac86c2..a68e508e 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs @@ -1,69 +1,68 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// A shader creating an abstract and colorful animation. +/// Ported from . +/// Created by Benoit Marini. +/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +/// +[AutoConstructor] +internal readonly partial struct ColorfulInfinity : IPixelShader { /// - /// A shader creating an abstract and colorful animation. - /// Ported from . - /// Created by Benoit Marini. - /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// The current time since the start of the application. /// - [AutoConstructor] - internal readonly partial struct ColorfulInfinity : IPixelShader + public readonly float time; + + /// + /// The total number of layers for the final animation. + /// + private const float NumberOfLayers = 16.0f; + + /// + /// The number of iterations to calculate a texel value. + /// + private const int NumberOfIterations = 23; + + /// + /// Makes some magic happen. + /// + private float4 Tex(float3 p) { - /// - /// The current time since the start of the application. - /// - public readonly float time; + float t = time + 78.0f; + float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f)); + float4 dec = + new float4(1.0f, 0.9f, 0.1f, 0.15f) + + new float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f)); - /// - /// The total number of layers for the final animation. - /// - private const float NumberOfLayers = 16.0f; - - /// - /// The number of iterations to calculate a texel value. - /// - private const int NumberOfIterations = 23; - - /// - /// Makes some magic happen. - /// - private float4 Tex(float3 p) + for (int i = 0; i++ < NumberOfIterations;) { - float t = time + 78.0f; - float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f)); - float4 dec = - new float4(1.0f, 0.9f, 0.1f, 0.15f) + - new float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f)); - - for (int i = 0; i++ < NumberOfIterations;) - { - o.XZYW = Hlsl.Abs(o / Hlsl.Dot(o, o) - dec); - } - - return o; + o.XZYW = Hlsl.Abs(o / Hlsl.Dot(o, o) - dec); } - /// - public float4 Execute() + return o; + } + + /// + public float4 Execute() + { + float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; + float3 col = 0; + float t = time * 0.3f; + + for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers) { - float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; - float3 col = 0; - float t = time * 0.3f; + float d = Hlsl.Frac(i + t); + float s = Hlsl.Lerp(5.0f, 0.5f, d); + float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d); - for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers) - { - float d = Hlsl.Frac(i + t); - float s = Hlsl.Lerp(5.0f, 0.5f, d); - float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d); - - col += Tex(new float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f; - } - - col /= NumberOfLayers; - col *= new float3(2, 1.0f, 2.0f); - col = Hlsl.Pow(col, 0.5f); - - return new(col.X, col.Y, col.Z, 1.0f); + col += Tex(new float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f; } + + col /= NumberOfLayers; + col *= new float3(2, 1.0f, 2.0f); + col = Hlsl.Pow(col, 0.5f); + + return new(col.X, col.Y, col.Z, 1.0f); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/ContouredLayers.cs b/samples/ComputeSharp.SwapChain/Shaders/ContouredLayers.cs index a9698767..d730bb65 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/ContouredLayers.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/ContouredLayers.cs @@ -1,197 +1,196 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// Constructing some concise contoured layers, then applying various edge and shading effects to produce some faux depth. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct ContouredLayers : IPixelShader { /// - /// Constructing some concise contoured layers, then applying various edge and shading effects to produce some faux depth. - /// Ported from . - /// Created by Shane. + /// The current time Hlsl.Since the start of the application. /// - [AutoConstructor] - internal readonly partial struct ContouredLayers : IPixelShader + public readonly float time; + + /// + /// The background texture to sample. + /// + public readonly IReadOnlyTexture2D texture; + + // float3 to float hash. + private static float Hash21(float2 p) { - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))) * 45758.5453f); + } - /// - /// The background texture to sample. - /// - public readonly IReadOnlyTexture2D texture; + // float2 to float2 hash. + private float2 Hash22(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(1, 113))); - // float3 to float hash. - private static float Hash21(float2 p) + p = Hlsl.Frac(new float2(262144, 32768) * n); + + return Hlsl.Sin(p * 6.2831853f + time); + } + + // float2 to float2 hash. + private static float2 Hash22B(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + + return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; + } + + // Smooth 2D noise + private static float Noise2D(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22B(i), p); + v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); + + p = p * p * (3.0f - 2.0f * p); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + // Based on IQ's gradient noise formula. + private float Noise2D3G(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22(i), p); + v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); + + p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + // Map function with noise layers + private float MapNoise(float3 p, float i) + { + return Noise2D3G(p.XY * 3.0f) * 0.66f + Noise2D3G(p.XY * 6.0f) * 0.34f + i / 10.0f * 1.0f - 0.15f; + } + + // 2D derivative function. + private float3 GetNormal(in float3 p, float m, float i) + { + float2 e = new(0.001f, 0); + + return new float3(m - MapNoise(p - e.XYY, i), m - MapNoise(p - e.YXY, i), 0.0f) / e.X * 1.4142f; + } + + // The map layer and its derivative + private float4 MapLayer(in float3 p, float i) + { + float4 d = default; + + d.X = MapNoise(p, i); + d.YZW = GetNormal(p, d.X, i); + + return d; + } + + // Layer color. Based on the shade, layer number and smoothing factor. + private float3 GetColor(float2 p, float sh, float fi) + { + float3 tx = texture[p + Hash21(new float2(sh, fi))].XYZ; + + tx *= tx; + + float3 col; + + col = (float3)1.0 * (1.0f - 0.75f / (1.0f + sh * sh * 2.0f)); + col = Hlsl.Min(col * tx * 3.0f, 1.0f); + + return col; + } + + // A hatch-like algorithm, or a stipple... or some kind of textured pattern. + private float Hatch(float2 p, float res) + { + p *= res / 16.0f; + + float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); + + float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); + if (hRnd > 0.66f) hatch = hRnd; + + hatch = hatch * 0.75f + 0.5f; + + return hatch; + } + + /// + public float4 Execute() + { + float2 fragCoord = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float res = Hlsl.Min(DispatchSize.Y, 700.0f); + float2 uv = (fragCoord - (float2)DispatchSize.XY * 0.5f) / res; + float sf = 1.0f / DispatchSize.Y; + float3 col = GetColor(uv, 0.0f, 0.0f); + float pL = 0.0f; + float hatch = Hatch(uv, res); + + col *= hatch; + + const int lNum = 5; + float flNum = lNum; + + for (int i = 0; i < lNum; i++) { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))) * 45758.5453f); + float fi = i; + + hatch = Hatch(uv + Hlsl.Sin(new float2(41.0f, 289.0f) * (fi + 1.0f)), res); + + float4 c = MapLayer(new float3(uv, 1.0f), fi); + float4 cSh = MapLayer(new float3(uv - new float2(0.03f, -0.03f) * ((flNum - fi) / flNum * 0.5f + 0.5f), 1.0f), fi); + float sh = (fi + 1.0f) / (flNum); + float3 lCol = GetColor(uv, sh, fi + 1.0f); + float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f)); + float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW); + float diff = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f); + + diff *= 2.5f; + + float3 eCol = lCol * (diff + 1.0f); + float sfL = sf * Hlsl.Length(c.YZX) * 2.0f; + float sfLSh = sf * Hlsl.Length(cSh.YZX) * 6.0f; + const float shF = 0.5f; + + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f); + col = Hlsl.Lerp(col, eCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.003f))); + col = Hlsl.Lerp(col, lCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.006f))); + + pL = c.X; } - // float2 to float2 hash. - private float2 Hash22(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(1, 113))); + col *= Hlsl.Lerp(new float3(1.8f, 1, 0.7f).ZYX, new float3(1.8f, 1, 0.7f).XZY, Noise2D(uv * 2.0f)); - p = Hlsl.Frac(new float2(262144, 32768) * n); + float3 rn3 = Noise2D(uv * DispatchSize.Y / 1.0f + 1.7f) - Noise2D(uv * DispatchSize.Y / 1.0f + 3.4f); - return Hlsl.Sin(p * 6.2831853f + time); - } + col *= 0.93f + 0.07f * rn3.XYZ + 0.07f * Hlsl.Dot(rn3, new float3(0.299f, 0.587f, 0.114f)); - // float2 to float2 hash. - private static float2 Hash22B(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + uv = fragCoord / DispatchSize.XY; - return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; - } + col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f); - // Smooth 2D noise - private static float Noise2D(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22B(i), p); - v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); - - p = p * p * (3.0f - 2.0f * p); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Based on IQ's gradient noise formula. - private float Noise2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22(i), p); - v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); - - p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Map function with noise layers - private float MapNoise(float3 p, float i) - { - return Noise2D3G(p.XY * 3.0f) * 0.66f + Noise2D3G(p.XY * 6.0f) * 0.34f + i / 10.0f * 1.0f - 0.15f; - } - - // 2D derivative function. - private float3 GetNormal(in float3 p, float m, float i) - { - float2 e = new(0.001f, 0); - - return new float3(m - MapNoise(p - e.XYY, i), m - MapNoise(p - e.YXY, i), 0.0f) / e.X * 1.4142f; - } - - // The map layer and its derivative - private float4 MapLayer(in float3 p, float i) - { - float4 d = default; - - d.X = MapNoise(p, i); - d.YZW = GetNormal(p, d.X, i); - - return d; - } - - // Layer color. Based on the shade, layer number and smoothing factor. - private float3 GetColor(float2 p, float sh, float fi) - { - float3 tx = texture[p + Hash21(new float2(sh, fi))].XYZ; - - tx *= tx; - - float3 col; - - col = (float3)1.0 * (1.0f - 0.75f / (1.0f + sh * sh * 2.0f)); - col = Hlsl.Min(col * tx * 3.0f, 1.0f); - - return col; - } - - // A hatch-like algorithm, or a stipple... or some kind of textured pattern. - private float Hatch(float2 p, float res) - { - p *= res / 16.0f; - - float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); - - float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); - if (hRnd > 0.66f) hatch = hRnd; - - hatch = hatch * 0.75f + 0.5f; - - return hatch; - } - - /// - public float4 Execute() - { - float2 fragCoord = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float res = Hlsl.Min(DispatchSize.Y, 700.0f); - float2 uv = (fragCoord - (float2)DispatchSize.XY * 0.5f) / res; - float sf = 1.0f / DispatchSize.Y; - float3 col = GetColor(uv, 0.0f, 0.0f); - float pL = 0.0f; - float hatch = Hatch(uv, res); - - col *= hatch; - - const int lNum = 5; - float flNum = lNum; - - for (int i = 0; i < lNum; i++) - { - float fi = i; - - hatch = Hatch(uv + Hlsl.Sin(new float2(41.0f, 289.0f) * (fi + 1.0f)), res); - - float4 c = MapLayer(new float3(uv, 1.0f), fi); - float4 cSh = MapLayer(new float3(uv - new float2(0.03f, -0.03f) * ((flNum - fi) / flNum * 0.5f + 0.5f), 1.0f), fi); - float sh = (fi + 1.0f) / (flNum); - float3 lCol = GetColor(uv, sh, fi + 1.0f); - float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f)); - float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW); - float diff = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f); - - diff *= 2.5f; - - float3 eCol = lCol * (diff + 1.0f); - float sfL = sf * Hlsl.Length(c.YZX) * 2.0f; - float sfLSh = sf * Hlsl.Length(cSh.YZX) * 6.0f; - const float shF = 0.5f; - - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f); - col = Hlsl.Lerp(col, eCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.003f))); - col = Hlsl.Lerp(col, lCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.006f))); - - pL = c.X; - } - - col *= Hlsl.Lerp(new float3(1.8f, 1, 0.7f).ZYX, new float3(1.8f, 1, 0.7f).XZY, Noise2D(uv * 2.0f)); - - float3 rn3 = Noise2D(uv * DispatchSize.Y / 1.0f + 1.7f) - Noise2D(uv * DispatchSize.Y / 1.0f + 3.4f); - - col *= 0.93f + 0.07f * rn3.XYZ + 0.07f * Hlsl.Dot(rn3, new float3(0.299f, 0.587f, 0.114f)); - - uv = fragCoord / DispatchSize.XY; - - col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f); - - return new float4(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } + return new float4(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/ExtrudedTruchetPattern.cs b/samples/ComputeSharp.SwapChain/Shaders/ExtrudedTruchetPattern.cs index 8ce68647..3956f1c9 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/ExtrudedTruchetPattern.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/ExtrudedTruchetPattern.cs @@ -1,293 +1,292 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// A basic extruded square grid-based blobby Truchet pattern. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct ExtrudedTruchetPattern : IPixelShader { /// - /// A basic extruded square grid-based blobby Truchet pattern. - /// Ported from . - /// Created by Shane. + /// The current time since the start of the application. /// - [AutoConstructor] - internal readonly partial struct ExtrudedTruchetPattern : IPixelShader + public readonly float time; + + /// + /// Curve shape - Round: 0, Semi-round: 1, Octagonal: 2, Superellipse: 3, Straight: 4. + /// + private static readonly int SHAPE = 0; + + /// + /// Object ID: Either the back plane or the metaballs. + /// + private static int objID; + + // Standard 2D rotation formula. + private static float2x2 Rotate2x2(float a) { - /// - /// The current time since the start of the application. - /// - public readonly float time; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - /// - /// Curve shape - Round: 0, Semi-round: 1, Octagonal: 2, Superellipse: 3, Straight: 4. - /// - private static readonly int SHAPE = 0; + return new(c, -s, s, c); + } - /// - /// Object ID: Either the back plane or the metaballs. - /// - private static int objID; + // IQ's float2 to float hash. + private static float Hash21(float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); + } - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(float a) + // Various distance metrics. + private static float Distance(float2 p) + { + if (SHAPE == 0) { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, -s, s, c); + return Hlsl.Length(p); } + else p = Hlsl.Abs(p); - // IQ's float2 to float hash. - private static float Hash21(float2 p) + switch (SHAPE) { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // Various distance metrics. - private static float Distance(float2 p) - { - if (SHAPE == 0) - { - return Hlsl.Length(p); - } - else p = Hlsl.Abs(p); - - switch (SHAPE) - { - case 1: return Hlsl.Max(Hlsl.Length(p), (p.X + p.Y) * 0.7071f + 0.015f); - case 2: return Hlsl.Max((p.X + p.Y) * 0.7071f, Hlsl.Max(p.X, p.Y)); - case 3: return Hlsl.Pow(Hlsl.Dot(Hlsl.Pow(p, 3), 1), 1.0f / 3.0f); - default: return (p.X + p.Y) * 0.7071f; - } - } - - // GLSL's mod function - private static float Mod(float x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - // A standard square grid 2D blobby Truchet routine: Render circles - // in opposite corners of a tile, reverse the pattern on alternate - // checker tiles, and randomly rotate. - private static float Truchet(float2 p) - { - const float sc = 0.5f; - float2 ip = Hlsl.Floor(p / sc) + 0.5f; - - p -= ip * sc; - - float rnd = Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(ip, new float2(1, 113))) * 45758.5453f); - - if (rnd < .5) p.Y = -p.Y; - - float d = Hlsl.Min(Distance(p - 0.5f * sc), Distance(p + 0.5f * sc)) - 0.5f * sc; - - if (SHAPE == 4) - { - d += (0.5f - 0.5f / Hlsl.Sqrt(2.0f)) * sc; - } - - if (rnd < 0.5f) d = -d; - if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) d = -d; - - return d - 0.03f; - } - - // The scene's distance function: There'd be faster ways to do this, but it's - // more readable this way. Plus, this is a pretty simple scene, so it's - // efficient enough. - private static float M(float3 p) - { - float fl = -p.Z; - float obj = Truchet(p.XY); - - obj = Hlsl.Max(obj, Hlsl.Abs(p.Z) - 0.125f) - Hlsl.SmoothStep(0.03f, 0.25f, -obj) * 0.1f; - - float studs = 1e5f; - const float sc = 0.5f; - float2 q = p.XY + 0.5f * sc; - float2 iq = Hlsl.Floor(q / sc) + 0.5f; - - q -= iq * sc; - - if (Mod(iq.X + iq.Y, 2.0f) > 0.5f) - { - studs = Hlsl.Max(Hlsl.Length(q) - 0.1f * sc - 0.02f, Hlsl.Abs(p.Z) - 0.26f); - } - - objID = fl < obj && fl < studs ? 0 : obj < studs ? 1 : 2; - - return Hlsl.Min(Hlsl.Min(fl, obj), studs); - } - - // Cheap shadows are hard. In fact, I'd almost say, shadowing particular scenes with limited - // iterations is impossible... However, I'd be very grateful if someone could prove me wrong. :) - private static float SoftShadow(float3 ro, float3 lp, float3 n, float k) - { - const int iter = 24; - - ro += n * 0.0015f; - - float3 rd = lp - ro; - float shade = 1.0f; - float t = 0; - float end = Hlsl.Max(Hlsl.Length(rd), 0.0001f); - - rd /= end; - - for (int i = 0; i < iter; i++) - { - float d = M(ro + rd * t); - - shade = Hlsl.Min(shade, k * d / t); - t += Hlsl.Clamp(d, 0.01f, 0.25f); - - if (d < 0.0f || t > end) break; - } - - return Hlsl.Max(shade, 0.0f); - } - - - // I keep a collection of occlusion routines... OK, that sounded really nerdy. :) - // Anyway, I like this one. I'm assuHlsl.Ming it's based on IQ's original. - private float CalculateAO(in float3 p, in float3 n) - { - float sca = 2.0f, occ = 0.0f; - - for (int i = (int)Hlsl.Min(time, 0f); i < 5; i++) - { - float hr = (i + 1f) * 0.15f / 5.0f; - float d = M(p + n * hr); - occ += (hr - d) * sca; - sca *= 0.7f; - - if (sca > 1e5f) break; - } - - return Hlsl.Clamp(1.0f - occ, 0.0f, 1.0f); - } - - // Standard normal function. - private static float3 Normal(in float3 p) - { - float2 e = new(0.001f, 0); - - return Hlsl.Normalize(new float3( - M(p + e.XYY) - M(p - e.XYY), - M(p + e.YXY) - M(p - e.YXY), - M(p + e.YYX) - M(p - e.YYX))); - } - - /// - public float4 Execute() - { - int2 coords = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float2 u = (coords - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; - float3 - r = Hlsl.Normalize(new float3(u, 1)), - o = new(0, time / 2.0f, -3), - l = o + new float3(0.25f, 0.25f, 2.0f); - - r.YZ = Hlsl.Mul(Rotate2x2(0.15f), r.YZ); - r.XZ = Hlsl.Mul(Rotate2x2(-Hlsl.Cos(time * 3.14159f / 32.0f) / 8.0f), r.XZ); - r.XY = Hlsl.Mul(Rotate2x2(Hlsl.Sin(time * 3.14159f / 32.0f) / 8.0f), r.XY); - - float d, t = Hash21(r.XY * 57.0f + Hlsl.Frac(time)) * 0.5f, glow = 0; - - for (int i = 0; i < 96; i++) - { - d = M(o + r * t); - - if (Hlsl.Abs(d) < .001) break; - - t += d * 0.7f; - glow += 0.2f / (1.0f + Hlsl.Abs(d) * 5.0f); - } - - int gObjID = objID; - float3 p = o + r * t, n = Normal(p); - float2 uv = p.XY; - float sc = 0.5f; - float2 iuv = Hlsl.Floor(uv / sc) + 0.5f; - - uv -= iuv * sc; - - float2 uv2 = p.XY + 0.5f * sc; - float2 iuv2 = Hlsl.Floor(uv2 / sc) + 0.5f; - - uv2 -= iuv2 * sc; - - float bord = Hlsl.Max(Hlsl.Abs(uv.X), Hlsl.Abs(uv.Y)) - 0.5f * sc; - - bord = Hlsl.Abs(bord) - 0.002f; - d = Truchet(p.XY); - - float lSc = 20.0f; - float pat = (Hlsl.Abs(Hlsl.Frac((uv.X - uv.Y) * lSc - 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; - float pat2 = (Hlsl.Abs(Hlsl.Frac((uv.X + uv.Y) * lSc + 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; - float sf = Hlsl.Dot(Hlsl.Sin(p.XY - Hlsl.Cos(p.YX * 2.0f)), 0.5f); - float sf2 = Hlsl.Dot(Hlsl.Sin(p.XY * 1.5f - Hlsl.Cos(p.YX * 3.0f)), 0.5f); - float4 col1 = Hlsl.Lerp(new float4(1, 0.75f, 0.6f, 0), new float4(1, 0.85f, 0.65f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf)); - float4 col2 = Hlsl.Lerp(new float4(0.4f, 0.7f, 1, 0), new float4(0.3f, 0.85f, 0.95f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf2) * 0.5f); - - col1 = Hlsl.Pow(col1, 1.6f); - col2 = Hlsl.Lerp(col1.ZYXW, Hlsl.Pow(col2, 1.4f), 0.666f); - - float4 oCol; - - if (gObjID == 0) - { - oCol = Hlsl.Lerp(col2, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat2)) * 0.35f); - oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); - - if (Mod(iuv.X + iuv.Y, 2.0f) > 0.5f) oCol *= 0.8f; - - oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, d - 0.015f)) * 0.8f); - } - else if (gObjID == 1) - { - oCol = Hlsl.Lerp(1, 0, 1.0f - Hlsl.SmoothStep(0, 0.01f, d + 0.05f)); - float4 fCol = Hlsl.Lerp(col1, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat)) * 0.35f); - fCol = Hlsl.Lerp(fCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); - - if (Mod(iuv.X + iuv.Y, 2.0f) < 0.5f) fCol *= 0.8f; - - oCol = Hlsl.Lerp(oCol, fCol, 1 - Hlsl.SmoothStep(0, 0.01f, d + 0.08f)); - oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, Hlsl.Length(uv2) - 0.08f)) * 0.8f); - } - else - { - oCol = col1; - - float ht = 0.26f; - - if (Mod(iuv2.X + iuv2.Y + 1.0f, 2.0f) > 0.5f) - { - float tmp = pat; pat = pat2; pat2 = tmp; - - oCol = col2; - ht = 0.05f; - } - - float mark = Hlsl.Length(uv2); - float markRim = Hlsl.Max(Hlsl.Abs(mark - 0.07f), Hlsl.Abs(p.Z + ht)) - 0.003f; - - oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, markRim)) * 0.8f); - oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, mark - 0.015f)) * 0.8f); - } - - float3 ld = l - p; - float lDist = Hlsl.Length(ld); - - ld /= lDist; - - float at = 1.0f / (1.0f + lDist * lDist * 0.125f); - float sh = SoftShadow(p, l, n, 8); - float ao = CalculateAO(p, n); - float df = Hlsl.Max(Hlsl.Dot(n, ld), 0); - float sp = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(r, n), ld), 0), 32); - - float4 c = oCol * (df * sh + sp * sh + 0.5f) * at * ao; - - c = Hlsl.Sqrt(Hlsl.Max(c, 0)); - - return c; + case 1: return Hlsl.Max(Hlsl.Length(p), (p.X + p.Y) * 0.7071f + 0.015f); + case 2: return Hlsl.Max((p.X + p.Y) * 0.7071f, Hlsl.Max(p.X, p.Y)); + case 3: return Hlsl.Pow(Hlsl.Dot(Hlsl.Pow(p, 3), 1), 1.0f / 3.0f); + default: return (p.X + p.Y) * 0.7071f; } } + + // GLSL's mod function + private static float Mod(float x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + // A standard square grid 2D blobby Truchet routine: Render circles + // in opposite corners of a tile, reverse the pattern on alternate + // checker tiles, and randomly rotate. + private static float Truchet(float2 p) + { + const float sc = 0.5f; + float2 ip = Hlsl.Floor(p / sc) + 0.5f; + + p -= ip * sc; + + float rnd = Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(ip, new float2(1, 113))) * 45758.5453f); + + if (rnd < .5) p.Y = -p.Y; + + float d = Hlsl.Min(Distance(p - 0.5f * sc), Distance(p + 0.5f * sc)) - 0.5f * sc; + + if (SHAPE == 4) + { + d += (0.5f - 0.5f / Hlsl.Sqrt(2.0f)) * sc; + } + + if (rnd < 0.5f) d = -d; + if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) d = -d; + + return d - 0.03f; + } + + // The scene's distance function: There'd be faster ways to do this, but it's + // more readable this way. Plus, this is a pretty simple scene, so it's + // efficient enough. + private static float M(float3 p) + { + float fl = -p.Z; + float obj = Truchet(p.XY); + + obj = Hlsl.Max(obj, Hlsl.Abs(p.Z) - 0.125f) - Hlsl.SmoothStep(0.03f, 0.25f, -obj) * 0.1f; + + float studs = 1e5f; + const float sc = 0.5f; + float2 q = p.XY + 0.5f * sc; + float2 iq = Hlsl.Floor(q / sc) + 0.5f; + + q -= iq * sc; + + if (Mod(iq.X + iq.Y, 2.0f) > 0.5f) + { + studs = Hlsl.Max(Hlsl.Length(q) - 0.1f * sc - 0.02f, Hlsl.Abs(p.Z) - 0.26f); + } + + objID = fl < obj && fl < studs ? 0 : obj < studs ? 1 : 2; + + return Hlsl.Min(Hlsl.Min(fl, obj), studs); + } + + // Cheap shadows are hard. In fact, I'd almost say, shadowing particular scenes with limited + // iterations is impossible... However, I'd be very grateful if someone could prove me wrong. :) + private static float SoftShadow(float3 ro, float3 lp, float3 n, float k) + { + const int iter = 24; + + ro += n * 0.0015f; + + float3 rd = lp - ro; + float shade = 1.0f; + float t = 0; + float end = Hlsl.Max(Hlsl.Length(rd), 0.0001f); + + rd /= end; + + for (int i = 0; i < iter; i++) + { + float d = M(ro + rd * t); + + shade = Hlsl.Min(shade, k * d / t); + t += Hlsl.Clamp(d, 0.01f, 0.25f); + + if (d < 0.0f || t > end) break; + } + + return Hlsl.Max(shade, 0.0f); + } + + + // I keep a collection of occlusion routines... OK, that sounded really nerdy. :) + // Anyway, I like this one. I'm assuHlsl.Ming it's based on IQ's original. + private float CalculateAO(in float3 p, in float3 n) + { + float sca = 2.0f, occ = 0.0f; + + for (int i = (int)Hlsl.Min(time, 0f); i < 5; i++) + { + float hr = (i + 1f) * 0.15f / 5.0f; + float d = M(p + n * hr); + occ += (hr - d) * sca; + sca *= 0.7f; + + if (sca > 1e5f) break; + } + + return Hlsl.Clamp(1.0f - occ, 0.0f, 1.0f); + } + + // Standard normal function. + private static float3 Normal(in float3 p) + { + float2 e = new(0.001f, 0); + + return Hlsl.Normalize(new float3( + M(p + e.XYY) - M(p - e.XYY), + M(p + e.YXY) - M(p - e.YXY), + M(p + e.YYX) - M(p - e.YYX))); + } + + /// + public float4 Execute() + { + int2 coords = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float2 u = (coords - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; + float3 + r = Hlsl.Normalize(new float3(u, 1)), + o = new(0, time / 2.0f, -3), + l = o + new float3(0.25f, 0.25f, 2.0f); + + r.YZ = Hlsl.Mul(Rotate2x2(0.15f), r.YZ); + r.XZ = Hlsl.Mul(Rotate2x2(-Hlsl.Cos(time * 3.14159f / 32.0f) / 8.0f), r.XZ); + r.XY = Hlsl.Mul(Rotate2x2(Hlsl.Sin(time * 3.14159f / 32.0f) / 8.0f), r.XY); + + float d, t = Hash21(r.XY * 57.0f + Hlsl.Frac(time)) * 0.5f, glow = 0; + + for (int i = 0; i < 96; i++) + { + d = M(o + r * t); + + if (Hlsl.Abs(d) < .001) break; + + t += d * 0.7f; + glow += 0.2f / (1.0f + Hlsl.Abs(d) * 5.0f); + } + + int gObjID = objID; + float3 p = o + r * t, n = Normal(p); + float2 uv = p.XY; + float sc = 0.5f; + float2 iuv = Hlsl.Floor(uv / sc) + 0.5f; + + uv -= iuv * sc; + + float2 uv2 = p.XY + 0.5f * sc; + float2 iuv2 = Hlsl.Floor(uv2 / sc) + 0.5f; + + uv2 -= iuv2 * sc; + + float bord = Hlsl.Max(Hlsl.Abs(uv.X), Hlsl.Abs(uv.Y)) - 0.5f * sc; + + bord = Hlsl.Abs(bord) - 0.002f; + d = Truchet(p.XY); + + float lSc = 20.0f; + float pat = (Hlsl.Abs(Hlsl.Frac((uv.X - uv.Y) * lSc - 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; + float pat2 = (Hlsl.Abs(Hlsl.Frac((uv.X + uv.Y) * lSc + 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; + float sf = Hlsl.Dot(Hlsl.Sin(p.XY - Hlsl.Cos(p.YX * 2.0f)), 0.5f); + float sf2 = Hlsl.Dot(Hlsl.Sin(p.XY * 1.5f - Hlsl.Cos(p.YX * 3.0f)), 0.5f); + float4 col1 = Hlsl.Lerp(new float4(1, 0.75f, 0.6f, 0), new float4(1, 0.85f, 0.65f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf)); + float4 col2 = Hlsl.Lerp(new float4(0.4f, 0.7f, 1, 0), new float4(0.3f, 0.85f, 0.95f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf2) * 0.5f); + + col1 = Hlsl.Pow(col1, 1.6f); + col2 = Hlsl.Lerp(col1.ZYXW, Hlsl.Pow(col2, 1.4f), 0.666f); + + float4 oCol; + + if (gObjID == 0) + { + oCol = Hlsl.Lerp(col2, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat2)) * 0.35f); + oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); + + if (Mod(iuv.X + iuv.Y, 2.0f) > 0.5f) oCol *= 0.8f; + + oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, d - 0.015f)) * 0.8f); + } + else if (gObjID == 1) + { + oCol = Hlsl.Lerp(1, 0, 1.0f - Hlsl.SmoothStep(0, 0.01f, d + 0.05f)); + float4 fCol = Hlsl.Lerp(col1, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat)) * 0.35f); + fCol = Hlsl.Lerp(fCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); + + if (Mod(iuv.X + iuv.Y, 2.0f) < 0.5f) fCol *= 0.8f; + + oCol = Hlsl.Lerp(oCol, fCol, 1 - Hlsl.SmoothStep(0, 0.01f, d + 0.08f)); + oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, Hlsl.Length(uv2) - 0.08f)) * 0.8f); + } + else + { + oCol = col1; + + float ht = 0.26f; + + if (Mod(iuv2.X + iuv2.Y + 1.0f, 2.0f) > 0.5f) + { + float tmp = pat; pat = pat2; pat2 = tmp; + + oCol = col2; + ht = 0.05f; + } + + float mark = Hlsl.Length(uv2); + float markRim = Hlsl.Max(Hlsl.Abs(mark - 0.07f), Hlsl.Abs(p.Z + ht)) - 0.003f; + + oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, markRim)) * 0.8f); + oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, mark - 0.015f)) * 0.8f); + } + + float3 ld = l - p; + float lDist = Hlsl.Length(ld); + + ld /= lDist; + + float at = 1.0f / (1.0f + lDist * lDist * 0.125f); + float sh = SoftShadow(p, l, n, 8); + float ao = CalculateAO(p, n); + float df = Hlsl.Max(Hlsl.Dot(n, ld), 0); + float sp = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(r, n), ld), 0), 32); + + float4 c = oCol * (df * sh + sp * sh + 0.5f) * at * ao; + + c = Hlsl.Sqrt(Hlsl.Max(c, 0)); + + return c; + } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs b/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs index 501d3396..d02828d6 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs @@ -1,46 +1,45 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// A shader creating a fractal tiling animation. +/// Ported from . +/// Created by Inigo Quilez. +/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +/// +[AutoConstructor] +internal readonly partial struct FractalTiling : IPixelShader { /// - /// A shader creating a fractal tiling animation. - /// Ported from . - /// Created by Inigo Quilez. - /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// The current time since the start of the application. /// - [AutoConstructor] - internal readonly partial struct FractalTiling : IPixelShader + public readonly float time; + + /// + public float4 Execute() { - /// - /// The current time since the start of the application. - /// - public readonly float time; + float2 position = ((float2)(256 * ThreadIds.XY)) / DispatchSize.X + time; + float4 color = 0; - /// - public float4 Execute() + for (int i = 0; i < 6; i++) { - float2 position = ((float2)(256 * ThreadIds.XY)) / DispatchSize.X + time; - float4 color = 0; + float2 a = Hlsl.Floor(position); + float2 b = Hlsl.Frac(position); + float4 w = Hlsl.Frac( + (Hlsl.Sin(a.X * 7 + 31.0f * a.Y + 0.01f * time) + + new float4(0.035f, 0.01f, 0, 0.7f)) + * 13.545317f); - for (int i = 0; i < 6; i++) - { - float2 a = Hlsl.Floor(position); - float2 b = Hlsl.Frac(position); - float4 w = Hlsl.Frac( - (Hlsl.Sin(a.X * 7 + 31.0f * a.Y + 0.01f * time) + - new float4(0.035f, 0.01f, 0, 0.7f)) - * 13.545317f); + color.XYZ += w.XYZ * + 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) * + Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y)); - color.XYZ += w.XYZ * - 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) * - Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y)); - - position /= 2.0f; - color /= 2.0f; - } - - color.XYZ = Hlsl.Pow(color.XYZ, new float3(0.7f, 0.8f, 0.5f)); - color.W = 1.0f; - - return color; + position /= 2.0f; + color /= 2.0f; } + + color.XYZ = Hlsl.Pow(color.XYZ, new float3(0.7f, 0.8f, 0.5f)); + color.W = 1.0f; + + return color; } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs b/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs index 3ba37ac8..93463b30 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs @@ -1,170 +1,169 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// A shader creating a flythrough in a Menger system. +/// Ported from . +/// Created by Syntopia. +/// +[AutoConstructor] +internal readonly partial struct MengerJourney : IPixelShader { /// - /// A shader creating a flythrough in a Menger system. - /// Ported from . - /// Created by Syntopia. + /// The current time since the start of the application. /// - [AutoConstructor] - internal readonly partial struct MengerJourney : IPixelShader + public readonly float time; + + private const int MaxSteps = 30; + private const float MinimumDistance = 0.0009f; + private const float NormalDistance = 0.0002f; + private const int Iterations = 7; + private const float Scale = 3.0f; + private const float FieldOfView = 1.0f; + private const float Jitter = 0.05f; + private const float FudgeFactor = 0.7f; + private const float NonLinearPerspective = 2.0f; + private const float Ambient = 0.32184f; + private const float Diffuse = 0.5f; + + private static readonly float3 LightDir = 1.0f; + private static readonly float3 LightColor = new(1.0f, 1.0f, 0.858824f); + private static readonly float3 LightDir2 = new(1.0f, -1.0f, 1.0f); + private static readonly float3 LightColor2 = new(0, 0.333333f, 1.0f); + private static readonly float3 Offset = new(0.92858f, 0.92858f, 0.32858f); + + /// + /// Rotates a given value by a specified amount. + /// + private static float2 Rotate(float2 v, float a) { - /// - /// The current time since the start of the application. - /// - public readonly float time; + return new(Hlsl.Cos(a) * v.X + Hlsl.Sin(a) * v.Y, -Hlsl.Sin(a) * v.X + Hlsl.Cos(a) * v.Y); + } - private const int MaxSteps = 30; - private const float MinimumDistance = 0.0009f; - private const float NormalDistance = 0.0002f; - private const int Iterations = 7; - private const float Scale = 3.0f; - private const float FieldOfView = 1.0f; - private const float Jitter = 0.05f; - private const float FudgeFactor = 0.7f; - private const float NonLinearPerspective = 2.0f; - private const float Ambient = 0.32184f; - private const float Diffuse = 0.5f; + /// + /// Calculates the light at a specified normal and starting color. + /// Uses two light sources and no specular lights. + /// + private static float3 GetLight(in float3 color, in float3 normal) + { + float3 lightDir = Hlsl.Normalize(LightDir); + float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir)); - private static readonly float3 LightDir = 1.0f; - private static readonly float3 LightColor = new(1.0f, 1.0f, 0.858824f); - private static readonly float3 LightDir2 = new(1.0f, -1.0f, 1.0f); - private static readonly float3 LightColor2 = new(0, 0.333333f, 1.0f); - private static readonly float3 Offset = new(0.92858f, 0.92858f, 0.32858f); + float3 lightDir2 = Hlsl.Normalize(LightDir2); + float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2)); - /// - /// Rotates a given value by a specified amount. - /// - private static float2 Rotate(float2 v, float a) + return + (diffuse * Diffuse) * (LightColor * color) + + (diffuse2 * Diffuse) * (LightColor2 * color); + } + + /// + /// DE: Infinitely tiled Menger IFS. + /// For more info on KIFS, see + /// + private float DE(float3 z) + { + // Performs the GLSL mod function. + static float3 Mod(float3 x, float y) { - return new(Hlsl.Cos(a) * v.X + Hlsl.Sin(a) * v.Y, -Hlsl.Sin(a) * v.X + Hlsl.Cos(a) * v.Y); + return x - y * Hlsl.Floor(x / y); } - /// - /// Calculates the light at a specified normal and starting color. - /// Uses two light sources and no specular lights. - /// - private static float3 GetLight(in float3 color, in float3 normal) + z = Hlsl.Abs(1.0f - Mod(z, 2.0f)); + + float d = 1000.0f; + + for (int n = 0; n < Iterations; n++) { - float3 lightDir = Hlsl.Normalize(LightDir); - float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir)); + z.XY = Rotate(z.XY, 4.0f + 2.0f * Hlsl.Cos(time / 8.0f)); + z = Hlsl.Abs(z); - float3 lightDir2 = Hlsl.Normalize(LightDir2); - float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2)); + if (z.X < z.Y) { z.XY = z.YX; } + if (z.X < z.Z) { z.XZ = z.ZX; } + if (z.Y < z.Z) { z.YZ = z.ZY; } - return - (diffuse * Diffuse) * (LightColor * color) + - (diffuse2 * Diffuse) * (LightColor2 * color); - } + z = Scale * z - Offset * (Scale - 1.0f); - /// - /// DE: Infinitely tiled Menger IFS. - /// For more info on KIFS, see - /// - private float DE(float3 z) - { - // Performs the GLSL mod function. - static float3 Mod(float3 x, float y) + if (z.Z < -0.5f * Offset.Z * (Scale - 1.0)) { - return x - y * Hlsl.Floor(x / y); + z.Z += Offset.Z * (Scale - 1.0f); } - z = Hlsl.Abs(1.0f - Mod(z, 2.0f)); - - float d = 1000.0f; - - for (int n = 0; n < Iterations; n++) - { - z.XY = Rotate(z.XY, 4.0f + 2.0f * Hlsl.Cos(time / 8.0f)); - z = Hlsl.Abs(z); - - if (z.X < z.Y) { z.XY = z.YX; } - if (z.X < z.Z) { z.XZ = z.ZX; } - if (z.Y < z.Z) { z.YZ = z.ZY; } - - z = Scale * z - Offset * (Scale - 1.0f); - - if (z.Z < -0.5f * Offset.Z * (Scale - 1.0)) - { - z.Z += Offset.Z * (Scale - 1.0f); - } - - d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f)); - } - - return d - 0.001f; + d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f)); } - /// - /// Calculates the finite difference normal at a given position. - /// - private float3 getNormal(in float3 pos) + return d - 0.001f; + } + + /// + /// Calculates the finite difference normal at a given position. + /// + private float3 getNormal(in float3 pos) + { + float3 e = new(0.0f, NormalDistance, 0.0f); + + return Hlsl.Normalize(new float3( + DE(pos + e.YXX) - DE(pos - e.YXX), + DE(pos + e.XYX) - DE(pos - e.XYX), + DE(pos + e.XXY) - DE(pos - e.XXY))); + } + + /// + /// Performs a ray march operation on a specific position. + /// + private float4 RayMarch(in float3 from, float3 dir, in float2 fragCoord) + { + // Computes a pseudo-random number + static float Rand(float2 co) { - float3 e = new(0.0f, NormalDistance, 0.0f); - - return Hlsl.Normalize(new float3( - DE(pos + e.YXX) - DE(pos - e.YXX), - DE(pos + e.XYX) - DE(pos - e.XYX), - DE(pos + e.XXY) - DE(pos - e.XXY))); + return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new float2(4.898f, 7.23f))) * 23421.631f); } - /// - /// Performs a ray march operation on a specific position. - /// - private float4 RayMarch(in float3 from, float3 dir, in float2 fragCoord) + float totalDistance = Jitter * Rand(fragCoord.XY + time); + float3 dir2 = dir; + float distance = 0; + int steps = 0; + float3 pos = 0; + + for (int i = 0; i < MaxSteps; i++) { - // Computes a pseudo-random number - static float Rand(float2 co) - { - return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new float2(4.898f, 7.23f))) * 23421.631f); - } + dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective); + pos = from + totalDistance * dir; + distance = DE(pos) * FudgeFactor; + totalDistance += distance; - float totalDistance = Jitter * Rand(fragCoord.XY + time); - float3 dir2 = dir; - float distance = 0; - int steps = 0; - float3 pos = 0; + if (distance < MinimumDistance) break; - for (int i = 0; i < MaxSteps; i++) - { - dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective); - pos = from + totalDistance * dir; - distance = DE(pos) * FudgeFactor; - totalDistance += distance; - - if (distance < MinimumDistance) break; - - steps = i; - } - - float smoothStep = steps + distance / MinimumDistance; - float ao = 1.1f - smoothStep / MaxSteps; - float3 normal = getNormal(pos - dir * NormalDistance * 3.0f); - float3 color = 1.0f; - float3 light = GetLight(color, normal); - - color = (color * Ambient + light) * ao; - - return new(color.X, color.Y, color.Z, 1.0f); + steps = i; } - /// - public float4 Execute() - { - float3 camPos = 0.5f * time * new float3(1.0f, 0.0f, 0.0f); - float3 target = camPos + new float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time)); - float3 camDir = Hlsl.Normalize(target - camPos); - float3 camUp = new(0.0f, 1.0f, 0.0f); + float smoothStep = steps + distance / MinimumDistance; + float ao = 1.1f - smoothStep / MaxSteps; + float3 normal = getNormal(pos - dir * NormalDistance * 3.0f); + float3 color = 1.0f; + float3 light = GetLight(color, normal); - camUp = Hlsl.Normalize(camUp - Hlsl.Dot(camDir, camUp) * camDir); + color = (color * Ambient + light) * ao; - float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp)); - float2 coord = -1.0f + 2.0f * (float2)ThreadIds.XY / DispatchSize.XY; + return new(color.X, color.Y, color.Z, 1.0f); + } - coord.X *= (float)DispatchSize.X / DispatchSize.Y; + /// + public float4 Execute() + { + float3 camPos = 0.5f * time * new float3(1.0f, 0.0f, 0.0f); + float3 target = camPos + new float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time)); + float3 camDir = Hlsl.Normalize(target - camPos); + float3 camUp = new(0.0f, 1.0f, 0.0f); - float3 rayDir = Hlsl.Normalize(camDir + (coord.X * camRight + coord.Y * camUp) * FieldOfView); + camUp = Hlsl.Normalize(camUp - Hlsl.Dot(camDir, camUp) * camDir); - return RayMarch(camPos, rayDir, ThreadIds.XY); - } + float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp)); + float2 coord = -1.0f + 2.0f * (float2)ThreadIds.XY / DispatchSize.XY; + + coord.X *= (float)DispatchSize.X / DispatchSize.Y; + + float3 rayDir = Hlsl.Normalize(camDir + (coord.X * camRight + coord.Y * camUp) * FieldOfView); + + return RayMarch(camPos, rayDir, ThreadIds.XY); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs b/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs index 85338f46..eee31181 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs @@ -1,123 +1,122 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// A shader creating an octagram animation, inspired by arabesque. +/// Ported from . +/// Created by whisky_shusuky. +/// +[AutoConstructor] +internal readonly partial struct Octagrams : IPixelShader { /// - /// A shader creating an octagram animation, inspired by arabesque. - /// Ported from . - /// Created by whisky_shusuky. + /// The current time since the start of the application. /// - [AutoConstructor] - internal readonly partial struct Octagrams : IPixelShader + public readonly float time; + + private static float2x2 Rotate(float a) { - /// - /// The current time since the start of the application. - /// - public readonly float time; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - private static float2x2 Rotate(float a) + return new(c, s, -s, c); + } + + private static float Box(float3 pos, float scale) + { + static float SDBox(float3 p, float3 b) { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); + float3 q = Hlsl.Abs(p) - b; - return new(c, s, -s, c); + return Hlsl.Length(Hlsl.Max(q, 0.0f)) + + Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f); } - private static float Box(float3 pos, float scale) - { - static float SDBox(float3 p, float3 b) - { - float3 q = Hlsl.Abs(p) - b; + pos *= scale; - return Hlsl.Length(Hlsl.Max(q, 0.0f)) + - Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f); + float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f; + + pos.XY *= 5.0f; + pos.Y -= 3.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f)); + + return -b; + } + + private static float BoxSet(float3 pos, float gTime) + { + float3 pos_origin = pos; + + pos = pos_origin; + pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box1 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box2 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box3 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box4 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box5 = Box(pos, 0.5f) * 6.0f; + + pos = pos_origin; + + float box6 = Box(pos, 0.5f) * 6.0f; + float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6); + + return result; + } + + /// + public float4 Execute() + { + float2 p = ((float2)ThreadIds.XY * 2.0f - DispatchSize.XY) / Hlsl.Min(DispatchSize.X, DispatchSize.Y); + float3 ro = new(0.0f, -0.2f, time * 4.0f); + float3 ray = Hlsl.Normalize(new float3(p, 1.5f)); + + ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f)); + ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f)); + + float t = 0.1f; + float ac = 0.0f; + + for (int i = 0; i < 99; i++) + { + static float3 Mod(float3 x, float y) + { + return x - y * Hlsl.Floor(x / y); } - pos *= scale; + float3 pos = ro + ray * t; - float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f; + pos = Mod(pos - 2.0f, 4.0f) - 2.0f; - pos.XY *= 5.0f; - pos.Y -= 3.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f)); + float gTime = time - i * 0.01f; + float d = BoxSet(pos, gTime); - return -b; + d = Hlsl.Max(Hlsl.Abs(d), 0.01f); + ac += Hlsl.Exp(-d * 23.0f); + t += d * 0.55f; } - private static float BoxSet(float3 pos, float gTime) - { - float3 pos_origin = pos; + float3 col = ac * 0.02f + new float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + Hlsl.Sin(time) * 0.2f); + float4 color = new(col, 1.0f - t * (0.02f + 0.02f * Hlsl.Sin(time))); - pos = pos_origin; - pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box1 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box2 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box3 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box4 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box5 = Box(pos, 0.5f) * 6.0f; - - pos = pos_origin; - - float box6 = Box(pos, 0.5f) * 6.0f; - float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6); - - return result; - } - - /// - public float4 Execute() - { - float2 p = ((float2)ThreadIds.XY * 2.0f - DispatchSize.XY) / Hlsl.Min(DispatchSize.X, DispatchSize.Y); - float3 ro = new(0.0f, -0.2f, time * 4.0f); - float3 ray = Hlsl.Normalize(new float3(p, 1.5f)); - - ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f)); - ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f)); - - float t = 0.1f; - float ac = 0.0f; - - for (int i = 0; i < 99; i++) - { - static float3 Mod(float3 x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - float3 pos = ro + ray * t; - - pos = Mod(pos - 2.0f, 4.0f) - 2.0f; - - float gTime = time - i * 0.01f; - float d = BoxSet(pos, gTime); - - d = Hlsl.Max(Hlsl.Abs(d), 0.01f); - ac += Hlsl.Exp(-d * 23.0f); - t += d * 0.55f; - } - - float3 col = ac * 0.02f + new float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + Hlsl.Sin(time) * 0.2f); - float4 color = new(col, 1.0f - t * (0.02f + 0.02f * Hlsl.Sin(time))); - - return color; - } + return color; } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs b/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs index 8087d074..895d27ea 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs @@ -1,168 +1,167 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// Fully procedural 3D animated volume with three evaluations per step (for shading). +/// Ported from . +/// Created by nimitz (twitter: @stormoid). +/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +/// +[AutoConstructor] +internal readonly partial struct ProteanClouds : IPixelShader { /// - /// Fully procedural 3D animated volume with three evaluations per step (for shading). - /// Ported from . - /// Created by nimitz (twitter: @stormoid). - /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// The current time Hlsl.Since the start of the application. /// - [AutoConstructor] - internal readonly partial struct ProteanClouds : IPixelShader + public readonly float time; + + private static readonly float3x3 m3 = new float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f; + + private static float2x2 Rotate(in float a) { - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); + + return new(c, s, -s, c); + } - private static readonly float3x3 m3 = new float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f; + private static float LinStep(in float mn, in float mx, in float x) + { + return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f); + } - private static float2x2 Rotate(in float a) + private static float2 Disp(float t) + { + return new float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f; + } + + private float2 Map(float3 p, float prm1, float2 bsMo) + { + float3 p2 = p; + + p2.XY -= Disp(p.Z).XY; + p.XY = Hlsl.Mul(p.XY, Rotate(Hlsl.Sin(p.Z + time) * (0.1f + prm1 * 0.05f) + time * 0.09f)); + + float cl = Hlsl.Dot(p2.XY, p2.XY); + float d = 0.0f; + + p *= 0.61f; + + float z = 1.0f; + float trk = 1.0f; + float dspAmp = 0.1f + prm1 * 0.2f; + + for (int i = 0; i < 5; i++) { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, s, -s, c); + p += Hlsl.Sin(p.ZXY * 0.75f * trk + time * trk * 0.8f) * dspAmp; + d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z); + z *= 0.57f; + trk *= 1.4f; + + p = Hlsl.Mul(p, m3); } - private static float LinStep(in float mn, in float mx, in float x) + d = Hlsl.Abs(d + prm1 * 3.0f) + prm1 * 0.3f - 2.5f + bsMo.Y; + + return new float2(d + cl * 0.2f + 0.25f, cl); + } + + private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo) + { + float4 rez = 0; + float t = 1.5f; + float fogT = 0; + + for (int i = 0; i < 130; i++) { - return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f); - } + if (rez.A > 0.99f) break; - private static float2 Disp(float t) - { - return new float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f; - } + float3 pos = ro + t * rd; + float2 mpv = Map(pos, prm1, bsMo); + float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f; + float dn = Hlsl.Clamp((mpv.X + 2.0f), 0.0f, 3.0f); + float4 col = 0f; - private float2 Map(float3 p, float prm1, float2 bsMo) - { - float3 p2 = p; - - p2.XY -= Disp(p.Z).XY; - p.XY = Hlsl.Mul(p.XY, Rotate(Hlsl.Sin(p.Z + time) * (0.1f + prm1 * 0.05f) + time * 0.09f)); - - float cl = Hlsl.Dot(p2.XY, p2.XY); - float d = 0.0f; - - p *= 0.61f; - - float z = 1.0f; - float trk = 1.0f; - float dspAmp = 0.1f + prm1 * 0.2f; - - for (int i = 0; i < 5; i++) + if (mpv.X > 0.6f) { - p += Hlsl.Sin(p.ZXY * 0.75f * trk + time * trk * 0.8f) * dspAmp; - d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z); - z *= 0.57f; - trk *= 1.4f; - p = Hlsl.Mul(p, m3); + col = new float4(Hlsl.Sin(new float3(5.0f, 0.4f, 0.2f) + mpv.Y * 0.1f + Hlsl.Sin(pos.Z * 0.4f) * 0.5f + 1.8f) * 0.5f + 0.5f, 0.08f); + col *= den * den * den; + col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f; + + float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f); + + dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f); + col.XYZ *= den * (new float3(0.005f, 0.045f, 0.075f) + 1.5f * new float3(0.033f, 0.07f, 0.03f) * dif); } - d = Hlsl.Abs(d + prm1 * 3.0f) + prm1 * 0.3f - 2.5f + bsMo.Y; + float fogC = Hlsl.Exp(t * 0.2f - 2.2f); - return new float2(d + cl * 0.2f + 0.25f, cl); + col += new float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f); + fogT = fogC; + rez += col * (1.0f - rez.A); + t += Hlsl.Clamp(0.5f - dn * dn * 0.05f, 0.09f, 0.3f); } - private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo) - { - float4 rez = 0; - float t = 1.5f; - float fogT = 0; + return Hlsl.Clamp(rez, 0.0f, 1.0f); + } - for (int i = 0; i < 130; i++) - { - if (rez.A > 0.99f) break; + private static float GetSaturation(float3 c) + { + float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z); + float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z); - float3 pos = ro + t * rd; - float2 mpv = Map(pos, prm1, bsMo); - float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f; - float dn = Hlsl.Clamp((mpv.X + 2.0f), 0.0f, 3.0f); - float4 col = 0f; + return (ma - mi) / (ma + (float)1e-7); + } - if (mpv.X > 0.6f) - { + private static float3 ILerp(in float3 a, in float3 b, in float x) + { + float3 ic = Hlsl.Lerp(a, b, x) + new float3((float)1e-6, 0.0f, 0.0f); + float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x)); + float3 dir = Hlsl.Normalize(new float3(2.0f * ic.X - ic.Y - ic.Z, 2.0f * ic.Y - ic.X - ic.Z, 2.0f * ic.Z - ic.Y - ic.X)); + float lgt = Hlsl.Dot(1.0f, ic); + float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic)); - col = new float4(Hlsl.Sin(new float3(5.0f, 0.4f, 0.2f) + mpv.Y * 0.1f + Hlsl.Sin(pos.Z * 0.4f) * 0.5f + 1.8f) * 0.5f + 0.5f, 0.08f); - col *= den * den * den; - col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f; + ic += 1.5f * dir * sd * ff * lgt; - float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f); + return Hlsl.Clamp(ic, 0.0f, 1.0f); + } - dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f); - col.XYZ *= den * (new float3(0.005f, 0.045f, 0.075f) + 1.5f * new float3(0.033f, 0.07f, 0.03f) * dif); - } + /// + public float4 Execute() + { + float2 q = (float2)ThreadIds.XY / DispatchSize.XY; + float2 p = (ThreadIds.XY - 0.5f * (float2)DispatchSize.XY) / DispatchSize.Y; + float2 bsMo = -0.5f * (float2)DispatchSize.XY / DispatchSize.Y; + float scaledTime = time * 3.0f; + float3 ro = new(0, 0, scaledTime); - float fogC = Hlsl.Exp(t * 0.2f - 2.2f); + ro += new float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0); - col += new float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f); - fogT = fogC; - rez += col * (1.0f - rez.A); - t += Hlsl.Clamp(0.5f - dn * dn * 0.05f, 0.09f, 0.3f); - } + float dspAmp = 0.85f; - return Hlsl.Clamp(rez, 0.0f, 1.0f); - } + ro.XY += Disp(ro.Z) * dspAmp; - private static float GetSaturation(float3 c) - { - float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z); - float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z); + float tgtDst = 3.5f; + float3 target = Hlsl.Normalize(ro - new float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst)); - return (ma - mi) / (ma + (float)1e-7); - } + ro.X -= bsMo.X * 2.0f; - private static float3 ILerp(in float3 a, in float3 b, in float x) - { - float3 ic = Hlsl.Lerp(a, b, x) + new float3((float)1e-6, 0.0f, 0.0f); - float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x)); - float3 dir = Hlsl.Normalize(new float3(2.0f * ic.X - ic.Y - ic.Z, 2.0f * ic.Y - ic.X - ic.Z, 2.0f * ic.Z - ic.Y - ic.X)); - float lgt = Hlsl.Dot(1.0f, ic); - float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic)); + float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new float3(0, 1, 0))); + float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target)); - ic += 1.5f * dir * sd * ff * lgt; + rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target)); - return Hlsl.Clamp(ic, 0.0f, 1.0f); - } + float3 rd = Hlsl.Normalize((p.X * rightdir + p.Y * updir) * 1.0f - target); - /// - public float4 Execute() - { - float2 q = (float2)ThreadIds.XY / DispatchSize.XY; - float2 p = (ThreadIds.XY - 0.5f * (float2)DispatchSize.XY) / DispatchSize.Y; - float2 bsMo = -0.5f * (float2)DispatchSize.XY / DispatchSize.Y; - float scaledTime = time * 3.0f; - float3 ro = new(0, 0, scaledTime); + rd.XY = Hlsl.Mul(rd.XY, Rotate(-Disp(scaledTime + 3.5f).X * 0.2f + bsMo.X)); - ro += new float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0); + float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f)); + float4 scn = Render(ro, rd, scaledTime, prm1, bsMo); + float3 col = scn.RGB; - float dspAmp = 0.85f; + col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f)); + col = Hlsl.Pow(col, new float3(0.55f, 0.65f, 0.6f)) * new float3(1.0f, 0.97f, 0.9f); + col *= Hlsl.Pow(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y), 0.12f) * 0.7f + 0.3f; - ro.XY += Disp(ro.Z) * dspAmp; - - float tgtDst = 3.5f; - float3 target = Hlsl.Normalize(ro - new float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst)); - - ro.X -= bsMo.X * 2.0f; - - float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new float3(0, 1, 0))); - float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target)); - - rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target)); - - float3 rd = Hlsl.Normalize((p.X * rightdir + p.Y * updir) * 1.0f - target); - - rd.XY = Hlsl.Mul(rd.XY, Rotate(-Disp(scaledTime + 3.5f).X * 0.2f + bsMo.X)); - - float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f)); - float4 scn = Render(ro, rd, scaledTime, prm1, bsMo); - float3 col = scn.RGB; - - col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f)); - col = Hlsl.Pow(col, new float3(0.55f, 0.65f, 0.6f)) * new float3(1.0f, 0.97f, 0.9f); - col *= Hlsl.Pow(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y), 0.12f) * 0.7f + 0.3f; - - return new(col, 1.0f); - } + return new(col, 1.0f); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/PyramidPattern.cs b/samples/ComputeSharp.SwapChain/Shaders/PyramidPattern.cs index 4c590090..51797672 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/PyramidPattern.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/PyramidPattern.cs @@ -1,176 +1,175 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// An offset grid of square-based pyramids whose tips have been offset according to an underlying directional noise field. +/// The faux lighting is provided via bump mapping. No raymarching was harmed during the making of this example. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct PyramidPattern : IPixelShader { /// - /// An offset grid of square-based pyramids whose tips have been offset according to an underlying directional noise field. - /// The faux lighting is provided via bump mapping. No raymarching was harmed during the making of this example. - /// Ported from . - /// Created by Shane. + /// The current time Hlsl.Since the start of the application. /// - [AutoConstructor] - internal readonly partial struct PyramidPattern : IPixelShader + public readonly float time; + + // Standard 2D rotation formula. + private static float2x2 Rotate2x2(in float a) { - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(in float a) + return new(c, -s, s, c); + } + + // IQ's float2 to float hash. + private static float Hash21(float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); + } + + // float2 to float2 hash. + private static float2 Hash22B(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + + return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; + } + + // Based on IQ's gradient noise formula. + private static float N2D3G(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22B(i), p); + v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); + + p = p * p * (3.0f - 2.0f * p); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + // Two layers of noise. + private static float FBM(float2 p) + { + return N2D3G(p) * 0.66f + N2D3G(p * 2.0f) * 0.34f; + } + + // HLSL mod from GLSL + private static float Mod(float x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + private float BMap(float2 p) + { + p = Hlsl.Mul(p, Rotate2x2(-3.14159f / 5.0f)); + + if (Mod(Hlsl.Floor(p.Y), 2.0f) < 0.5f) { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, -s, s, c); + p.X += 0.5f; } - // IQ's float2 to float hash. - private static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } + float2 ip = Hlsl.Floor(p); - // float2 to float2 hash. - private static float2 Hash22B(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + p -= ip + 0.5f; - return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; - } + float ang = -3.14159f * 3.0f / 5.0f + (FBM(ip / 8.0f + time / 3.0f)) * 6.2831f * 2.0f; - // Based on IQ's gradient noise formula. - private static float N2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; + float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f; - float4 v = default; + if (p.X < offs.X) p.X = 1.0f - (p.X + 0.5f) / Hlsl.Abs(offs.X + 0.5f); + else p.X = (p.X - offs.X) / (0.5f - offs.X); - v.X = Hlsl.Dot(Hash22B(i), p); - v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); + if (p.Y < offs.Y) p.Y = 1.0f - (p.Y + 0.5f) / Hlsl.Abs(offs.Y + 0.5f); + else p.Y = (p.Y - offs.Y) / (0.5f - offs.Y); - p = p * p * (3.0f - 2.0f * p); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Two layers of noise. - private static float FBM(float2 p) - { - return N2D3G(p) * 0.66f + N2D3G(p * 2.0f) * 0.34f; - } - - // HLSL mod from GLSL - private static float Mod(float x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - private float BMap(float2 p) - { - p = Hlsl.Mul(p, Rotate2x2(-3.14159f / 5.0f)); - - if (Mod(Hlsl.Floor(p.Y), 2.0f) < 0.5f) - { - p.X += 0.5f; - } - - float2 ip = Hlsl.Floor(p); - - p -= ip + 0.5f; - - float ang = -3.14159f * 3.0f / 5.0f + (FBM(ip / 8.0f + time / 3.0f)) * 6.2831f * 2.0f; - - float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f; - - if (p.X < offs.X) p.X = 1.0f - (p.X + 0.5f) / Hlsl.Abs(offs.X + 0.5f); - else p.X = (p.X - offs.X) / (0.5f - offs.X); - - if (p.Y < offs.Y) p.Y = 1.0f - (p.Y + 0.5f) / Hlsl.Abs(offs.Y + 0.5f); - else p.Y = (p.Y - offs.Y) / (0.5f - offs.Y); - - return 1.0f - Hlsl.Max(p.X, p.Y); - } + return 1.0f - Hlsl.Max(p.X, p.Y); + } - // Standard function-based bump mapping function, with an edge value included for good measure - private float3 DoBumpMap(in float2 p, in float3 n, float bumpfactor, ref float edge) - { - float2 e = new(0.025f, 0); + // Standard function-based bump mapping function, with an edge value included for good measure + private float3 DoBumpMap(in float2 p, in float3 n, float bumpfactor, ref float edge) + { + float2 e = new(0.025f, 0); - float f = BMap(p); - float fx = BMap(p - e.XY); - float fy = BMap(p - e.YX); - float fx2 = BMap(p + e.XY); - float fy2 = BMap(p + e.YX); + float f = BMap(p); + float fx = BMap(p - e.XY); + float fy = BMap(p - e.YX); + float fx2 = BMap(p + e.XY); + float fy2 = BMap(p + e.YX); - float3 grad = (new float3(fx - fx2, fy - fx2, 0)) / e.X / 2.0f; + float3 grad = (new float3(fx - fx2, fy - fx2, 0)) / e.X / 2.0f; - edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - f * 2.0f); - edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X); + edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - f * 2.0f); + edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X); - grad -= n * Hlsl.Dot(n, grad); + grad -= n * Hlsl.Dot(n, grad); - return Hlsl.Normalize(n + grad * bumpfactor); - } + return Hlsl.Normalize(n + grad * bumpfactor); + } - // A hatch-like algorithm, or a stipple... or some kind of textured pattern - private float DoHatch(float2 p, float res) - { - p *= res / 16.0f; + // A hatch-like algorithm, or a stipple... or some kind of textured pattern + private float DoHatch(float2 p, float res) + { + p *= res / 16.0f; - float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); + float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); - float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); - if (hRnd > 0.66f) hatch = hRnd; + float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); + if (hRnd > 0.66f) hatch = hRnd; - return hatch; - } + return hatch; + } - /// - public float4 Execute() - { - int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float iRes = Hlsl.Min(DispatchSize.Y, 800.0f); - float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / iRes; - float3 rd = Hlsl.Normalize(new float3(uv, 0.5f)); - const float gSc = 10.0f; - float2 p = uv * gSc + new float2(0, time / 2.0f); - float2 oP = p; - float m = BMap(p); - float3 n = new(0, 0, -1); - float - edge = 0.0f, - bumpFactor = 0.25f; + /// + public float4 Execute() + { + int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float iRes = Hlsl.Min(DispatchSize.Y, 800.0f); + float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / iRes; + float3 rd = Hlsl.Normalize(new float3(uv, 0.5f)); + const float gSc = 10.0f; + float2 p = uv * gSc + new float2(0, time / 2.0f); + float2 oP = p; + float m = BMap(p); + float3 n = new(0, 0, -1); + float + edge = 0.0f, + bumpFactor = 0.25f; - n = DoBumpMap(p, n, bumpFactor, ref edge); + n = DoBumpMap(p, n, bumpFactor, ref edge); - float3 lp = new float3(-0.0f + Hlsl.Sin(time) * 0.3f, 0.0f + Hlsl.Cos(time * 1.3f) * 0.3f, -1) - new float3(uv, 0); - float lDist = Hlsl.Max(Hlsl.Length(lp), 0.001f); - float3 ld = lp / lDist; - float diff = Hlsl.Max(Hlsl.Dot(n, ld), 0.0f); + float3 lp = new float3(-0.0f + Hlsl.Sin(time) * 0.3f, 0.0f + Hlsl.Cos(time * 1.3f) * 0.3f, -1) - new float3(uv, 0); + float lDist = Hlsl.Max(Hlsl.Length(lp), 0.001f); + float3 ld = lp / lDist; + float diff = Hlsl.Max(Hlsl.Dot(n, ld), 0.0f); - diff = Hlsl.Pow(diff, 4.0f); + diff = Hlsl.Pow(diff, 4.0f); - float spec = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(-ld, n), -rd), 0.0f), 16.0f); - float fre = Hlsl.Min(Hlsl.Pow(Hlsl.Max(1.0f + Hlsl.Dot(n, rd), 0.0f), 4.0f), 3.0f); - float3 col = 0.15f * (diff + 0.251f + spec * new float3(1, 0.7f, 0.3f) * 9.0f + fre * new float3(0.1f, 0.3f, 1) * 12.0f); - float rf = Hlsl.SmoothStep(0.0f, 0.35f, BMap(Hlsl.Reflect(rd, n).XY * 2.0f) * FBM(Hlsl.Reflect(rd, n).XY * 3.0f) + 0.1f); + float spec = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(-ld, n), -rd), 0.0f), 16.0f); + float fre = Hlsl.Min(Hlsl.Pow(Hlsl.Max(1.0f + Hlsl.Dot(n, rd), 0.0f), 4.0f), 3.0f); + float3 col = 0.15f * (diff + 0.251f + spec * new float3(1, 0.7f, 0.3f) * 9.0f + fre * new float3(0.1f, 0.3f, 1) * 12.0f); + float rf = Hlsl.SmoothStep(0.0f, 0.35f, BMap(Hlsl.Reflect(rd, n).XY * 2.0f) * FBM(Hlsl.Reflect(rd, n).XY * 3.0f) + 0.1f); - col += col * col * rf * rf * new float3(1, 0.1f, 0.1f) * 15.0f; + col += col * col * rf * rf * new float3(1, 0.1f, 0.1f) * 15.0f; - float shade = m * 0.83f + 0.17f; + float shade = m * 0.83f + 0.17f; - col *= shade; - col *= 1.0f - edge * 0.8f; + col *= shade; + col *= 1.0f - edge * 0.8f; - float hatch = DoHatch(oP / gSc, iRes); + float hatch = DoHatch(oP / gSc, iRes); - col *= hatch * 0.5f + 0.7f; + col *= hatch * 0.5f + 0.7f; - return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } + return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/TriangleGridContouring.cs b/samples/ComputeSharp.SwapChain/Shaders/TriangleGridContouring.cs index 301fbe75..89a50c34 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/TriangleGridContouring.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/TriangleGridContouring.cs @@ -1,279 +1,278 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// Utilizing a 2D simplex grid to construct the isolines of a noise function. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct TriangleGridContouring : IPixelShader { /// - /// Utilizing a 2D simplex grid to construct the isolines of a noise function. - /// Ported from . - /// Created by Shane. + /// The current time Hlsl.Since the start of the application. /// - [AutoConstructor] - internal readonly partial struct TriangleGridContouring : IPixelShader + public readonly float time; + + // Standard 2D rotation formula. + private static float2x2 Rotate2x2(in float a) { - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(in float a) + return new(c, -s, s, c); + } + + // IQ's float2 to float hash. + private static float Hash21(float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); + } + + // float2 to float2 hash. + private float2 Hash22(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + + p = Hlsl.Frac(new float2(262144, 32768) * n); + + return Hlsl.Sin(p * 6.2831853f + time); + } + + // Based on IQ's gradient noise formula. + private float N2D3G(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22(i), p); + v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); + + p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + + // The isofunction. Just a Hlsl.Single noise function, but it can be more elaborate. + private float IsoFunction(in float2 p) + { + return N2D3G(p / 4.0f + 0.07f); + } + + // Unsigned distance to the segment joining "a" and "b". + private static float DistLine(float2 a, float2 b) + { + b = a - b; + + float h = Hlsl.Clamp(Hlsl.Dot(a, b) / Hlsl.Dot(b, b), 0.0f, 1.0f); + + return Hlsl.Length(a - b * h); + } + + // Based on IQ's signed distance to the segment joining "a" and "b". + private static float distEdge(float2 a, float2 b) + { + return Hlsl.Dot((a + b) * 0.5f, Hlsl.Normalize((b - a).YX * new float2(-1, 1))); + } + + // Interpolating along the edge connecting vertices v1 and v2 with respect to the isovalue. + private static float2 Interpolate(in float2 p1, in float2 p2, float v1, float v2, float isovalue) + { + return Hlsl.Lerp(p1, p2, (isovalue - v1) / (v2 - v1) * 0.75f + 0.25f / 2.0f); + } + + // Isoline function. + private static int IsoLine( + float3 n3, + float2 ip0, + float2 ip1, + float2 ip2, + float isovalue, + float i, + ref float2 p0, + ref float2 p1) + { + p0 = 1e5f; + p1 = 1e5f; + + int iTh = 0; + + if (n3.X > isovalue) iTh += 4; + if (n3.Y > isovalue) iTh += 2; + if (n3.Z > isovalue) iTh += 1; + + if (iTh == 1 || iTh == 6) { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); + p0 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); + p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); - return new(c, -s, s, c); + } + else if (iTh == 2 || iTh == 5) + { + p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); + p1 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); + + } + else if (iTh == 3 || iTh == 4) + { + p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); + p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); } - // IQ's float2 to float hash. - private static float Hash21(float2 p) + if (iTh >= 4 && iTh <= 6) { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // float2 to float2 hash. - private float2 Hash22(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); - - p = Hlsl.Frac(new float2(262144, 32768) * n); - - return Hlsl.Sin(p * 6.2831853f + time); - } - - // Based on IQ's gradient noise formula. - private float N2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); + float2 tmp = p0; - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22(i), p); - v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); - - p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + p0 = p1; + p1 = tmp; } - - // The isofunction. Just a Hlsl.Single noise function, but it can be more elaborate. - private float IsoFunction(in float2 p) + if (i == 0.0f) { - return N2D3G(p / 4.0f + 0.07f); + float2 tmp = p0; + + p0 = p1; + p1 = tmp; } - // Unsigned distance to the segment joining "a" and "b". - private static float DistLine(float2 a, float2 b) + return iTh; + } + + private float3 SimplexContour(float2 p) + { + const float gSc = 8.0f; + + p *= gSc; + + float2 oP = p; + + p += new float2(N2D3G(p * 3.5f), N2D3G(p * 3.5f + 7.3f)) * 0.015f; + + float2 s = Hlsl.Floor(p + (p.X + p.Y) * 0.36602540378f); + + p -= s - (s.X + s.Y) * 0.211324865f; + + float i = p.X < p.Y ? 1.0f : 0.0f; + float2 + ioffs = new(1.0f - i, i), + ip0 = 0, + ip1 = ioffs - 0.2113248654f, + ip2 = 0.577350269f, + ctr = (ip0 + ip1 + ip2) / 3.0f; + + ip0 -= ctr; + ip1 -= ctr; + ip2 -= ctr; + p -= ctr; + + float3 n3 = default; + + n3.X = IsoFunction(s); + n3.Y = IsoFunction(s + ioffs); + n3.Z = IsoFunction(s + 1.0f); + + float + d = 1e5f, + d2 = 1e5f, + d3 = 1e5f, + d4 = 1e5f, + d5 = 1e5f; + + float isovalue = 0; + float2 p0 = default, p1 = default; + int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); + + d = Hlsl.Min(d, distEdge(p - p0, p - p1)); + + if (iTh == 7) { - b = a - b; - - float h = Hlsl.Clamp(Hlsl.Dot(a, b) / Hlsl.Dot(b, b), 0.0f, 1.0f); - - return Hlsl.Length(a - b * h); + d = 0; } - // Based on IQ's signed distance to the segment joining "a" and "b". - private static float distEdge(float2 a, float2 b) - { - return Hlsl.Dot((a + b) * 0.5f, Hlsl.Normalize((b - a).YX * new float2(-1, 1))); - } + d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); + d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - // Interpolating along the edge connecting vertices v1 and v2 with respect to the isovalue. - private static float2 Interpolate(in float2 p1, in float2 p2, float v1, float v2, float isovalue) - { - return Hlsl.Lerp(p1, p2, (isovalue - v1) / (v2 - v1) * 0.75f + 0.25f / 2.0f); - } + float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0)); - // Isoline function. - private static int IsoLine( - float3 n3, - float2 ip0, - float2 ip1, - float2 ip2, - float isovalue, - float i, - ref float2 p0, - ref float2 p1) - { - p0 = 1e5f; - p1 = 1e5f; + d5 = Hlsl.Min(d5, tri); + d5 = Hlsl.Min(d5, Hlsl.Length(p) - 0.02f); + isovalue = -0.15f; - int iTh = 0; + int iTh2 = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); - if (n3.X > isovalue) iTh += 4; - if (n3.Y > isovalue) iTh += 2; - if (n3.Z > isovalue) iTh += 1; + d2 = Hlsl.Min(d2, distEdge(p - p0, p - p1)); - if (iTh == 1 || iTh == 6) - { - p0 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); - p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); + float oldD2 = d2; - } - else if (iTh == 2 || iTh == 5) - { - p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); - p1 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); + if (iTh2 == 7) d2 = 0.0f; + if (iTh == 7) d2 = 1e5f; - } - else if (iTh == 3 || iTh == 4) - { - p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); - p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); - } + d2 = Hlsl.Max(d2, -d); + d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); + d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); + d4 -= 0.075f; + d3 -= 0.0125f; + d /= gSc; + d2 /= gSc; + d3 /= gSc; + d4 /= gSc; + d5 /= gSc; - if (iTh >= 4 && iTh <= 6) - { - float2 tmp = p0; - - p0 = p1; - p1 = tmp; - } + float3 col = new(1, 0.85f, 0.6f); + float sf = 0.004f; - if (i == 0.0f) - { - float2 tmp = p0; - - p0 = p1; - p1 = tmp; - } + if (d > 0.0f && d2 > 0.0f) col = new float3(1, 1.8f, 3) * 0.45f; + if (d > 0.0f) col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f))); - return iTh; - } + col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), (1.0f - Hlsl.SmoothStep(0.0f, sf, d2))); + col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f))); + col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d))); - private float3 SimplexContour(float2 p) - { - const float gSc = 8.0f; + if (d2 > 0.0f) col *= (Hlsl.Abs(Hlsl.Dot(n3, float3.One)) * 1.25f + 1.25f) / 2.0f; + else col *= Hlsl.Max(2.0f - (Hlsl.Dot(n3, float3.One) + 1.45f) / 1.25f, 0.0f); - p *= gSc; + float pat = Hlsl.Abs(Hlsl.Frac(tri * 12.5f + 0.4f) - 0.5f) * 2.0f; - float2 oP = p; + col *= pat * 0.425f + 0.75f; + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d3))); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4))); + col = Hlsl.Lerp(col, float3.One, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f))); - p += new float2(N2D3G(p * 3.5f), N2D3G(p * 3.5f + 7.3f)) * 0.015f; + float2 q = oP * 1.5f; - float2 s = Hlsl.Floor(p + (p.X + p.Y) * 0.36602540378f); + col = Hlsl.Min(col, 1.0f); - p -= s - (s.X + s.Y) * 0.211324865f; + float gr = Hlsl.Sqrt(Hlsl.Dot(col, new float3(0.299f, 0.587f, 0.114f))) * 1.25f; + float ns = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; - float i = p.X < p.Y ? 1.0f : 0.0f; - float2 - ioffs = new(1.0f - i, i), - ip0 = 0, - ip1 = ioffs - 0.2113248654f, - ip2 = 0.577350269f, - ctr = (ip0 + ip1 + ip2) / 3.0f; + ns = gr - ns; + q = Hlsl.Mul(q, Rotate2x2(3.14159f / 3.0f)); - ip0 -= ctr; - ip1 -= ctr; - ip2 -= ctr; - p -= ctr; + float ns2 = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; - float3 n3 = default; + ns2 = gr - ns2; + ns = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Min(ns, ns2)); + col = Hlsl.Lerp(col, col * (ns + 0.35f), 0.4f); - n3.X = IsoFunction(s); - n3.Y = IsoFunction(s + ioffs); - n3.Z = IsoFunction(s + 1.0f); + return col; + } - float - d = 1e5f, - d2 = 1e5f, - d3 = 1e5f, - d4 = 1e5f, - d5 = 1e5f; + /// + public float4 Execute() + { + int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / Hlsl.Min(650.0f, DispatchSize.Y); + float2 p = Hlsl.Mul(Rotate2x2(3.14159f / 12.0f), uv) + new float2(0.8660254f, 0.5f) * time / 16.0f; + float3 col = SimplexContour(p); - float isovalue = 0; - float2 p0 = default, p1 = default; - int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); + uv = coordinate / (float2)DispatchSize.XY; + col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f) + 0.1f; - d = Hlsl.Min(d, distEdge(p - p0, p - p1)); - - if (iTh == 7) - { - d = 0; - } - - d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); - d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - - float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0)); - - d5 = Hlsl.Min(d5, tri); - d5 = Hlsl.Min(d5, Hlsl.Length(p) - 0.02f); - isovalue = -0.15f; - - int iTh2 = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); - - d2 = Hlsl.Min(d2, distEdge(p - p0, p - p1)); - - float oldD2 = d2; - - if (iTh2 == 7) d2 = 0.0f; - if (iTh == 7) d2 = 1e5f; - - d2 = Hlsl.Max(d2, -d); - d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); - d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - d4 -= 0.075f; - d3 -= 0.0125f; - d /= gSc; - d2 /= gSc; - d3 /= gSc; - d4 /= gSc; - d5 /= gSc; - - float3 col = new(1, 0.85f, 0.6f); - float sf = 0.004f; - - if (d > 0.0f && d2 > 0.0f) col = new float3(1, 1.8f, 3) * 0.45f; - if (d > 0.0f) col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f))); - - col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), (1.0f - Hlsl.SmoothStep(0.0f, sf, d2))); - col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f))); - col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d))); - - if (d2 > 0.0f) col *= (Hlsl.Abs(Hlsl.Dot(n3, float3.One)) * 1.25f + 1.25f) / 2.0f; - else col *= Hlsl.Max(2.0f - (Hlsl.Dot(n3, float3.One) + 1.45f) / 1.25f, 0.0f); - - float pat = Hlsl.Abs(Hlsl.Frac(tri * 12.5f + 0.4f) - 0.5f) * 2.0f; - - col *= pat * 0.425f + 0.75f; - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d3))); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4))); - col = Hlsl.Lerp(col, float3.One, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f))); - - float2 q = oP * 1.5f; - - col = Hlsl.Min(col, 1.0f); - - float gr = Hlsl.Sqrt(Hlsl.Dot(col, new float3(0.299f, 0.587f, 0.114f))) * 1.25f; - float ns = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; - - ns = gr - ns; - q = Hlsl.Mul(q, Rotate2x2(3.14159f / 3.0f)); - - float ns2 = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; - - ns2 = gr - ns2; - ns = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Min(ns, ns2)); - col = Hlsl.Lerp(col, col * (ns + 0.35f), 0.4f); - - return col; - } - - /// - public float4 Execute() - { - int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / Hlsl.Min(650.0f, DispatchSize.Y); - float2 p = Hlsl.Mul(Rotate2x2(3.14159f / 12.0f), uv) + new float2(0.8660254f, 0.5f) * time / 16.0f; - float3 col = SimplexContour(p); - - uv = coordinate / (float2)DispatchSize.XY; - col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f) + 0.1f; - - return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } + return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); } } diff --git a/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs index fa3e6125..9e4005e3 100644 --- a/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs @@ -1,144 +1,143 @@ -namespace ComputeSharp.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders; + +/// +/// A shader creating an animated two-tiles Truchet arrangement. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct TwoTiledTruchet : IPixelShader { /// - /// A shader creating an animated two-tiles Truchet arrangement. - /// Ported from . - /// Created by Shane. + /// The current time since the start of the application. /// - [AutoConstructor] - internal readonly partial struct TwoTiledTruchet : IPixelShader + public readonly float time; + + /// + /// Calculates the Truchet distance field. + /// + /// The input value to compute the distance field for. + /// The resulting Truchet angle. + /// The distance field for the input value. + private float2 DistanceField(float2 p, out float2 ang) { - /// - /// The current time since the start of the application. - /// - public readonly float time; - - /// - /// Calculates the Truchet distance field. - /// - /// The input value to compute the distance field for. - /// The resulting Truchet angle. - /// The distance field for the input value. - private float2 DistanceField(float2 p, out float2 ang) + // Fast hash for a pair of floats + static float Hash21(float2 p) { - // Fast hash for a pair of floats - static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // HLSL's port of the GLSL mod intrinsic - static float Mod(float x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - float2 ip2 = Hlsl.Floor(p / 2.0f); - float2 ip = Hlsl.Floor(p); - float rnd = Hash21(ip); - float rnd3 = Hash21(ip + 0.57f); - float2 d = 1e5f; - - p -= ip + 0.5f; - - if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f) - { - d = Hlsl.Abs(p); - ang = p.YX; - - if (Mod(ip.X + 1.0f, 2.0f) < 0.5f) - { - ang.X *= -1.0f; - - } - - if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f) - { - ang.Y *= -1.0f; - } - - if (rnd3 < .5) - { - d = d.YX; - ang = ang.YX; - } - - ang += 0.5f; - ang *= 3.0f; - - } - else - { - if (rnd < .5) - { - p = p.YX * new float2(1, -1); - } - - d.X = Hlsl.Length(p - 0.5f) - 0.5f; - d.Y = Hlsl.Length(p + 0.5f) - 0.5f; - - d = Hlsl.Abs(d); - - ang = 0; - ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f)); - ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f)); - - if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) - { - ang *= -1.0f; - } - - if (rnd < 0.5f) - { - ang *= -1.0f; - } - - if (rnd3 < 0.5f) - { - d = d.YX; - ang = ang.YX; - } - - ang *= 4.0f / 6.2831853f; - ang *= 2.0f; - } - - ang = Hlsl.Frac(ang + time / 4.0f); - - return d; + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); } - /// - public float4 Execute() + // HLSL's port of the GLSL mod intrinsic + static float Mod(float x, float y) { - float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; - float gSc = 7.0f; - float2 p = uv * gSc - new float2(-1, -0.5f) * time / 2.0f; - float sf = 2.0f / DispatchSize.Y * gSc; - float lSc = 6.0f; - float lw = 1.0f / lSc / gSc; - float2 d = DistanceField(p, out float2 ang) - 2.5f / lSc; - float3 col = new(1.0f, 0.9f, 0.8f); + return x - y * Hlsl.Floor(x / y); + } - for (int i = 0; i < 2; i++) + float2 ip2 = Hlsl.Floor(p / 2.0f); + float2 ip = Hlsl.Floor(p); + float rnd = Hash21(ip); + float rnd3 = Hash21(ip + 0.57f); + float2 d = 1e5f; + + p -= ip + 0.5f; + + if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f) + { + d = Hlsl.Abs(p); + ang = p.YX; + + if (Mod(ip.X + 1.0f, 2.0f) < 0.5f) { - float di = d[i] - lw / 4.0f; - float tracks = Hlsl.Clamp(Hlsl.Sin(ang[i] * 6.2831f + time * 6.0f) * 4.0f, 0.0f, 1.0f); - float gap = 1.0f + lw; + ang.X *= -1.0f; - col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di)); - col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + lw * 2.0f)); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc)); - col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc + lw)); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc)); - col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc + lw)); } - float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f)); - float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f); + if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f) + { + ang.Y *= -1.0f; + } + + if (rnd3 < .5) + { + d = d.YX; + ang = ang.YX; + } + + ang += 0.5f; + ang *= 3.0f; - return color; } + else + { + if (rnd < .5) + { + p = p.YX * new float2(1, -1); + } + + d.X = Hlsl.Length(p - 0.5f) - 0.5f; + d.Y = Hlsl.Length(p + 0.5f) - 0.5f; + + d = Hlsl.Abs(d); + + ang = 0; + ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f)); + ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f)); + + if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) + { + ang *= -1.0f; + } + + if (rnd < 0.5f) + { + ang *= -1.0f; + } + + if (rnd3 < 0.5f) + { + d = d.YX; + ang = ang.YX; + } + + ang *= 4.0f / 6.2831853f; + ang *= 2.0f; + } + + ang = Hlsl.Frac(ang + time / 4.0f); + + return d; + } + + /// + public float4 Execute() + { + float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; + float gSc = 7.0f; + float2 p = uv * gSc - new float2(-1, -0.5f) * time / 2.0f; + float sf = 2.0f / DispatchSize.Y * gSc; + float lSc = 6.0f; + float lw = 1.0f / lSc / gSc; + float2 d = DistanceField(p, out float2 ang) - 2.5f / lSc; + float3 col = new(1.0f, 0.9f, 0.8f); + + for (int i = 0; i < 2; i++) + { + float di = d[i] - lw / 4.0f; + float tracks = Hlsl.Clamp(Hlsl.Sin(ang[i] * 6.2831f + time * 6.0f) * 4.0f, 0.0f, 1.0f); + float gap = 1.0f + lw; + + col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di)); + col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + lw * 2.0f)); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc)); + col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc + lw)); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc)); + col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc + lw)); + } + + float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f)); + float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f); + + return color; } } diff --git a/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.SyntaxReceiver.cs b/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.SyntaxReceiver.cs index cbeb0acd..478303bb 100644 --- a/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.SyntaxReceiver.cs +++ b/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.SyntaxReceiver.cs @@ -4,53 +4,51 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class AutoConstructorGenerator { - /// - public sealed partial class AutoConstructorGenerator + /// + /// An that selects candidate nodes to process. + /// + private sealed class SyntaxReceiver : ISyntaxContextReceiver { /// - /// An that selects candidate nodes to process. + /// The list of info gathered during exploration. /// - private sealed class SyntaxReceiver : ISyntaxContextReceiver + private readonly List gatheredInfo = new(); + + /// + /// Gets the collection of gathered info to process. + /// + public IReadOnlyCollection GatheredInfo => this.gatheredInfo; + + /// + public void OnVisitSyntaxNode(GeneratorSyntaxContext context) { - /// - /// The list of info gathered during exploration. - /// - private readonly List gatheredInfo = new(); - - /// - /// Gets the collection of gathered info to process. - /// - public IReadOnlyCollection GatheredInfo => this.gatheredInfo; - - /// - public void OnVisitSyntaxNode(GeneratorSyntaxContext context) + if (context.Node is StructDeclarationSyntax { AttributeLists: { Count: > 0 } } structDeclaration && + context.SemanticModel.GetDeclaredSymbol(structDeclaration) is INamedTypeSymbol structSymbol && + context.SemanticModel.Compilation.GetTypeByMetadataName(typeof(AutoConstructorAttribute).FullName) is INamedTypeSymbol attributeSymbol && + structSymbol.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, attributeSymbol)) is AttributeData attributeData && + attributeData.ApplicationSyntaxReference is SyntaxReference syntaxReference && + syntaxReference.GetSyntax() is AttributeSyntax attributeSyntax) { - if (context.Node is StructDeclarationSyntax { AttributeLists: { Count: > 0 } } structDeclaration && - context.SemanticModel.GetDeclaredSymbol(structDeclaration) is INamedTypeSymbol structSymbol && - context.SemanticModel.Compilation.GetTypeByMetadataName(typeof(AutoConstructorAttribute).FullName) is INamedTypeSymbol attributeSymbol && - structSymbol.GetAttributes().FirstOrDefault(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, attributeSymbol)) is AttributeData attributeData && - attributeData.ApplicationSyntaxReference is SyntaxReference syntaxReference && - syntaxReference.GetSyntax() is AttributeSyntax attributeSyntax) - { - this.gatheredInfo.Add(new Item(structDeclaration, structSymbol, attributeSyntax, attributeData)); - } + this.gatheredInfo.Add(new Item(structDeclaration, structSymbol, attributeSyntax, attributeData)); } - - /// - /// A model for a group of item representing a discovered type to process. - /// - /// The instance for the target struct declaration. - /// The instance for . - /// The instance for the target attribute over . - /// The instance for . - public sealed record Item( - StructDeclarationSyntax StructDeclaration, - INamedTypeSymbol StructSymbol, - AttributeSyntax AttributeSyntax, - AttributeData AttributeData); } + + /// + /// A model for a group of item representing a discovered type to process. + /// + /// The instance for the target struct declaration. + /// The instance for . + /// The instance for the target attribute over . + /// The instance for . + public sealed record Item( + StructDeclarationSyntax StructDeclaration, + INamedTypeSymbol StructSymbol, + AttributeSyntax AttributeSyntax, + AttributeData AttributeData); } } - diff --git a/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs b/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs index 8d31d254..a0456aed 100644 --- a/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs @@ -11,102 +11,100 @@ using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using static Microsoft.CodeAnalysis.SymbolDisplayTypeQualificationStyle; -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +/// A source generator creating constructors for types annotated with . +/// +[Generator] +public sealed partial class AutoConstructorGenerator : ISourceGenerator { - /// - /// A source generator creating constructors for types annotated with . - /// - [Generator] - public sealed partial class AutoConstructorGenerator : ISourceGenerator + /// + public void Initialize(GeneratorInitializationContext context) { - /// - public void Initialize(GeneratorInitializationContext context) + context.RegisterForSyntaxNotifications(static () => new SyntaxReceiver()); + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Get the syntax receiver with the candidate nodes + if (context.SyntaxContextReceiver is not SyntaxReceiver syntaxReceiver) { - context.RegisterForSyntaxNotifications(static () => new SyntaxReceiver()); + return; } - /// - public void Execute(GeneratorExecutionContext context) + foreach (SyntaxReceiver.Item item in syntaxReceiver.GatheredInfo) { - // Get the syntax receiver with the candidate nodes - if (context.SyntaxContextReceiver is not SyntaxReceiver syntaxReceiver) + try { - return; + OnExecute(context, item.StructDeclaration, item.StructSymbol); } - - foreach (SyntaxReceiver.Item item in syntaxReceiver.GatheredInfo) + catch { - try - { - OnExecute(context, item.StructDeclaration, item.StructSymbol); - } - catch - { - context.ReportDiagnostic(AutoConstructorGeneratorError, item.AttributeSyntax, item.StructSymbol); - } + context.ReportDiagnostic(AutoConstructorGeneratorError, item.AttributeSyntax, item.StructSymbol); } } - - /// - /// Processes a given target type. - /// - /// The input instance to use. - /// The node to process. - /// The for . - private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol) - { - // Extract the info on the type to process - var namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); - var structName = structDeclaration.Identifier.Text; - var structModifiers = structDeclaration.Modifiers; - var fields = ( - from fieldSymbol in structDeclarationSymbol.GetMembers().OfType() - where !fieldSymbol.IsConst && !fieldSymbol.IsStatic && !fieldSymbol.IsFixedSizeBuffer - let typeName = fieldSymbol.Type!.ToDisplayString() - let fieldFullType = ParseTypeName(typeName) - select (Type: fieldFullType, Identifier: Identifier(fieldSymbol.Name))).ToImmutableArray(); - - // Create the constructor declaration for the type. This will - // produce a constructor with simple initialization of all variables: - // - // public MyType(Foo a, Bar b, Baz c, ...) - // { - // this.a = a; - // this.b = b; - // this.c = c; - // ... - // } - var structDeclarationSyntax = - StructDeclaration(structName).WithModifiers(structModifiers).AddMembers( - ConstructorDeclaration(structName) - .AddModifiers(Token(SyntaxKind.PublicKeyword)) - .AddParameterListParameters(fields.Select(field => Parameter(field.Identifier).WithType(field.Type)).ToArray()) - .AddBodyStatements(fields.Select(field => ParseStatement($"this.{field.Identifier} = {field.Identifier};")).ToArray())); - - TypeDeclarationSyntax typeDeclarationSyntax = structDeclarationSyntax; - - // Add all parent types in ascending order, if any - foreach (var parentType in structDeclaration.Ancestors().OfType()) - { - typeDeclarationSyntax = parentType - .WithMembers(SingletonList(typeDeclarationSyntax)) - .WithConstraintClauses(List()) - .WithBaseList(null) - .WithAttributeLists(List()) - .WithoutTrivia(); - } - - // Create the compilation unit with the namespace and target member. - // From this, we can finally generate the source code to output. - var source = - CompilationUnit().AddMembers( - NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax)) - .NormalizeWhitespace(eol: "\n") - .ToFullString(); - - // Add the partial type - context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); - } } -} + /// + /// Processes a given target type. + /// + /// The input instance to use. + /// The node to process. + /// The for . + private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol) + { + // Extract the info on the type to process + var namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); + var structName = structDeclaration.Identifier.Text; + var structModifiers = structDeclaration.Modifiers; + var fields = ( + from fieldSymbol in structDeclarationSymbol.GetMembers().OfType() + where !fieldSymbol.IsConst && !fieldSymbol.IsStatic && !fieldSymbol.IsFixedSizeBuffer + let typeName = fieldSymbol.Type!.ToDisplayString() + let fieldFullType = ParseTypeName(typeName) + select (Type: fieldFullType, Identifier: Identifier(fieldSymbol.Name))).ToImmutableArray(); + + // Create the constructor declaration for the type. This will + // produce a constructor with simple initialization of all variables: + // + // public MyType(Foo a, Bar b, Baz c, ...) + // { + // this.a = a; + // this.b = b; + // this.c = c; + // ... + // } + var structDeclarationSyntax = + StructDeclaration(structName).WithModifiers(structModifiers).AddMembers( + ConstructorDeclaration(structName) + .AddModifiers(Token(SyntaxKind.PublicKeyword)) + .AddParameterListParameters(fields.Select(field => Parameter(field.Identifier).WithType(field.Type)).ToArray()) + .AddBodyStatements(fields.Select(field => ParseStatement($"this.{field.Identifier} = {field.Identifier};")).ToArray())); + + TypeDeclarationSyntax typeDeclarationSyntax = structDeclarationSyntax; + + // Add all parent types in ascending order, if any + foreach (var parentType in structDeclaration.Ancestors().OfType()) + { + typeDeclarationSyntax = parentType + .WithMembers(SingletonList(typeDeclarationSyntax)) + .WithConstraintClauses(List()) + .WithBaseList(null) + .WithAttributeLists(List()) + .WithoutTrivia(); + } + + // Create the compilation unit with the namespace and target member. + // From this, we can finally generate the source code to output. + var source = + CompilationUnit().AddMembers( + NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax)) + .NormalizeWhitespace(eol: "\n") + .ToFullString(); + + // Add the partial type + context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } +} diff --git a/src/ComputeSharp.SourceGenerators/Core/Interfaces/__Internals/IShader.cs b/src/ComputeSharp.SourceGenerators/Core/Interfaces/__Internals/IShader.cs index d2b7a4c8..44644c69 100644 --- a/src/ComputeSharp.SourceGenerators/Core/Interfaces/__Internals/IShader.cs +++ b/src/ComputeSharp.SourceGenerators/Core/Interfaces/__Internals/IShader.cs @@ -1,14 +1,13 @@ using System; using System.ComponentModel; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// A base representing a given shader that can be dispatched. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This interface is not intended to be used directly by user code")] +public interface IShader { - /// - /// A base representing a given shader that can be dispatched. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This interface is not intended to be used directly by user code")] - public interface IShader - { - } } diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs index e936e826..c46faa7f 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs @@ -1,634 +1,633 @@ using Microsoft.CodeAnalysis; -namespace ComputeSharp.SourceGenerators.Diagnostics +namespace ComputeSharp.SourceGenerators.Diagnostics; + +/// +/// A container for all instances for errors reported by analyzers in this project. +/// +internal static class DiagnosticDescriptors { /// - /// A container for all instances for errors reported by analyzers in this project. + /// Gets a for an invalid shader field. + /// + /// Format: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}". + /// /// - internal static class DiagnosticDescriptors - { - /// - /// Gets a for an invalid shader field. - /// - /// Format: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}". - /// - /// - public static readonly DiagnosticDescriptor InvalidShaderField = new( - id: "CMPS0001", - title: "Invalid shader field", - messageFormat: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A type representing a compute shader contains a field of a type that is not supported in HLSL.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + public static readonly DiagnosticDescriptor InvalidShaderField = new( + id: "CMPS0001", + title: "Invalid shader field", + messageFormat: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A type representing a compute shader contains a field of a type that is not supported in HLSL.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid group shared field type. - /// - /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2}". - /// - /// - public static readonly DiagnosticDescriptor InvalidGroupSharedFieldType = new( - id: "CMPS0002", - title: "Invalid group shared field type", - messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2} (it must be an array)", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A group shared field must be of an array type.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid group shared field type. + /// + /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2}". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSharedFieldType = new( + id: "CMPS0002", + title: "Invalid group shared field type", + messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2} (it must be an array)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A group shared field must be of an array type.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid group shared field element type. - /// - /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid element type {2}". - /// - /// - public static readonly DiagnosticDescriptor InvalidGroupSharedFieldElementType = new( - id: "CMPS0003", - title: "Invalid group shared field element type", - messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2} (it must be a primitive or unmanaged type)", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A group shared field element must be of a primitive or unmanaged type.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid group shared field element type. + /// + /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid element type {2}". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSharedFieldElementType = new( + id: "CMPS0003", + title: "Invalid group shared field element type", + messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2} (it must be a primitive or unmanaged type)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A group shared field element must be of a primitive or unmanaged type.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid group shared field declaration. - /// - /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" that is not static". - /// - /// - public static readonly DiagnosticDescriptor InvalidGroupSharedFieldDeclaration = new( - id: "CMPS0004", - title: "Invalid group shared field declaration", - messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" that is not static", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A group shared field must be static.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid group shared field declaration. + /// + /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" that is not static". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSharedFieldDeclaration = new( + id: "CMPS0004", + title: "Invalid group shared field declaration", + messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" that is not static", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A group shared field must be static.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a shader with no resources. - /// - /// Format: "The compute shader of type {0} contains no resources to work on". - /// - /// - public static readonly DiagnosticDescriptor MissingShaderResources = new( - id: "CMPS0005", - title: "Missing shader resources", - messageFormat: "The compute shader of type {0} contains no resources to work on", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A compute shader must contain at least one resource.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a shader with no resources. + /// + /// Format: "The compute shader of type {0} contains no resources to work on". + /// + /// + public static readonly DiagnosticDescriptor MissingShaderResources = new( + id: "CMPS0005", + title: "Missing shader resources", + messageFormat: "The compute shader of type {0} contains no resources to work on", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader must contain at least one resource.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid usage. - /// - public static readonly DiagnosticDescriptor InvalidThreadIdsUsage = new( - id: "CMPS0006", - title: "Invalid ThreadIds usage", - messageFormat: "The ThreadIds type can only be used within the main body of a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The ThreadIds type can only be used within the main body of a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid usage. + /// + public static readonly DiagnosticDescriptor InvalidThreadIdsUsage = new( + id: "CMPS0006", + title: "Invalid ThreadIds usage", + messageFormat: "The ThreadIds type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The ThreadIds type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid usage. - /// - public static readonly DiagnosticDescriptor InvalidGroupIdsUsage = new( - id: "CMPS0007", - title: "Invalid GroupIds usage", - messageFormat: "The GroupIds type can only be used within the main body of a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The GroupIds type can only be used within the main body of a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid usage. + /// + public static readonly DiagnosticDescriptor InvalidGroupIdsUsage = new( + id: "CMPS0007", + title: "Invalid GroupIds usage", + messageFormat: "The GroupIds type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The GroupIds type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid usage. - /// - public static readonly DiagnosticDescriptor InvalidGroupSizeUsage = new( - id: "CMPS0008", - title: "Invalid GroupSize usage", - messageFormat: "The GroupSize type can only be used within the main body of a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The GroupSize type can only be used within the main body of a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid usage. + /// + public static readonly DiagnosticDescriptor InvalidGroupSizeUsage = new( + id: "CMPS0008", + title: "Invalid GroupSize usage", + messageFormat: "The GroupSize type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The GroupSize type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid usage. - /// - public static readonly DiagnosticDescriptor InvalidGridIdsUsage = new( - id: "CMPS0009", - title: "Invalid GridIds usage", - messageFormat: "The GridIds type can only be used within the main body of a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The GridIds type can only be used within the main body of a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid usage. + /// + public static readonly DiagnosticDescriptor InvalidGridIdsUsage = new( + id: "CMPS0009", + title: "Invalid GridIds usage", + messageFormat: "The GridIds type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The GridIds type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid object creation expression. - /// - /// Format: "The type {0} cannot be created in a compute shader". - /// - /// - public static readonly DiagnosticDescriptor InvalidObjectCreationExpression = new( - id: "CMPS0010", - title: "Invalid object creation expression", - messageFormat: "The type {0} cannot be created in a compute shader (only unmanaged types are supported)", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Only unmanaged value type objects can be created in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid object creation expression. + /// + /// Format: "The type {0} cannot be created in a compute shader". + /// + /// + public static readonly DiagnosticDescriptor InvalidObjectCreationExpression = new( + id: "CMPS0010", + title: "Invalid object creation expression", + messageFormat: "The type {0} cannot be created in a compute shader (only unmanaged types are supported)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Only unmanaged value type objects can be created in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an anonymous object creation expression. - /// - public static readonly DiagnosticDescriptor AnonymousObjectCreationExpression = new( - id: "CMPS0011", - title: "Anonymous object creation expression", - messageFormat: "An anonymous object cannot be created in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "An anonymous object cannot be created in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an anonymous object creation expression. + /// + public static readonly DiagnosticDescriptor AnonymousObjectCreationExpression = new( + id: "CMPS0011", + title: "Anonymous object creation expression", + messageFormat: "An anonymous object cannot be created in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "An anonymous object cannot be created in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an async modifier on a method or function. - /// - public static readonly DiagnosticDescriptor AsyncModifierOnMethodOrFunction = new( - id: "CMPS0012", - title: "Async modifier on method or function", - messageFormat: "The async modifier cannot be used in methods or functions used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The async modifier cannot be used in methods or functions used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an async modifier on a method or function. + /// + public static readonly DiagnosticDescriptor AsyncModifierOnMethodOrFunction = new( + id: "CMPS0012", + title: "Async modifier on method or function", + messageFormat: "The async modifier cannot be used in methods or functions used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The async modifier cannot be used in methods or functions used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an await expression. - /// - public static readonly DiagnosticDescriptor AwaitExpression = new( - id: "CMPS0013", - title: "Await expression", - messageFormat: "The await expression cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The await expression cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an await expression. + /// + public static readonly DiagnosticDescriptor AwaitExpression = new( + id: "CMPS0013", + title: "Await expression", + messageFormat: "The await expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The await expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a checked expression. - /// - public static readonly DiagnosticDescriptor CheckedExpression = new( - id: "CMPS0014", - title: "Checked expression", - messageFormat: "A checked expression cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A checked expression cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a checked expression. + /// + public static readonly DiagnosticDescriptor CheckedExpression = new( + id: "CMPS0014", + title: "Checked expression", + messageFormat: "A checked expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A checked expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a checked statement. - /// - public static readonly DiagnosticDescriptor CheckedStatement = new( - id: "CMPS0015", - title: "Checked statement", - messageFormat: "A checked statement cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A checked statement cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a checked statement. + /// + public static readonly DiagnosticDescriptor CheckedStatement = new( + id: "CMPS0015", + title: "Checked statement", + messageFormat: "A checked statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A checked statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a fixed statement. - /// - public static readonly DiagnosticDescriptor FixedStatement = new( - id: "CMPS0016", - title: "Fixed statement", - messageFormat: "A fixed statement cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A fixed statement cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a fixed statement. + /// + public static readonly DiagnosticDescriptor FixedStatement = new( + id: "CMPS0016", + title: "Fixed statement", + messageFormat: "A fixed statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A fixed statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a foreach statement. - /// - public static readonly DiagnosticDescriptor ForEachStatement = new( - id: "CMPS0017", - title: "Foreach statement", - messageFormat: "A foreach statement cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A foreach statement cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a foreach statement. + /// + public static readonly DiagnosticDescriptor ForEachStatement = new( + id: "CMPS0017", + title: "Foreach statement", + messageFormat: "A foreach statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A foreach statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a lock statement. - /// - public static readonly DiagnosticDescriptor LockStatement = new( - id: "CMPS0018", - title: "Foreach statement", - messageFormat: "A lock statement cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A lock statement cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a lock statement. + /// + public static readonly DiagnosticDescriptor LockStatement = new( + id: "CMPS0018", + title: "Foreach statement", + messageFormat: "A lock statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A lock statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a query statement. - /// - public static readonly DiagnosticDescriptor QueryExpression = new( - id: "CMPS0019", - title: "Foreach statement", - messageFormat: "A LINQ query expression cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A LINQ query expression cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a query statement. + /// + public static readonly DiagnosticDescriptor QueryExpression = new( + id: "CMPS0019", + title: "Foreach statement", + messageFormat: "A LINQ query expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A LINQ query expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a range expression. - /// - public static readonly DiagnosticDescriptor RangeExpression = new( - id: "CMPS0020", - title: "Range expression", - messageFormat: "A range expression cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A range expression cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a range expression. + /// + public static readonly DiagnosticDescriptor RangeExpression = new( + id: "CMPS0020", + title: "Range expression", + messageFormat: "A range expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A range expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a recursive pattern. - /// - public static readonly DiagnosticDescriptor RecursivePattern = new( - id: "CMPS0021", - title: "Recursive pattern", - messageFormat: "A recursive pattern cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A recursive pattern cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a recursive pattern. + /// + public static readonly DiagnosticDescriptor RecursivePattern = new( + id: "CMPS0021", + title: "Recursive pattern", + messageFormat: "A recursive pattern cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A recursive pattern cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a ref type. - /// - public static readonly DiagnosticDescriptor RefType = new( - id: "CMPS0022", - title: "Ref type", - messageFormat: "A compute shader cannot have a ref type declaration", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A compute shader cannot have a ref type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a ref type. + /// + public static readonly DiagnosticDescriptor RefType = new( + id: "CMPS0022", + title: "Ref type", + messageFormat: "A compute shader cannot have a ref type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a ref type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a relational pattern. - /// - public static readonly DiagnosticDescriptor RelationalPattern = new( - id: "CMPS0023", - title: "Relational pattern", - messageFormat: "A relational pattern cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A relational pattern cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a relational pattern. + /// + public static readonly DiagnosticDescriptor RelationalPattern = new( + id: "CMPS0023", + title: "Relational pattern", + messageFormat: "A relational pattern cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A relational pattern cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a sizeof expression. - /// - public static readonly DiagnosticDescriptor SizeOfExpression = new( - id: "CMPS0024", - title: "Sizeof expression", - messageFormat: "A sizeof expression cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A sizeof expression cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a sizeof expression. + /// + public static readonly DiagnosticDescriptor SizeOfExpression = new( + id: "CMPS0024", + title: "Sizeof expression", + messageFormat: "A sizeof expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A sizeof expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a stackalloc expression. - /// - public static readonly DiagnosticDescriptor StackAllocArrayCreationExpression = new( - id: "CMPS0025", - title: "Stackalloc expression", - messageFormat: "A stackalloc expression cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A stackalloc expression cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a stackalloc expression. + /// + public static readonly DiagnosticDescriptor StackAllocArrayCreationExpression = new( + id: "CMPS0025", + title: "Stackalloc expression", + messageFormat: "A stackalloc expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A stackalloc expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a throw expression or statement. - /// - public static readonly DiagnosticDescriptor ThrowExpressionOrStatement = new( - id: "CMPS0026", - title: "Throw expression or statement", - messageFormat: "Throw expressions and statements cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Throw expressions and statements cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a throw expression or statement. + /// + public static readonly DiagnosticDescriptor ThrowExpressionOrStatement = new( + id: "CMPS0026", + title: "Throw expression or statement", + messageFormat: "Throw expressions and statements cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Throw expressions and statements cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a try statement. - /// - public static readonly DiagnosticDescriptor TryStatement = new( - id: "CMPS0027", - title: "Try statement", - messageFormat: "A try statement cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A try statement cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a try statement. + /// + public static readonly DiagnosticDescriptor TryStatement = new( + id: "CMPS0027", + title: "Try statement", + messageFormat: "A try statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A try statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a tuple type. - /// - public static readonly DiagnosticDescriptor TupleType = new( - id: "CMPS0028", - title: "Tuple type", - messageFormat: "A compute shader cannot have a tuple type declaration", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A compute shader cannot have a tuple type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a tuple type. + /// + public static readonly DiagnosticDescriptor TupleType = new( + id: "CMPS0028", + title: "Tuple type", + messageFormat: "A compute shader cannot have a tuple type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a tuple type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a using statement or declaration. - /// - public static readonly DiagnosticDescriptor UsingStatementOrDeclaration = new( - id: "CMPS0029", - title: "Using statement or declaration", - messageFormat: "Using statements and declarations cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Using statements and declarations cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a using statement or declaration. + /// + public static readonly DiagnosticDescriptor UsingStatementOrDeclaration = new( + id: "CMPS0029", + title: "Using statement or declaration", + messageFormat: "Using statements and declarations cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Using statements and declarations cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a yield statement. - /// - public static readonly DiagnosticDescriptor YieldStatement = new( - id: "CMPS0030", - title: "Yield statement", - messageFormat: "A yield statement cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A yield statement cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a yield statement. + /// + public static readonly DiagnosticDescriptor YieldStatement = new( + id: "CMPS0030", + title: "Yield statement", + messageFormat: "A yield statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A yield statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid object declaration. - /// - /// Format: "A variable of type {0} cannot be declared in a compute shader". - /// - /// - public static readonly DiagnosticDescriptor InvalidObjectDeclaration = new( - id: "CMPS0031", - title: "Invalid object declaration", - messageFormat: "A variable of type {0} cannot be declared in a compute shader (only unmanaged types are supported)", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Only unmanaged value type objects can be declared in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid object declaration. + /// + /// Format: "A variable of type {0} cannot be declared in a compute shader". + /// + /// + public static readonly DiagnosticDescriptor InvalidObjectDeclaration = new( + id: "CMPS0031", + title: "Invalid object declaration", + messageFormat: "A variable of type {0} cannot be declared in a compute shader (only unmanaged types are supported)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Only unmanaged value type objects can be declared in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a pointer type. - /// - public static readonly DiagnosticDescriptor PointerType = new( - id: "CMPS0032", - title: "Pointer type", - messageFormat: "A compute shader cannot have a pointer type declaration", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A compute shader cannot have a pointer type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a pointer type. + /// + public static readonly DiagnosticDescriptor PointerType = new( + id: "CMPS0032", + title: "Pointer type", + messageFormat: "A compute shader cannot have a pointer type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a pointer type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a function pointer type. - /// - public static readonly DiagnosticDescriptor FunctionPointer = new( - id: "CMPS0033", - title: "Function pointer type", - messageFormat: "A compute shader cannot have a function pointer type declaration", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A compute shader cannot have a function pointer type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a function pointer type. + /// + public static readonly DiagnosticDescriptor FunctionPointer = new( + id: "CMPS0033", + title: "Function pointer type", + messageFormat: "A compute shader cannot have a function pointer type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a function pointer type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an unsafe statement. - /// - public static readonly DiagnosticDescriptor UnsafeStatement = new( - id: "CMPS0034", - title: "Unsafe statement", - messageFormat: "A compute shader cannot have an unsafe statement", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A compute shader cannot have an unsafe statement.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an unsafe statement. + /// + public static readonly DiagnosticDescriptor UnsafeStatement = new( + id: "CMPS0034", + title: "Unsafe statement", + messageFormat: "A compute shader cannot have an unsafe statement", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have an unsafe statement.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an unsafe modifier on a method or function. - /// - public static readonly DiagnosticDescriptor UnsafeModifierOnMethodOrFunction = new( - id: "CMPS0035", - title: "Unsafe modifier on method or function", - messageFormat: "The unsafe modifier cannot be used in methods or functions used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The unsafe modifier cannot be used in methods or functions used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an unsafe modifier on a method or function. + /// + public static readonly DiagnosticDescriptor UnsafeModifierOnMethodOrFunction = new( + id: "CMPS0035", + title: "Unsafe modifier on method or function", + messageFormat: "The unsafe modifier cannot be used in methods or functions used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The unsafe modifier cannot be used in methods or functions used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a string literal. - /// - public static readonly DiagnosticDescriptor StringLiteralExpression = new( - id: "CMPS0036", - title: "String literal expression", - messageFormat: "String literal expressions cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "String literal expressions cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a string literal. + /// + public static readonly DiagnosticDescriptor StringLiteralExpression = new( + id: "CMPS0036", + title: "String literal expression", + messageFormat: "String literal expressions cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "String literal expressions cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an internal error in . - /// - /// Format: "The generator AutoConstructorGenerator failed to execute on type {0}, and its constructor might not be available". - /// - /// - public static readonly DiagnosticDescriptor AutoConstructorGeneratorError = new( - id: "CMPS0037", - title: $"Internal error for {nameof(AutoConstructorGenerator)}", - messageFormat: $"The generator {nameof(AutoConstructorGenerator)} failed to execute on type {{0}}, and its constructor might not be available", - category: typeof(AutoConstructorGenerator).FullName, - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: $"The {nameof(AutoConstructorGenerator)} generator encountered an error while processing a type, and its constructor might not be available. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator AutoConstructorGenerator failed to execute on type {0}, and its constructor might not be available". + /// + /// + public static readonly DiagnosticDescriptor AutoConstructorGeneratorError = new( + id: "CMPS0037", + title: $"Internal error for {nameof(AutoConstructorGenerator)}", + messageFormat: $"The generator {nameof(AutoConstructorGenerator)} failed to execute on type {{0}}, and its constructor might not be available", + category: typeof(AutoConstructorGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(AutoConstructorGenerator)} generator encountered an error while processing a type, and its constructor might not be available. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an internal error in . - /// - /// Format: "The generator IShaderGenerator failed to execute on type {0}, and trying to use that shader might result in a runtime crash". - /// - /// - public static readonly DiagnosticDescriptor IShaderGeneratorError = new( - id: "CMPS0040", - title: $"Internal error for {nameof(IShaderGenerator)}", - messageFormat: $"The generator {nameof(IShaderGenerator)} failed to execute on type {{0}}, and trying to use that shader might result in a runtime crash", - category: typeof(IShaderGenerator).FullName, - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: $"The {nameof(IShaderGenerator)} generator encountered an error while processing a type, and trying to use that shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator IShaderGenerator failed to execute on type {0}, and trying to use that shader might result in a runtime crash". + /// + /// + public static readonly DiagnosticDescriptor IShaderGeneratorError = new( + id: "CMPS0040", + title: $"Internal error for {nameof(IShaderGenerator)}", + messageFormat: $"The generator {nameof(IShaderGenerator)} failed to execute on type {{0}}, and trying to use that shader might result in a runtime crash", + category: typeof(IShaderGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(IShaderGenerator)} generator encountered an error while processing a type, and trying to use that shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an internal error in . - /// - /// Format: "The generator ShaderMethodSourceGenerator failed to execute on method {0}, and using it in a shader might result in a runtime crash". - /// - /// - public static readonly DiagnosticDescriptor ShaderMethodSourceGeneratorError = new( - id: "CMPS0041", - title: $"Internal error for {nameof(ShaderMethodSourceGenerator)}", - messageFormat: $"The generator {nameof(ShaderMethodSourceGenerator)} failed to execute on method {{0}}, and using it in a shader might result in a runtime crash", - category: typeof(ShaderMethodSourceGenerator).FullName, - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: $"The {nameof(ShaderMethodSourceGenerator)} generator encountered an error while processing a method, and using it in a shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator ShaderMethodSourceGenerator failed to execute on method {0}, and using it in a shader might result in a runtime crash". + /// + /// + public static readonly DiagnosticDescriptor ShaderMethodSourceGeneratorError = new( + id: "CMPS0041", + title: $"Internal error for {nameof(ShaderMethodSourceGenerator)}", + messageFormat: $"The generator {nameof(ShaderMethodSourceGenerator)} failed to execute on method {{0}}, and using it in a shader might result in a runtime crash", + category: typeof(ShaderMethodSourceGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(ShaderMethodSourceGenerator)} generator encountered an error while processing a method, and using it in a shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an incorrect matrix swizzling property argument. - /// - public static readonly DiagnosticDescriptor NonConstantMatrixSwizzledIndex = new( - id: "CMPS0042", - title: "Non constant matrix swizzled property argument", - messageFormat: "The arguments in a swizzled indexer for a matrix type must be compile-time constants", - category: typeof(ShaderMethodSourceGenerator).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The arguments in a swizzled indexer for a matrix type must be compile-time constants.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an incorrect matrix swizzling property argument. + /// + public static readonly DiagnosticDescriptor NonConstantMatrixSwizzledIndex = new( + id: "CMPS0042", + title: "Non constant matrix swizzled property argument", + messageFormat: "The arguments in a swizzled indexer for a matrix type must be compile-time constants", + category: typeof(ShaderMethodSourceGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The arguments in a swizzled indexer for a matrix type must be compile-time constants.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid shader static field type. - /// - /// Format: "The compute shader of type {0} contains a static field \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)". - /// - /// - public static readonly DiagnosticDescriptor InvalidShaderStaticFieldType = new( - id: "CMPS0043", - title: "Invalid shader static field type", - messageFormat: "The compute shader of type {0} contains a static field \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A type representing a compute shader contains a static field of a type that is not supported.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid shader static field type. + /// + /// Format: "The compute shader of type {0} contains a static field \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)". + /// + /// + public static readonly DiagnosticDescriptor InvalidShaderStaticFieldType = new( + id: "CMPS0043", + title: "Invalid shader static field type", + messageFormat: "The compute shader of type {0} contains a static field \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A type representing a compute shader contains a static field of a type that is not supported.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for an invalid usage. - /// - public static readonly DiagnosticDescriptor InvalidDispatchSizeUsage = new( - id: "CMPS0044", - title: "Invalid DispatchSize usage", - messageFormat: "The DispatchSize type can only be used within the main body of a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The DispatchSize type can only be used within the main body of a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for an invalid usage. + /// + public static readonly DiagnosticDescriptor InvalidDispatchSizeUsage = new( + id: "CMPS0044", + title: "Invalid DispatchSize usage", + messageFormat: "The DispatchSize type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The DispatchSize type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a property declaration. - /// - public static readonly DiagnosticDescriptor PropertyDeclaration = new( - id: "CMPS0045", - title: "Property declaration", - messageFormat: "Property declarations cannot be used in a compute shader", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Property declarations cannot be used in a compute shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a property declaration. + /// + public static readonly DiagnosticDescriptor PropertyDeclaration = new( + id: "CMPS0045", + title: "Property declaration", + messageFormat: "Property declarations cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Property declarations cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a shader with a root signature that is too large. - /// - /// Format: "The compute shader of type {0} has exceeded the maximum allowed size for captured values and resources". - /// - /// - public static readonly DiagnosticDescriptor ShaderDispatchDataSizeExceeded = new( - id: "CMPS0046", - title: "Shader dispatch data size exceeded", - messageFormat: "The compute shader of type {0} has exceeded the maximum allowed size for captured values and resources", - category: typeof(IComputeShader).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The compute shader of type {0} has exceeded the maximum allowed size for captured values and resources.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + /// + /// Gets a for a shader with a root signature that is too large. + /// + /// Format: "The compute shader of type {0} has exceeded the maximum allowed size for captured values and resources". + /// + /// + public static readonly DiagnosticDescriptor ShaderDispatchDataSizeExceeded = new( + id: "CMPS0046", + title: "Shader dispatch data size exceeded", + messageFormat: "The compute shader of type {0} has exceeded the maximum allowed size for captured values and resources", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The compute shader of type {0} has exceeded the maximum allowed size for captured values and resources.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - /// - /// Gets a for a type implementing multiple shader interfaces. - /// - /// Format: "The shader of type {0} cannot implement more than one shader interface". - /// - /// - public static readonly DiagnosticDescriptor MultipleShaderTypesImplemented = new( - id: "CMPS0047", - title: "Multiple shader implementations for type declaration", - messageFormat: $"The shader of type {{0}} cannot implement more than one shader interface", - category: typeof(IShaderGenerator).FullName, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A shader type cannot implement more than one shader interface.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - } + /// + /// Gets a for a type implementing multiple shader interfaces. + /// + /// Format: "The shader of type {0} cannot implement more than one shader interface". + /// + /// + public static readonly DiagnosticDescriptor MultipleShaderTypesImplemented = new( + id: "CMPS0047", + title: "Multiple shader implementations for type declaration", + messageFormat: $"The shader of type {{0}} cannot implement more than one shader interface", + category: typeof(IShaderGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A shader type cannot implement more than one shader interface.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); } diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs index e9509100..9739f8ab 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs @@ -1,43 +1,42 @@ using System.Linq; using Microsoft.CodeAnalysis; -namespace ComputeSharp.SourceGenerators.Diagnostics +namespace ComputeSharp.SourceGenerators.Diagnostics; + +/// +/// Extension methods for , specifically for reporting diagnostics. +/// +internal static class DiagnosticsExtensions { /// - /// Extension methods for , specifically for reporting diagnostics. + /// Adds a new diagnostics to the current compilation. /// - internal static class DiagnosticsExtensions + /// The instance currently in use. + /// The input for the diagnostics to create. + /// The source to attach the diagnostics to. + /// The optional arguments for the formatted message to include. + public static void ReportDiagnostic( + this GeneratorExecutionContext context, + DiagnosticDescriptor descriptor, + ISymbol symbol, + params object[] args) { - /// - /// Adds a new diagnostics to the current compilation. - /// - /// The instance currently in use. - /// The input for the diagnostics to create. - /// The source to attach the diagnostics to. - /// The optional arguments for the formatted message to include. - public static void ReportDiagnostic( - this GeneratorExecutionContext context, - DiagnosticDescriptor descriptor, - ISymbol symbol, - params object[] args) - { - context.ReportDiagnostic(Diagnostic.Create(descriptor, symbol.Locations.FirstOrDefault(), args)); - } + context.ReportDiagnostic(Diagnostic.Create(descriptor, symbol.Locations.FirstOrDefault(), args)); + } - /// - /// Adds a new diagnostics to the current compilation. - /// - /// The instance currently in use. - /// The input for the diagnostics to create. - /// The source to attach the diagnostics to. - /// The optional arguments for the formatted message to include. - public static void ReportDiagnostic( - this GeneratorExecutionContext context, - DiagnosticDescriptor descriptor, - SyntaxNode node, - params object[] args) - { - context.ReportDiagnostic(Diagnostic.Create(descriptor, node.GetLocation(), args)); - } + /// + /// Adds a new diagnostics to the current compilation. + /// + /// The instance currently in use. + /// The input for the diagnostics to create. + /// The source to attach the diagnostics to. + /// The optional arguments for the formatted message to include. + public static void ReportDiagnostic( + this GeneratorExecutionContext context, + DiagnosticDescriptor descriptor, + SyntaxNode node, + params object[] args) + { + context.ReportDiagnostic(Diagnostic.Create(descriptor, node.GetLocation(), args)); } } diff --git a/src/ComputeSharp.SourceGenerators/EmbeddedResources/GlobalUsingDirectives.cs b/src/ComputeSharp.SourceGenerators/EmbeddedResources/GlobalUsingDirectives.cs index c21e8500..8c405107 100644 --- a/src/ComputeSharp.SourceGenerators/EmbeddedResources/GlobalUsingDirectives.cs +++ b/src/ComputeSharp.SourceGenerators/EmbeddedResources/GlobalUsingDirectives.cs @@ -92,4 +92,4 @@ global using uint3x4 = global::ComputeSharp.UInt3x4; global using uint4x1 = global::ComputeSharp.UInt4x1; global using uint4x2 = global::ComputeSharp.UInt4x2; global using uint4x3 = global::ComputeSharp.UInt4x3; -global using uint4x4 = global::ComputeSharp.UInt4x4; \ No newline at end of file +global using uint4x4 = global::ComputeSharp.UInt4x4; diff --git a/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs b/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs index 1191c018..aade5e79 100644 --- a/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs +++ b/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs @@ -7,145 +7,144 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.Extensions +namespace ComputeSharp.SourceGenerators.Extensions; + +/// +/// Extension methods for types. +/// +internal static class ISymbolExtensions { /// - /// Extension methods for types. + /// A custom instance with fully qualified style, without global::. /// - internal static class ISymbolExtensions + public static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalFormat = new( + globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted, + typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, + genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters); + + /// + /// A custom instance with fully qualified style, without global:: and parameters. + /// + private static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalAndParametersFormat = + FullyQualifiedWithoutGlobalFormat + .WithMemberOptions(SymbolDisplayMemberOptions.IncludeContainingType) + .WithParameterOptions(SymbolDisplayParameterOptions.None); + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this ITypeSymbol symbol) { - /// - /// A custom instance with fully qualified style, without global::. - /// - public static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalFormat = new( - globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted, - typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, - genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters); - - /// - /// A custom instance with fully qualified style, without global:: and parameters. - /// - private static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalAndParametersFormat = - FullyQualifiedWithoutGlobalFormat - .WithMemberOptions(SymbolDisplayMemberOptions.IncludeContainingType) - .WithParameterOptions(SymbolDisplayParameterOptions.None); - - /// - /// Gets the full metadata name for a given instance. - /// - /// The input instance. - /// The full metadata name for . - [Pure] - public static string GetFullMetadataName(this ITypeSymbol symbol) + static StringBuilder BuildFrom(ISymbol? symbol, StringBuilder builder) { - static StringBuilder BuildFrom(ISymbol? symbol, StringBuilder builder) + return symbol switch { - return symbol switch - { - INamespaceSymbol ns when ns.IsGlobalNamespace => builder, - INamespaceSymbol ns when ns.ContainingNamespace is { IsGlobalNamespace: false } - => BuildFrom(ns.ContainingNamespace, builder.Insert(0, $".{ns.MetadataName}")), - ITypeSymbol ts when ts.ContainingType is ISymbol pt => BuildFrom(pt, builder.Insert(0, $"+{ts.MetadataName}")), - ITypeSymbol ts when ts.ContainingNamespace is ISymbol pn => BuildFrom(pn, builder.Insert(0, $".{ts.MetadataName}")), - ISymbol => BuildFrom(symbol.ContainingSymbol, builder.Insert(0, symbol.MetadataName)), - _ => builder - }; - } - - return BuildFrom(symbol, new StringBuilder(256)).ToString(); + INamespaceSymbol ns when ns.IsGlobalNamespace => builder, + INamespaceSymbol ns when ns.ContainingNamespace is { IsGlobalNamespace: false } + => BuildFrom(ns.ContainingNamespace, builder.Insert(0, $".{ns.MetadataName}")), + ITypeSymbol ts when ts.ContainingType is ISymbol pt => BuildFrom(pt, builder.Insert(0, $"+{ts.MetadataName}")), + ITypeSymbol ts when ts.ContainingNamespace is ISymbol pn => BuildFrom(pn, builder.Insert(0, $".{ts.MetadataName}")), + ISymbol => BuildFrom(symbol.ContainingSymbol, builder.Insert(0, symbol.MetadataName)), + _ => builder + }; } - /// - /// Gets the full metadata name for a given instance. - /// - /// The input instance. - /// Whether or not to also include parameter types. - /// The full metadata name for . - [Pure] - public static string GetFullMetadataName(this IMethodSymbol symbol, bool includeParameters = false) + return BuildFrom(symbol, new StringBuilder(256)).ToString(); + } + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// Whether or not to also include parameter types. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this IMethodSymbol symbol, bool includeParameters = false) + { + if (includeParameters) { - if (includeParameters) - { - var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); + var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); - return $"{symbol.ToDisplayString(FullyQualifiedWithoutGlobalAndParametersFormat)}({parameters})"; - } - - return symbol.ToDisplayString(FullyQualifiedWithoutGlobalAndParametersFormat); + return $"{symbol.ToDisplayString(FullyQualifiedWithoutGlobalAndParametersFormat)}({parameters})"; } - /// - /// Gets the full metadata name for a given instance. - /// - /// The input instance. - /// The full metadata name for . - [Pure] - public static string GetFullMetadataName(this IPropertySymbol symbol) + return symbol.ToDisplayString(FullyQualifiedWithoutGlobalAndParametersFormat); + } + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this IPropertySymbol symbol) + { + string declaringTypeName = symbol.ContainingType.GetFullMetadataName(); + + if (symbol.IsIndexer) { - string declaringTypeName = symbol.ContainingType.GetFullMetadataName(); + var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); - if (symbol.IsIndexer) - { - var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); - - return $"{declaringTypeName}.this[{parameters}]"; - } - - return $"{declaringTypeName}.{symbol.Name}"; + return $"{declaringTypeName}.this[{parameters}]"; } - /// - /// Gets the full metadata name for a given instance. - /// - /// The input instance. - /// The full metadata name for . - [Pure] - public static string GetFullMetadataName(this IFieldSymbol symbol) + return $"{declaringTypeName}.{symbol.Name}"; + } + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this IFieldSymbol symbol) + { + return $"{symbol.ContainingType.GetFullMetadataName()}.{symbol.Name}"; + } + + /// + /// Gets a valid filename for a target symbol and generator type. + /// + /// The symbol being processed. + /// A filename in the form "<SYMBOL_FULLNAME>" + [Pure] + public static string GetGeneratedFileName(this INamedTypeSymbol symbol) + { + return symbol.GetFullMetadataName().Replace('`', '-').Replace('+', '.'); + } + + /// + /// Gets a valid filename for a target symbol and generator type. + /// + /// The symbol being processed. + /// A filename in the form "<SYMBOL_FULLNAME>" + [Pure] + public static string GetGeneratedFileName(this IMethodSymbol symbol) + { + return symbol.GetFullMetadataName(true).Replace('`', '-').Replace('+', '.'); + } + + /// + /// Tracks an instance and returns an HLSL compatible object. + /// + /// The input instance to process. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TypeSyntax TrackType(this ITypeSymbol typeSymbol, ICollection discoveredTypes) + { + string typeName = typeSymbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat); + + discoveredTypes.Add((INamedTypeSymbol)typeSymbol); + + if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) { - return $"{symbol.ContainingType.GetFullMetadataName()}.{symbol.Name}"; + return ParseTypeName(mappedName!); } - /// - /// Gets a valid filename for a target symbol and generator type. - /// - /// The symbol being processed. - /// A filename in the form "<SYMBOL_FULLNAME>" - [Pure] - public static string GetGeneratedFileName(this INamedTypeSymbol symbol) - { - return symbol.GetFullMetadataName().Replace('`', '-').Replace('+', '.'); - } - - /// - /// Gets a valid filename for a target symbol and generator type. - /// - /// The symbol being processed. - /// A filename in the form "<SYMBOL_FULLNAME>" - [Pure] - public static string GetGeneratedFileName(this IMethodSymbol symbol) - { - return symbol.GetFullMetadataName(true).Replace('`', '-').Replace('+', '.'); - } - - /// - /// Tracks an instance and returns an HLSL compatible object. - /// - /// The input instance to process. - /// The collection of currently discovered types. - /// A instance that represents a type compatible with HLSL. - [Pure] - public static TypeSyntax TrackType(this ITypeSymbol typeSymbol, ICollection discoveredTypes) - { - string typeName = typeSymbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat); - - discoveredTypes.Add((INamedTypeSymbol)typeSymbol); - - if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) - { - return ParseTypeName(mappedName!); - } - - return ParseTypeName(typeName.ToHlslIdentifierName()); - } + return ParseTypeName(typeName.ToHlslIdentifierName()); } } diff --git a/src/ComputeSharp.SourceGenerators/Extensions/StringExtensions.cs b/src/ComputeSharp.SourceGenerators/Extensions/StringExtensions.cs index 8a84730d..0e9472d3 100644 --- a/src/ComputeSharp.SourceGenerators/Extensions/StringExtensions.cs +++ b/src/ComputeSharp.SourceGenerators/Extensions/StringExtensions.cs @@ -1,21 +1,20 @@ using System.Diagnostics.Contracts; -namespace ComputeSharp.SourceGenerators.Extensions +namespace ComputeSharp.SourceGenerators.Extensions; + +/// +/// Extension methods for types. +/// +internal static class StringExtensions { /// - /// Extension methods for types. + /// Converts a given instance to a valid HLSL identifier name. /// - internal static class StringExtensions + /// The input instance to convert. + /// An valid HLSL identifier name from . + [Pure] + public static string ToHlslIdentifierName(this string text) { - /// - /// Converts a given instance to a valid HLSL identifier name. - /// - /// The input instance to convert. - /// An valid HLSL identifier name from . - [Pure] - public static string ToHlslIdentifierName(this string text) - { - return text.Replace('.', '_').Replace('+', '_'); - } + return text.Replace('.', '_').Replace('+', '_'); } } diff --git a/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs b/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs index dbfbbb86..9688a6f0 100644 --- a/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs +++ b/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs @@ -7,202 +7,201 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.Extensions +namespace ComputeSharp.SourceGenerators.Extensions; + +/// +/// A with some extension methods for C# syntax nodes. +/// +internal static class SyntaxNodeExtensions { /// - /// A with some extension methods for C# syntax nodes. + /// Checks a value and replaces the value type to be HLSL compatible, if needed. /// - internal static class SyntaxNodeExtensions + /// The type of the input instance. + /// The input to check and modify if needed. + /// The source to use to get type into from . + /// The instance with info on the input tree. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TRoot ReplaceAndTrackType(this TRoot node, SyntaxNode sourceType, SemanticModel semanticModel, ICollection discoveredTypes) + where TRoot : TypeSyntax { - /// - /// Checks a value and replaces the value type to be HLSL compatible, if needed. - /// - /// The type of the input instance. - /// The input to check and modify if needed. - /// The source to use to get type into from . - /// The instance with info on the input tree. - /// The collection of currently discovered types. - /// A instance that represents a type compatible with HLSL. - [Pure] - public static TRoot ReplaceAndTrackType(this TRoot node, SyntaxNode sourceType, SemanticModel semanticModel, ICollection discoveredTypes) - where TRoot : TypeSyntax + return node.ReplaceAndTrackType(node, sourceType, semanticModel, discoveredTypes); + } + + /// + /// Checks a value and replaces the value type to be HLSL compatible, if needed. + /// + /// The type of the input instance. + /// The input to check and modify if needed. + /// The target node to replace. + /// The source to use to get type into from . + /// The instance with info on the input tree. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TRoot ReplaceAndTrackType(this TRoot node, TypeSyntax targetType, SyntaxNode sourceType, SemanticModel semanticModel, ICollection discoveredTypes) + where TRoot : SyntaxNode + { + // Skip immediately for function pointers + if (sourceType is FunctionPointerTypeSyntax) { - return node.ReplaceAndTrackType(node, sourceType, semanticModel, discoveredTypes); + return node.ReplaceNode(targetType, ParseTypeName("void*")); } - /// - /// Checks a value and replaces the value type to be HLSL compatible, if needed. - /// - /// The type of the input instance. - /// The input to check and modify if needed. - /// The target node to replace. - /// The source to use to get type into from . - /// The instance with info on the input tree. - /// The collection of currently discovered types. - /// A instance that represents a type compatible with HLSL. - [Pure] - public static TRoot ReplaceAndTrackType(this TRoot node, TypeSyntax targetType, SyntaxNode sourceType, SemanticModel semanticModel, ICollection discoveredTypes) - where TRoot : SyntaxNode + // Handle the various possible type kinds + ITypeSymbol typeSymbol = sourceType switch { - // Skip immediately for function pointers - if (sourceType is FunctionPointerTypeSyntax) - { - return node.ReplaceNode(targetType, ParseTypeName("void*")); - } + RefTypeSyntax refType => semanticModel.GetTypeInfo(refType.Type).Type!, + PointerTypeSyntax pointerType => semanticModel.GetTypeInfo(pointerType.ElementType).Type!, + _ => semanticModel.GetTypeInfo(sourceType).Type! + }; - // Handle the various possible type kinds - ITypeSymbol typeSymbol = sourceType switch + // Do nothing if the type is just void + if (typeSymbol.SpecialType == SpecialType.System_Void) + { + return node; + } + + string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat); + + discoveredTypes.Add((INamedTypeSymbol)typeSymbol); + + if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) + { + TypeSyntax newType = ParseTypeName(mappedName!); + + return node.ReplaceNode(targetType, newType); + } + + return node.ReplaceNode(targetType, ParseTypeName(typeName.ToHlslIdentifierName())); + } + + /// + /// Tracks the associated type for a value and returns the HLSL compatible . + /// + /// The input to check. + /// The instance with info on the input tree. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TypeSyntax TrackType(this SyntaxNode node, SemanticModel semanticModel, ICollection discoveredTypes) + { + ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(node).Type!; + string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat); + + discoveredTypes.Add((INamedTypeSymbol)typeSymbol); + + if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) + { + return ParseTypeName(mappedName!); + } + + return ParseTypeName(typeName.ToHlslIdentifierName()); + } + + /// + /// Returns a with a block body. + /// + /// The input node. + /// A node like the one in input, but always with a block body. + [Pure] + public static MethodDeclarationSyntax WithBlockBody(this MethodDeclarationSyntax node) + { + if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow) + { + StatementSyntax statement = node.ReturnType switch { - RefTypeSyntax refType => semanticModel.GetTypeInfo(refType.Type).Type!, - PointerTypeSyntax pointerType => semanticModel.GetTypeInfo(pointerType.ElementType).Type!, - _ => semanticModel.GetTypeInfo(sourceType).Type! + PredefinedTypeSyntax pts when pts.Keyword.IsKind(SyntaxKind.VoidKeyword) => ExpressionStatement(arrow.Expression), + _ => ReturnStatement(arrow.Expression) }; - // Do nothing if the type is just void - if (typeSymbol.SpecialType == SpecialType.System_Void) - { - return node; - } - - string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat); - - discoveredTypes.Add((INamedTypeSymbol)typeSymbol); - - if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) - { - TypeSyntax newType = ParseTypeName(mappedName!); - - return node.ReplaceNode(targetType, newType); - } - - return node.ReplaceNode(targetType, ParseTypeName(typeName.ToHlslIdentifierName())); + return node + .WithBody(Block(statement)) + .WithExpressionBody(null) + .WithSemicolonToken(MissingToken(SyntaxKind.SemicolonToken)); } - /// - /// Tracks the associated type for a value and returns the HLSL compatible . - /// - /// The input to check. - /// The instance with info on the input tree. - /// The collection of currently discovered types. - /// A instance that represents a type compatible with HLSL. - [Pure] - public static TypeSyntax TrackType(this SyntaxNode node, SemanticModel semanticModel, ICollection discoveredTypes) + return node; + } + + /// + /// Returns a as a method definition. + /// + /// The input node. + /// A node like the one in input, but just as a definition. + [Pure] + public static MethodDeclarationSyntax AsDefinition(this MethodDeclarationSyntax node) + { + if (node.ExpressionBody is ArrowExpressionClauseSyntax) { - ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(node).Type!; - string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat); - - discoveredTypes.Add((INamedTypeSymbol)typeSymbol); - - if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) - { - return ParseTypeName(mappedName!); - } - - return ParseTypeName(typeName.ToHlslIdentifierName()); + return node.WithExpressionBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); } - /// - /// Returns a with a block body. - /// - /// The input node. - /// A node like the one in input, but always with a block body. - [Pure] - public static MethodDeclarationSyntax WithBlockBody(this MethodDeclarationSyntax node) + return node.WithBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); + } + + /// + /// Returns a with a block body. + /// + /// The input node. + /// A node like the one in input, but always with a block body. + /// + /// This method is the same as , but it is necessary to + /// duplicate the code because the two types don't have a common base type or interface that can be leveraged. + /// + [Pure] + public static LocalFunctionStatementSyntax WithBlockBody(this LocalFunctionStatementSyntax node) + { + if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow) { - if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow) + StatementSyntax statement = node.ReturnType switch { - StatementSyntax statement = node.ReturnType switch - { - PredefinedTypeSyntax pts when pts.Keyword.IsKind(SyntaxKind.VoidKeyword) => ExpressionStatement(arrow.Expression), - _ => ReturnStatement(arrow.Expression) - }; + PredefinedTypeSyntax pts when pts.Keyword.IsKind(SyntaxKind.VoidKeyword) => ExpressionStatement(arrow.Expression), + _ => ReturnStatement(arrow.Expression) + }; - return node - .WithBody(Block(statement)) - .WithExpressionBody(null) - .WithSemicolonToken(MissingToken(SyntaxKind.SemicolonToken)); - } - - return node; + return node + .WithBody(Block(statement)) + .WithExpressionBody(null) + .WithSemicolonToken(MissingToken(SyntaxKind.SemicolonToken)); } - /// - /// Returns a as a method definition. - /// - /// The input node. - /// A node like the one in input, but just as a definition. - [Pure] - public static MethodDeclarationSyntax AsDefinition(this MethodDeclarationSyntax node) + return node; + } + + /// + /// Returns a as a method definition. + /// + /// The input node. + /// A node like the one in input, but just as a definition. + [Pure] + public static LocalFunctionStatementSyntax AsDefinition(this LocalFunctionStatementSyntax node) + { + if (node.ExpressionBody is ArrowExpressionClauseSyntax) { - if (node.ExpressionBody is ArrowExpressionClauseSyntax) - { - return node.WithExpressionBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); - } - - return node.WithBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); + return node.WithExpressionBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); } - /// - /// Returns a with a block body. - /// - /// The input node. - /// A node like the one in input, but always with a block body. - /// - /// This method is the same as , but it is necessary to - /// duplicate the code because the two types don't have a common base type or interface that can be leveraged. - /// - [Pure] - public static LocalFunctionStatementSyntax WithBlockBody(this LocalFunctionStatementSyntax node) + return node.WithBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); + } + + /// + /// Returns a instance with no accessibility modifiers. + /// + /// The input node. + /// A node just like but with no accessibility modifiers. + [Pure] + public static MethodDeclarationSyntax WithoutAccessibilityModifiers(this MethodDeclarationSyntax node) + { + return node.WithModifiers(TokenList(node.Modifiers.Where(static modifier => modifier.Kind() switch { - if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow) - { - StatementSyntax statement = node.ReturnType switch - { - PredefinedTypeSyntax pts when pts.Keyword.IsKind(SyntaxKind.VoidKeyword) => ExpressionStatement(arrow.Expression), - _ => ReturnStatement(arrow.Expression) - }; - - return node - .WithBody(Block(statement)) - .WithExpressionBody(null) - .WithSemicolonToken(MissingToken(SyntaxKind.SemicolonToken)); - } - - return node; - } - - /// - /// Returns a as a method definition. - /// - /// The input node. - /// A node like the one in input, but just as a definition. - [Pure] - public static LocalFunctionStatementSyntax AsDefinition(this LocalFunctionStatementSyntax node) - { - if (node.ExpressionBody is ArrowExpressionClauseSyntax) - { - return node.WithExpressionBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); - } - - return node.WithBody(null).WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); - } - - /// - /// Returns a instance with no accessibility modifiers. - /// - /// The input node. - /// A node just like but with no accessibility modifiers. - [Pure] - public static MethodDeclarationSyntax WithoutAccessibilityModifiers(this MethodDeclarationSyntax node) - { - return node.WithModifiers(TokenList(node.Modifiers.Where(static modifier => modifier.Kind() switch - { - SyntaxKind.PublicKeyword => false, - SyntaxKind.PrivateKeyword => false, - SyntaxKind.ProtectedKeyword => false, - SyntaxKind.InternalKeyword => false, - _ => true - }).ToArray())); - } + SyntaxKind.PublicKeyword => false, + SyntaxKind.PrivateKeyword => false, + SyntaxKind.ProtectedKeyword => false, + SyntaxKind.InternalKeyword => false, + _ => true + }).ToArray())); } } diff --git a/src/ComputeSharp.SourceGenerators/GlobalUsingDirectivesGenerator.cs b/src/ComputeSharp.SourceGenerators/GlobalUsingDirectivesGenerator.cs index 9f303d5f..020d0056 100644 --- a/src/ComputeSharp.SourceGenerators/GlobalUsingDirectivesGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/GlobalUsingDirectivesGenerator.cs @@ -4,34 +4,32 @@ using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +/// A source generator to create global using directives for the HLSL primitive types. +/// +[Generator] +public sealed class GlobalUsingDirectivesGenerator : ISourceGenerator { - /// - /// A source generator to create global using directives for the HLSL primitive types. - /// - [Generator] - public sealed class GlobalUsingDirectivesGenerator : ISourceGenerator + /// + public void Initialize(GeneratorInitializationContext context) { - /// - public void Initialize(GeneratorInitializationContext context) + context.RegisterForPostInitialization(static context => { - context.RegisterForPostInitialization(static context => - { - const string filename = "ComputeSharp.SourceGenerators.EmbeddedResources.GlobalUsingDirectives.cs"; + const string filename = "ComputeSharp.SourceGenerators.EmbeddedResources.GlobalUsingDirectives.cs"; - using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename); - using StreamReader reader = new(stream); + using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename); + using StreamReader reader = new(stream); - string globalUsingDirectives = reader.ReadToEnd(); + string globalUsingDirectives = reader.ReadToEnd(); - context.AddSource("GlobalUsingDirectives.cs", SourceText.From(globalUsingDirectives, Encoding.UTF8)); - }); - } + context.AddSource("GlobalUsingDirectives.cs", SourceText.From(globalUsingDirectives, Encoding.UTF8)); + }); + } - /// - public void Execute(GeneratorExecutionContext context) - { - } + /// + public void Execute(GeneratorExecutionContext context) + { } } - diff --git a/src/ComputeSharp.SourceGenerators/Helpers/MemoryMarshal.cs b/src/ComputeSharp.SourceGenerators/Helpers/MemoryMarshal.cs index 4c92387c..7ae4730f 100644 --- a/src/ComputeSharp.SourceGenerators/Helpers/MemoryMarshal.cs +++ b/src/ComputeSharp.SourceGenerators/Helpers/MemoryMarshal.cs @@ -1,25 +1,24 @@ using System; -namespace ComputeSharp.SourceGenerators.Helpers -{ - /// - /// A polyfill type that mirrors some methods from on .NET 5. - /// - internal static class MemoryMarshal - { - /// - public static ref T GetReference(Span span) - { - return ref System.Runtime.InteropServices.MemoryMarshal.GetReference(span); - } +namespace ComputeSharp.SourceGenerators.Helpers; - /// - /// Creates a new from a given reference. - /// - /// The type of reference to wrap. - /// The target reference. - /// The length of the to create. - /// A new wrapping . - public static Span CreateSpan(ref T value, int length) => default; +/// +/// A polyfill type that mirrors some methods from on .NET 5. +/// +internal static class MemoryMarshal +{ + /// + public static ref T GetReference(Span span) + { + return ref System.Runtime.InteropServices.MemoryMarshal.GetReference(span); } + + /// + /// Creates a new from a given reference. + /// + /// The type of reference to wrap. + /// The target reference. + /// The length of the to create. + /// A new wrapping . + public static Span CreateSpan(ref T value, int length) => default; } diff --git a/src/ComputeSharp.SourceGenerators/Helpers/RuntimeHelpers.cs b/src/ComputeSharp.SourceGenerators/Helpers/RuntimeHelpers.cs index adcb0187..55cafd42 100644 --- a/src/ComputeSharp.SourceGenerators/Helpers/RuntimeHelpers.cs +++ b/src/ComputeSharp.SourceGenerators/Helpers/RuntimeHelpers.cs @@ -1,18 +1,17 @@ using System; -namespace ComputeSharp.SourceGenerators.Helpers +namespace ComputeSharp.SourceGenerators.Helpers; + +/// +/// A polyfill type that mirrors some methods from on .NET 5. +/// +internal static class RuntimeHelpers { /// - /// A polyfill type that mirrors some methods from on .NET 5. + /// Allocates some memory tied to the lifetime of a specific type. /// - internal static class RuntimeHelpers - { - /// - /// Allocates some memory tied to the lifetime of a specific type. - /// - /// The type to associate the memory to. - /// The size in byte of the memory to allocate. - /// A pointer to the allocated memory. - public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) => default; - } + /// The type to associate the memory to. + /// The size in byte of the memory to allocate. + /// A pointer to the allocated memory. + public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) => default; } diff --git a/src/ComputeSharp.SourceGenerators/Helpers/SemanticModelProvider.cs b/src/ComputeSharp.SourceGenerators/Helpers/SemanticModelProvider.cs index 2b6e5529..ca6efc34 100644 --- a/src/ComputeSharp.SourceGenerators/Helpers/SemanticModelProvider.cs +++ b/src/ComputeSharp.SourceGenerators/Helpers/SemanticModelProvider.cs @@ -1,48 +1,47 @@ using System.Collections.Generic; using Microsoft.CodeAnalysis; -namespace ComputeSharp.SourceGenerators.Helpers +namespace ComputeSharp.SourceGenerators.Helpers; + +/// +/// A type providing instances for nodes. +/// +internal sealed class SemanticModelProvider { /// - /// A type providing instances for nodes. + /// The source instance. /// - internal sealed class SemanticModelProvider + private readonly Compilation compilation; + + /// + /// The map of loaded instances. + /// + private readonly Dictionary semanticModelsMap; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The source instance. + public SemanticModelProvider(Compilation compilation) { - /// - /// The source instance. - /// - private readonly Compilation compilation; + this.compilation = compilation; + this.semanticModelsMap = new Dictionary(); + } - /// - /// The map of loaded instances. - /// - private readonly Dictionary semanticModelsMap; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The source instance. - public SemanticModelProvider(Compilation compilation) + /// + /// Gets a instance with info on a given . + /// + /// The input to get info for. + /// A instance containing info on . + public SemanticModel For(SyntaxNode syntaxNode) + { + if (!this.semanticModelsMap.TryGetValue(syntaxNode.SyntaxTree, out SemanticModel semanticModel)) { - this.compilation = compilation; - this.semanticModelsMap = new Dictionary(); + semanticModel = this.compilation.GetSemanticModel(syntaxNode.SyntaxTree); + + this.semanticModelsMap.Add(syntaxNode.SyntaxTree, semanticModel); } - /// - /// Gets a instance with info on a given . - /// - /// The input to get info for. - /// A instance containing info on . - public SemanticModel For(SyntaxNode syntaxNode) - { - if (!this.semanticModelsMap.TryGetValue(syntaxNode.SyntaxTree, out SemanticModel semanticModel)) - { - semanticModel = this.compilation.GetSemanticModel(syntaxNode.SyntaxTree); - - this.semanticModelsMap.Add(syntaxNode.SyntaxTree, semanticModel); - } - - return semanticModel; - } + return semanticModel; } } diff --git a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs index 80403c01..8b08572f 100644 --- a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs +++ b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs @@ -5,40 +5,39 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.Helpers +namespace ComputeSharp.SourceGenerators.Helpers; + +/// +/// A class containing additional factory methods for constructing syntax nodes, tokens and trivia. +/// +internal static class SyntaxFactoryHelper { /// - /// A class containing additional factory methods for constructing syntax nodes, tokens and trivia. + /// Creates an [] array expression with the nested groups in the input sequence. + /// + /// That it, it applies the following transformation: + /// + /// { ("K1", "V1"), ("K2", "V2") } => new object[] { new string[] { "K1", "V1" }, new string[] { "K2", "V2" } } + /// + /// /// - internal static class SyntaxFactoryHelper + /// The input sequence of groups. + /// An instance with the described contents. + [Pure] + public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B)> groups) { - /// - /// Creates an [] array expression with the nested groups in the input sequence. - /// - /// That it, it applies the following transformation: - /// - /// { ("K1", "V1"), ("K2", "V2") } => new object[] { new string[] { "K1", "V1" }, new string[] { "K2", "V2" } } - /// - /// - /// - /// The input sequence of groups. - /// An instance with the described contents. - [Pure] - public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B)> groups) - { - return + return + ArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.ObjectKeyword))) + .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) + .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) + .AddExpressions(groups.Select(static group => ArrayCreationExpression( - ArrayType(PredefinedType(Token(SyntaxKind.ObjectKeyword))) + ArrayType(PredefinedType(Token(SyntaxKind.StringKeyword))) .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) - .AddExpressions(groups.Select(static group => - ArrayCreationExpression( - ArrayType(PredefinedType(Token(SyntaxKind.StringKeyword))) - .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) - .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) - .AddExpressions( - LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(group.A)), - LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(group.B))))).ToArray())); - } + .AddExpressions( + LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(group.A)), + LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(group.B))))).ToArray())); } } diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslStringMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslStringMethod.cs index 3ae64350..cc339834 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslStringMethod.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslStringMethod.cs @@ -18,807 +18,805 @@ using static Microsoft.CodeAnalysis.SymbolDisplayTypeQualificationStyle; #pragma warning disable CS0618, RS1024 -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class IShaderGenerator { /// - public sealed partial class IShaderGenerator + private static partial MethodDeclarationSyntax CreateBuildHlslStringMethod( + GeneratorExecutionContext context, + StructDeclarationSyntax structDeclaration, + INamedTypeSymbol structDeclarationSymbol, + out string? implicitTextureType, + out bool isSamplerUsed, + out bool isHashSetDirectiveNeeded) { - /// - private static partial MethodDeclarationSyntax CreateBuildHlslStringMethod( - GeneratorExecutionContext context, - StructDeclarationSyntax structDeclaration, - INamedTypeSymbol structDeclarationSymbol, - out string? implicitTextureType, - out bool isSamplerUsed, - out bool isHashSetDirectiveNeeded) + // Properties are not supported + DetectAndReportPropertyDeclarations(context, structDeclarationSymbol); + + // We need to sets to track all discovered custom types and static methods + HashSet discoveredTypes = new(SymbolEqualityComparer.Default); + Dictionary staticMethods = new(SymbolEqualityComparer.Default); + Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); + + // A given type can only represent a single shader type + if (structDeclarationSymbol.AllInterfaces.Count(static interfaceSymbol => interfaceSymbol is { Name: nameof(IComputeShader) } or { IsGenericType: true, Name: nameof(IPixelShader) }) > 1) { - // Properties are not supported - DetectAndReportPropertyDeclarations(context, structDeclarationSymbol); - - // We need to sets to track all discovered custom types and static methods - HashSet discoveredTypes = new(SymbolEqualityComparer.Default); - Dictionary staticMethods = new(SymbolEqualityComparer.Default); - Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); - - // A given type can only represent a single shader type - if (structDeclarationSymbol.AllInterfaces.Count(static interfaceSymbol => interfaceSymbol is { Name: nameof(IComputeShader) } or { IsGenericType: true, Name: nameof(IPixelShader) }) > 1) - { - context.ReportDiagnostic(MultipleShaderTypesImplemented, structDeclarationSymbol, structDeclarationSymbol); - } - - // Explore the syntax tree and extract the processed info - var semanticModel = new SemanticModelProvider(context.Compilation); - var pixelShaderSymbol = structDeclarationSymbol.AllInterfaces.FirstOrDefault(static interfaceSymbol => interfaceSymbol is { IsGenericType: true, Name: nameof(IPixelShader) }); - var isComputeShader = pixelShaderSymbol is null; - var pixelShaderTextureType = isComputeShader ? null : HlslKnownTypes.GetMappedNameForPixelShaderType(pixelShaderSymbol!); - var processedMembers = GetProcessedFields(context, structDeclarationSymbol, discoveredTypes, isComputeShader).ToArray(); - var sharedBuffers = GetGroupSharedMembers(context, structDeclarationSymbol, discoveredTypes).ToArray(); - var (entryPoint, processedMethods, accessesStaticSampler) = GetProcessedMethods(context, structDeclaration, structDeclarationSymbol, semanticModel, discoveredTypes, staticMethods, constantDefinitions, isComputeShader); - var implicitSamplerField = accessesStaticSampler ? ("SamplerState", "__sampler") : default((string, string)?); - var processedTypes = GetProcessedTypes(discoveredTypes).ToArray(); - var processedConstants = GetProcessedConstants(constantDefinitions); - var staticFields = GetStaticFields(context, semanticModel, structDeclaration, structDeclarationSymbol, discoveredTypes, constantDefinitions); - string namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); - string structName = structDeclaration.Identifier.Text; - SyntaxTokenList structModifiers = structDeclaration.Modifiers; - IEnumerable bodyStatements = GenerateRenderMethodBody( - processedConstants, - staticFields, - processedTypes, - isComputeShader, - processedMembers, - pixelShaderTextureType, - accessesStaticSampler, - sharedBuffers, - processedMethods, - entryPoint, - out isHashSetDirectiveNeeded); - - implicitTextureType = pixelShaderTextureType; - isSamplerUsed = accessesStaticSampler; - - // This code produces a method declaration as follows: - // - // readonly void IShader.BuildHlslString(ref ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ) - // { - // - // } - return - MethodDeclaration( - PredefinedType(Token(SyntaxKind.VoidKeyword)), - Identifier("BuildHlslString")) - .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) - .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .AddParameterListParameters( - Parameter(Identifier("builder")).AddModifiers(Token(SyntaxKind.OutKeyword)).WithType(IdentifierName("ArrayPoolStringBuilder")), - Parameter(Identifier("threadsX")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), - Parameter(Identifier("threadsY")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), - Parameter(Identifier("threadsZ")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword)))) - .WithBody(Block(bodyStatements)); + context.ReportDiagnostic(MultipleShaderTypesImplemented, structDeclarationSymbol, structDeclarationSymbol); } - /// - /// Gets a sequence of captured fields and their mapped names. - /// - /// The current generator context in use. - /// The input instance to process. - /// The collection of currently discovered types. - /// Indicates whether or not represents a compute shader. - /// A sequence of captured fields in . - [Pure] - private static IEnumerable<(IFieldSymbol Symbol, string HlslName, string HlslType)> GetProcessedFields( - GeneratorExecutionContext context, - INamedTypeSymbol structDeclarationSymbol, - ICollection types, - bool isComputeShader) - { - bool hlslResourceFound = false; + // Explore the syntax tree and extract the processed info + var semanticModel = new SemanticModelProvider(context.Compilation); + var pixelShaderSymbol = structDeclarationSymbol.AllInterfaces.FirstOrDefault(static interfaceSymbol => interfaceSymbol is { IsGenericType: true, Name: nameof(IPixelShader) }); + var isComputeShader = pixelShaderSymbol is null; + var pixelShaderTextureType = isComputeShader ? null : HlslKnownTypes.GetMappedNameForPixelShaderType(pixelShaderSymbol!); + var processedMembers = GetProcessedFields(context, structDeclarationSymbol, discoveredTypes, isComputeShader).ToArray(); + var sharedBuffers = GetGroupSharedMembers(context, structDeclarationSymbol, discoveredTypes).ToArray(); + var (entryPoint, processedMethods, accessesStaticSampler) = GetProcessedMethods(context, structDeclaration, structDeclarationSymbol, semanticModel, discoveredTypes, staticMethods, constantDefinitions, isComputeShader); + var implicitSamplerField = accessesStaticSampler ? ("SamplerState", "__sampler") : default((string, string)?); + var processedTypes = GetProcessedTypes(discoveredTypes).ToArray(); + var processedConstants = GetProcessedConstants(constantDefinitions); + var staticFields = GetStaticFields(context, semanticModel, structDeclaration, structDeclarationSymbol, discoveredTypes, constantDefinitions); + string namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); + string structName = structDeclaration.Identifier.Text; + SyntaxTokenList structModifiers = structDeclaration.Modifiers; + IEnumerable bodyStatements = GenerateRenderMethodBody( + processedConstants, + staticFields, + processedTypes, + isComputeShader, + processedMembers, + pixelShaderTextureType, + accessesStaticSampler, + sharedBuffers, + processedMethods, + entryPoint, + out isHashSetDirectiveNeeded); - foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) + implicitTextureType = pixelShaderTextureType; + isSamplerUsed = accessesStaticSampler; + + // This code produces a method declaration as follows: + // + // readonly void IShader.BuildHlslString(ref ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ) + // { + // + // } + return + MethodDeclaration( + PredefinedType(Token(SyntaxKind.VoidKeyword)), + Identifier("BuildHlslString")) + .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) + .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) + .AddParameterListParameters( + Parameter(Identifier("builder")).AddModifiers(Token(SyntaxKind.OutKeyword)).WithType(IdentifierName("ArrayPoolStringBuilder")), + Parameter(Identifier("threadsX")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), + Parameter(Identifier("threadsY")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), + Parameter(Identifier("threadsZ")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword)))) + .WithBody(Block(bodyStatements)); + } + + /// + /// Gets a sequence of captured fields and their mapped names. + /// + /// The current generator context in use. + /// The input instance to process. + /// The collection of currently discovered types. + /// Indicates whether or not represents a compute shader. + /// A sequence of captured fields in . + [Pure] + private static IEnumerable<(IFieldSymbol Symbol, string HlslName, string HlslType)> GetProcessedFields( + GeneratorExecutionContext context, + INamedTypeSymbol structDeclarationSymbol, + ICollection types, + bool isComputeShader) + { + bool hlslResourceFound = false; + + foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) + { + if (fieldSymbol.IsStatic) continue; + + AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); + + // Group shared fields must be static + if (attribute is not null) { - if (fieldSymbol.IsStatic) continue; + context.ReportDiagnostic(InvalidGroupSharedFieldDeclaration, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name); + } + + // Captured fields must be named type symbols + if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol) + { + context.ReportDiagnostic(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + + continue; + } + + string metadataName = typeSymbol.GetFullMetadataName(); + + // Allowed fields must be either resources, unmanaged values or delegates + if (HlslKnownTypes.IsTypedResourceType(metadataName)) + { + hlslResourceFound = true; + + // Track the type of items in the current buffer + if (HlslKnownTypes.IsStructuredBufferType(metadataName)) + { + types.Add((INamedTypeSymbol)typeSymbol.TypeArguments[0]); + } + } + else if (!typeSymbol.IsUnmanagedType && + typeSymbol.TypeKind != TypeKind.Delegate) + { + // Shaders can only capture valid HLSL resource types or unmanaged types + context.ReportDiagnostic(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, typeSymbol); + + continue; + } + else if (typeSymbol.IsUnmanagedType && + !HlslKnownTypes.IsKnownHlslType(metadataName)) + { + // Track the type if it's a custom struct + types.Add(typeSymbol); + } + + string typeName = HlslKnownTypes.GetMappedName(typeSymbol); + + _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); + + // Yield back the current mapping for the name (if the name used a reserved keyword) + yield return (fieldSymbol, mapping ?? fieldSymbol.Name, typeName); + } + + // If the shader is a compute one (so no implicit output texture), it has to contain at least one resource + if (!hlslResourceFound && isComputeShader) + { + context.ReportDiagnostic(MissingShaderResources, structDeclarationSymbol, structDeclarationSymbol); + } + } + + /// + /// Gets a sequence of shader static fields and their mapped names. + /// + /// The current generator context in use. + /// The instance for the type to process. + /// The instance for the current type. + /// The type symbol for the shader type. + /// The collection of currently discovered types. + /// The collection of discovered constant definitions. + /// A sequence of static constant fields in . + [Pure] + private static IEnumerable<(string Name, string TypeDeclaration, string? Assignment)> GetStaticFields( + GeneratorExecutionContext context, + SemanticModelProvider semanticModel, + StructDeclarationSyntax structDeclaration, + INamedTypeSymbol structDeclarationSymbol, + ICollection discoveredTypes, + IDictionary constantDefinitions) + { + foreach (var fieldDeclaration in structDeclaration.Members.OfType()) + { + foreach (var variableDeclarator in fieldDeclaration.Declaration.Variables) + { + IFieldSymbol fieldSymbol = (IFieldSymbol)semanticModel.For(variableDeclarator).GetDeclaredSymbol(variableDeclarator)!; + + if (!fieldSymbol.IsStatic || fieldSymbol.IsConst) + { + continue; + } AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); - // Group shared fields must be static - if (attribute is not null) - { - context.ReportDiagnostic(InvalidGroupSharedFieldDeclaration, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name); - } + if (attribute is not null) continue; - // Captured fields must be named type symbols - if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol) + // Constant properties must be of a primitive, vector or matrix type + if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol || + !HlslKnownTypes.IsKnownHlslType(typeSymbol.GetFullMetadataName())) { - context.ReportDiagnostic(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + context.ReportDiagnostic(InvalidShaderStaticFieldType, variableDeclarator, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); continue; } - string metadataName = typeSymbol.GetFullMetadataName(); - - // Allowed fields must be either resources, unmanaged values or delegates - if (HlslKnownTypes.IsTypedResourceType(metadataName)) - { - hlslResourceFound = true; - - // Track the type of items in the current buffer - if (HlslKnownTypes.IsStructuredBufferType(metadataName)) - { - types.Add((INamedTypeSymbol)typeSymbol.TypeArguments[0]); - } - } - else if (!typeSymbol.IsUnmanagedType && - typeSymbol.TypeKind != TypeKind.Delegate) - { - // Shaders can only capture valid HLSL resource types or unmanaged types - context.ReportDiagnostic(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, typeSymbol); - - continue; - } - else if (typeSymbol.IsUnmanagedType && - !HlslKnownTypes.IsKnownHlslType(metadataName)) - { - // Track the type if it's a custom struct - types.Add(typeSymbol); - } - - string typeName = HlslKnownTypes.GetMappedName(typeSymbol); - _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); - // Yield back the current mapping for the name (if the name used a reserved keyword) - yield return (fieldSymbol, mapping ?? fieldSymbol.Name, typeName); - } - - // If the shader is a compute one (so no implicit output texture), it has to contain at least one resource - if (!hlslResourceFound && isComputeShader) - { - context.ReportDiagnostic(MissingShaderResources, structDeclarationSymbol, structDeclarationSymbol); - } - } - - /// - /// Gets a sequence of shader static fields and their mapped names. - /// - /// The current generator context in use. - /// The instance for the type to process. - /// The instance for the current type. - /// The type symbol for the shader type. - /// The collection of currently discovered types. - /// The collection of discovered constant definitions. - /// A sequence of static constant fields in . - [Pure] - private static IEnumerable<(string Name, string TypeDeclaration, string? Assignment)> GetStaticFields( - GeneratorExecutionContext context, - SemanticModelProvider semanticModel, - StructDeclarationSyntax structDeclaration, - INamedTypeSymbol structDeclarationSymbol, - ICollection discoveredTypes, - IDictionary constantDefinitions) - { - foreach (var fieldDeclaration in structDeclaration.Members.OfType()) - { - foreach (var variableDeclarator in fieldDeclaration.Declaration.Variables) + string typeDeclaration = fieldSymbol.IsReadOnly switch { - IFieldSymbol fieldSymbol = (IFieldSymbol)semanticModel.For(variableDeclarator).GetDeclaredSymbol(variableDeclarator)!; + true => $"static const {HlslKnownTypes.GetMappedName(typeSymbol)}", + false => $"static {HlslKnownTypes.GetMappedName(typeSymbol)}" + }; - if (!fieldSymbol.IsStatic || fieldSymbol.IsConst) - { - continue; - } - - AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); - - if (attribute is not null) continue; - - // Constant properties must be of a primitive, vector or matrix type - if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol || - !HlslKnownTypes.IsKnownHlslType(typeSymbol.GetFullMetadataName())) - { - context.ReportDiagnostic(InvalidShaderStaticFieldType, variableDeclarator, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); - - continue; - } - - _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); - - string typeDeclaration = fieldSymbol.IsReadOnly switch - { - true => $"static const {HlslKnownTypes.GetMappedName(typeSymbol)}", - false => $"static {HlslKnownTypes.GetMappedName(typeSymbol)}" - }; - - StaticFieldRewriter staticFieldRewriter = new( - semanticModel, - discoveredTypes, - constantDefinitions, - context); - - string? assignment = staticFieldRewriter.Visit(variableDeclarator)?.NormalizeWhitespace(eol: "\n").ToFullString(); - - yield return (mapping ?? fieldSymbol.Name, typeDeclaration, assignment); - } - } - } - - /// - /// Gets a sequence of captured members and their mapped names. - /// - /// The current generator context in use. - /// The input instance to process. - /// The collection of currently discovered types. - /// A sequence of captured members in . - [Pure] - private static IEnumerable<(string Name, string Type, int? Count)> GetGroupSharedMembers( - GeneratorExecutionContext context, - INamedTypeSymbol structDeclarationSymbol, - ICollection types) - { - foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) - { - if (!fieldSymbol.IsStatic) continue; - - AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); - - if (attribute is null) continue; - - if (fieldSymbol.Type is not IArrayTypeSymbol typeSymbol) - { - context.ReportDiagnostic(InvalidGroupSharedFieldType, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); - - continue; - } - - if (!typeSymbol.ElementType.IsUnmanagedType) - { - context.ReportDiagnostic(InvalidGroupSharedFieldElementType, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); - - continue; - } - - int? bufferSize = (int?)attribute.ConstructorArguments.FirstOrDefault().Value; - - string typeName = HlslKnownTypes.GetMappedElementName(typeSymbol); - - _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); - - yield return (mapping ?? fieldSymbol.Name, typeName, bufferSize); - - types.Add((INamedTypeSymbol)typeSymbol.ElementType); - } - } - - /// - /// Gets a sequence of processed methods declared within a given type. - /// - /// The current generator context in use. - /// The type symbol for the shader type. - /// The instance for the current type. - /// The instance for the type to process. - /// The collection of currently discovered types. - /// The set of discovered and processed static methods. - /// The collection of discovered constant definitions. - /// Indicates whether or not represents a compute shader. - /// A sequence of processed methods in , and the entry point. - [Pure] - private static (string EntryPoint, IEnumerable<(string Signature, string Definition)> ProcessedMethods, bool IsSamplerUser) GetProcessedMethods( - GeneratorExecutionContext context, - StructDeclarationSyntax structDeclaration, - INamedTypeSymbol structDeclarationSymbol, - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary staticMethods, - IDictionary constantDefinitions, - bool isComputeShader) - { - // Find all declared methods in the type - ImmutableArray methodDeclarations = ( - from syntaxNode in structDeclaration.DescendantNodes() - where syntaxNode.IsKind(SyntaxKind.MethodDeclaration) - select (MethodDeclarationSyntax)syntaxNode).ToImmutableArray(); - - string? entryPoint = null; - List<(string, string)> processedMethods = new(); - bool isSamplerUsed = false; - - foreach (MethodDeclarationSyntax methodDeclaration in methodDeclarations) - { - IMethodSymbol methodDeclarationSymbol = semanticModel.For(methodDeclaration).GetDeclaredSymbol(methodDeclaration)!; - bool isShaderEntryPoint = - (isComputeShader && - methodDeclarationSymbol.Name == nameof(IComputeShader.Execute) && - methodDeclarationSymbol.ReturnsVoid && - methodDeclarationSymbol.TypeParameters.Length == 0 && - methodDeclarationSymbol.Parameters.Length == 0) || - (!isComputeShader && - methodDeclarationSymbol.Name == nameof(IPixelShader.Execute) && - methodDeclarationSymbol.ReturnType is not null && // TODO: match for pixel type - methodDeclarationSymbol.TypeParameters.Length == 0 && - methodDeclarationSymbol.Parameters.Length == 0); - - // Create the source rewriter for the current method - ShaderSourceRewriter shaderSourceRewriter = new( - structDeclarationSymbol, + StaticFieldRewriter staticFieldRewriter = new( semanticModel, discoveredTypes, - staticMethods, constantDefinitions, - context, - isShaderEntryPoint); + context); - // Rewrite the method syntax tree - MethodDeclarationSyntax? processedMethod = shaderSourceRewriter.Visit(methodDeclaration)!.WithoutTrivia(); + string? assignment = staticFieldRewriter.Visit(variableDeclarator)?.NormalizeWhitespace(eol: "\n").ToFullString(); - // Track the implicit sampler, if used - isSamplerUsed = isSamplerUsed || shaderSourceRewriter.IsSamplerUsed; + yield return (mapping ?? fieldSymbol.Name, typeDeclaration, assignment); + } + } + } - // Emit the extracted local functions first - foreach (var localFunction in shaderSourceRewriter.LocalFunctions) - { - processedMethods.Add(( - localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString())); - } + /// + /// Gets a sequence of captured members and their mapped names. + /// + /// The current generator context in use. + /// The input instance to process. + /// The collection of currently discovered types. + /// A sequence of captured members in . + [Pure] + private static IEnumerable<(string Name, string Type, int? Count)> GetGroupSharedMembers( + GeneratorExecutionContext context, + INamedTypeSymbol structDeclarationSymbol, + ICollection types) + { + foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) + { + if (!fieldSymbol.IsStatic) continue; - // If the method is the shader entry point, do additional processing - if (isShaderEntryPoint) - { - processedMethod = isComputeShader switch - { - true => new ExecuteMethodRewriter.Compute(shaderSourceRewriter).Visit(processedMethod)!, - false => new ExecuteMethodRewriter.Pixel(shaderSourceRewriter).Visit(processedMethod)! - }; + AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); - entryPoint = processedMethod.NormalizeWhitespace(eol: "\n").ToFullString(); - } - else - { - processedMethods.Add(( - processedMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - processedMethod.NormalizeWhitespace(eol: "\n").ToFullString())); - } + if (attribute is null) continue; + + if (fieldSymbol.Type is not IArrayTypeSymbol typeSymbol) + { + context.ReportDiagnostic(InvalidGroupSharedFieldType, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + + continue; } - // Process static methods as well - foreach (MethodDeclarationSyntax staticMethod in staticMethods.Values) + if (!typeSymbol.ElementType.IsUnmanagedType) + { + context.ReportDiagnostic(InvalidGroupSharedFieldElementType, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + + continue; + } + + int? bufferSize = (int?)attribute.ConstructorArguments.FirstOrDefault().Value; + + string typeName = HlslKnownTypes.GetMappedElementName(typeSymbol); + + _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); + + yield return (mapping ?? fieldSymbol.Name, typeName, bufferSize); + + types.Add((INamedTypeSymbol)typeSymbol.ElementType); + } + } + + /// + /// Gets a sequence of processed methods declared within a given type. + /// + /// The current generator context in use. + /// The type symbol for the shader type. + /// The instance for the current type. + /// The instance for the type to process. + /// The collection of currently discovered types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// Indicates whether or not represents a compute shader. + /// A sequence of processed methods in , and the entry point. + [Pure] + private static (string EntryPoint, IEnumerable<(string Signature, string Definition)> ProcessedMethods, bool IsSamplerUser) GetProcessedMethods( + GeneratorExecutionContext context, + StructDeclarationSyntax structDeclaration, + INamedTypeSymbol structDeclarationSymbol, + SemanticModelProvider semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions, + bool isComputeShader) + { + // Find all declared methods in the type + ImmutableArray methodDeclarations = ( + from syntaxNode in structDeclaration.DescendantNodes() + where syntaxNode.IsKind(SyntaxKind.MethodDeclaration) + select (MethodDeclarationSyntax)syntaxNode).ToImmutableArray(); + + string? entryPoint = null; + List<(string, string)> processedMethods = new(); + bool isSamplerUsed = false; + + foreach (MethodDeclarationSyntax methodDeclaration in methodDeclarations) + { + IMethodSymbol methodDeclarationSymbol = semanticModel.For(methodDeclaration).GetDeclaredSymbol(methodDeclaration)!; + bool isShaderEntryPoint = + (isComputeShader && + methodDeclarationSymbol.Name == nameof(IComputeShader.Execute) && + methodDeclarationSymbol.ReturnsVoid && + methodDeclarationSymbol.TypeParameters.Length == 0 && + methodDeclarationSymbol.Parameters.Length == 0) || + (!isComputeShader && + methodDeclarationSymbol.Name == nameof(IPixelShader.Execute) && + methodDeclarationSymbol.ReturnType is not null && // TODO: match for pixel type + methodDeclarationSymbol.TypeParameters.Length == 0 && + methodDeclarationSymbol.Parameters.Length == 0); + + // Create the source rewriter for the current method + ShaderSourceRewriter shaderSourceRewriter = new( + structDeclarationSymbol, + semanticModel, + discoveredTypes, + staticMethods, + constantDefinitions, + context, + isShaderEntryPoint); + + // Rewrite the method syntax tree + MethodDeclarationSyntax? processedMethod = shaderSourceRewriter.Visit(methodDeclaration)!.WithoutTrivia(); + + // Track the implicit sampler, if used + isSamplerUsed = isSamplerUsed || shaderSourceRewriter.IsSamplerUsed; + + // Emit the extracted local functions first + foreach (var localFunction in shaderSourceRewriter.LocalFunctions) { processedMethods.Add(( - staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - staticMethod.NormalizeWhitespace(eol: "\n").ToFullString())); + localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), + localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString())); } - return (entryPoint!, processedMethods, isSamplerUsed); - } - - /// - /// Gets a sequence of discovered constants. - /// - /// The collection of discovered constant definitions. - /// A sequence of discovered constants to declare in the shader. - [Pure] - internal static IEnumerable<(string Name, string Value)> GetProcessedConstants(IReadOnlyDictionary constantDefinitions) - { - foreach (var constant in constantDefinitions) + // If the method is the shader entry point, do additional processing + if (isShaderEntryPoint) { - var ownerTypeName = ((INamedTypeSymbol)constant.Key.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); - var constantName = $"__{ownerTypeName}__{constant.Key.Name}"; + processedMethod = isComputeShader switch + { + true => new ExecuteMethodRewriter.Compute(shaderSourceRewriter).Visit(processedMethod)!, + false => new ExecuteMethodRewriter.Pixel(shaderSourceRewriter).Visit(processedMethod)! + }; - yield return (constantName, constant.Value); + entryPoint = processedMethod.NormalizeWhitespace(eol: "\n").ToFullString(); + } + else + { + processedMethods.Add(( + processedMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), + processedMethod.NormalizeWhitespace(eol: "\n").ToFullString())); } } - /// - /// Gets the sequence of processed discovered custom types. - /// - /// The sequence of discovered custom types. - /// A sequence of custom type definitions to add to the shader source. - internal static IEnumerable<(string Name, string Definition)> GetProcessedTypes(IEnumerable types) + // Process static methods as well + foreach (MethodDeclarationSyntax staticMethod in staticMethods.Values) { - foreach (var type in HlslKnownTypes.GetCustomTypes(types)) + processedMethods.Add(( + staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), + staticMethod.NormalizeWhitespace(eol: "\n").ToFullString())); + } + + return (entryPoint!, processedMethods, isSamplerUsed); + } + + /// + /// Gets a sequence of discovered constants. + /// + /// The collection of discovered constant definitions. + /// A sequence of discovered constants to declare in the shader. + [Pure] + internal static IEnumerable<(string Name, string Value)> GetProcessedConstants(IReadOnlyDictionary constantDefinitions) + { + foreach (var constant in constantDefinitions) + { + var ownerTypeName = ((INamedTypeSymbol)constant.Key.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); + var constantName = $"__{ownerTypeName}__{constant.Key.Name}"; + + yield return (constantName, constant.Value); + } + } + + /// + /// Gets the sequence of processed discovered custom types. + /// + /// The sequence of discovered custom types. + /// A sequence of custom type definitions to add to the shader source. + internal static IEnumerable<(string Name, string Definition)> GetProcessedTypes(IEnumerable types) + { + foreach (var type in HlslKnownTypes.GetCustomTypes(types)) + { + var structType = type.GetFullMetadataName().ToHlslIdentifierName(); + var structDeclaration = StructDeclaration(structType); + + // Declare the fields of the current type + foreach (var field in type.GetMembers().OfType()) { - var structType = type.GetFullMetadataName().ToHlslIdentifierName(); - var structDeclaration = StructDeclaration(structType); + if (field.IsStatic) continue; - // Declare the fields of the current type - foreach (var field in type.GetMembers().OfType()) + INamedTypeSymbol fieldType = (INamedTypeSymbol)field.Type; + + // Convert the name to the fully qualified HLSL version + if (!HlslKnownTypes.TryGetMappedName(fieldType.GetFullMetadataName(), out string? mapped)) { - if (field.IsStatic) continue; - - INamedTypeSymbol fieldType = (INamedTypeSymbol)field.Type; - - // Convert the name to the fully qualified HLSL version - if (!HlslKnownTypes.TryGetMappedName(fieldType.GetFullMetadataName(), out string? mapped)) - { - mapped = fieldType.GetFullMetadataName().ToHlslIdentifierName(); - } - - structDeclaration = structDeclaration.AddMembers( - FieldDeclaration(VariableDeclaration( - IdentifierName(mapped!)).AddVariables( - VariableDeclarator(Identifier(field.Name))))); + mapped = fieldType.GetFullMetadataName().ToHlslIdentifierName(); } - // Insert the trailing ; right after the closing bracket (after normalization) - yield return - (structType, - structDeclaration - .NormalizeWhitespace(eol: "\n") - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - .ToFullString()); + structDeclaration = structDeclaration.AddMembers( + FieldDeclaration(VariableDeclaration( + IdentifierName(mapped!)).AddVariables( + VariableDeclarator(Identifier(field.Name))))); + } + + // Insert the trailing ; right after the closing bracket (after normalization) + yield return + (structType, + structDeclaration + .NormalizeWhitespace(eol: "\n") + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + .ToFullString()); + } + } + + /// + /// Finds and reports all declared properties in a shader. + /// + /// The current generator context in use. + /// The input instance to process. + private static void DetectAndReportPropertyDeclarations(GeneratorExecutionContext context, INamedTypeSymbol structDeclarationSymbol) + { + foreach (var propertySymbol in structDeclarationSymbol.GetMembers().OfType()) + { + context.ReportDiagnostic(DiagnosticDescriptors.PropertyDeclaration, propertySymbol); + } + } + + /// + /// Produces the series of statements to build the current HLSL source. + /// + /// The sequence of defined constants for the shader. + /// The sequence of static fields referenced by the shader. + /// The sequence of declared types used by the shader. + /// Whether or not the current shader is a compute shader (or a pixel shader). + /// The sequence of instance fields for the current shader. + /// The type of the implicit target texture, if present. + /// Whether the static sampler is used by the shader. + /// The sequence of shared buffers declared by the shader. + /// The sequence of processed methods used by the shader. + /// The body of the entry point of the shader. + /// Indicates whether or not the directive for is needed. + /// The series of statements to build the HLSL source to compile to execute the current shader. + private static IEnumerable GenerateRenderMethodBody( + IEnumerable<(string Name, string Value)> definedConstants, + IEnumerable<(string Name, string TypeDeclaration, string? Assignment)> staticFields, + IEnumerable<(string Name, string Definition)> declaredTypes, + bool isComputeShader, + IEnumerable<(IFieldSymbol Symbol, string HlslName, string HlslType)> instanceFields, + string? implicitTextureType, + bool isSamplerUsed, + IEnumerable<(string Name, string Type, int? Count)> sharedBuffers, + IEnumerable<(string Signature, string Definition)> processedMethods, + string executeMethod, + out bool isHashSetDirectiveNeeded) + { + List statements = new(); + StringBuilder textBuilder = new(); + int capturedDelegates = 0; + int prologueStatements = 0; + int sizeHint = 64; + + void AppendLF() + { + textBuilder.Append('\n'); + } + + void AppendLine(string text) + { + textBuilder.Append(text); + } + + void AppendLineAndLF(string text) + { + textBuilder.Append(text); + textBuilder.Append('\n'); + } + + void AppendCharacterAndLF(char c) + { + textBuilder.Append(c); + textBuilder.Append('\n'); + } + + void AppendParsedStatement(string text) + { + FlushText(); + + statements.Add(ParseStatement(text)); + } + + void FlushText() + { + if (textBuilder.Length > 0) + { + sizeHint += textBuilder.Length; + + statements.Add( + ExpressionStatement( + InvocationExpression( + MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("builder"), IdentifierName("Append"))) + .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(textBuilder.ToString())))))); + + textBuilder.Clear(); } } - /// - /// Finds and reports all declared properties in a shader. - /// - /// The current generator context in use. - /// The input instance to process. - private static void DetectAndReportPropertyDeclarations(GeneratorExecutionContext context, INamedTypeSymbol structDeclarationSymbol) + // Declare the hashsets to track imported members and types from delegates, if needed + if (instanceFields.Any(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) { - foreach (var propertySymbol in structDeclarationSymbol.GetMembers().OfType()) + void DeclareMapping(int index, string name, IEnumerable items) { - context.ReportDiagnostic(DiagnosticDescriptors.PropertyDeclaration, propertySymbol); - } - } + // HashSet = new(); + statements.Insert(index, + LocalDeclarationStatement(VariableDeclaration( + GenericName(Identifier("HashSet")) + .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.StringKeyword)))) + .AddVariables( + VariableDeclarator(Identifier(name)) + .WithInitializer(EqualsValueClause(ImplicitObjectCreationExpression()))))); - /// - /// Produces the series of statements to build the current HLSL source. - /// - /// The sequence of defined constants for the shader. - /// The sequence of static fields referenced by the shader. - /// The sequence of declared types used by the shader. - /// Whether or not the current shader is a compute shader (or a pixel shader). - /// The sequence of instance fields for the current shader. - /// The type of the implicit target texture, if present. - /// Whether the static sampler is used by the shader. - /// The sequence of shared buffers declared by the shader. - /// The sequence of processed methods used by the shader. - /// The body of the entry point of the shader. - /// Indicates whether or not the directive for is needed. - /// The series of statements to build the HLSL source to compile to execute the current shader. - private static IEnumerable GenerateRenderMethodBody( - IEnumerable<(string Name, string Value)> definedConstants, - IEnumerable<(string Name, string TypeDeclaration, string? Assignment)> staticFields, - IEnumerable<(string Name, string Definition)> declaredTypes, - bool isComputeShader, - IEnumerable<(IFieldSymbol Symbol, string HlslName, string HlslType)> instanceFields, - string? implicitTextureType, - bool isSamplerUsed, - IEnumerable<(string Name, string Type, int? Count)> sharedBuffers, - IEnumerable<(string Signature, string Definition)> processedMethods, - string executeMethod, - out bool isHashSetDirectiveNeeded) - { - List statements = new(); - StringBuilder textBuilder = new(); - int capturedDelegates = 0; - int prologueStatements = 0; - int sizeHint = 64; + prologueStatements++; - void AppendLF() - { - textBuilder.Append('\n'); - } - - void AppendLine(string text) - { - textBuilder.Append(text); - } - - void AppendLineAndLF(string text) - { - textBuilder.Append(text); - textBuilder.Append('\n'); - } - - void AppendCharacterAndLF(char c) - { - textBuilder.Append(c); - textBuilder.Append('\n'); - } - - void AppendParsedStatement(string text) - { - FlushText(); - - statements.Add(ParseStatement(text)); - } - - void FlushText() - { - if (textBuilder.Length > 0) - { - sizeHint += textBuilder.Length; - - statements.Add( - ExpressionStatement( - InvocationExpression( - MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("builder"), IdentifierName("Append"))) - .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(textBuilder.ToString())))))); - - textBuilder.Clear(); - } - } - - // Declare the hashsets to track imported members and types from delegates, if needed - if (instanceFields.Any(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) - { - void DeclareMapping(int index, string name, IEnumerable items) - { - // HashSet = new(); - statements.Insert(index, - LocalDeclarationStatement(VariableDeclaration( - GenericName(Identifier("HashSet")) - .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.StringKeyword)))) - .AddVariables( - VariableDeclarator(Identifier(name)) - .WithInitializer(EqualsValueClause(ImplicitObjectCreationExpression()))))); - - prologueStatements++; - - // .Add(""); - foreach (var item in items) - { - statements.Add( - ExpressionStatement( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(name), - IdentifierName("Add"))) - .AddArgumentListArguments(Argument( - LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(item)))))); - - prologueStatements++; - } - } - - DeclareMapping(0, "__typeNames", declaredTypes.Select(static t => t.Name)); - DeclareMapping(1, "__constantNames", definedConstants.Select(static t => t.Name)); - DeclareMapping(2, "__methodNames", processedMethods.Select(static t => t.Signature)); - - // Go through all existing delegate fields, if any - foreach (var (fieldSymbol, fieldName, fieldType) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) - { - // ShaderMethodSourceAttribute __Attribute = ShaderMethodSourceAttribute.GetForDelegate(, ""); - statements.Add( - LocalDeclarationStatement(VariableDeclaration(IdentifierName(nameof(ShaderMethodSourceAttribute))) - .AddVariables( - VariableDeclarator(Identifier($"__{fieldName}Attribute")) - .WithInitializer( - EqualsValueClause( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(nameof(ShaderMethodSourceAttribute)), - IdentifierName(nameof(ShaderMethodSourceAttribute.GetForDelegate)))) - .AddArgumentListArguments( - Argument(IdentifierName(fieldName)), - Argument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(fieldName))))))))); - - capturedDelegates++; - prologueStatements++; - } - } - - isHashSetDirectiveNeeded = capturedDelegates > 0; - - // Header - AppendLineAndLF("// ================================================"); - AppendLineAndLF("// AUTO GENERATED"); - AppendLineAndLF("// ================================================"); - AppendLineAndLF("// This shader was created by ComputeSharp."); - AppendLineAndLF("// See: https://github.com/Sergio0694/ComputeSharp."); - - // Group size constants - AppendLF(); - AppendLine("#define __GroupSize__get_X "); - AppendParsedStatement("builder.Append(threadsX);"); - AppendLF(); - AppendLine("#define __GroupSize__get_Y "); - AppendParsedStatement("builder.Append(threadsY);"); - AppendLF(); - AppendLine("#define __GroupSize__get_Z "); - AppendParsedStatement("builder.Append(threadsZ);"); - AppendLF(); - - // Define declarations - foreach (var (name, value) in definedConstants) - { - AppendLineAndLF($"#define {name} {value}"); - } - - // Defines from captured delegates - foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) - { - AppendParsedStatement($"__{fieldName}Attribute.AppendConstants(ref builder, __constantNames);"); - } - - // Static fields - if (staticFields.Any()) - { - AppendLF(); - - foreach (var field in staticFields) - { - if (field.Assignment is string assignment) - { - AppendLineAndLF($"{field.TypeDeclaration} {field.Name} = {assignment};"); - } - else - { - AppendLineAndLF($"{field.TypeDeclaration} {field.Name};"); - } - } - } - - // Declared types - foreach (var (_, typeDefinition) in declaredTypes) - { - AppendLF(); - AppendLineAndLF(typeDefinition); - } - - // Declared types from captured delegates - foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) - { - AppendParsedStatement($"__{fieldName}Attribute.AppendTypes(ref builder, __typeNames);"); - } - - // Captured variables - AppendLF(); - AppendLineAndLF("cbuffer _ : register(b0)"); - AppendCharacterAndLF('{'); - AppendLineAndLF(" uint __x;"); - AppendLineAndLF(" uint __y;"); - - if (isComputeShader) - { - AppendLineAndLF(" uint __z;"); - } - - // User-defined values - foreach (var (fieldSymbol, fieldName, fieldType) in instanceFields.Where(static t => t.Symbol.Type.IsUnmanagedType)) - { - AppendLineAndLF($" {fieldType} {fieldName};"); - } - - AppendCharacterAndLF('}'); - - int - constantBuffersCount = 1, - readOnlyBuffersCount = 0, - readWriteBuffersCount = 0; - - // Optional implicit texture field - if (!isComputeShader) - { - AppendLF(); - AppendLineAndLF($"{implicitTextureType} __outputTexture : register(u{readWriteBuffersCount++});"); - } - - // Optional sampler field - if (isSamplerUsed) - { - AppendLF(); - AppendLineAndLF("SamplerState __sampler : register(s);"); - } - - // Resources - foreach (var (fieldSymbol, fieldName, fieldType) in instanceFields) - { - string metadataName = fieldSymbol.Type.GetFullMetadataName(); - - if (HlslKnownTypes.IsConstantBufferType(metadataName)) - { - AppendLF(); - AppendLineAndLF($"cbuffer _{fieldName} : register(b{constantBuffersCount++})"); - AppendCharacterAndLF('{'); - AppendLineAndLF($" {fieldType} {fieldName}[2];"); - AppendCharacterAndLF('}'); - } - else if (HlslKnownTypes.IsReadOnlyTypedResourceType(metadataName)) - { - AppendLF(); - AppendLineAndLF($"{fieldType} {fieldName} : register(t{readOnlyBuffersCount++});"); - } - else if (HlslKnownTypes.IsTypedResourceType(metadataName)) - { - AppendLF(); - AppendLineAndLF($"{fieldType} {fieldName} : register(u{readWriteBuffersCount++});"); - } - } - - // Shared buffers - foreach (var (bufferName, bufferType, bufferCount) in sharedBuffers) - { - object count = (object?)bufferCount ?? "threadsX * threadsY * threadsZ"; - - AppendLF(); - AppendLineAndLF($"groupshared {bufferType} {bufferName} [{count}];"); - } - - // Forward declarations - foreach (var (forwardDeclaration, _) in processedMethods) - { - AppendLF(); - AppendLineAndLF(forwardDeclaration); - } - - // Forward declarations from captured delegates - foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) - { - AppendParsedStatement($"__{fieldName}Attribute.AppendForwardDeclarations(ref builder, __methodNames);"); - } - - // Remove all forward declarations from methods that are embedded into the shader. - // This is necessary to avoid duplicate definitions from methods from delegates. - if (capturedDelegates > 0) - { // .Add(""); - foreach (var (forwardDeclaration, _) in processedMethods) + foreach (var item in items) { - FlushText(); - statements.Add( ExpressionStatement( InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("__methodNames"), - IdentifierName("Remove"))) + IdentifierName(name), + IdentifierName("Add"))) .AddArgumentListArguments(Argument( - LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(forwardDeclaration)))))); + LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(item)))))); + + prologueStatements++; } } - // Captured methods - foreach (var (_, method) in processedMethods) - { - AppendLF(); - AppendLineAndLF(method); - } + DeclareMapping(0, "__typeNames", declaredTypes.Select(static t => t.Name)); + DeclareMapping(1, "__constantNames", definedConstants.Select(static t => t.Name)); + DeclareMapping(2, "__methodNames", processedMethods.Select(static t => t.Signature)); - // Captured methods from captured delegates - foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) + // Go through all existing delegate fields, if any + foreach (var (fieldSymbol, fieldName, fieldType) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) { - AppendParsedStatement($"__{fieldName}Attribute.AppendMethods(ref builder, __methodNames);"); - } + // ShaderMethodSourceAttribute __Attribute = ShaderMethodSourceAttribute.GetForDelegate(, ""); + statements.Add( + LocalDeclarationStatement(VariableDeclaration(IdentifierName(nameof(ShaderMethodSourceAttribute))) + .AddVariables( + VariableDeclarator(Identifier($"__{fieldName}Attribute")) + .WithInitializer( + EqualsValueClause( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ShaderMethodSourceAttribute)), + IdentifierName(nameof(ShaderMethodSourceAttribute.GetForDelegate)))) + .AddArgumentListArguments( + Argument(IdentifierName(fieldName)), + Argument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(fieldName))))))))); - // Captured delegate methods - foreach (var (fieldSymbol, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) - { - AppendLF(); - AppendParsedStatement($"__{fieldName}Attribute.AppendMappedInvokeMethod(ref builder, \"{fieldName}\");"); - AppendLF(); + capturedDelegates++; + prologueStatements++; } + } - // Entry point + isHashSetDirectiveNeeded = capturedDelegates > 0; + + // Header + AppendLineAndLF("// ================================================"); + AppendLineAndLF("// AUTO GENERATED"); + AppendLineAndLF("// ================================================"); + AppendLineAndLF("// This shader was created by ComputeSharp."); + AppendLineAndLF("// See: https://github.com/Sergio0694/ComputeSharp."); + + // Group size constants + AppendLF(); + AppendLine("#define __GroupSize__get_X "); + AppendParsedStatement("builder.Append(threadsX);"); + AppendLF(); + AppendLine("#define __GroupSize__get_Y "); + AppendParsedStatement("builder.Append(threadsY);"); + AppendLF(); + AppendLine("#define __GroupSize__get_Z "); + AppendParsedStatement("builder.Append(threadsZ);"); + AppendLF(); + + // Define declarations + foreach (var (name, value) in definedConstants) + { + AppendLineAndLF($"#define {name} {value}"); + } + + // Defines from captured delegates + foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) + { + AppendParsedStatement($"__{fieldName}Attribute.AppendConstants(ref builder, __constantNames);"); + } + + // Static fields + if (staticFields.Any()) + { AppendLF(); - AppendLineAndLF("[NumThreads(__GroupSize__get_X, __GroupSize__get_Y, __GroupSize__get_Z)]"); - AppendLineAndLF(executeMethod); - FlushText(); + foreach (var field in staticFields) + { + if (field.Assignment is string assignment) + { + AppendLineAndLF($"{field.TypeDeclaration} {field.Name} = {assignment};"); + } + else + { + AppendLineAndLF($"{field.TypeDeclaration} {field.Name};"); + } + } + } - // builder = ArrayPoolStringBuilder.Create(); - statements.Insert( - prologueStatements, - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - IdentifierName("builder"), + // Declared types + foreach (var (_, typeDefinition) in declaredTypes) + { + AppendLF(); + AppendLineAndLF(typeDefinition); + } + + // Declared types from captured delegates + foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) + { + AppendParsedStatement($"__{fieldName}Attribute.AppendTypes(ref builder, __typeNames);"); + } + + // Captured variables + AppendLF(); + AppendLineAndLF("cbuffer _ : register(b0)"); + AppendCharacterAndLF('{'); + AppendLineAndLF(" uint __x;"); + AppendLineAndLF(" uint __y;"); + + if (isComputeShader) + { + AppendLineAndLF(" uint __z;"); + } + + // User-defined values + foreach (var (fieldSymbol, fieldName, fieldType) in instanceFields.Where(static t => t.Symbol.Type.IsUnmanagedType)) + { + AppendLineAndLF($" {fieldType} {fieldName};"); + } + + AppendCharacterAndLF('}'); + + int + constantBuffersCount = 1, + readOnlyBuffersCount = 0, + readWriteBuffersCount = 0; + + // Optional implicit texture field + if (!isComputeShader) + { + AppendLF(); + AppendLineAndLF($"{implicitTextureType} __outputTexture : register(u{readWriteBuffersCount++});"); + } + + // Optional sampler field + if (isSamplerUsed) + { + AppendLF(); + AppendLineAndLF("SamplerState __sampler : register(s);"); + } + + // Resources + foreach (var (fieldSymbol, fieldName, fieldType) in instanceFields) + { + string metadataName = fieldSymbol.Type.GetFullMetadataName(); + + if (HlslKnownTypes.IsConstantBufferType(metadataName)) + { + AppendLF(); + AppendLineAndLF($"cbuffer _{fieldName} : register(b{constantBuffersCount++})"); + AppendCharacterAndLF('{'); + AppendLineAndLF($" {fieldType} {fieldName}[2];"); + AppendCharacterAndLF('}'); + } + else if (HlslKnownTypes.IsReadOnlyTypedResourceType(metadataName)) + { + AppendLF(); + AppendLineAndLF($"{fieldType} {fieldName} : register(t{readOnlyBuffersCount++});"); + } + else if (HlslKnownTypes.IsTypedResourceType(metadataName)) + { + AppendLF(); + AppendLineAndLF($"{fieldType} {fieldName} : register(u{readWriteBuffersCount++});"); + } + } + + // Shared buffers + foreach (var (bufferName, bufferType, bufferCount) in sharedBuffers) + { + object count = (object?)bufferCount ?? "threadsX * threadsY * threadsZ"; + + AppendLF(); + AppendLineAndLF($"groupshared {bufferType} {bufferName} [{count}];"); + } + + // Forward declarations + foreach (var (forwardDeclaration, _) in processedMethods) + { + AppendLF(); + AppendLineAndLF(forwardDeclaration); + } + + // Forward declarations from captured delegates + foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) + { + AppendParsedStatement($"__{fieldName}Attribute.AppendForwardDeclarations(ref builder, __methodNames);"); + } + + // Remove all forward declarations from methods that are embedded into the shader. + // This is necessary to avoid duplicate definitions from methods from delegates. + if (capturedDelegates > 0) + { + // .Add(""); + foreach (var (forwardDeclaration, _) in processedMethods) + { + FlushText(); + + statements.Add( + ExpressionStatement( InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("ArrayPoolStringBuilder"), - IdentifierName("Create"))) - .AddArgumentListArguments( - Argument(LiteralExpression( - SyntaxKind.NumericLiteralExpression, - Literal(sizeHint))))))); - - return statements; + IdentifierName("__methodNames"), + IdentifierName("Remove"))) + .AddArgumentListArguments(Argument( + LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(forwardDeclaration)))))); + } } + + // Captured methods + foreach (var (_, method) in processedMethods) + { + AppendLF(); + AppendLineAndLF(method); + } + + // Captured methods from captured delegates + foreach (var (_, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) + { + AppendParsedStatement($"__{fieldName}Attribute.AppendMethods(ref builder, __methodNames);"); + } + + // Captured delegate methods + foreach (var (fieldSymbol, fieldName, _) in instanceFields.Where(static t => t.Symbol.Type.TypeKind == TypeKind.Delegate)) + { + AppendLF(); + AppendParsedStatement($"__{fieldName}Attribute.AppendMappedInvokeMethod(ref builder, \"{fieldName}\");"); + AppendLF(); + } + + // Entry point + AppendLF(); + AppendLineAndLF("[NumThreads(__GroupSize__get_X, __GroupSize__get_Y, __GroupSize__get_Z)]"); + AppendLineAndLF(executeMethod); + + FlushText(); + + // builder = ArrayPoolStringBuilder.Create(); + statements.Insert( + prologueStatements, + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + IdentifierName("builder"), + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("ArrayPoolStringBuilder"), + IdentifierName("Create"))) + .AddArgumentListArguments( + Argument(LiteralExpression( + SyntaxKind.NumericLiteralExpression, + Literal(sizeHint))))))); + + return statements; } } - diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateGetDispatchIdMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateGetDispatchIdMethod.cs index aa056abb..092fb425 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateGetDispatchIdMethod.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateGetDispatchIdMethod.cs @@ -10,91 +10,89 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; #pragma warning disable CS0618 -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class IShaderGenerator { /// - public sealed partial class IShaderGenerator + private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol) { - /// - private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol) + // This code produces a method declaration as follows: + // + // readonly int IShader.GetDispatchId() + // { + // + // } + return + MethodDeclaration( + PredefinedType(Token(SyntaxKind.IntKeyword)), + Identifier("GetDispatchId")) + .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) + .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) + .WithBody(GetShaderHashCodeBody(structDeclarationSymbol)); + } + + /// + /// Gets a instance with the logic to compute the hashcode of a given shader type. + /// + /// The input instance to process. + /// The instance to hash the input shader. + [Pure] + private static BlockSyntax GetShaderHashCodeBody(INamedTypeSymbol structDeclarationSymbol) + { + var delegateFields = structDeclarationSymbol + .GetMembers() + .OfType() + .Where(static m => m.Type is INamedTypeSymbol { TypeKind: TypeKind.Delegate, IsStatic: false }) + .ToImmutableArray(); + + if (delegateFields.Length == 0) { - // This code produces a method declaration as follows: - // - // readonly int IShader.GetDispatchId() - // { - // - // } + // return 0; return - MethodDeclaration( - PredefinedType(Token(SyntaxKind.IntKeyword)), - Identifier("GetDispatchId")) - .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) - .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .WithBody(GetShaderHashCodeBody(structDeclarationSymbol)); + Block(ReturnStatement( + LiteralExpression( + SyntaxKind.NumericLiteralExpression, + Literal(0)))); } - /// - /// Gets a instance with the logic to compute the hashcode of a given shader type. - /// - /// The input instance to process. - /// The instance to hash the input shader. - [Pure] - private static BlockSyntax GetShaderHashCodeBody(INamedTypeSymbol structDeclarationSymbol) - { - var delegateFields = structDeclarationSymbol - .GetMembers() - .OfType() - .Where(static m => m.Type is INamedTypeSymbol { TypeKind: TypeKind.Delegate, IsStatic: false }) - .ToImmutableArray(); + List blockStatements = new(4); - if (delegateFields.Length == 0) - { - // return 0; - return - Block(ReturnStatement( + // HashCode hashCode = default; + blockStatements.Add(LocalDeclarationStatement( + VariableDeclaration(IdentifierName("HashCode")) + .AddVariables( + VariableDeclarator(Identifier("hashCode")) + .WithInitializer(EqualsValueClause( LiteralExpression( - SyntaxKind.NumericLiteralExpression, - Literal(0)))); - } + SyntaxKind.DefaultLiteralExpression, + Token(SyntaxKind.DefaultKeyword))))))); - List blockStatements = new(4); - - // HashCode hashCode = default; - blockStatements.Add(LocalDeclarationStatement( - VariableDeclaration(IdentifierName("HashCode")) - .AddVariables( - VariableDeclarator(Identifier("hashCode")) - .WithInitializer(EqualsValueClause( - LiteralExpression( - SyntaxKind.DefaultLiteralExpression, - Token(SyntaxKind.DefaultKeyword))))))); - - foreach (IFieldSymbol fieldSymbol in delegateFields) - { - // hashCode.Add(delegateField.Method); - blockStatements.Add(ExpressionStatement( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("hashCode"), - IdentifierName("Add"))) - .AddArgumentListArguments(Argument( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(fieldSymbol.Name), - IdentifierName("Method")))))); - } - - // return hashCode.ToHashCode(); - blockStatements.Add(ReturnStatement( + foreach (IFieldSymbol fieldSymbol in delegateFields) + { + // hashCode.Add(delegateField.Method); + blockStatements.Add(ExpressionStatement( InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, IdentifierName("hashCode"), - IdentifierName("ToHashCode"))))); - - return Block(blockStatements); + IdentifierName("Add"))) + .AddArgumentListArguments(Argument( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(fieldSymbol.Name), + IdentifierName("Method")))))); } + + // return hashCode.ToHashCode(); + blockStatements.Add(ReturnStatement( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("hashCode"), + IdentifierName("ToHashCode"))))); + + return Block(blockStatements); } } - diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.cs index 84473701..bc16e5ac 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.cs @@ -14,327 +14,325 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; #pragma warning disable CS0618 -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class IShaderGenerator { /// - public sealed partial class IShaderGenerator + private static partial MethodDeclarationSyntax CreateLoadDispatchDataMethod( + GeneratorExecutionContext context, + INamedTypeSymbol structDeclarationSymbol, + out IReadOnlyCollection discoveredResources, + out int root32BitConstantsCount) { - /// - private static partial MethodDeclarationSyntax CreateLoadDispatchDataMethod( - GeneratorExecutionContext context, - INamedTypeSymbol structDeclarationSymbol, - out IReadOnlyCollection discoveredResources, - out int root32BitConstantsCount) + // This code produces a method declaration as follows: + // + // readonly void IShader.LoadDispatchData(ref TDataLoader loader, GraphicsDevice device, int x, int y, int z) + // { + // + // } + return + MethodDeclaration( + PredefinedType(Token(SyntaxKind.VoidKeyword)), + Identifier("LoadDispatchData")) + .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) + .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) + .AddTypeParameterListParameters(TypeParameter(Identifier("TDataLoader"))) + .AddParameterListParameters( + Parameter(Identifier("loader")) + .AddModifiers(Token(SyntaxKind.RefKeyword)) + .WithType(IdentifierName("TDataLoader")), + Parameter(Identifier("device")).WithType(IdentifierName("GraphicsDevice")), + Parameter(Identifier("x")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), + Parameter(Identifier("y")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), + Parameter(Identifier("z")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword)))) + .WithBody(Block(GetDispatchDataLoadingStatements(context, structDeclarationSymbol, out discoveredResources, out root32BitConstantsCount))); + } + + /// + /// Gets a sequence of statements to load the dispatch data for a given shader. + /// + /// The current generator context in use. + /// The input instance to process. + /// The collection of discovered resources in the current shader type. + /// The total number of 32 bit root constants being loaded for the current shader type. + /// The sequence of instances to load shader dispatch data. + private static IEnumerable GetDispatchDataLoadingStatements(GeneratorExecutionContext context, INamedTypeSymbol structDeclarationSymbol, out IReadOnlyCollection discoveredResources, out int root32BitConstantsCount) + { + List statements = new(); + List resources = new(); + + discoveredResources = resources; + + var pixelShaderSymbol = structDeclarationSymbol.AllInterfaces.FirstOrDefault(static interfaceSymbol => interfaceSymbol is { IsGenericType: true, Name: nameof(IPixelShader) }); + var isComputeShader = pixelShaderSymbol is null; + int + resourceOffset = 0, + rawDataOffset = sizeof(int) * (isComputeShader ? 3 : 2); + + // Append the statements for the dispatch ranges: + // + // span0[0] = (uint)x; + // span0[1] = (uint)y; + // span0[2] = (uint)z; + statements.Add( + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ElementAccessExpression(IdentifierName("span0")) + .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0)))), + CastExpression(PredefinedType(Token(SyntaxKind.UIntKeyword)), IdentifierName("x"))))); + + statements.Add( + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ElementAccessExpression(IdentifierName("span0")) + .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(1)))), + CastExpression(PredefinedType(Token(SyntaxKind.UIntKeyword)), IdentifierName("y"))))); + + if (isComputeShader) { - // This code produces a method declaration as follows: - // - // readonly void IShader.LoadDispatchData(ref TDataLoader loader, GraphicsDevice device, int x, int y, int z) - // { - // - // } - return - MethodDeclaration( - PredefinedType(Token(SyntaxKind.VoidKeyword)), - Identifier("LoadDispatchData")) - .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) - .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .AddTypeParameterListParameters(TypeParameter(Identifier("TDataLoader"))) - .AddParameterListParameters( - Parameter(Identifier("loader")) - .AddModifiers(Token(SyntaxKind.RefKeyword)) - .WithType(IdentifierName("TDataLoader")), - Parameter(Identifier("device")).WithType(IdentifierName("GraphicsDevice")), - Parameter(Identifier("x")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), - Parameter(Identifier("y")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), - Parameter(Identifier("z")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword)))) - .WithBody(Block(GetDispatchDataLoadingStatements(context, structDeclarationSymbol, out discoveredResources, out root32BitConstantsCount))); + statements.Add( + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ElementAccessExpression(IdentifierName("span0")) + .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(2)))), + CastExpression(PredefinedType(Token(SyntaxKind.UIntKeyword)), IdentifierName("z"))))); } - /// - /// Gets a sequence of statements to load the dispatch data for a given shader. - /// - /// The current generator context in use. - /// The input instance to process. - /// The collection of discovered resources in the current shader type. - /// The total number of 32 bit root constants being loaded for the current shader type. - /// The sequence of instances to load shader dispatch data. - private static IEnumerable GetDispatchDataLoadingStatements(GeneratorExecutionContext context, INamedTypeSymbol structDeclarationSymbol, out IReadOnlyCollection discoveredResources, out int root32BitConstantsCount) + // Append the statements to load all fields (both resources and other captured values) + AppendFields(structDeclarationSymbol, Array.Empty(), ref resourceOffset, ref rawDataOffset, resources, statements); + + // After all the captured fields have been processed, ansure the reported byte size for + // the local variables is padded to a multiple of a 32 bit value. This is necessary to + // enable loading all the dispatch data after reinterpreting it to a sequence of values + // of size 32 bits (via SetComputeRoot32BitConstants), without reading out of bounds. + rawDataOffset = AlignmentHelper.Pad(rawDataOffset, sizeof(int)); + root32BitConstantsCount = rawDataOffset / sizeof(int); + + // A shader root signature has a maximum size of 64 DWORDs, so 256 bytes. + // Loaded values in the root signature have the following costs: + // - Root constants cost 1 DWORD each, since they are 32-bit values. + // - Descriptor tables cost 1 DWORD each. + // - Root descriptors (64-bit GPU virtual addresses) cost 2 DWORDs each. + // So here we check whether the current signature respects that constraint, + // and emit a build error otherwise. For more info on this, see the docs here: + // https://docs.microsoft.com/windows/win32/direct3d12/root-signature-limits. + int rootSignatureDwordSize = root32BitConstantsCount + resourceOffset; + + if (rootSignatureDwordSize > 64) { - List statements = new(); - List resources = new(); + context.ReportDiagnostic(ShaderDispatchDataSizeExceeded, structDeclarationSymbol, structDeclarationSymbol); + } - discoveredResources = resources; + // Span span0 = stackalloc uint[]; + statements.Insert(0, + LocalDeclarationStatement( + VariableDeclaration( + GenericName(Identifier("Span")) + .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.UIntKeyword)))) + .AddVariables( + VariableDeclarator(Identifier("span0")) + .WithInitializer(EqualsValueClause( + StackAllocArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.UIntKeyword))) + .AddRankSpecifiers( + ArrayRankSpecifier(SingletonSeparatedList( + LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(root32BitConstantsCount))))))))))); - var pixelShaderSymbol = structDeclarationSymbol.AllInterfaces.FirstOrDefault(static interfaceSymbol => interfaceSymbol is { IsGenericType: true, Name: nameof(IPixelShader) }); - var isComputeShader = pixelShaderSymbol is null; - int - resourceOffset = 0, - rawDataOffset = sizeof(int) * (isComputeShader ? 3 : 2); + // ref uint r0 = ref span0[0]; + statements.Insert(1, + LocalDeclarationStatement( + VariableDeclaration(RefType(PredefinedType(Token(SyntaxKind.UIntKeyword)))) + .AddVariables( + VariableDeclarator(Identifier("r0")) + .WithInitializer(EqualsValueClause( + RefExpression( + ElementAccessExpression(IdentifierName("span0")) + .AddArgumentListArguments(Argument( + LiteralExpression( + SyntaxKind.NumericLiteralExpression, + Literal(0)))))))))); - // Append the statements for the dispatch ranges: - // - // span0[0] = (uint)x; - // span0[1] = (uint)y; - // span0[2] = (uint)z; - statements.Add( - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - ElementAccessExpression(IdentifierName("span0")) - .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0)))), - CastExpression(PredefinedType(Token(SyntaxKind.UIntKeyword)), IdentifierName("x"))))); + // loader.LoadCapturedValues(span0); + statements.Add( + ExpressionStatement( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("loader"), + IdentifierName("LoadCapturedValues"))) + .AddArgumentListArguments(Argument(IdentifierName("span0"))))); - statements.Add( - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - ElementAccessExpression(IdentifierName("span0")) - .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(1)))), - CastExpression(PredefinedType(Token(SyntaxKind.UIntKeyword)), IdentifierName("y"))))); - - if (isComputeShader) - { - statements.Add( - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - ElementAccessExpression(IdentifierName("span0")) - .AddArgumentListArguments(Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(2)))), - CastExpression(PredefinedType(Token(SyntaxKind.UIntKeyword)), IdentifierName("z"))))); - } - - // Append the statements to load all fields (both resources and other captured values) - AppendFields(structDeclarationSymbol, Array.Empty(), ref resourceOffset, ref rawDataOffset, resources, statements); - - // After all the captured fields have been processed, ansure the reported byte size for - // the local variables is padded to a multiple of a 32 bit value. This is necessary to - // enable loading all the dispatch data after reinterpreting it to a sequence of values - // of size 32 bits (via SetComputeRoot32BitConstants), without reading out of bounds. - rawDataOffset = AlignmentHelper.Pad(rawDataOffset, sizeof(int)); - root32BitConstantsCount = rawDataOffset / sizeof(int); - - // A shader root signature has a maximum size of 64 DWORDs, so 256 bytes. - // Loaded values in the root signature have the following costs: - // - Root constants cost 1 DWORD each, since they are 32-bit values. - // - Descriptor tables cost 1 DWORD each. - // - Root descriptors (64-bit GPU virtual addresses) cost 2 DWORDs each. - // So here we check whether the current signature respects that constraint, - // and emit a build error otherwise. For more info on this, see the docs here: - // https://docs.microsoft.com/windows/win32/direct3d12/root-signature-limits. - int rootSignatureDwordSize = root32BitConstantsCount + resourceOffset; - - if (rootSignatureDwordSize > 64) - { - context.ReportDiagnostic(ShaderDispatchDataSizeExceeded, structDeclarationSymbol, structDeclarationSymbol); - } - - // Span span0 = stackalloc uint[]; - statements.Insert(0, + if (resourceOffset > 0) + { + // Span span1 = stackalloc ulong[]; + statements.Insert(1, LocalDeclarationStatement( VariableDeclaration( GenericName(Identifier("Span")) - .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.UIntKeyword)))) + .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.ULongKeyword)))) .AddVariables( - VariableDeclarator(Identifier("span0")) + VariableDeclarator(Identifier("span1")) .WithInitializer(EqualsValueClause( StackAllocArrayCreationExpression( - ArrayType(PredefinedType(Token(SyntaxKind.UIntKeyword))) + ArrayType(PredefinedType(Token(SyntaxKind.ULongKeyword))) .AddRankSpecifiers( ArrayRankSpecifier(SingletonSeparatedList( - LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(root32BitConstantsCount))))))))))); + LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(resourceOffset))))))))))); - // ref uint r0 = ref span0[0]; - statements.Insert(1, + // ref ulong r1 = ref span1[0]; + statements.Insert(3, LocalDeclarationStatement( - VariableDeclaration(RefType(PredefinedType(Token(SyntaxKind.UIntKeyword)))) + VariableDeclaration(RefType(PredefinedType(Token(SyntaxKind.ULongKeyword)))) .AddVariables( - VariableDeclarator(Identifier("r0")) + VariableDeclarator(Identifier("r1")) .WithInitializer(EqualsValueClause( RefExpression( - ElementAccessExpression(IdentifierName("span0")) + ElementAccessExpression(IdentifierName("span1")) .AddArgumentListArguments(Argument( LiteralExpression( SyntaxKind.NumericLiteralExpression, Literal(0)))))))))); - // loader.LoadCapturedValues(span0); + // loader.LoadCapturedResources(span1); statements.Add( ExpressionStatement( InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, IdentifierName("loader"), - IdentifierName("LoadCapturedValues"))) - .AddArgumentListArguments(Argument(IdentifierName("span0"))))); - - if (resourceOffset > 0) - { - // Span span1 = stackalloc ulong[]; - statements.Insert(1, - LocalDeclarationStatement( - VariableDeclaration( - GenericName(Identifier("Span")) - .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.ULongKeyword)))) - .AddVariables( - VariableDeclarator(Identifier("span1")) - .WithInitializer(EqualsValueClause( - StackAllocArrayCreationExpression( - ArrayType(PredefinedType(Token(SyntaxKind.ULongKeyword))) - .AddRankSpecifiers( - ArrayRankSpecifier(SingletonSeparatedList( - LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(resourceOffset))))))))))); - - // ref ulong r1 = ref span1[0]; - statements.Insert(3, - LocalDeclarationStatement( - VariableDeclaration(RefType(PredefinedType(Token(SyntaxKind.ULongKeyword)))) - .AddVariables( - VariableDeclarator(Identifier("r1")) - .WithInitializer(EqualsValueClause( - RefExpression( - ElementAccessExpression(IdentifierName("span1")) - .AddArgumentListArguments(Argument( - LiteralExpression( - SyntaxKind.NumericLiteralExpression, - Literal(0)))))))))); - - // loader.LoadCapturedResources(span1); - statements.Add( - ExpressionStatement( - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("loader"), - IdentifierName("LoadCapturedResources"))) - .AddArgumentListArguments(Argument(IdentifierName("span1"))))); - } - - return statements; + IdentifierName("LoadCapturedResources"))) + .AddArgumentListArguments(Argument(IdentifierName("span1"))))); } - /// - /// Explores a given type hierarchy and generates statements to load fields. - /// - /// The current type being explored. - /// The current path of the field with respect to the shader instance. - /// The current offset in the root table of loaded resources. - /// The current offset within the loaded data buffer. - /// The target list of resources in the current shader type. - /// The target list of statements being generated. - private static void AppendFields(ITypeSymbol currentTypeSymbol, IReadOnlyCollection fieldPath, ref int resourceOffset, ref int rawDataOffset, ICollection resources, ICollection statements) + return statements; + } + + /// + /// Explores a given type hierarchy and generates statements to load fields. + /// + /// The current type being explored. + /// The current path of the field with respect to the shader instance. + /// The current offset in the root table of loaded resources. + /// The current offset within the loaded data buffer. + /// The target list of resources in the current shader type. + /// The target list of statements being generated. + private static void AppendFields(ITypeSymbol currentTypeSymbol, IReadOnlyCollection fieldPath, ref int resourceOffset, ref int rawDataOffset, ICollection resources, ICollection statements) + { + bool isFirstField = true; + + foreach ( + IFieldSymbol fieldSymbol in + from fieldSymbol in currentTypeSymbol.GetMembers().OfType() + where fieldSymbol.Type is INamedTypeSymbol { IsStatic: false } && + !fieldSymbol.IsConst && !fieldSymbol.IsStatic && !fieldSymbol.IsFixedSizeBuffer + select fieldSymbol) { - bool isFirstField = true; + string + fieldName = fieldSymbol.Name, + typeName = fieldSymbol.Type.GetFullMetadataName(); - foreach ( - IFieldSymbol fieldSymbol in - from fieldSymbol in currentTypeSymbol.GetMembers().OfType() - where fieldSymbol.Type is INamedTypeSymbol { IsStatic: false } && - !fieldSymbol.IsConst && !fieldSymbol.IsStatic && !fieldSymbol.IsFixedSizeBuffer - select fieldSymbol) + // Disambiguates the name of target fields against the current input parameters + if (fieldName is "loader" or "device" or "x" or "y" or "z") { - string - fieldName = fieldSymbol.Name, - typeName = fieldSymbol.Type.GetFullMetadataName(); - - // Disambiguates the name of target fields against the current input parameters - if (fieldName is "loader" or "device" or "x" or "y" or "z") - { - fieldName = $"this.{fieldName}"; - } - - // The first item in each nested struct needs to be aligned to 16 bytes - if (isFirstField && fieldPath.Count > 0) - { - rawDataOffset = AlignmentHelper.Pad(rawDataOffset, 16); - - isFirstField = false; - } - - if (HlslKnownTypes.IsTypedResourceType(typeName)) - { - resources.Add(typeName); - - statements.Add(ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - ParseExpression($"Unsafe.Add(ref r1, {resourceOffset++})"), - ParseExpression($"GraphicsResourceHelper.ValidateAndGetGpuDescriptorHandle({fieldName}, device)")))); - } - else if (HlslKnownTypes.IsKnownHlslType(typeName)) - { - AppendHlslKnownTypeField(fieldPath.Concat(new[] { fieldName }), typeName, ref rawDataOffset, statements); - } - else if (fieldSymbol.Type.IsUnmanagedType) - { - // Custom struct type defined by the user - AppendFields(fieldSymbol.Type, fieldPath.Concat(new[] { fieldName }).ToArray(), ref resourceOffset, ref rawDataOffset, resources, statements); - } + fieldName = $"this.{fieldName}"; } - } - /// - /// Generates a loading statement for a known HLSL primitive type field (scalar, vector or matrix). - /// - /// The current path of the field with respect to the shader instance. - /// The type name currently being read. - /// The current offset within the loaded data buffer. - /// The target list of statements being generated. - private static void AppendHlslKnownTypeField(IEnumerable fieldPath, string typeName, ref int rawDataOffset, ICollection statements) - { - // For scalar, vector and linear matrix types, serialize the value normally. - // Only the initial alignment needs to be considered, while data is packed. - var (fieldSize, fieldPack) = HlslKnownSizes.GetTypeInfo(typeName); - - // Check if the current type is a matrix type with more than one row. In this - // case, each row is aligned as if it was a separate array, so the start of - // each row needs to be at a multiple of 16 bytes (a float4 register). - if (HlslKnownTypes.IsNonLinearMatrixType(typeName, out string? elementName, out int rows, out int columns)) + // The first item in each nested struct needs to be aligned to 16 bytes + if (isFirstField && fieldPath.Count > 0) { - string - rowTypeName = $"ComputeSharp.{elementName}{columns}", - rowLocalName = $"__{string.Join("_", fieldPath)}__row0"; + rawDataOffset = AlignmentHelper.Pad(rawDataOffset, 16); - statements.Add(ParseStatement($"ref {rowTypeName} {rowLocalName} = ref Unsafe.As<{typeName}, {rowTypeName}>(ref Unsafe.AsRef(in {string.Join(".", fieldPath)}));")); - - // Generate the loading code for each individual row, with proper alignment. - // This will result in the following (assuming Float2x3 m): - // - // ref Float3 __m__row0 = ref Unsafe.As(ref Unsafe.AsRef(in m)); - // Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint)rawDataOffset)) =, Unsafe.Add(ref __m__row0, 0); - // Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint)(rawDataOffset + 16))) = Unsafe.Add(ref __m__row0, 1); - for (int j = 0; j < rows; j++) - { - rawDataOffset = AlignmentHelper.Pad(rawDataOffset, 16); - - statements.Add(ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - ParseExpression($"Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint){rawDataOffset}))"), - ParseExpression($"Unsafe.Add(ref {rowLocalName}, {j})")))); - - rawDataOffset += fieldPack * columns; - } + isFirstField = false; } - else + + if (HlslKnownTypes.IsTypedResourceType(typeName)) { - // Calculate the right offset with 16-bytes padding (HLSL constant buffer). - // Since we're in a constant buffer, we need to both pad the starting offset - // to be aligned to the packing size of the type, and also to align the initial - // offset to ensure that values do not cross 16 bytes boundaries either. - rawDataOffset = AlignmentHelper.AlignToBoundary( - AlignmentHelper.Pad(rawDataOffset, fieldPack), - fieldSize, - 16); + resources.Add(typeName); statements.Add(ExpressionStatement( AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, - ParseExpression($"Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint){rawDataOffset}))"), - ParseExpression($"{string.Join(".", fieldPath)}")))); - - rawDataOffset += fieldSize; + ParseExpression($"Unsafe.Add(ref r1, {resourceOffset++})"), + ParseExpression($"GraphicsResourceHelper.ValidateAndGetGpuDescriptorHandle({fieldName}, device)")))); + } + else if (HlslKnownTypes.IsKnownHlslType(typeName)) + { + AppendHlslKnownTypeField(fieldPath.Concat(new[] { fieldName }), typeName, ref rawDataOffset, statements); + } + else if (fieldSymbol.Type.IsUnmanagedType) + { + // Custom struct type defined by the user + AppendFields(fieldSymbol.Type, fieldPath.Concat(new[] { fieldName }).ToArray(), ref resourceOffset, ref rawDataOffset, resources, statements); } } } -} + /// + /// Generates a loading statement for a known HLSL primitive type field (scalar, vector or matrix). + /// + /// The current path of the field with respect to the shader instance. + /// The type name currently being read. + /// The current offset within the loaded data buffer. + /// The target list of statements being generated. + private static void AppendHlslKnownTypeField(IEnumerable fieldPath, string typeName, ref int rawDataOffset, ICollection statements) + { + // For scalar, vector and linear matrix types, serialize the value normally. + // Only the initial alignment needs to be considered, while data is packed. + var (fieldSize, fieldPack) = HlslKnownSizes.GetTypeInfo(typeName); + + // Check if the current type is a matrix type with more than one row. In this + // case, each row is aligned as if it was a separate array, so the start of + // each row needs to be at a multiple of 16 bytes (a float4 register). + if (HlslKnownTypes.IsNonLinearMatrixType(typeName, out string? elementName, out int rows, out int columns)) + { + string + rowTypeName = $"ComputeSharp.{elementName}{columns}", + rowLocalName = $"__{string.Join("_", fieldPath)}__row0"; + + statements.Add(ParseStatement($"ref {rowTypeName} {rowLocalName} = ref Unsafe.As<{typeName}, {rowTypeName}>(ref Unsafe.AsRef(in {string.Join(".", fieldPath)}));")); + + // Generate the loading code for each individual row, with proper alignment. + // This will result in the following (assuming Float2x3 m): + // + // ref Float3 __m__row0 = ref Unsafe.As(ref Unsafe.AsRef(in m)); + // Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint)rawDataOffset)) =, Unsafe.Add(ref __m__row0, 0); + // Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint)(rawDataOffset + 16))) = Unsafe.Add(ref __m__row0, 1); + for (int j = 0; j < rows; j++) + { + rawDataOffset = AlignmentHelper.Pad(rawDataOffset, 16); + + statements.Add(ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ParseExpression($"Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint){rawDataOffset}))"), + ParseExpression($"Unsafe.Add(ref {rowLocalName}, {j})")))); + + rawDataOffset += fieldPack * columns; + } + } + else + { + // Calculate the right offset with 16-bytes padding (HLSL constant buffer). + // Since we're in a constant buffer, we need to both pad the starting offset + // to be aligned to the packing size of the type, and also to align the initial + // offset to ensure that values do not cross 16 bytes boundaries either. + rawDataOffset = AlignmentHelper.AlignToBoundary( + AlignmentHelper.Pad(rawDataOffset, fieldPack), + fieldSize, + 16); + + statements.Add(ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ParseExpression($"Unsafe.As(ref Unsafe.AddByteOffset(ref r0, (nint){rawDataOffset}))"), + ParseExpression($"{string.Join(".", fieldPath)}")))); + + rawDataOffset += fieldSize; + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs index 3e72c856..087413ef 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs @@ -8,152 +8,150 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; #pragma warning disable CS0618 -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class IShaderGenerator { /// - public sealed partial class IShaderGenerator + private static partial MethodDeclarationSyntax CreateLoadDispatchMetadataMethod( + string? implicitTextureType, + IReadOnlyCollection discoveredResources, + int root32BitConstantsCount, + bool isSamplerUsed) { - /// - private static partial MethodDeclarationSyntax CreateLoadDispatchMetadataMethod( - string? implicitTextureType, - IReadOnlyCollection discoveredResources, - int root32BitConstantsCount, - bool isSamplerUsed) + // This code produces a method declaration as follows: + // + // readonly void IShader.LoadDispatchMetadata(ref TMetadataLoader loader, out IntPtr result) + // { + // + // } + return + MethodDeclaration( + PredefinedType(Token(SyntaxKind.VoidKeyword)), + Identifier("LoadDispatchMetadata")) + .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) + .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) + .AddTypeParameterListParameters(TypeParameter(Identifier("TMetadataLoader"))) + .AddParameterListParameters( + Parameter(Identifier("loader")) + .AddModifiers(Token(SyntaxKind.RefKeyword)) + .WithType(IdentifierName("TMetadataLoader")), + Parameter(Identifier("result")) + .AddModifiers(Token(SyntaxKind.OutKeyword)) + .WithType(IdentifierName(typeof(IntPtr).Name))) + .WithBody(Block(GetDispatchMetadataLoadingStatements(implicitTextureType, discoveredResources, root32BitConstantsCount, isSamplerUsed))); + } + + /// + /// Gets a sequence of statements to load the dispatch metadata for a given shader type. + /// + /// The implicit texture type, if available (if the shader is a pixel shader). + /// The collection of resources used by the shader. + /// The total number of 32 bit root constants being loaded for the shader. + /// Whether or not the shader requires a static sampler to be available. + /// The sequence of instances to load shader dispatch data. + private static IEnumerable GetDispatchMetadataLoadingStatements( + string? implicitTextureType, + IReadOnlyCollection discoveredResources, + int root32BitConstantsCount, + bool isSamplerUsed) + { + // Span span0 = stackalloc byte[5]; + yield return + LocalDeclarationStatement( + VariableDeclaration( + GenericName(Identifier("Span")) + .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.ByteKeyword)))) + .AddVariables( + VariableDeclarator(Identifier("span0")) + .WithInitializer(EqualsValueClause( + StackAllocArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.ByteKeyword))) + .AddRankSpecifiers( + ArrayRankSpecifier(SingletonSeparatedList( + LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(5)))))))))); + + // Compute the total number of resources (discovered ones and the implicit target texture, if present) + int totalResourcesCount = discoveredResources.Count + (implicitTextureType is not null ? 1 : 0); + + // Span span1 = stackalloc ResourceDescriptor[]; + yield return + LocalDeclarationStatement( + VariableDeclaration( + GenericName(Identifier("Span")) + .AddTypeArgumentListArguments(IdentifierName("ResourceDescriptor"))) + .AddVariables( + VariableDeclarator(Identifier("span1")) + .WithInitializer(EqualsValueClause( + StackAllocArrayCreationExpression( + ArrayType(IdentifierName("ResourceDescriptor")) + .AddRankSpecifiers( + ArrayRankSpecifier(SingletonSeparatedList( + LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(totalResourcesCount)))))))))); + + // ref byte r0 = ref span0[0]; + yield return + LocalDeclarationStatement( + VariableDeclaration(RefType(PredefinedType(Token(SyntaxKind.ByteKeyword)))) + .AddVariables( + VariableDeclarator(Identifier("r0")) + .WithInitializer(EqualsValueClause( + RefExpression( + ElementAccessExpression(IdentifierName("span0")) + .AddArgumentListArguments(Argument( + LiteralExpression( + SyntaxKind.NumericLiteralExpression, + Literal(0))))))))); + + // ref ResourceDescriptor r1 = ref span1[0]; + yield return + LocalDeclarationStatement( + VariableDeclaration(RefType(IdentifierName("ResourceDescriptor"))) + .AddVariables( + VariableDeclarator(Identifier("r1")) + .WithInitializer(EqualsValueClause( + RefExpression( + ElementAccessExpression(IdentifierName("span1")) + .AddArgumentListArguments(Argument( + LiteralExpression( + SyntaxKind.NumericLiteralExpression, + Literal(0))))))))); + + // Serialized shader metadata + yield return ParseStatement($"Unsafe.WriteUnaligned(ref Unsafe.Add(ref r0, 0), {root32BitConstantsCount});"); + yield return ParseStatement($"Unsafe.WriteUnaligned(ref Unsafe.Add(ref r0, 4), {isSamplerUsed.ToString().ToLowerInvariant()});"); + + int + constantBufferOffset = 1, + readOnlyResourceOffset = 0, + readWriteResourceOffset = 0, + resourceOffset = 0; + + // Add the implicit texture descriptor, if needed + if (implicitTextureType is not null) { - // This code produces a method declaration as follows: - // - // readonly void IShader.LoadDispatchMetadata(ref TMetadataLoader loader, out IntPtr result) - // { - // - // } - return - MethodDeclaration( - PredefinedType(Token(SyntaxKind.VoidKeyword)), - Identifier("LoadDispatchMetadata")) - .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName(nameof(IShader)))) - .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .AddTypeParameterListParameters(TypeParameter(Identifier("TMetadataLoader"))) - .AddParameterListParameters( - Parameter(Identifier("loader")) - .AddModifiers(Token(SyntaxKind.RefKeyword)) - .WithType(IdentifierName("TMetadataLoader")), - Parameter(Identifier("result")) - .AddModifiers(Token(SyntaxKind.OutKeyword)) - .WithType(IdentifierName(typeof(IntPtr).Name))) - .WithBody(Block(GetDispatchMetadataLoadingStatements(implicitTextureType, discoveredResources, root32BitConstantsCount, isSamplerUsed))); + yield return ParseStatement($"ResourceDescriptor.Create(1, {readWriteResourceOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); } - /// - /// Gets a sequence of statements to load the dispatch metadata for a given shader type. - /// - /// The implicit texture type, if available (if the shader is a pixel shader). - /// The collection of resources used by the shader. - /// The total number of 32 bit root constants being loaded for the shader. - /// Whether or not the shader requires a static sampler to be available. - /// The sequence of instances to load shader dispatch data. - private static IEnumerable GetDispatchMetadataLoadingStatements( - string? implicitTextureType, - IReadOnlyCollection discoveredResources, - int root32BitConstantsCount, - bool isSamplerUsed) + // Populate the sequence of resource descriptors + foreach (var resource in discoveredResources) { - // Span span0 = stackalloc byte[5]; - yield return - LocalDeclarationStatement( - VariableDeclaration( - GenericName(Identifier("Span")) - .AddTypeArgumentListArguments(PredefinedType(Token(SyntaxKind.ByteKeyword)))) - .AddVariables( - VariableDeclarator(Identifier("span0")) - .WithInitializer(EqualsValueClause( - StackAllocArrayCreationExpression( - ArrayType(PredefinedType(Token(SyntaxKind.ByteKeyword))) - .AddRankSpecifiers( - ArrayRankSpecifier(SingletonSeparatedList( - LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(5)))))))))); - - // Compute the total number of resources (discovered ones and the implicit target texture, if present) - int totalResourcesCount = discoveredResources.Count + (implicitTextureType is not null ? 1 : 0); - - // Span span1 = stackalloc ResourceDescriptor[]; - yield return - LocalDeclarationStatement( - VariableDeclaration( - GenericName(Identifier("Span")) - .AddTypeArgumentListArguments(IdentifierName("ResourceDescriptor"))) - .AddVariables( - VariableDeclarator(Identifier("span1")) - .WithInitializer(EqualsValueClause( - StackAllocArrayCreationExpression( - ArrayType(IdentifierName("ResourceDescriptor")) - .AddRankSpecifiers( - ArrayRankSpecifier(SingletonSeparatedList( - LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(totalResourcesCount)))))))))); - - // ref byte r0 = ref span0[0]; - yield return - LocalDeclarationStatement( - VariableDeclaration(RefType(PredefinedType(Token(SyntaxKind.ByteKeyword)))) - .AddVariables( - VariableDeclarator(Identifier("r0")) - .WithInitializer(EqualsValueClause( - RefExpression( - ElementAccessExpression(IdentifierName("span0")) - .AddArgumentListArguments(Argument( - LiteralExpression( - SyntaxKind.NumericLiteralExpression, - Literal(0))))))))); - - // ref ResourceDescriptor r1 = ref span1[0]; - yield return - LocalDeclarationStatement( - VariableDeclaration(RefType(IdentifierName("ResourceDescriptor"))) - .AddVariables( - VariableDeclarator(Identifier("r1")) - .WithInitializer(EqualsValueClause( - RefExpression( - ElementAccessExpression(IdentifierName("span1")) - .AddArgumentListArguments(Argument( - LiteralExpression( - SyntaxKind.NumericLiteralExpression, - Literal(0))))))))); - - // Serialized shader metadata - yield return ParseStatement($"Unsafe.WriteUnaligned(ref Unsafe.Add(ref r0, 0), {root32BitConstantsCount});"); - yield return ParseStatement($"Unsafe.WriteUnaligned(ref Unsafe.Add(ref r0, 4), {isSamplerUsed.ToString().ToLowerInvariant()});"); - - int - constantBufferOffset = 1, - readOnlyResourceOffset = 0, - readWriteResourceOffset = 0, - resourceOffset = 0; - - // Add the implicit texture descriptor, if needed - if (implicitTextureType is not null) + if (HlslKnownTypes.IsConstantBufferType(resource)) + { + yield return ParseStatement($"ResourceDescriptor.Create(2, {constantBufferOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); + } + else if (HlslKnownTypes.IsReadOnlyTypedResourceType(resource)) + { + yield return ParseStatement($"ResourceDescriptor.Create(0, {readOnlyResourceOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); + } + else { yield return ParseStatement($"ResourceDescriptor.Create(1, {readWriteResourceOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); } - - // Populate the sequence of resource descriptors - foreach (var resource in discoveredResources) - { - if (HlslKnownTypes.IsConstantBufferType(resource)) - { - yield return ParseStatement($"ResourceDescriptor.Create(2, {constantBufferOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); - } - else if (HlslKnownTypes.IsReadOnlyTypedResourceType(resource)) - { - yield return ParseStatement($"ResourceDescriptor.Create(0, {readOnlyResourceOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); - } - else - { - yield return ParseStatement($"ResourceDescriptor.Create(1, {readWriteResourceOffset++}, out Unsafe.Add(ref r1, {resourceOffset++}));"); - } - } - - // Invoke the value delegate to create the opaque root signature handle - yield return ParseStatement("loader.LoadMetadataHandle(span0, span1, out result);"); } + + // Invoke the value delegate to create the opaque root signature handle + yield return ParseStatement("loader.LoadMetadataHandle(span0, span1, out result);"); } } - diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.SyntaxReceiver.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.SyntaxReceiver.cs index 0f61834c..1fe3c634 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.SyntaxReceiver.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.SyntaxReceiver.cs @@ -4,46 +4,44 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class IShaderGenerator { - /// - public sealed partial class IShaderGenerator + /// + /// An that selects candidate nodes to process. + /// + private sealed class SyntaxReceiver : ISyntaxContextReceiver { /// - /// An that selects candidate nodes to process. + /// The list of info gathered during exploration. /// - private sealed class SyntaxReceiver : ISyntaxContextReceiver + private readonly List gatheredInfo = new(); + + /// + /// Gets the collection of gathered info to process. + /// + public IReadOnlyCollection GatheredInfo => this.gatheredInfo; + + /// + public void OnVisitSyntaxNode(GeneratorSyntaxContext context) { - /// - /// The list of info gathered during exploration. - /// - private readonly List gatheredInfo = new(); - - /// - /// Gets the collection of gathered info to process. - /// - public IReadOnlyCollection GatheredInfo => this.gatheredInfo; - - /// - public void OnVisitSyntaxNode(GeneratorSyntaxContext context) + if (context.Node is StructDeclarationSyntax structDeclaration && + context.SemanticModel.GetDeclaredSymbol(structDeclaration) is INamedTypeSymbol structSymbol && + structSymbol.Interfaces.Any(static interfaceSymbol => + interfaceSymbol.Name == nameof(IComputeShader) || + interfaceSymbol is { IsGenericType: true, Name: nameof(IPixelShader) })) { - if (context.Node is StructDeclarationSyntax structDeclaration && - context.SemanticModel.GetDeclaredSymbol(structDeclaration) is INamedTypeSymbol structSymbol && - structSymbol.Interfaces.Any(static interfaceSymbol => - interfaceSymbol.Name == nameof(IComputeShader) || - interfaceSymbol is { IsGenericType: true, Name: nameof(IPixelShader) })) - { - this.gatheredInfo.Add(new Item(structDeclaration, structSymbol)); - } + this.gatheredInfo.Add(new Item(structDeclaration, structSymbol)); } - - /// - /// A model for a group of item representing a discovered type to process. - /// - /// The instance for the target struct declaration. - /// The instance for . - public sealed record Item(StructDeclarationSyntax StructDeclaration, INamedTypeSymbol StructSymbol); } + + /// + /// A model for a group of item representing a discovered type to process. + /// + /// The instance for the target struct declaration. + /// The instance for . + public sealed record Item(StructDeclarationSyntax StructDeclaration, INamedTypeSymbol StructSymbol); } } - diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs index 9dd8a4c5..d82d2cdd 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs @@ -11,218 +11,216 @@ using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using static Microsoft.CodeAnalysis.SymbolDisplayTypeQualificationStyle; -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +/// A source generator creating data loaders for and types. +/// +[Generator] +public sealed partial class IShaderGenerator : ISourceGenerator { - /// - /// A source generator creating data loaders for and types. - /// - [Generator] - public sealed partial class IShaderGenerator : ISourceGenerator + /// + public void Initialize(GeneratorInitializationContext context) { - /// - public void Initialize(GeneratorInitializationContext context) - { - context.RegisterForSyntaxNotifications(static () => new SyntaxReceiver()); - } - - /// - public void Execute(GeneratorExecutionContext context) - { - // Get the syntax receiver with the candidate nodes - if (context.SyntaxContextReceiver is not SyntaxReceiver syntaxReceiver) - { - return; - } - - foreach (SyntaxReceiver.Item item in syntaxReceiver.GatheredInfo) - { - try - { - OnExecute(context, item.StructDeclaration, item.StructSymbol); - } - catch - { - context.ReportDiagnostic(IShaderGeneratorError, item.StructDeclaration, item.StructSymbol); - } - } - } - - /// - /// Processes a given target type. - /// - /// The input instance to use. - /// The node to process. - /// The for . - private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol) - { - // Create the required interface methods for the current shader type - MethodDeclarationSyntax - getDispatchIdMethod = CreateGetDispatchIdMethod(structDeclarationSymbol), - loadDispatchDataMethod = CreateLoadDispatchDataMethod(context, structDeclarationSymbol, out var discoveredResources, out int root32BitConstants), - buildHlslStringMethod = CreateBuildHlslStringMethod(context, structDeclaration, structDeclarationSymbol, out string? implicitTextureType, out bool isSamplerUsed, out bool isHashSetDirectiveNeeded), - loadDispatchMetadataMethod = CreateLoadDispatchMetadataMethod(implicitTextureType, discoveredResources, root32BitConstants, isSamplerUsed); - - // Reorder the method declarations to respect the order in the interface definition - MethodDeclarationSyntax[] methods = - { - getDispatchIdMethod, - loadDispatchDataMethod, - loadDispatchMetadataMethod, - buildHlslStringMethod - }; - - // Method attributes - List attributes = new() - { - AttributeList(SingletonSeparatedList( - Attribute(IdentifierName("GeneratedCode")).AddArgumentListArguments( - AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(typeof(IShaderGenerator).FullName))), - AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(typeof(IShaderGenerator).Assembly.GetName().Version.ToString())))))), - AttributeList(SingletonSeparatedList(Attribute(IdentifierName("DebuggerNonUserCode")))), - AttributeList(SingletonSeparatedList(Attribute(IdentifierName("ExcludeFromCodeCoverage")))), - AttributeList(SingletonSeparatedList( - Attribute(IdentifierName("EditorBrowsable")).AddArgumentListArguments( - AttributeArgument(ParseExpression("EditorBrowsableState.Never"))))), - AttributeList(SingletonSeparatedList( - Attribute(IdentifierName("Obsolete")).AddArgumentListArguments( - AttributeArgument(LiteralExpression( - SyntaxKind.StringLiteralExpression, - Literal("This method is not intended to be used directly by user code")))))) - }; - - // Add [SkipLocalsInit] if the target project allows it - if (context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) - { - attributes.Add(AttributeList(SingletonSeparatedList(Attribute(IdentifierName("SkipLocalsInit"))))); - } - - string namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); - string structName = structDeclaration.Identifier.Text; - SyntaxTokenList structModifiers = structDeclaration.Modifiers; - - // Create the partial shader type declaration with the hashcode interface method implementation. - // This code produces a struct declaration as follows: - // - // public struct ShaderType - // { - // - // } - var structDeclarationSyntax = - StructDeclaration(structName) - .WithModifiers(structModifiers) - .AddMembers(methods.Select(m => m.AddAttributeLists(attributes.ToArray())).ToArray()); - - TypeDeclarationSyntax typeDeclarationSyntax = structDeclarationSyntax; - - // Add all parent types in ascending order, if any - foreach (var parentType in structDeclaration.Ancestors().OfType()) - { - typeDeclarationSyntax = parentType - .WithMembers(SingletonList(typeDeclarationSyntax)) - .WithConstraintClauses(List()) - .WithBaseList(null) - .WithAttributeLists(List()) - .WithoutTrivia(); - } - - // Prepare the necessary using directives - List usingDirectives = new() - { - UsingDirective(IdentifierName("System")), - UsingDirective(IdentifierName("System.CodeDom.Compiler")), - UsingDirective(IdentifierName("System.ComponentModel")), - UsingDirective(IdentifierName("System.Diagnostics")), - UsingDirective(IdentifierName("System.Diagnostics.CodeAnalysis")), - UsingDirective(IdentifierName("System.Runtime.CompilerServices")), - UsingDirective(IdentifierName("ComputeSharp")), - UsingDirective(IdentifierName("ComputeSharp.__Internals")) - }; - - if (isHashSetDirectiveNeeded) - { - usingDirectives.Insert(2, UsingDirective(IdentifierName("System.Collections.Generic"))); - } - - // Create a static method to create the combined hashcode for a given shader type. - // This code takes a block syntax and produces a compilation unit as follows: - // - // using System; - // using System.CodeDom.Compiler; - // using System.ComponentModel; - // using System.Diagnostics; - // using System.Diagnostics.CodeAnalysis; - // using System.Runtime.CompilerServices; - // using ComputeSharp.__Internals; - // - // #pragma warning disable - // - // namespace - // { - // - // } - var source = - CompilationUnit().AddUsings(usingDirectives.ToArray()).AddMembers( - NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax) - .WithNamespaceKeyword(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.NamespaceKeyword, TriviaList()))) - .NormalizeWhitespace(eol: "\n") - .ToFullString(); - - // Add the method source attribute - context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); - } - - /// - /// Creates a instance for the GetDispatchId method. - /// - /// The for . - /// The resulting instance for the GetDispatchId method. - private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol); - - /// - /// Creates a instance for the LoadDispatchDataMethod method. - /// - /// The input instance to use. - /// The for . - /// The collection of discovered resources in the current shader type. - /// The total number of 32 bit root constants being loaded for the current shader type. - /// The resulting instance for the LoadDispatchDataMethod method. - private static partial MethodDeclarationSyntax CreateLoadDispatchDataMethod( - GeneratorExecutionContext context, - INamedTypeSymbol structDeclarationSymbol, - out IReadOnlyCollection discoveredResources, - out int root32BitConstantsCount); - - /// - /// Creates a instance for the BuildHlslString method. - /// - /// The input instance to use. - /// The node to process. - /// The for . - /// The implicit texture type, if available (if the shader is a pixel shader). - /// Whether or not the current shader type requires a static sampler to be available. - /// Indicates whether or not the directive for is needed. - /// The resulting instance for the BuildHlslString method. - private static partial MethodDeclarationSyntax CreateBuildHlslStringMethod( - GeneratorExecutionContext context, - StructDeclarationSyntax structDeclaration, - INamedTypeSymbol structDeclarationSymbol, - out string? implicitTextureType, - out bool isSamplerUsed, - out bool isHashSetDirectiveNeeded); - - /// - /// Creates a instance for the LoadDispatchMetadata method. - /// - /// The implicit texture type, if available (if the shader is a pixel shader). - /// The collection of resources used by the shader. - /// The total number of 32 bit root constants being loaded for the shader. - /// Whether or not the shader requires a static sampler to be available. - /// The resulting instance for the LoadDispatchMetadata method. - private static partial MethodDeclarationSyntax CreateLoadDispatchMetadataMethod( - string? implicitTextureType, - IReadOnlyCollection discoveredResources, - int root32BitConstantsCount, - bool isSamplerUsed); + context.RegisterForSyntaxNotifications(static () => new SyntaxReceiver()); } -} + /// + public void Execute(GeneratorExecutionContext context) + { + // Get the syntax receiver with the candidate nodes + if (context.SyntaxContextReceiver is not SyntaxReceiver syntaxReceiver) + { + return; + } + + foreach (SyntaxReceiver.Item item in syntaxReceiver.GatheredInfo) + { + try + { + OnExecute(context, item.StructDeclaration, item.StructSymbol); + } + catch + { + context.ReportDiagnostic(IShaderGeneratorError, item.StructDeclaration, item.StructSymbol); + } + } + } + + /// + /// Processes a given target type. + /// + /// The input instance to use. + /// The node to process. + /// The for . + private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol) + { + // Create the required interface methods for the current shader type + MethodDeclarationSyntax + getDispatchIdMethod = CreateGetDispatchIdMethod(structDeclarationSymbol), + loadDispatchDataMethod = CreateLoadDispatchDataMethod(context, structDeclarationSymbol, out var discoveredResources, out int root32BitConstants), + buildHlslStringMethod = CreateBuildHlslStringMethod(context, structDeclaration, structDeclarationSymbol, out string? implicitTextureType, out bool isSamplerUsed, out bool isHashSetDirectiveNeeded), + loadDispatchMetadataMethod = CreateLoadDispatchMetadataMethod(implicitTextureType, discoveredResources, root32BitConstants, isSamplerUsed); + + // Reorder the method declarations to respect the order in the interface definition + MethodDeclarationSyntax[] methods = + { + getDispatchIdMethod, + loadDispatchDataMethod, + loadDispatchMetadataMethod, + buildHlslStringMethod + }; + + // Method attributes + List attributes = new() + { + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("GeneratedCode")).AddArgumentListArguments( + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(typeof(IShaderGenerator).FullName))), + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(typeof(IShaderGenerator).Assembly.GetName().Version.ToString())))))), + AttributeList(SingletonSeparatedList(Attribute(IdentifierName("DebuggerNonUserCode")))), + AttributeList(SingletonSeparatedList(Attribute(IdentifierName("ExcludeFromCodeCoverage")))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("EditorBrowsable")).AddArgumentListArguments( + AttributeArgument(ParseExpression("EditorBrowsableState.Never"))))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("Obsolete")).AddArgumentListArguments( + AttributeArgument(LiteralExpression( + SyntaxKind.StringLiteralExpression, + Literal("This method is not intended to be used directly by user code")))))) + }; + + // Add [SkipLocalsInit] if the target project allows it + if (context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true }) + { + attributes.Add(AttributeList(SingletonSeparatedList(Attribute(IdentifierName("SkipLocalsInit"))))); + } + + string namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); + string structName = structDeclaration.Identifier.Text; + SyntaxTokenList structModifiers = structDeclaration.Modifiers; + + // Create the partial shader type declaration with the hashcode interface method implementation. + // This code produces a struct declaration as follows: + // + // public struct ShaderType + // { + // + // } + var structDeclarationSyntax = + StructDeclaration(structName) + .WithModifiers(structModifiers) + .AddMembers(methods.Select(m => m.AddAttributeLists(attributes.ToArray())).ToArray()); + + TypeDeclarationSyntax typeDeclarationSyntax = structDeclarationSyntax; + + // Add all parent types in ascending order, if any + foreach (var parentType in structDeclaration.Ancestors().OfType()) + { + typeDeclarationSyntax = parentType + .WithMembers(SingletonList(typeDeclarationSyntax)) + .WithConstraintClauses(List()) + .WithBaseList(null) + .WithAttributeLists(List()) + .WithoutTrivia(); + } + + // Prepare the necessary using directives + List usingDirectives = new() + { + UsingDirective(IdentifierName("System")), + UsingDirective(IdentifierName("System.CodeDom.Compiler")), + UsingDirective(IdentifierName("System.ComponentModel")), + UsingDirective(IdentifierName("System.Diagnostics")), + UsingDirective(IdentifierName("System.Diagnostics.CodeAnalysis")), + UsingDirective(IdentifierName("System.Runtime.CompilerServices")), + UsingDirective(IdentifierName("ComputeSharp")), + UsingDirective(IdentifierName("ComputeSharp.__Internals")) + }; + + if (isHashSetDirectiveNeeded) + { + usingDirectives.Insert(2, UsingDirective(IdentifierName("System.Collections.Generic"))); + } + + // Create a static method to create the combined hashcode for a given shader type. + // This code takes a block syntax and produces a compilation unit as follows: + // + // using System; + // using System.CodeDom.Compiler; + // using System.ComponentModel; + // using System.Diagnostics; + // using System.Diagnostics.CodeAnalysis; + // using System.Runtime.CompilerServices; + // using ComputeSharp.__Internals; + // + // #pragma warning disable + // + // namespace + // { + // + // } + var source = + CompilationUnit().AddUsings(usingDirectives.ToArray()).AddMembers( + NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax) + .WithNamespaceKeyword(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.NamespaceKeyword, TriviaList()))) + .NormalizeWhitespace(eol: "\n") + .ToFullString(); + + // Add the method source attribute + context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + + /// + /// Creates a instance for the GetDispatchId method. + /// + /// The for . + /// The resulting instance for the GetDispatchId method. + private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol); + + /// + /// Creates a instance for the LoadDispatchDataMethod method. + /// + /// The input instance to use. + /// The for . + /// The collection of discovered resources in the current shader type. + /// The total number of 32 bit root constants being loaded for the current shader type. + /// The resulting instance for the LoadDispatchDataMethod method. + private static partial MethodDeclarationSyntax CreateLoadDispatchDataMethod( + GeneratorExecutionContext context, + INamedTypeSymbol structDeclarationSymbol, + out IReadOnlyCollection discoveredResources, + out int root32BitConstantsCount); + + /// + /// Creates a instance for the BuildHlslString method. + /// + /// The input instance to use. + /// The node to process. + /// The for . + /// The implicit texture type, if available (if the shader is a pixel shader). + /// Whether or not the current shader type requires a static sampler to be available. + /// Indicates whether or not the directive for is needed. + /// The resulting instance for the BuildHlslString method. + private static partial MethodDeclarationSyntax CreateBuildHlslStringMethod( + GeneratorExecutionContext context, + StructDeclarationSyntax structDeclaration, + INamedTypeSymbol structDeclarationSymbol, + out string? implicitTextureType, + out bool isSamplerUsed, + out bool isHashSetDirectiveNeeded); + + /// + /// Creates a instance for the LoadDispatchMetadata method. + /// + /// The implicit texture type, if available (if the shader is a pixel shader). + /// The collection of resources used by the shader. + /// The total number of 32 bit root constants being loaded for the shader. + /// Whether or not the shader requires a static sampler to be available. + /// The resulting instance for the LoadDispatchMetadata method. + private static partial MethodDeclarationSyntax CreateLoadDispatchMetadataMethod( + string? implicitTextureType, + IReadOnlyCollection discoveredResources, + int root32BitConstantsCount, + bool isSamplerUsed); +} diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs index f0a3700e..015c69fd 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs @@ -4,70 +4,69 @@ using System.Linq; using System.Reflection; using ComputeSharp.Core.Intrinsics.Attributes; -namespace ComputeSharp.SourceGenerators.Mappings +namespace ComputeSharp.SourceGenerators.Mappings; + +/// +/// A that contains and maps known HLSL identifier names valid HLSL names. +/// +internal static class HlslKnownKeywords { /// - /// A that contains and maps known HLSL identifier names valid HLSL names. + /// The mapping of known HLSL keywords. /// - internal static class HlslKnownKeywords + private static readonly IReadOnlyCollection KnownKeywords = BuildKnownKeywordsMap(); + + /// + /// Builds the mapping of all known HLSL keywords. + /// + [Pure] + private static IReadOnlyCollection BuildKnownKeywordsMap() { - /// - /// The mapping of known HLSL keywords. - /// - private static readonly IReadOnlyCollection KnownKeywords = BuildKnownKeywordsMap(); - - /// - /// Builds the mapping of all known HLSL keywords. - /// - [Pure] - private static IReadOnlyCollection BuildKnownKeywordsMap() + // HLSL keywords + HashSet knownKeywords = new(new[] { - // HLSL keywords - HashSet knownKeywords = new(new[] - { - "asm", "asm_fragment", "cbuffer", "centroid", "column_major", - "compile", "discard", "dword", "export", "fxgroup", "groupshared", - "half", "inline", "inout", "line", "lineadj", "linear", "matrix", - "nointerpolation", "noperspective", "NULL", "packoffset", "pass", - "pixelfragment", "point", "precise", "register", "row_major", "sample", - "sampler", "shared", "snorm", "stateblock", "stateblock_state", "tbuffer", - "technique", "typedef", "triangle", "triangleadj", "uniform", "unorm", - "unsigned", "vector", "vertexfragment", "zero" - }); + "asm", "asm_fragment", "cbuffer", "centroid", "column_major", + "compile", "discard", "dword", "export", "fxgroup", "groupshared", + "half", "inline", "inout", "line", "lineadj", "linear", "matrix", + "nointerpolation", "noperspective", "NULL", "packoffset", "pass", + "pixelfragment", "point", "precise", "register", "row_major", "sample", + "sampler", "shared", "snorm", "stateblock", "stateblock_state", "tbuffer", + "technique", "typedef", "triangle", "triangleadj", "uniform", "unorm", + "unsigned", "vector", "vertexfragment", "zero" + }); - // Dispatch type names - knownKeywords.Add(nameof(ThreadIds)); - knownKeywords.Add(nameof(GroupIds)); - knownKeywords.Add(nameof(GroupSize)); - knownKeywords.Add(nameof(GridIds)); + // Dispatch type names + knownKeywords.Add(nameof(ThreadIds)); + knownKeywords.Add(nameof(GroupIds)); + knownKeywords.Add(nameof(GroupSize)); + knownKeywords.Add(nameof(GridIds)); - // HLSL intrinsics method names - foreach (var method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static)) - { - string name = method.GetCustomAttribute()?.Name ?? method.Name; + // HLSL intrinsics method names + foreach (var method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static)) + { + string name = method.GetCustomAttribute()?.Name ?? method.Name; - knownKeywords.Add(name); - } - - return knownKeywords; + knownKeywords.Add(name); } - /// - /// Tries to get the mapped HLSL-compatible identifier name for the input identifier name. - /// - /// The input identifier name. - /// The mapped identifier name, if a replacement is needed. - /// The HLSL-compatible identifier name that can be used in an HLSL shader. - [Pure] - public static bool TryGetMappedName(string name, out string? mapped) - { - mapped = KnownKeywords.Contains(name) switch - { - true => $"__reserved__{name}", - false => null - }; + return knownKeywords; + } - return mapped is not null; - } + /// + /// Tries to get the mapped HLSL-compatible identifier name for the input identifier name. + /// + /// The input identifier name. + /// The mapped identifier name, if a replacement is needed. + /// The HLSL-compatible identifier name that can be used in an HLSL shader. + [Pure] + public static bool TryGetMappedName(string name, out string? mapped) + { + mapped = KnownKeywords.Contains(name) switch + { + true => $"__reserved__{name}", + false => null + }; + + return mapped is not null; } } diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs index 75a0095c..796a0f20 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs @@ -7,434 +7,433 @@ using System.Numerics; using System.Reflection; using System.Text.RegularExpressions; -namespace ComputeSharp.SourceGenerators.Mappings +namespace ComputeSharp.SourceGenerators.Mappings; + +/// +/// A that contains and maps known HLSL member names to common .NET members. +/// +internal static class HlslKnownMembers { /// - /// A that contains and maps known HLSL member names to common .NET members. + /// The mapping of supported known indexers to HLSL resource type names. /// - internal static class HlslKnownMembers + private static readonly IReadOnlyDictionary KnownResourceIndexers = new Dictionary { - /// - /// The mapping of supported known indexers to HLSL resource type names. - /// - private static readonly IReadOnlyDictionary KnownResourceIndexers = new Dictionary + [$"ComputeSharp.ReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadWriteTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.IReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.ReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.ReadWriteTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.IReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.IReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3" + }; + + /// + /// The mapping of supported known samplers to HLSL resource type names. + /// + private static readonly IReadOnlyDictionary KnownResourceSamplers = new Dictionary + { + [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2", + [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(Float2).FullName}]"] = null, + [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2", + [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(Float2).FullName}]"] = null, + [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3", + [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(Float3).FullName}]"] = null, + [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3", + [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(Float3).FullName}]"] = null + }; + + /// + /// The mapping of supported known size accessors for HLSL resource types. + /// + private static readonly IReadOnlyDictionary KnownSizeAccessors = new Dictionary + { + ["ComputeSharp.Resources.Buffer`1.Length"] = (2, 0), + ["ComputeSharp.Resources.Texture2D`1.Width"] = (2, 0), + ["ComputeSharp.Resources.Texture2D`1.Height"] = (2, 1), + ["ComputeSharp.Resources.Texture3D`1.Width"] = (3, 0), + ["ComputeSharp.Resources.Texture3D`1.Height"] = (3, 1), + ["ComputeSharp.Resources.Texture3D`1.Depth"] = (3, 2), + ["ComputeSharp.IReadOnlyTexture2D`1.Width"] = (2, 0), + ["ComputeSharp.IReadOnlyTexture2D`1.Height"] = (2, 1), + ["ComputeSharp.IReadOnlyTexture3D`1.Width"] = (3, 0), + ["ComputeSharp.IReadOnlyTexture3D`1.Height"] = (3, 1), + ["ComputeSharp.IReadOnlyTexture3D`1.Depth"] = (3, 2), + ["ComputeSharp.IReadWriteTexture2D`1.Width"] = (2, 0), + ["ComputeSharp.IReadWriteTexture2D`1.Height"] = (2, 1), + ["ComputeSharp.IReadWriteTexture3D`1.Width"] = (3, 0), + ["ComputeSharp.IReadWriteTexture3D`1.Height"] = (3, 1), + ["ComputeSharp.IReadWriteTexture3D`1.Depth"] = (3, 2) + }; + + /// + /// The mapping of supported known members to HLSL names. + /// + private static readonly IReadOnlyDictionary KnownMembers = BuildKnownMembersMap(); + + /// + /// Builds the mapping of supported known members to HLSL names. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownMembersMap() + { + Dictionary knownMembers = new() { - [$"ComputeSharp.ReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.ReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.ReadWriteTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.IReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.ReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", - [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", - [$"ComputeSharp.ReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", - [$"ComputeSharp.ReadWriteTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", - [$"ComputeSharp.IReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", - [$"ComputeSharp.IReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3" + [$"{typeof(Vector2).FullName}.{nameof(Vector2.X)}"] = "x", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Y)}"] = "y", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Zero)}"] = "(float2)0", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.One)}"] = "float2(1.0f, 1.0f)", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.UnitX)}"] = "float2(1.0f, 0.0f)", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.UnitY)}"] = "float2(0.0f, 1.0f)", + + [$"{typeof(Vector3).FullName}.{nameof(Vector3.X)}"] = "x", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Y)}"] = "y", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Z)}"] = "z", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Zero)}"] = "(float3)0", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.One)}"] = "float3(1.0f, 1.0f, 1.0f)", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitX)}"] = "float3(1.0f, 0.0f, 0.0f)", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitY)}"] = "float3(0.0f, 1.0f, 0.0f)", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitZ)}"] = "float3(0.0f, 0.0f, 1.0f)", + + [$"{typeof(Vector4).FullName}.{nameof(Vector4.X)}"] = "x", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Y)}"] = "y", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Z)}"] = "z", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.W)}"] = "w", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Zero)}"] = "(float4)0", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.One)}"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", + + [$"{typeof(Bool2).FullName}.{nameof(Bool2.False)}"] = "(bool2)0", + [$"{typeof(Bool2).FullName}.{nameof(Bool2.True)}"] = "bool2(true, true)", + [$"{typeof(Bool2).FullName}.{nameof(Bool2.TrueX)}"] = "bool2(true, false)", + [$"{typeof(Bool2).FullName}.{nameof(Bool2.TrueY)}"] = "bool2(false, true)", + + [$"{typeof(Bool3).FullName}.{nameof(Bool3.False)}"] = "(bool3)0", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.True)}"] = "bool3(true, true, true)", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueX)}"] = "bool3(true, false, false)", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueY)}"] = "bool3(false, true, false)", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueZ)}"] = "bool3(false, false, true)", + + [$"{typeof(Bool4).FullName}.{nameof(Bool4.False)}"] = "(bool4)0", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.True)}"] = "bool4(true, true, true, true)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueX)}"] = "bool4(true, false, false, false)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueY)}"] = "bool4(false, true, false, false)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueZ)}"] = "bool4(false, false, true, false)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueW)}"] = "bool4(false, false, false, true)", + + [$"{typeof(Int2).FullName}.{nameof(Int2.Zero)}"] = "(int2)0", + [$"{typeof(Int2).FullName}.{nameof(Int2.One)}"] = "int2(1, 1)", + [$"{typeof(Int2).FullName}.{nameof(Int2.UnitX)}"] = "int2(1, 0)", + [$"{typeof(Int2).FullName}.{nameof(Int2.UnitY)}"] = "int2(0, 1)", + + [$"{typeof(Int3).FullName}.{nameof(Int3.Zero)}"] = "(int3)0", + [$"{typeof(Int3).FullName}.{nameof(Int3.One)}"] = "int3(1, 1, 1)", + [$"{typeof(Int3).FullName}.{nameof(Int3.UnitX)}"] = "int3(1, 0, 0)", + [$"{typeof(Int3).FullName}.{nameof(Int3.UnitY)}"] = "int3(0, 1, 0)", + [$"{typeof(Int3).FullName}.{nameof(Int3.UnitZ)}"] = "int3(0, 0, 1)", + + [$"{typeof(Int4).FullName}.{nameof(Int4.Zero)}"] = "(int4)0", + [$"{typeof(Int4).FullName}.{nameof(Int4.One)}"] = "int4(1, 1, 1, 1)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitX)}"] = "int4(1, 0, 0, 0)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitY)}"] = "int4(0, 1, 0, 0)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitZ)}"] = "int4(0, 0, 1, 0)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitW)}"] = "int4(0, 0, 0, 1)", + + [$"{typeof(UInt2).FullName}.{nameof(UInt2.Zero)}"] = "(uint2)0", + [$"{typeof(UInt2).FullName}.{nameof(UInt2.One)}"] = "uint2(1u, 1u)", + [$"{typeof(UInt2).FullName}.{nameof(UInt2.UnitX)}"] = "uint2(1u, 0u)", + [$"{typeof(UInt2).FullName}.{nameof(UInt2.UnitY)}"] = "uint2(0u, 1u)", + + [$"{typeof(UInt3).FullName}.{nameof(UInt3.Zero)}"] = "(uint3)0", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.One)}"] = "uint3(1u, 1u, 1u)", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitX)}"] = "uint3(1u, 0u, 0u)", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitY)}"] = "uint3(0u, 1u, 0u)", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitZ)}"] = "uint3(0u, 0u, 1u)", + + [$"{typeof(UInt4).FullName}.{nameof(UInt4.Zero)}"] = "(uint4)0", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.One)}"] = "uint4(1u, 1u, 1u, 1u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitX)}"] = "uint4(1u, 0u, 0u, 0u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitY)}"] = "uint4(0u, 1u, 0u, 0u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitZ)}"] = "uint4(0u, 0u, 1u, 0u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitW)}"] = "uint4(0u, 0u, 0u, 1u)", + + [$"{typeof(Float2).FullName}.{nameof(Float2.Zero)}"] = "(float2)0", + [$"{typeof(Float2).FullName}.{nameof(Float2.One)}"] = "float2(1.0f, 1.0f)", + [$"{typeof(Float2).FullName}.{nameof(Float2.UnitX)}"] = "float2(1.0f, 0.0f)", + [$"{typeof(Float2).FullName}.{nameof(Float2.UnitY)}"] = "float2(0.0f, 1.0f)", + + [$"{typeof(Float3).FullName}.{nameof(Float3.Zero)}"] = "(float3)0", + [$"{typeof(Float3).FullName}.{nameof(Float3.One)}"] = "float3(1.0f, 1.0f, 1.0f)", + [$"{typeof(Float3).FullName}.{nameof(Float3.UnitX)}"] = "float3(1.0f, 0.0f, 0.0f)", + [$"{typeof(Float3).FullName}.{nameof(Float3.UnitY)}"] = "float3(0.0f, 1.0f, 0.0f)", + [$"{typeof(Float3).FullName}.{nameof(Float3.UnitZ)}"] = "float3(0.0f, 0.0f, 1.0f)", + + [$"{typeof(Float4).FullName}.{nameof(Float4.Zero)}"] = "(float4)0", + [$"{typeof(Float4).FullName}.{nameof(Float4.One)}"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitX)}"] = "float4(1.0f, 0.0f, 0.0f, 0.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitY)}"] = "float4(0.0f, 1.0f, 0.0f, 0.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitZ)}"] = "float4(0.0f, 0.0f, 1.0f, 0.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitW)}"] = "float4(0.0f, 0.0f, 0.0f, 1.0f)", + + [$"{typeof(Double2).FullName}.{nameof(Double2.Zero)}"] = "(double2)0", + [$"{typeof(Double2).FullName}.{nameof(Double2.One)}"] = "double2(1.0, 1.0)", + [$"{typeof(Double2).FullName}.{nameof(Double2.UnitX)}"] = "double2(1.0, 0.0)", + [$"{typeof(Double2).FullName}.{nameof(Double2.UnitY)}"] = "double2(0.0, 1.0)", + + [$"{typeof(Double3).FullName}.{nameof(Double3.Zero)}"] = "(double3)0", + [$"{typeof(Double3).FullName}.{nameof(Double3.One)}"] = "double3(1.0, 1.0, 1.0)", + [$"{typeof(Double3).FullName}.{nameof(Double3.UnitX)}"] = "double3(1.0, 0.0, 0.0)", + [$"{typeof(Double3).FullName}.{nameof(Double3.UnitY)}"] = "double3(0.0, 1.0, 0.0)", + [$"{typeof(Double3).FullName}.{nameof(Double3.UnitZ)}"] = "double3(0.0, 0.0, 1.0)", + + [$"{typeof(Double4).FullName}.{nameof(Double4.Zero)}"] = "(double4)0", + [$"{typeof(Double4).FullName}.{nameof(Double4.One)}"] = "double4(1.0, 1.0, 1.0, 1.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitX)}"] = "double4(1.0, 0.0, 0.0, 0.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitY)}"] = "double4(0.0, 1.0, 0.0, 0.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitZ)}"] = "double4(0.0, 0.0, 1.0, 0.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitW)}"] = "double4(0.0, 0.0, 0.0, 1.0)" }; - /// - /// The mapping of supported known samplers to HLSL resource type names. - /// - private static readonly IReadOnlyDictionary KnownResourceSamplers = new Dictionary + // Programmatically load mappings for the instance members of the HLSL vector types + foreach (var item in + from type in HlslKnownTypes.KnownVectorTypes + from property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + select (Type: type, Property: property)) { - [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2", - [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(Float2).FullName}]"] = null, - [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2", - [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(Float2).FullName}]"] = null, - [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3", - [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(Float3).FullName}]"] = null, - [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName}]"] = "float3", - [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(Float3).FullName}]"] = null - }; + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"{item.Property.Name.ToLower()}"); + } - /// - /// The mapping of supported known size accessors for HLSL resource types. - /// - private static readonly IReadOnlyDictionary KnownSizeAccessors = new Dictionary + // Load mappings for the matrix properties as well + foreach (var item in + from type in HlslKnownTypes.KnownMatrixTypes + from property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + where Regex.IsMatch(property.Name, "^M[1-4]{2}$") + select (Type: type, Property: property)) { - ["ComputeSharp.Resources.Buffer`1.Length"] = (2, 0), - ["ComputeSharp.Resources.Texture2D`1.Width"] = (2, 0), - ["ComputeSharp.Resources.Texture2D`1.Height"] = (2, 1), - ["ComputeSharp.Resources.Texture3D`1.Width"] = (3, 0), - ["ComputeSharp.Resources.Texture3D`1.Height"] = (3, 1), - ["ComputeSharp.Resources.Texture3D`1.Depth"] = (3, 2), - ["ComputeSharp.IReadOnlyTexture2D`1.Width"] = (2, 0), - ["ComputeSharp.IReadOnlyTexture2D`1.Height"] = (2, 1), - ["ComputeSharp.IReadOnlyTexture3D`1.Width"] = (3, 0), - ["ComputeSharp.IReadOnlyTexture3D`1.Height"] = (3, 1), - ["ComputeSharp.IReadOnlyTexture3D`1.Depth"] = (3, 2), - ["ComputeSharp.IReadWriteTexture2D`1.Width"] = (2, 0), - ["ComputeSharp.IReadWriteTexture2D`1.Height"] = (2, 1), - ["ComputeSharp.IReadWriteTexture3D`1.Width"] = (3, 0), - ["ComputeSharp.IReadWriteTexture3D`1.Height"] = (3, 1), - ["ComputeSharp.IReadWriteTexture3D`1.Depth"] = (3, 2) - }; + char + row = (char)(item.Property.Name[1] - 1), + column = (char)(item.Property.Name[2] - 1); - /// - /// The mapping of supported known members to HLSL names. - /// - private static readonly IReadOnlyDictionary KnownMembers = BuildKnownMembersMap(); + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"_m{row}{column}"); + } - /// - /// Builds the mapping of supported known members to HLSL names. - /// - [Pure] - private static IReadOnlyDictionary BuildKnownMembersMap() + // Store GroupIds.Index for a quicker comparison afterwards + PropertyInfo groupindexProperty = typeof(GroupIds).GetProperty(nameof(GroupIds.Index), BindingFlags.Static | BindingFlags.Public); + + // Programmatically load mappings for the dispatch types + foreach (var item in + from type in HlslKnownTypes.HlslDispatchTypes + from property in type.GetProperties(BindingFlags.Static | BindingFlags.Public) + select (Type: type, Property: property)) { - Dictionary knownMembers = new() + if (item.Property == groupindexProperty) { - [$"{typeof(Vector2).FullName}.{nameof(Vector2.X)}"] = "x", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Y)}"] = "y", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Zero)}"] = "(float2)0", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.One)}"] = "float2(1.0f, 1.0f)", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.UnitX)}"] = "float2(1.0f, 0.0f)", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.UnitY)}"] = "float2(0.0f, 1.0f)", - - [$"{typeof(Vector3).FullName}.{nameof(Vector3.X)}"] = "x", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Y)}"] = "y", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Z)}"] = "z", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Zero)}"] = "(float3)0", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.One)}"] = "float3(1.0f, 1.0f, 1.0f)", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitX)}"] = "float3(1.0f, 0.0f, 0.0f)", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitY)}"] = "float3(0.0f, 1.0f, 0.0f)", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitZ)}"] = "float3(0.0f, 0.0f, 1.0f)", - - [$"{typeof(Vector4).FullName}.{nameof(Vector4.X)}"] = "x", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Y)}"] = "y", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Z)}"] = "z", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.W)}"] = "w", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Zero)}"] = "(float4)0", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.One)}"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", - - [$"{typeof(Bool2).FullName}.{nameof(Bool2.False)}"] = "(bool2)0", - [$"{typeof(Bool2).FullName}.{nameof(Bool2.True)}"] = "bool2(true, true)", - [$"{typeof(Bool2).FullName}.{nameof(Bool2.TrueX)}"] = "bool2(true, false)", - [$"{typeof(Bool2).FullName}.{nameof(Bool2.TrueY)}"] = "bool2(false, true)", - - [$"{typeof(Bool3).FullName}.{nameof(Bool3.False)}"] = "(bool3)0", - [$"{typeof(Bool3).FullName}.{nameof(Bool3.True)}"] = "bool3(true, true, true)", - [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueX)}"] = "bool3(true, false, false)", - [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueY)}"] = "bool3(false, true, false)", - [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueZ)}"] = "bool3(false, false, true)", - - [$"{typeof(Bool4).FullName}.{nameof(Bool4.False)}"] = "(bool4)0", - [$"{typeof(Bool4).FullName}.{nameof(Bool4.True)}"] = "bool4(true, true, true, true)", - [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueX)}"] = "bool4(true, false, false, false)", - [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueY)}"] = "bool4(false, true, false, false)", - [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueZ)}"] = "bool4(false, false, true, false)", - [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueW)}"] = "bool4(false, false, false, true)", - - [$"{typeof(Int2).FullName}.{nameof(Int2.Zero)}"] = "(int2)0", - [$"{typeof(Int2).FullName}.{nameof(Int2.One)}"] = "int2(1, 1)", - [$"{typeof(Int2).FullName}.{nameof(Int2.UnitX)}"] = "int2(1, 0)", - [$"{typeof(Int2).FullName}.{nameof(Int2.UnitY)}"] = "int2(0, 1)", - - [$"{typeof(Int3).FullName}.{nameof(Int3.Zero)}"] = "(int3)0", - [$"{typeof(Int3).FullName}.{nameof(Int3.One)}"] = "int3(1, 1, 1)", - [$"{typeof(Int3).FullName}.{nameof(Int3.UnitX)}"] = "int3(1, 0, 0)", - [$"{typeof(Int3).FullName}.{nameof(Int3.UnitY)}"] = "int3(0, 1, 0)", - [$"{typeof(Int3).FullName}.{nameof(Int3.UnitZ)}"] = "int3(0, 0, 1)", - - [$"{typeof(Int4).FullName}.{nameof(Int4.Zero)}"] = "(int4)0", - [$"{typeof(Int4).FullName}.{nameof(Int4.One)}"] = "int4(1, 1, 1, 1)", - [$"{typeof(Int4).FullName}.{nameof(Int4.UnitX)}"] = "int4(1, 0, 0, 0)", - [$"{typeof(Int4).FullName}.{nameof(Int4.UnitY)}"] = "int4(0, 1, 0, 0)", - [$"{typeof(Int4).FullName}.{nameof(Int4.UnitZ)}"] = "int4(0, 0, 1, 0)", - [$"{typeof(Int4).FullName}.{nameof(Int4.UnitW)}"] = "int4(0, 0, 0, 1)", - - [$"{typeof(UInt2).FullName}.{nameof(UInt2.Zero)}"] = "(uint2)0", - [$"{typeof(UInt2).FullName}.{nameof(UInt2.One)}"] = "uint2(1u, 1u)", - [$"{typeof(UInt2).FullName}.{nameof(UInt2.UnitX)}"] = "uint2(1u, 0u)", - [$"{typeof(UInt2).FullName}.{nameof(UInt2.UnitY)}"] = "uint2(0u, 1u)", - - [$"{typeof(UInt3).FullName}.{nameof(UInt3.Zero)}"] = "(uint3)0", - [$"{typeof(UInt3).FullName}.{nameof(UInt3.One)}"] = "uint3(1u, 1u, 1u)", - [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitX)}"] = "uint3(1u, 0u, 0u)", - [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitY)}"] = "uint3(0u, 1u, 0u)", - [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitZ)}"] = "uint3(0u, 0u, 1u)", - - [$"{typeof(UInt4).FullName}.{nameof(UInt4.Zero)}"] = "(uint4)0", - [$"{typeof(UInt4).FullName}.{nameof(UInt4.One)}"] = "uint4(1u, 1u, 1u, 1u)", - [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitX)}"] = "uint4(1u, 0u, 0u, 0u)", - [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitY)}"] = "uint4(0u, 1u, 0u, 0u)", - [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitZ)}"] = "uint4(0u, 0u, 1u, 0u)", - [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitW)}"] = "uint4(0u, 0u, 0u, 1u)", - - [$"{typeof(Float2).FullName}.{nameof(Float2.Zero)}"] = "(float2)0", - [$"{typeof(Float2).FullName}.{nameof(Float2.One)}"] = "float2(1.0f, 1.0f)", - [$"{typeof(Float2).FullName}.{nameof(Float2.UnitX)}"] = "float2(1.0f, 0.0f)", - [$"{typeof(Float2).FullName}.{nameof(Float2.UnitY)}"] = "float2(0.0f, 1.0f)", - - [$"{typeof(Float3).FullName}.{nameof(Float3.Zero)}"] = "(float3)0", - [$"{typeof(Float3).FullName}.{nameof(Float3.One)}"] = "float3(1.0f, 1.0f, 1.0f)", - [$"{typeof(Float3).FullName}.{nameof(Float3.UnitX)}"] = "float3(1.0f, 0.0f, 0.0f)", - [$"{typeof(Float3).FullName}.{nameof(Float3.UnitY)}"] = "float3(0.0f, 1.0f, 0.0f)", - [$"{typeof(Float3).FullName}.{nameof(Float3.UnitZ)}"] = "float3(0.0f, 0.0f, 1.0f)", - - [$"{typeof(Float4).FullName}.{nameof(Float4.Zero)}"] = "(float4)0", - [$"{typeof(Float4).FullName}.{nameof(Float4.One)}"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", - [$"{typeof(Float4).FullName}.{nameof(Float4.UnitX)}"] = "float4(1.0f, 0.0f, 0.0f, 0.0f)", - [$"{typeof(Float4).FullName}.{nameof(Float4.UnitY)}"] = "float4(0.0f, 1.0f, 0.0f, 0.0f)", - [$"{typeof(Float4).FullName}.{nameof(Float4.UnitZ)}"] = "float4(0.0f, 0.0f, 1.0f, 0.0f)", - [$"{typeof(Float4).FullName}.{nameof(Float4.UnitW)}"] = "float4(0.0f, 0.0f, 0.0f, 1.0f)", - - [$"{typeof(Double2).FullName}.{nameof(Double2.Zero)}"] = "(double2)0", - [$"{typeof(Double2).FullName}.{nameof(Double2.One)}"] = "double2(1.0, 1.0)", - [$"{typeof(Double2).FullName}.{nameof(Double2.UnitX)}"] = "double2(1.0, 0.0)", - [$"{typeof(Double2).FullName}.{nameof(Double2.UnitY)}"] = "double2(0.0, 1.0)", - - [$"{typeof(Double3).FullName}.{nameof(Double3.Zero)}"] = "(double3)0", - [$"{typeof(Double3).FullName}.{nameof(Double3.One)}"] = "double3(1.0, 1.0, 1.0)", - [$"{typeof(Double3).FullName}.{nameof(Double3.UnitX)}"] = "double3(1.0, 0.0, 0.0)", - [$"{typeof(Double3).FullName}.{nameof(Double3.UnitY)}"] = "double3(0.0, 1.0, 0.0)", - [$"{typeof(Double3).FullName}.{nameof(Double3.UnitZ)}"] = "double3(0.0, 0.0, 1.0)", - - [$"{typeof(Double4).FullName}.{nameof(Double4.Zero)}"] = "(double4)0", - [$"{typeof(Double4).FullName}.{nameof(Double4.One)}"] = "double4(1.0, 1.0, 1.0, 1.0)", - [$"{typeof(Double4).FullName}.{nameof(Double4.UnitX)}"] = "double4(1.0, 0.0, 0.0, 0.0)", - [$"{typeof(Double4).FullName}.{nameof(Double4.UnitY)}"] = "double4(0.0, 1.0, 0.0, 0.0)", - [$"{typeof(Double4).FullName}.{nameof(Double4.UnitZ)}"] = "double4(0.0, 0.0, 1.0, 0.0)", - [$"{typeof(Double4).FullName}.{nameof(Double4.UnitW)}"] = "double4(0.0, 0.0, 0.0, 1.0)" - }; - - // Programmatically load mappings for the instance members of the HLSL vector types - foreach (var item in - from type in HlslKnownTypes.KnownVectorTypes - from property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - select (Type: type, Property: property)) - { - knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"{item.Property.Name.ToLower()}"); + // The thread group index is a standalone parameter, so if this property is used, we + // just map the access directly to that implicit and hidden parameter name instead. + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"__{nameof(GroupIds)}__get_Index"); } - - // Load mappings for the matrix properties as well - foreach (var item in - from type in HlslKnownTypes.KnownMatrixTypes - from property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - where Regex.IsMatch(property.Name, "^M[1-4]{2}$") - select (Type: type, Property: property)) + else { - char - row = (char)(item.Property.Name[1] - 1), - column = (char)(item.Property.Name[2] - 1); - - knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"_m{row}{column}"); + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"{item.Type.Name}.{item.Property.Name.ToLower()}"); } + } - // Store GroupIds.Index for a quicker comparison afterwards - PropertyInfo groupindexProperty = typeof(GroupIds).GetProperty(nameof(GroupIds.Index), BindingFlags.Static | BindingFlags.Public); + // Programmatically load mappings for the normalized thread ids + foreach (var property in typeof(ThreadIds.Normalized).GetProperties(BindingFlags.Static | BindingFlags.Public)) + { + string key = $"{typeof(ThreadIds).FullName}{Type.Delimiter}{typeof(ThreadIds.Normalized).Name}{Type.Delimiter}{property.Name}"; - // Programmatically load mappings for the dispatch types - foreach (var item in - from type in HlslKnownTypes.HlslDispatchTypes - from property in type.GetProperties(BindingFlags.Static | BindingFlags.Public) - select (Type: type, Property: property)) + switch (property.Name) { - if (item.Property == groupindexProperty) + case string name when name.Length == 1: + knownMembers.Add(key, $"{typeof(ThreadIds).Name}.{char.ToLower(name[0])} / (float)__{char.ToLower(name[0])}"); + break; + case string name when name.Length == 2: { - // The thread group index is a standalone parameter, so if this property is used, we - // just map the access directly to that implicit and hidden parameter name instead. - knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"__{nameof(GroupIds)}__get_Index"); + string + numerator = $"float2({typeof(ThreadIds).Name}.{char.ToLower(name[0])}, {typeof(ThreadIds).Name}.{char.ToLower(name[1])})", + denominator = $"float2(__{char.ToLower(name[0])}, __{char.ToLower(name[1])})"; + + knownMembers.Add(key, $"{numerator} / {denominator}"); + break; } - else + case string name when name.Length == 3: { - knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"{item.Type.Name}.{item.Property.Name.ToLower()}"); + string + numerator = $"float3({typeof(ThreadIds).Name}.{char.ToLower(name[0])}, {typeof(ThreadIds).Name}.{char.ToLower(name[1])}, {typeof(ThreadIds).Name}.{char.ToLower(name[2])})", + denominator = $"float3(__{char.ToLower(name[0])}, __{char.ToLower(name[1])}, __{char.ToLower(name[2])})"; + + knownMembers.Add(key, $"{numerator} / {denominator}"); + break; } } + } - // Programmatically load mappings for the normalized thread ids - foreach (var property in typeof(ThreadIds.Normalized).GetProperties(BindingFlags.Static | BindingFlags.Public)) + // Programmatically load mappings for the group size + foreach (var property in typeof(GroupSize).GetProperties(BindingFlags.Static | BindingFlags.Public)) + { + string key = $"{typeof(GroupSize).FullName}{Type.Delimiter}{property.Name}"; + + switch (property.Name) { - string key = $"{typeof(ThreadIds).FullName}{Type.Delimiter}{typeof(ThreadIds.Normalized).Name}{Type.Delimiter}{property.Name}"; - - switch (property.Name) - { - case string name when name.Length == 1: - knownMembers.Add(key, $"{typeof(ThreadIds).Name}.{char.ToLower(name[0])} / (float)__{char.ToLower(name[0])}"); - break; - case string name when name.Length == 2: - { - string - numerator = $"float2({typeof(ThreadIds).Name}.{char.ToLower(name[0])}, {typeof(ThreadIds).Name}.{char.ToLower(name[1])})", - denominator = $"float2(__{char.ToLower(name[0])}, __{char.ToLower(name[1])})"; - - knownMembers.Add(key, $"{numerator} / {denominator}"); - break; - } - case string name when name.Length == 3: - { - string - numerator = $"float3({typeof(ThreadIds).Name}.{char.ToLower(name[0])}, {typeof(ThreadIds).Name}.{char.ToLower(name[1])}, {typeof(ThreadIds).Name}.{char.ToLower(name[2])})", - denominator = $"float3(__{char.ToLower(name[0])}, __{char.ToLower(name[1])}, __{char.ToLower(name[2])})"; - - knownMembers.Add(key, $"{numerator} / {denominator}"); - break; - } - } + case nameof(GroupSize.Count): + knownMembers.Add(key, "__GroupSize__get_X * __GroupSize__get_Y * __GroupSize__get_Z"); + break; + case string name when name.Length == 1: + knownMembers.Add(key, $"__GroupSize__get_{name}"); + break; + case string name when name.Length == 2: + knownMembers.Add(key, $"int2(__GroupSize__get_{name[0]}, __GroupSize__get_{name[1]})"); + break; + case string name when name.Length == 3: + knownMembers.Add(key, $"int3(__GroupSize__get_{name[0]}, __GroupSize__get_{name[1]}, __GroupSize__get_{name[2]})"); + break; } + } - // Programmatically load mappings for the group size - foreach (var property in typeof(GroupSize).GetProperties(BindingFlags.Static | BindingFlags.Public)) + // Programmatically load mappings for the dispatch size + foreach (var property in typeof(DispatchSize).GetProperties(BindingFlags.Static | BindingFlags.Public)) + { + string key = $"{typeof(DispatchSize).FullName}{Type.Delimiter}{property.Name}"; + + switch (property.Name) { - string key = $"{typeof(GroupSize).FullName}{Type.Delimiter}{property.Name}"; - - switch (property.Name) - { - case nameof(GroupSize.Count): - knownMembers.Add(key, "__GroupSize__get_X * __GroupSize__get_Y * __GroupSize__get_Z"); - break; - case string name when name.Length == 1: - knownMembers.Add(key, $"__GroupSize__get_{name}"); - break; - case string name when name.Length == 2: - knownMembers.Add(key, $"int2(__GroupSize__get_{name[0]}, __GroupSize__get_{name[1]})"); - break; - case string name when name.Length == 3: - knownMembers.Add(key, $"int3(__GroupSize__get_{name[0]}, __GroupSize__get_{name[1]}, __GroupSize__get_{name[2]})"); - break; - } + case nameof(DispatchSize.Count): + knownMembers.Add(key, "__x * __y * __z"); + break; + case string name when name.Length == 1: + knownMembers.Add(key, $"__{char.ToLower(name[0])}"); + break; + case string name when name.Length == 2: + knownMembers.Add(key, $"int2(__{char.ToLower(name[0])}, __{char.ToLower(name[1])})"); + break; + case string name when name.Length == 3: + knownMembers.Add(key, $"int3(__{char.ToLower(name[0])}, __{char.ToLower(name[1])}, __{char.ToLower(name[2])})"); + break; } - - // Programmatically load mappings for the dispatch size - foreach (var property in typeof(DispatchSize).GetProperties(BindingFlags.Static | BindingFlags.Public)) - { - string key = $"{typeof(DispatchSize).FullName}{Type.Delimiter}{property.Name}"; - - switch (property.Name) - { - case nameof(DispatchSize.Count): - knownMembers.Add(key, "__x * __y * __z"); - break; - case string name when name.Length == 1: - knownMembers.Add(key, $"__{char.ToLower(name[0])}"); - break; - case string name when name.Length == 2: - knownMembers.Add(key, $"int2(__{char.ToLower(name[0])}, __{char.ToLower(name[1])})"); - break; - case string name when name.Length == 3: - knownMembers.Add(key, $"int3(__{char.ToLower(name[0])}, __{char.ToLower(name[1])}, __{char.ToLower(name[2])})"); - break; - } - } - - return knownMembers; } - /// - /// The mapping of supported known members to HLSL names. - /// - private static readonly IReadOnlyCollection KnownMatrixIndexers = BuildKnownMatrixIndexers(); + return knownMembers; + } - /// - /// Builds the mapping of swizzled matrix indexer properties. - /// - [Pure] - private static IReadOnlyCollection BuildKnownMatrixIndexers() + /// + /// The mapping of supported known members to HLSL names. + /// + private static readonly IReadOnlyCollection KnownMatrixIndexers = BuildKnownMatrixIndexers(); + + /// + /// Builds the mapping of swizzled matrix indexer properties. + /// + [Pure] + private static IReadOnlyCollection BuildKnownMatrixIndexers() + { + return ( + from type in Assembly.GetExecutingAssembly().ExportedTypes + where Regex.IsMatch(type.FullName, @"ComputeSharp\.(Bool|Double|Float|Int|UInt)[1-4]x[1-4]") + from property in type.GetProperties() + let indices = property.GetIndexParameters() + where indices.Length > 0 && + indices.All(static index => index.ParameterType == typeof(MatrixIndex)) + let metadataName = $"{type.FullName}.this[{string.Join(", ", indices.Select(index => index.ParameterType))}]" + select metadataName).ToImmutableHashSet(); + } + + /// + /// The mapping of supported known members to HLSL names. + /// + private static readonly IReadOnlyCollection KnownMatrixIndices = BuildKnownMatrixIndices(); + + /// + /// Builds the mapping of swizzled matrix indices. + /// + [Pure] + private static IReadOnlyCollection BuildKnownMatrixIndices() + { + return ( + from name in Enum.GetNames(typeof(MatrixIndex)) + select $"{typeof(MatrixIndex).FullName}.{name}").ToImmutableHashSet(); + } + + /// + /// Checks whether or not a given property fullname matches a matrix swizzled indexer. + /// + /// The input fully qualified member name. + /// Whether or not is a matrix swizzled indexer. + [Pure] + public static bool IsKnownMatrixIndexer(string name) + { + return KnownMatrixIndexers.Contains(name); + } + + /// + /// Checks whether or not a given property fullname matches a matrix swizzled index. + /// + /// The input fully qualified member name. + /// Whether or not is a matrix swizzled index. + [Pure] + public static bool IsKnownMatrixIndex(string name) + { + return KnownMatrixIndices.Contains(name); + } + + /// + /// Tries to get the mapped HLSL-compatible member name for the input member name. + /// + /// The input fully qualified member name. + /// The mapped name, if one is found. + /// The HLSL-compatible member name that can be used in an HLSL shader. + [Pure] + public static bool TryGetMappedName(string name, out string? mapped) + { + return KnownMembers.TryGetValue(name, out mapped); + } + + /// + /// Tries to get the mapped HLSL-compatible indexer resource type name for the input indexer name. + /// + /// The input fully qualified indexer name. + /// The mapped type name, if one is found. + /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. + [Pure] + public static bool TryGetMappedResourceIndexerTypeName(string name, out string? mapped) + { + return KnownResourceIndexers.TryGetValue(name, out mapped); + } + + /// + /// Tries to get the mapped HLSL-compatible sampler resource type name for the input indexer name. + /// + /// The input fully qualified indexer name. + /// The mapped type name, if one is found. + /// The HLSL-compatible type name that can be used in an HLSL shader for the given sampler. + [Pure] + public static bool TryGetMappedResourceSamplerAccessType(string name, out string? mapped) + { + return KnownResourceSamplers.TryGetValue(name, out mapped); + } + + /// + /// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name. + /// + /// The input fully qualified indexer name. + /// The mapped type name, if one is found. + /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. + [Pure] + public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis) + { + if (KnownSizeAccessors.TryGetValue(name, out var info)) { - return ( - from type in Assembly.GetExecutingAssembly().ExportedTypes - where Regex.IsMatch(type.FullName, @"ComputeSharp\.(Bool|Double|Float|Int|UInt)[1-4]x[1-4]") - from property in type.GetProperties() - let indices = property.GetIndexParameters() - where indices.Length > 0 && - indices.All(static index => index.ParameterType == typeof(MatrixIndex)) - let metadataName = $"{type.FullName}.this[{string.Join(", ", indices.Select(index => index.ParameterType))}]" - select metadataName).ToImmutableHashSet(); + (rank, axis) = info; + + return true; } - /// - /// The mapping of supported known members to HLSL names. - /// - private static readonly IReadOnlyCollection KnownMatrixIndices = BuildKnownMatrixIndices(); + (rank, axis) = default((int, int)); - /// - /// Builds the mapping of swizzled matrix indices. - /// - [Pure] - private static IReadOnlyCollection BuildKnownMatrixIndices() - { - return ( - from name in Enum.GetNames(typeof(MatrixIndex)) - select $"{typeof(MatrixIndex).FullName}.{name}").ToImmutableHashSet(); - } - - /// - /// Checks whether or not a given property fullname matches a matrix swizzled indexer. - /// - /// The input fully qualified member name. - /// Whether or not is a matrix swizzled indexer. - [Pure] - public static bool IsKnownMatrixIndexer(string name) - { - return KnownMatrixIndexers.Contains(name); - } - - /// - /// Checks whether or not a given property fullname matches a matrix swizzled index. - /// - /// The input fully qualified member name. - /// Whether or not is a matrix swizzled index. - [Pure] - public static bool IsKnownMatrixIndex(string name) - { - return KnownMatrixIndices.Contains(name); - } - - /// - /// Tries to get the mapped HLSL-compatible member name for the input member name. - /// - /// The input fully qualified member name. - /// The mapped name, if one is found. - /// The HLSL-compatible member name that can be used in an HLSL shader. - [Pure] - public static bool TryGetMappedName(string name, out string? mapped) - { - return KnownMembers.TryGetValue(name, out mapped); - } - - /// - /// Tries to get the mapped HLSL-compatible indexer resource type name for the input indexer name. - /// - /// The input fully qualified indexer name. - /// The mapped type name, if one is found. - /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. - [Pure] - public static bool TryGetMappedResourceIndexerTypeName(string name, out string? mapped) - { - return KnownResourceIndexers.TryGetValue(name, out mapped); - } - - /// - /// Tries to get the mapped HLSL-compatible sampler resource type name for the input indexer name. - /// - /// The input fully qualified indexer name. - /// The mapped type name, if one is found. - /// The HLSL-compatible type name that can be used in an HLSL shader for the given sampler. - [Pure] - public static bool TryGetMappedResourceSamplerAccessType(string name, out string? mapped) - { - return KnownResourceSamplers.TryGetValue(name, out mapped); - } - - /// - /// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name. - /// - /// The input fully qualified indexer name. - /// The mapped type name, if one is found. - /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. - [Pure] - public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis) - { - if (KnownSizeAccessors.TryGetValue(name, out var info)) - { - (rank, axis) = info; - - return true; - } - - (rank, axis) = default((int, int)); - - return false; - } + return false; } } diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs index 744be482..c52d36de 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; @@ -6,152 +6,151 @@ using System.Numerics; using System.Reflection; using ComputeSharp.Core.Intrinsics.Attributes; -namespace ComputeSharp.SourceGenerators.Mappings +namespace ComputeSharp.SourceGenerators.Mappings; + +/// +/// A that contains and maps known HLSL method names to common .NET methods. +/// +internal static class HlslKnownMethods { /// - /// A that contains and maps known HLSL method names to common .NET methods. + /// The mapping of supported known methods to HLSL names. /// - internal static class HlslKnownMethods + private static readonly IReadOnlyDictionary KnownMethods = BuildKnownMethodsMap(); + + /// + /// Builds the mapping of supported known methods to HLSL names. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownMethodsMap() { - /// - /// The mapping of supported known methods to HLSL names. - /// - private static readonly IReadOnlyDictionary KnownMethods = BuildKnownMethodsMap(); - - /// - /// Builds the mapping of supported known methods to HLSL names. - /// - [Pure] - private static IReadOnlyDictionary BuildKnownMethodsMap() + Dictionary knownMethods = new() { - Dictionary knownMethods = new() - { - [$"{typeof(Math).FullName}.{nameof(Math.Abs)}"] = "abs", - [$"{typeof(Math).FullName}.{nameof(Math.Max)}"] = "max", - [$"{typeof(Math).FullName}.{nameof(Math.Min)}"] = "min", - [$"{typeof(Math).FullName}.{nameof(Math.Pow)}"] = "pow", - [$"{typeof(Math).FullName}.{nameof(Math.Sin)}"] = "sin", - [$"{typeof(Math).FullName}.{nameof(Math.Sinh)}"] = "sinh", - [$"{typeof(Math).FullName}.{nameof(Math.Asin)}"] = "asin", - [$"{typeof(Math).FullName}.{nameof(Math.Cos)}"] = "cos", - [$"{typeof(Math).FullName}.{nameof(Math.Cosh)}"] = "cosh", - [$"{typeof(Math).FullName}.{nameof(Math.Acos)}"] = "acos", - [$"{typeof(Math).FullName}.{nameof(Math.Tan)}"] = "tan", - [$"{typeof(Math).FullName}.{nameof(Math.Tanh)}"] = "tanh", - [$"{typeof(Math).FullName}.{nameof(Math.Atan)}"] = "atan", - [$"{typeof(Math).FullName}.{nameof(Math.Atan2)}"] = "atan2", - [$"{typeof(Math).FullName}.{nameof(Math.Ceiling)}"] = "ceil", - [$"{typeof(Math).FullName}.{nameof(Math.Floor)}"] = "floor", - [$"{typeof(Math).FullName}.Clamp"] = "clamp", - [$"{typeof(Math).FullName}.{nameof(Math.Exp)}"] = "exp", - [$"{typeof(Math).FullName}.{nameof(Math.Log)}"] = "log", - [$"{typeof(Math).FullName}.{nameof(Math.Log10)}"] = "log10", - [$"{typeof(Math).FullName}.{nameof(Math.Max)}"] = "max", - [$"{typeof(Math).FullName}.{nameof(Math.Min)}"] = "min", - [$"{typeof(Math).FullName}.{nameof(Math.Round)}"] = "round", - [$"{typeof(Math).FullName}.{nameof(Math.Sqrt)}"] = "sqrt", - [$"{typeof(Math).FullName}.{nameof(Math.Sign)}"] = "sign", - [$"{typeof(Math).FullName}.{nameof(Math.Truncate)}"] = "trunc", + [$"{typeof(Math).FullName}.{nameof(Math.Abs)}"] = "abs", + [$"{typeof(Math).FullName}.{nameof(Math.Max)}"] = "max", + [$"{typeof(Math).FullName}.{nameof(Math.Min)}"] = "min", + [$"{typeof(Math).FullName}.{nameof(Math.Pow)}"] = "pow", + [$"{typeof(Math).FullName}.{nameof(Math.Sin)}"] = "sin", + [$"{typeof(Math).FullName}.{nameof(Math.Sinh)}"] = "sinh", + [$"{typeof(Math).FullName}.{nameof(Math.Asin)}"] = "asin", + [$"{typeof(Math).FullName}.{nameof(Math.Cos)}"] = "cos", + [$"{typeof(Math).FullName}.{nameof(Math.Cosh)}"] = "cosh", + [$"{typeof(Math).FullName}.{nameof(Math.Acos)}"] = "acos", + [$"{typeof(Math).FullName}.{nameof(Math.Tan)}"] = "tan", + [$"{typeof(Math).FullName}.{nameof(Math.Tanh)}"] = "tanh", + [$"{typeof(Math).FullName}.{nameof(Math.Atan)}"] = "atan", + [$"{typeof(Math).FullName}.{nameof(Math.Atan2)}"] = "atan2", + [$"{typeof(Math).FullName}.{nameof(Math.Ceiling)}"] = "ceil", + [$"{typeof(Math).FullName}.{nameof(Math.Floor)}"] = "floor", + [$"{typeof(Math).FullName}.Clamp"] = "clamp", + [$"{typeof(Math).FullName}.{nameof(Math.Exp)}"] = "exp", + [$"{typeof(Math).FullName}.{nameof(Math.Log)}"] = "log", + [$"{typeof(Math).FullName}.{nameof(Math.Log10)}"] = "log10", + [$"{typeof(Math).FullName}.{nameof(Math.Max)}"] = "max", + [$"{typeof(Math).FullName}.{nameof(Math.Min)}"] = "min", + [$"{typeof(Math).FullName}.{nameof(Math.Round)}"] = "round", + [$"{typeof(Math).FullName}.{nameof(Math.Sqrt)}"] = "sqrt", + [$"{typeof(Math).FullName}.{nameof(Math.Sign)}"] = "sign", + [$"{typeof(Math).FullName}.{nameof(Math.Truncate)}"] = "trunc", - ["System.MathF.Abs"] = "abs", - ["System.MathF.Max"] = "max", - ["System.MathF.Min"] = "min", - ["System.MathF.Pow"] = "pow", - ["System.MathF.Sin"] = "sin", - ["System.MathF.Sinh"] = "sinh", - ["System.MathF.Asin"] = "asin", - ["System.MathF.Cos"] = "cos", - ["System.MathF.Cosh"] = "cosh", - ["System.MathF.Acos"] = "acos", - ["System.MathF.Tan"] = "tan", - ["System.MathF.Tanh"] = "tanh", - ["System.MathF.Atan"] = "atan", - ["System.MathF.Atan2"] = "atan2", - ["System.MathF.Ceiling"] = "ceil", - ["System.MathF.Floor"] = "floor", - ["System.MathF.Clamp"] = "clamp", - ["System.MathF.Exp"] = "exp", - ["System.MathF.Log"] = "log", - ["System.MathF.Log10"] = "log10", - ["System.MathF.Max"] = "max", - ["System.MathF.Min"] = "min", - ["System.MathF.Round"] = "round", - ["System.MathF.Sqrt"] = "sqrt", - ["System.MathF.Sign"] = "sign", - ["System.MathF.Truncate"] = "trunc", + ["System.MathF.Abs"] = "abs", + ["System.MathF.Max"] = "max", + ["System.MathF.Min"] = "min", + ["System.MathF.Pow"] = "pow", + ["System.MathF.Sin"] = "sin", + ["System.MathF.Sinh"] = "sinh", + ["System.MathF.Asin"] = "asin", + ["System.MathF.Cos"] = "cos", + ["System.MathF.Cosh"] = "cosh", + ["System.MathF.Acos"] = "acos", + ["System.MathF.Tan"] = "tan", + ["System.MathF.Tanh"] = "tanh", + ["System.MathF.Atan"] = "atan", + ["System.MathF.Atan2"] = "atan2", + ["System.MathF.Ceiling"] = "ceil", + ["System.MathF.Floor"] = "floor", + ["System.MathF.Clamp"] = "clamp", + ["System.MathF.Exp"] = "exp", + ["System.MathF.Log"] = "log", + ["System.MathF.Log10"] = "log10", + ["System.MathF.Max"] = "max", + ["System.MathF.Min"] = "min", + ["System.MathF.Round"] = "round", + ["System.MathF.Sqrt"] = "sqrt", + ["System.MathF.Sign"] = "sign", + ["System.MathF.Truncate"] = "trunc", - [$"{typeof(float).FullName}.IsFinite"] = "isfinite", - [$"{typeof(float).FullName}.{nameof(float.IsInfinity)}"] = "isinf", - [$"{typeof(float).FullName}.{nameof(float.IsNaN)}"] = "isnan", + [$"{typeof(float).FullName}.IsFinite"] = "isfinite", + [$"{typeof(float).FullName}.{nameof(float.IsInfinity)}"] = "isinf", + [$"{typeof(float).FullName}.{nameof(float.IsNaN)}"] = "isnan", - [$"{typeof(double).FullName}.IsFinite"] = "isfinite", - [$"{typeof(double).FullName}.{nameof(double.IsInfinity)}"] = "isinf", - [$"{typeof(double).FullName}.{nameof(double.IsNaN)}"] = "isnan", + [$"{typeof(double).FullName}.IsFinite"] = "isfinite", + [$"{typeof(double).FullName}.{nameof(double.IsInfinity)}"] = "isinf", + [$"{typeof(double).FullName}.{nameof(double.IsNaN)}"] = "isnan", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Abs)}"] = "abs", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Clamp)}"] = "clamp", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Distance)}"] = "distance", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Dot)}"] = "dot", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Lerp)}"] = "lerp", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Max)}"] = "max", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Min)}"] = "min", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Reflect)}"] = "reflect", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Transform)}"] = "mul", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.TransformNormal)}"] = "mul", - [$"{typeof(Vector2).FullName}.{nameof(Vector2.Normalize)}"] = "normalize", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Abs)}"] = "abs", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Clamp)}"] = "clamp", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Distance)}"] = "distance", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Dot)}"] = "dot", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Lerp)}"] = "lerp", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Max)}"] = "max", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Min)}"] = "min", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Reflect)}"] = "reflect", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Transform)}"] = "mul", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.TransformNormal)}"] = "mul", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Normalize)}"] = "normalize", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Abs)}"] = "abs", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Clamp)}"] = "clamp", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Cross)}"] = "cross", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Distance)}"] = "distance", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Dot)}"] = "dot", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Lerp)}"] = "lerp", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Max)}"] = "max", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Min)}"] = "min", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Reflect)}"] = "reflect", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Transform)}"] = "mul", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.TransformNormal)}"] = "mul", - [$"{typeof(Vector3).FullName}.{nameof(Vector3.Normalize)}"] = "normalize", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Abs)}"] = "abs", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Clamp)}"] = "clamp", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Cross)}"] = "cross", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Distance)}"] = "distance", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Dot)}"] = "dot", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Lerp)}"] = "lerp", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Max)}"] = "max", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Min)}"] = "min", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Reflect)}"] = "reflect", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Transform)}"] = "mul", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.TransformNormal)}"] = "mul", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Normalize)}"] = "normalize", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Abs)}"] = "abs", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Clamp)}"] = "clamp", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Distance)}"] = "distance", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Dot)}"] = "dot", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Lerp)}"] = "lerp", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Max)}"] = "max", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Min)}"] = "min", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Transform)}"] = "mul", - [$"{typeof(Vector4).FullName}.{nameof(Vector4.Normalize)}"] = "normalize" - }; + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Abs)}"] = "abs", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Clamp)}"] = "clamp", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Distance)}"] = "distance", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Dot)}"] = "dot", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Lerp)}"] = "lerp", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Max)}"] = "max", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Min)}"] = "min", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Transform)}"] = "mul", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Normalize)}"] = "normalize" + }; - // Programmatically load mappings from the Hlsl class as well - foreach (var method in - from method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static) - group method by method.Name - into groups - select groups.First()) - { - // Check whether the current method should be translated with the original name - // or with the lowercase version. This is needed because all C# methods are exposed - // with the upper camel case format, while HLSL intrinsics use multiple different formats. - string hlslName = method.GetCustomAttribute()?.Name ?? method.Name; + // Programmatically load mappings from the Hlsl class as well + foreach (var method in + from method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static) + group method by method.Name + into groups + select groups.First()) + { + // Check whether the current method should be translated with the original name + // or with the lowercase version. This is needed because all C# methods are exposed + // with the upper camel case format, while HLSL intrinsics use multiple different formats. + string hlslName = method.GetCustomAttribute()?.Name ?? method.Name; - knownMethods.Add($"{typeof(Hlsl).FullName}{Type.Delimiter}{method.Name}", hlslName); - } - - return knownMethods; + knownMethods.Add($"{typeof(Hlsl).FullName}{Type.Delimiter}{method.Name}", hlslName); } - /// - /// Tries to get the mapped HLSL-compatible method name for the input method name. - /// - /// The input fully qualified method name. - /// The mapped name, if one is found. - /// The HLSL-compatible member name that can be used in an HLSL shader. - [Pure] - public static bool TryGetMappedName(string name, out string? mapped) - { - return KnownMethods.TryGetValue(name, out mapped); - } + return knownMethods; + } + + /// + /// Tries to get the mapped HLSL-compatible method name for the input method name. + /// + /// The input fully qualified method name. + /// The mapped name, if one is found. + /// The HLSL-compatible member name that can be used in an HLSL shader. + [Pure] + public static bool TryGetMappedName(string name, out string? mapped) + { + return KnownMethods.TryGetValue(name, out mapped); } } diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs index 86bc3c8e..47a93263 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs @@ -5,58 +5,57 @@ using System.Numerics; using System.Reflection; using System.Text.RegularExpressions; -namespace ComputeSharp.SourceGenerators.Mappings +namespace ComputeSharp.SourceGenerators.Mappings; + +/// +/// A that contains and maps known HLSL types to their alignment sizes. +/// +internal static class HlslKnownSizes { /// - /// A that contains and maps known HLSL types to their alignment sizes. + /// The mapping of supported known sizes to HLSL type names. /// - internal static class HlslKnownSizes + private static IReadOnlyDictionary KnownSizes = BuildKnownSizesMap(); + + /// + /// Builds the mapping of known type sizes and alignments. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownSizesMap() { - /// - /// The mapping of supported known sizes to HLSL type names. - /// - private static IReadOnlyDictionary KnownSizes = BuildKnownSizesMap(); - - /// - /// Builds the mapping of known type sizes and alignments. - /// - [Pure] - private static IReadOnlyDictionary BuildKnownSizesMap() + Dictionary knownSizes = new() { - Dictionary knownSizes = new() - { - [typeof(bool).FullName] = (4, 4), - [typeof(int).FullName] = (4, 4), - [typeof(uint).FullName] = (4, 4), - [typeof(float).FullName] = (4, 4), - [typeof(double).FullName] = (8, 8), + [typeof(bool).FullName] = (4, 4), + [typeof(int).FullName] = (4, 4), + [typeof(uint).FullName] = (4, 4), + [typeof(float).FullName] = (4, 4), + [typeof(double).FullName] = (8, 8), - [typeof(Vector2).FullName] = (8, 4), - [typeof(Vector3).FullName] = (12, 4), - [typeof(Vector4).FullName] = (16, 4) - }; + [typeof(Vector2).FullName] = (8, 4), + [typeof(Vector3).FullName] = (12, 4), + [typeof(Vector4).FullName] = (16, 4) + }; - foreach ( - var type in - from type in Assembly.GetExecutingAssembly().ExportedTypes - where Regex.IsMatch(type.FullName, @"^ComputeSharp\.(Bool|Double|Float|Int|UInt)") - select type) - { - knownSizes.Add(type.FullName, (type.StructLayoutAttribute.Size, type.StructLayoutAttribute.Pack)); - } - - return knownSizes; + foreach ( + var type in + from type in Assembly.GetExecutingAssembly().ExportedTypes + where Regex.IsMatch(type.FullName, @"^ComputeSharp\.(Bool|Double|Float|Int|UInt)") + select type) + { + knownSizes.Add(type.FullName, (type.StructLayoutAttribute.Size, type.StructLayoutAttribute.Pack)); } - /// - /// Gets the size and alignment info for a specified primitive type. - /// - /// The type name to get info for. - /// The size and and alignment for the input type. - [Pure] - public static (int Size, int Pack) GetTypeInfo(string typeName) - { - return KnownSizes[typeName]; - } + return knownSizes; + } + + /// + /// Gets the size and alignment info for a specified primitive type. + /// + /// The type name to get info for. + /// The size and and alignment for the input type. + [Pure] + public static (int Size, int Pack) GetTypeInfo(string typeName) + { + return KnownSizes[typeName]; } } diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs index 68553678..9ebd68ed 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs @@ -9,301 +9,253 @@ using Microsoft.CodeAnalysis; #pragma warning disable RS1024 -namespace ComputeSharp.SourceGenerators.Mappings +namespace ComputeSharp.SourceGenerators.Mappings; + +/// +/// A that contains and maps known HLSL type names to common .NET types. +/// +internal static class HlslKnownTypes { /// - /// A that contains and maps known HLSL type names to common .NET types. + /// Gets the known HLSL dispatch types. /// - internal static class HlslKnownTypes + public static IReadOnlyCollection HlslDispatchTypes { get; } = new[] { - /// - /// Gets the known HLSL dispatch types. - /// - public static IReadOnlyCollection HlslDispatchTypes { get; } = new[] + typeof(ThreadIds), + typeof(GroupIds), + typeof(GridIds) + }; + + /// + /// Gets the set of HLSL vector types. + /// + public static IReadOnlyCollection KnownVectorTypes { get; } = new[] + { + typeof(Bool2), typeof(Bool3), typeof(Bool4), + typeof(Int2), typeof(Int3), typeof(Int4), + typeof(UInt2), typeof(UInt3), typeof(UInt4), + typeof(Float2), typeof(Float3), typeof(Float4), + typeof(Double2), typeof(Double3), typeof(Double4) + }; + + /// + /// Gets the set of HLSL matrix types. + /// + public static IReadOnlyCollection KnownMatrixTypes { get; } = new[] + { + typeof(Bool1x1), typeof(Bool1x2), typeof(Bool1x3), typeof(Bool1x4), + typeof(Bool2x1), typeof(Bool2x2), typeof(Bool2x3), typeof(Bool2x4), + typeof(Bool3x1), typeof(Bool3x2), typeof(Bool3x3), typeof(Bool3x4), + typeof(Bool4x1), typeof(Bool4x2), typeof(Bool4x3), typeof(Bool4x4), + typeof(Int1x1), typeof(Int1x2), typeof(Int1x3), typeof(Int1x4), + typeof(Int2x1), typeof(Int2x2), typeof(Int2x3), typeof(Int2x4), + typeof(Int3x1), typeof(Int3x2), typeof(Int3x3), typeof(Int3x4), + typeof(Int4x1), typeof(Int4x2), typeof(Int4x3), typeof(Int4x4), + typeof(UInt1x1), typeof(UInt1x2), typeof(UInt1x3), typeof(UInt1x4), + typeof(UInt2x1), typeof(UInt2x2), typeof(UInt2x3), typeof(UInt2x4), + typeof(UInt3x1), typeof(UInt3x2), typeof(UInt3x3), typeof(UInt3x4), + typeof(UInt4x1), typeof(UInt4x2), typeof(UInt4x3), typeof(UInt4x4), + typeof(Float1x1), typeof(Float1x2), typeof(Float1x3), typeof(Float1x4), + typeof(Float2x1), typeof(Float2x2), typeof(Float2x3), typeof(Float2x4), + typeof(Float3x1), typeof(Float3x2), typeof(Float3x3), typeof(Float3x4), + typeof(Float4x1), typeof(Float4x2), typeof(Float4x3), typeof(Float4x4), + typeof(Double1x1), typeof(Double1x2), typeof(Double1x3), typeof(Double1x4), + typeof(Double2x1), typeof(Double2x2), typeof(Double2x3), typeof(Double2x4), + typeof(Double3x1), typeof(Double3x2), typeof(Double3x3), typeof(Double3x4), + typeof(Double4x1), typeof(Double4x2), typeof(Double4x3), typeof(Double4x4) + }; + + /// + /// The mapping of supported known types to HLSL types. + /// + private static readonly IReadOnlyDictionary KnownHlslTypes = BuildKnownHlslTypes(); + + /// + /// Builds the mapping of known primitive types. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownHlslTypes() + { + Dictionary knownTypes = new() { - typeof(ThreadIds), - typeof(GroupIds), - typeof(GridIds) + [typeof(bool).FullName] = "bool", + [typeof(int).FullName] = "int", + [typeof(uint).FullName] = "uint", + [typeof(float).FullName] = "float", + [typeof(Vector2).FullName] = "float2", + [typeof(Vector3).FullName] = "float3", + [typeof(Vector4).FullName] = "float4", + [typeof(double).FullName] = "double" }; - /// - /// Gets the set of HLSL vector types. - /// - public static IReadOnlyCollection KnownVectorTypes { get; } = new[] + // Add all the vector types + foreach (var type in KnownVectorTypes) { - typeof(Bool2), typeof(Bool3), typeof(Bool4), - typeof(Int2), typeof(Int3), typeof(Int4), - typeof(UInt2), typeof(UInt3), typeof(UInt4), - typeof(Float2), typeof(Float3), typeof(Float4), - typeof(Double2), typeof(Double3), typeof(Double4) + knownTypes.Add(type.FullName, type.Name.ToLower()); + } + + // Add all the matrix types + foreach (var type in KnownMatrixTypes) + { + knownTypes.Add(type.FullName, type.Name.ToLower()); + } + + return knownTypes; + } + + /// + /// Checks whether or not a given type name matches a constant buffer type. + /// + /// The input type name to check. + /// Whether or not represents a constant buffer type. + public static bool IsConstantBufferType(string typeName) + { + return typeName == "ComputeSharp.ConstantBuffer`1"; + } + + /// + /// Checks whether or not a given type name matches a structured buffer type. + /// + /// The input type name to check. + /// Whether or not represents a structured buffer type. + public static bool IsStructuredBufferType(string typeName) + { + return typeName switch + { + "ComputeSharp.ConstantBuffer`1" or + "ComputeSharp.ReadOnlyBuffer`1" or + "ComputeSharp.ReadWriteBuffer`1" => true, + _ => false, }; + } - /// - /// Gets the set of HLSL matrix types. - /// - public static IReadOnlyCollection KnownMatrixTypes { get; } = new[] + /// + /// Checks whether or not a given type name matches a readonly typed resource type. + /// + /// The input type name to check. + /// Whether or not represents a readonly typed resource type. + public static bool IsReadOnlyTypedResourceType(string typeName) + { + return typeName switch { - typeof(Bool1x1), typeof(Bool1x2), typeof(Bool1x3), typeof(Bool1x4), - typeof(Bool2x1), typeof(Bool2x2), typeof(Bool2x3), typeof(Bool2x4), - typeof(Bool3x1), typeof(Bool3x2), typeof(Bool3x3), typeof(Bool3x4), - typeof(Bool4x1), typeof(Bool4x2), typeof(Bool4x3), typeof(Bool4x4), - typeof(Int1x1), typeof(Int1x2), typeof(Int1x3), typeof(Int1x4), - typeof(Int2x1), typeof(Int2x2), typeof(Int2x3), typeof(Int2x4), - typeof(Int3x1), typeof(Int3x2), typeof(Int3x3), typeof(Int3x4), - typeof(Int4x1), typeof(Int4x2), typeof(Int4x3), typeof(Int4x4), - typeof(UInt1x1), typeof(UInt1x2), typeof(UInt1x3), typeof(UInt1x4), - typeof(UInt2x1), typeof(UInt2x2), typeof(UInt2x3), typeof(UInt2x4), - typeof(UInt3x1), typeof(UInt3x2), typeof(UInt3x3), typeof(UInt3x4), - typeof(UInt4x1), typeof(UInt4x2), typeof(UInt4x3), typeof(UInt4x4), - typeof(Float1x1), typeof(Float1x2), typeof(Float1x3), typeof(Float1x4), - typeof(Float2x1), typeof(Float2x2), typeof(Float2x3), typeof(Float2x4), - typeof(Float3x1), typeof(Float3x2), typeof(Float3x3), typeof(Float3x4), - typeof(Float4x1), typeof(Float4x2), typeof(Float4x3), typeof(Float4x4), - typeof(Double1x1), typeof(Double1x2), typeof(Double1x3), typeof(Double1x4), - typeof(Double2x1), typeof(Double2x2), typeof(Double2x3), typeof(Double2x4), - typeof(Double3x1), typeof(Double3x2), typeof(Double3x3), typeof(Double3x4), - typeof(Double4x1), typeof(Double4x2), typeof(Double4x3), typeof(Double4x4) + "ComputeSharp.ReadOnlyBuffer`1" or + "ComputeSharp.ReadOnlyTexture2D`1" or + "ComputeSharp.ReadOnlyTexture2D`2" or + "ComputeSharp.ReadOnlyTexture3D`1" or + "ComputeSharp.ReadOnlyTexture3D`2" or + "ComputeSharp.IReadOnlyTexture2D`1" or + "ComputeSharp.IReadOnlyTexture3D`1" => true, + _ => false, }; + } - /// - /// The mapping of supported known types to HLSL types. - /// - private static readonly IReadOnlyDictionary KnownHlslTypes = BuildKnownHlslTypes(); - - /// - /// Builds the mapping of known primitive types. - /// - [Pure] - private static IReadOnlyDictionary BuildKnownHlslTypes() + /// + /// Checks whether or not a given type name matches a typed resource type. + /// + /// The input type name to check. + /// Whether or not represents a typed resource type. + public static bool IsTypedResourceType(string typeName) + { + return typeName switch { - Dictionary knownTypes = new() - { - [typeof(bool).FullName] = "bool", - [typeof(int).FullName] = "int", - [typeof(uint).FullName] = "uint", - [typeof(float).FullName] = "float", - [typeof(Vector2).FullName] = "float2", - [typeof(Vector3).FullName] = "float3", - [typeof(Vector4).FullName] = "float4", - [typeof(double).FullName] = "double" - }; + "ComputeSharp.ConstantBuffer`1" or + "ComputeSharp.ReadOnlyBuffer`1" or + "ComputeSharp.ReadWriteBuffer`1" or + "ComputeSharp.ReadOnlyTexture2D`1" or + "ComputeSharp.ReadOnlyTexture2D`2" or + "ComputeSharp.ReadWriteTexture2D`1" or + "ComputeSharp.ReadWriteTexture2D`2" or + "ComputeSharp.ReadOnlyTexture3D`1" or + "ComputeSharp.ReadOnlyTexture3D`2" or + "ComputeSharp.ReadWriteTexture3D`1" or + "ComputeSharp.ReadWriteTexture3D`2" or + "ComputeSharp.IReadOnlyTexture2D`1" or + "ComputeSharp.IReadWriteTexture2D`1" or + "ComputeSharp.IReadOnlyTexture3D`1" or + "ComputeSharp.IReadWriteTexture3D`1" => true, + _ => false, + }; + } - // Add all the vector types - foreach (var type in KnownVectorTypes) + /// + /// Checks whether or not a given type name matches a known HLSL primitive type (scalar, vector or matrix). + /// + /// The input type name to check. + /// Whether or not represents a scalar, vector or matrix type. + public static bool IsKnownHlslType(string typeName) + { + return KnownHlslTypes.ContainsKey(typeName); + } + + /// + /// Checks whether or not a given type name matches a vector type. + /// + /// The input type name to check. + /// Whether or not represents a vector type. + public static bool IsVectorType(string typeName) + { + return KnownVectorTypes.Any(type => type.FullName == typeName); + } + + /// + /// Checks whether or not a given type name matches a matrix type. + /// + /// The input type name to check. + /// Whether or not represents a matrix type. + public static bool IsMatrixType(string typeName) + { + return KnownMatrixTypes.Any(type => type.FullName == typeName); + } + + /// + /// Checks whether or not a given type name is a non linear matrix type. + /// That is, a matrix type with more than a single row (which affects the constant buffer alignment). + /// + /// The input type name to check. + /// The element name of the matrix type. + /// The number of rows in the matrix type. + /// The number of columns in the matrix type. + /// Whether or not represents a non linear matrix type. + public static bool IsNonLinearMatrixType(string typeName, out string? elementName, out int rows, out int columns) + { + if (KnownMatrixTypes.Any(type => type.FullName == typeName)) + { + var match = Regex.Match(typeName, @"^ComputeSharp\.(Bool|Int|UInt|Float|Double)([2-4])x([1-4])$"); + + if (match.Success) { - knownTypes.Add(type.FullName, type.Name.ToLower()); + elementName = match.Groups[1].Value; + rows = int.Parse(match.Groups[2].Value); + columns = int.Parse(match.Groups[3].Value); + + return true; } - - // Add all the matrix types - foreach (var type in KnownMatrixTypes) - { - knownTypes.Add(type.FullName, type.Name.ToLower()); - } - - return knownTypes; } - /// - /// Checks whether or not a given type name matches a constant buffer type. - /// - /// The input type name to check. - /// Whether or not represents a constant buffer type. - public static bool IsConstantBufferType(string typeName) + elementName = null; + rows = columns = 0; + + return false; + } + + /// + /// Gets the mapped HLSL-compatible type name for the input type symbol. + /// + /// The input type to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + [Pure] + public static string GetMappedName(INamedTypeSymbol typeSymbol) + { + // Delegate types just return an empty string, as they're not actually + // used in the generated shaders, but just mapped to a function at runtime. + if (typeSymbol.TypeKind == TypeKind.Delegate) return ""; + + string typeName = typeSymbol.GetFullMetadataName(); + + // Special case for the resource types + if (IsTypedResourceType(typeName)) { - return typeName == "ComputeSharp.ConstantBuffer`1"; - } - - /// - /// Checks whether or not a given type name matches a structured buffer type. - /// - /// The input type name to check. - /// Whether or not represents a structured buffer type. - public static bool IsStructuredBufferType(string typeName) - { - return typeName switch - { - "ComputeSharp.ConstantBuffer`1" or - "ComputeSharp.ReadOnlyBuffer`1" or - "ComputeSharp.ReadWriteBuffer`1" => true, - _ => false, - }; - } - - /// - /// Checks whether or not a given type name matches a readonly typed resource type. - /// - /// The input type name to check. - /// Whether or not represents a readonly typed resource type. - public static bool IsReadOnlyTypedResourceType(string typeName) - { - return typeName switch - { - "ComputeSharp.ReadOnlyBuffer`1" or - "ComputeSharp.ReadOnlyTexture2D`1" or - "ComputeSharp.ReadOnlyTexture2D`2" or - "ComputeSharp.ReadOnlyTexture3D`1" or - "ComputeSharp.ReadOnlyTexture3D`2" or - "ComputeSharp.IReadOnlyTexture2D`1" or - "ComputeSharp.IReadOnlyTexture3D`1" => true, - _ => false, - }; - } - - /// - /// Checks whether or not a given type name matches a typed resource type. - /// - /// The input type name to check. - /// Whether or not represents a typed resource type. - public static bool IsTypedResourceType(string typeName) - { - return typeName switch - { - "ComputeSharp.ConstantBuffer`1" or - "ComputeSharp.ReadOnlyBuffer`1" or - "ComputeSharp.ReadWriteBuffer`1" or - "ComputeSharp.ReadOnlyTexture2D`1" or - "ComputeSharp.ReadOnlyTexture2D`2" or - "ComputeSharp.ReadWriteTexture2D`1" or - "ComputeSharp.ReadWriteTexture2D`2" or - "ComputeSharp.ReadOnlyTexture3D`1" or - "ComputeSharp.ReadOnlyTexture3D`2" or - "ComputeSharp.ReadWriteTexture3D`1" or - "ComputeSharp.ReadWriteTexture3D`2" or - "ComputeSharp.IReadOnlyTexture2D`1" or - "ComputeSharp.IReadWriteTexture2D`1" or - "ComputeSharp.IReadOnlyTexture3D`1" or - "ComputeSharp.IReadWriteTexture3D`1" => true, - _ => false, - }; - } - - /// - /// Checks whether or not a given type name matches a known HLSL primitive type (scalar, vector or matrix). - /// - /// The input type name to check. - /// Whether or not represents a scalar, vector or matrix type. - public static bool IsKnownHlslType(string typeName) - { - return KnownHlslTypes.ContainsKey(typeName); - } - - /// - /// Checks whether or not a given type name matches a vector type. - /// - /// The input type name to check. - /// Whether or not represents a vector type. - public static bool IsVectorType(string typeName) - { - return KnownVectorTypes.Any(type => type.FullName == typeName); - } - - /// - /// Checks whether or not a given type name matches a matrix type. - /// - /// The input type name to check. - /// Whether or not represents a matrix type. - public static bool IsMatrixType(string typeName) - { - return KnownMatrixTypes.Any(type => type.FullName == typeName); - } - - /// - /// Checks whether or not a given type name is a non linear matrix type. - /// That is, a matrix type with more than a single row (which affects the constant buffer alignment). - /// - /// The input type name to check. - /// The element name of the matrix type. - /// The number of rows in the matrix type. - /// The number of columns in the matrix type. - /// Whether or not represents a non linear matrix type. - public static bool IsNonLinearMatrixType(string typeName, out string? elementName, out int rows, out int columns) - { - if (KnownMatrixTypes.Any(type => type.FullName == typeName)) - { - var match = Regex.Match(typeName, @"^ComputeSharp\.(Bool|Int|UInt|Float|Double)([2-4])x([1-4])$"); - - if (match.Success) - { - elementName = match.Groups[1].Value; - rows = int.Parse(match.Groups[2].Value); - columns = int.Parse(match.Groups[3].Value); - - return true; - } - } - - elementName = null; - rows = columns = 0; - - return false; - } - - /// - /// Gets the mapped HLSL-compatible type name for the input type symbol. - /// - /// The input type to map. - /// The HLSL-compatible type name that can be used in an HLSL shader. - [Pure] - public static string GetMappedName(INamedTypeSymbol typeSymbol) - { - // Delegate types just return an empty string, as they're not actually - // used in the generated shaders, but just mapped to a function at runtime. - if (typeSymbol.TypeKind == TypeKind.Delegate) return ""; - - string typeName = typeSymbol.GetFullMetadataName(); - - // Special case for the resource types - if (IsTypedResourceType(typeName)) - { - string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.Last()).GetFullMetadataName(); - - // If the current type is a custom type, format it as needed - if (!KnownHlslTypes.TryGetValue(genericArgumentName, out string? mappedElementType)) - { - mappedElementType = genericArgumentName.ToHlslIdentifierName(); - } - - // Construct the HLSL type name - return typeName switch - { - "ComputeSharp.ConstantBuffer`1" => mappedElementType, - "ComputeSharp.ReadOnlyBuffer`1" => $"StructuredBuffer<{mappedElementType}>", - "ComputeSharp.ReadWriteBuffer`1" => $"RWStructuredBuffer<{mappedElementType}>", - "ComputeSharp.ReadOnlyTexture2D`1" => $"Texture2D<{mappedElementType}>", - "ComputeSharp.ReadOnlyTexture2D`2" => $"Texture2D", - "ComputeSharp.ReadWriteTexture2D`1" => $"RWTexture2D<{mappedElementType}>", - "ComputeSharp.ReadWriteTexture2D`2" => $"RWTexture2D", - "ComputeSharp.ReadOnlyTexture3D`1" => $"Texture3D<{mappedElementType}>", - "ComputeSharp.ReadOnlyTexture3D`2" => $"Texture3D", - "ComputeSharp.ReadWriteTexture3D`1" => $"RWTexture3D<{mappedElementType}>", - "ComputeSharp.ReadWriteTexture3D`2" => $"RWTexture3D", - "ComputeSharp.IReadOnlyTexture2D`1" => $"Texture2D", - "ComputeSharp.IReadWriteTexture2D`1" => $"RWTexture2D", - "ComputeSharp.IReadOnlyTexture3D`1" => $"Texture3D", - "ComputeSharp.IReadWriteTexture3D`1" => $"RWTexture3D", - _ => throw new ArgumentException() - }; - } - - // The captured field is of an HLSL primitive type - if (KnownHlslTypes.TryGetValue(typeName, out string? mappedType)) - { - return mappedType; - } - - // The captured field is of a custom struct type - return typeName.ToHlslIdentifierName(); - } - - /// - /// Gets the mapped HLSL-compatible type name for the output texture of a pixel shader. - /// - /// The pixel shader type to map. - /// The HLSL-compatible type name that can be used in an HLSL shader. - [Pure] - public static string GetMappedNameForPixelShaderType(INamedTypeSymbol typeSymbol) - { - string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.First()).GetFullMetadataName(); + string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.Last()).GetFullMetadataName(); // If the current type is a custom type, format it as needed if (!KnownHlslTypes.TryGetValue(genericArgumentName, out string? mappedElementType)) @@ -312,124 +264,171 @@ namespace ComputeSharp.SourceGenerators.Mappings } // Construct the HLSL type name - return $"RWTexture2D"; + return typeName switch + { + "ComputeSharp.ConstantBuffer`1" => mappedElementType, + "ComputeSharp.ReadOnlyBuffer`1" => $"StructuredBuffer<{mappedElementType}>", + "ComputeSharp.ReadWriteBuffer`1" => $"RWStructuredBuffer<{mappedElementType}>", + "ComputeSharp.ReadOnlyTexture2D`1" => $"Texture2D<{mappedElementType}>", + "ComputeSharp.ReadOnlyTexture2D`2" => $"Texture2D", + "ComputeSharp.ReadWriteTexture2D`1" => $"RWTexture2D<{mappedElementType}>", + "ComputeSharp.ReadWriteTexture2D`2" => $"RWTexture2D", + "ComputeSharp.ReadOnlyTexture3D`1" => $"Texture3D<{mappedElementType}>", + "ComputeSharp.ReadOnlyTexture3D`2" => $"Texture3D", + "ComputeSharp.ReadWriteTexture3D`1" => $"RWTexture3D<{mappedElementType}>", + "ComputeSharp.ReadWriteTexture3D`2" => $"RWTexture3D", + "ComputeSharp.IReadOnlyTexture2D`1" => $"Texture2D", + "ComputeSharp.IReadWriteTexture2D`1" => $"RWTexture2D", + "ComputeSharp.IReadOnlyTexture3D`1" => $"Texture3D", + "ComputeSharp.IReadWriteTexture3D`1" => $"RWTexture3D", + _ => throw new ArgumentException() + }; } - /// - /// Gets the mapped HLSL-compatible type name for the input element type symbol. - /// - /// The input type to map. - /// The HLSL-compatible type name that can be used in an HLSL shader. - [Pure] - public static string GetMappedElementName(IArrayTypeSymbol typeSymbol) + // The captured field is of an HLSL primitive type + if (KnownHlslTypes.TryGetValue(typeName, out string? mappedType)) { - string elementTypeName = ((INamedTypeSymbol)typeSymbol.ElementType).GetFullMetadataName(); + return mappedType; + } - if (KnownHlslTypes.TryGetValue(elementTypeName, out string? mapped)) + // The captured field is of a custom struct type + return typeName.ToHlslIdentifierName(); + } + + /// + /// Gets the mapped HLSL-compatible type name for the output texture of a pixel shader. + /// + /// The pixel shader type to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + [Pure] + public static string GetMappedNameForPixelShaderType(INamedTypeSymbol typeSymbol) + { + string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.First()).GetFullMetadataName(); + + // If the current type is a custom type, format it as needed + if (!KnownHlslTypes.TryGetValue(genericArgumentName, out string? mappedElementType)) + { + mappedElementType = genericArgumentName.ToHlslIdentifierName(); + } + + // Construct the HLSL type name + return $"RWTexture2D"; + } + + /// + /// Gets the mapped HLSL-compatible type name for the input element type symbol. + /// + /// The input type to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + [Pure] + public static string GetMappedElementName(IArrayTypeSymbol typeSymbol) + { + string elementTypeName = ((INamedTypeSymbol)typeSymbol.ElementType).GetFullMetadataName(); + + if (KnownHlslTypes.TryGetValue(elementTypeName, out string? mapped)) + { + return mapped; + } + + return elementTypeName.ToHlslIdentifierName(); + } + + /// + /// Gets the mapped HLSL-compatible type name for the input type name. + /// + /// The input type name to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + public static bool TryGetMappedName(string originalName, out string? mappedName) + { + return KnownHlslTypes.TryGetValue(originalName, out mappedName); + } + + /// + /// Gets the sequence of unique custom types from a collection of discovered types. + /// + /// The input collection of discovered types. + /// The list of unique custom types. + public static IEnumerable GetCustomTypes(IEnumerable discoveredTypes) + { + // Local function to recursively gather nested types + static void ExploreTypes(INamedTypeSymbol type, HashSet customTypes) + { + if (KnownHlslTypes.ContainsKey(type.GetFullMetadataName())) return; + + if (!customTypes.Add(type)) return; + + foreach (var field in type.GetMembers().OfType()) { - return mapped; + if (field.IsStatic) continue; + + ExploreTypes((INamedTypeSymbol)field.Type, customTypes); } - - return elementTypeName.ToHlslIdentifierName(); } - /// - /// Gets the mapped HLSL-compatible type name for the input type name. - /// - /// The input type name to map. - /// The HLSL-compatible type name that can be used in an HLSL shader. - public static bool TryGetMappedName(string originalName, out string? mappedName) + HashSet customTypes = new(SymbolEqualityComparer.Default); + + // Explore all input types and their nested types + foreach (INamedTypeSymbol type in discoveredTypes) { - return KnownHlslTypes.TryGetValue(originalName, out mappedName); + ExploreTypes(type, customTypes); } - /// - /// Gets the sequence of unique custom types from a collection of discovered types. - /// - /// The input collection of discovered types. - /// The list of unique custom types. - public static IEnumerable GetCustomTypes(IEnumerable discoveredTypes) + return OrderByDependency(customTypes); + } + + /// + /// Orders the input sequence of types so that they can be declared in HLSL successfully. + /// + /// The input collection of types to declare. + /// The same list as input, but in a valid HLSL declaration order. + [Pure] + private static IEnumerable OrderByDependency(IEnumerable types) + { + Queue<(INamedTypeSymbol Type, HashSet Fields)> queue = new(); + + // Build a mapping of type dependencies for all the captured types. A type depends on another + // when the latter is a field in the first type. HLSL requires custom types to be declared in + // order of usage, so we need to ensure that types are declared in an order that guarantees + // that no type will be referenced before being defined. To do so, we can create a mapping of + // types and their dependencies, and iteratively remove items from the map when they have no + // dependencies left. When one type is processed and removed, it is also removed from the list + // of dependencies of all other remaining types in the map, until there is none left. + foreach (var type in types) { - // Local function to recursively gather nested types - static void ExploreTypes(INamedTypeSymbol type, HashSet customTypes) + HashSet dependencies = new(SymbolEqualityComparer.Default); + + // Only add other custom types as dependencies, and ignore HLSL types + foreach (var field in type.GetMembers().OfType()) { - if (KnownHlslTypes.ContainsKey(type.GetFullMetadataName())) return; + if (field.IsStatic) continue; - if (!customTypes.Add(type)) return; + INamedTypeSymbol fieldType = (INamedTypeSymbol)field.Type; - foreach (var field in type.GetMembers().OfType()) + if (!KnownHlslTypes.ContainsKey(fieldType.GetFullMetadataName())) { - if (field.IsStatic) continue; - - ExploreTypes((INamedTypeSymbol)field.Type, customTypes); + _ = dependencies.Add(fieldType); } } - HashSet customTypes = new(SymbolEqualityComparer.Default); - - // Explore all input types and their nested types - foreach (INamedTypeSymbol type in discoveredTypes) - { - ExploreTypes(type, customTypes); - } - - return OrderByDependency(customTypes); + queue.Enqueue((type, dependencies)); } - /// - /// Orders the input sequence of types so that they can be declared in HLSL successfully. - /// - /// The input collection of types to declare. - /// The same list as input, but in a valid HLSL declaration order. - [Pure] - private static IEnumerable OrderByDependency(IEnumerable types) + while (queue.Count > 0) { - Queue<(INamedTypeSymbol Type, HashSet Fields)> queue = new(); + var entry = queue.Dequeue(); - // Build a mapping of type dependencies for all the captured types. A type depends on another - // when the latter is a field in the first type. HLSL requires custom types to be declared in - // order of usage, so we need to ensure that types are declared in an order that guarantees - // that no type will be referenced before being defined. To do so, we can create a mapping of - // types and their dependencies, and iteratively remove items from the map when they have no - // dependencies left. When one type is processed and removed, it is also removed from the list - // of dependencies of all other remaining types in the map, until there is none left. - foreach (var type in types) + // No dependencies left, we can declare this type + if (entry.Fields.Count == 0) { - HashSet dependencies = new(SymbolEqualityComparer.Default); - - // Only add other custom types as dependencies, and ignore HLSL types - foreach (var field in type.GetMembers().OfType()) + // Remove the current type from dependencies of others + foreach (var pair in queue) { - if (field.IsStatic) continue; - - INamedTypeSymbol fieldType = (INamedTypeSymbol)field.Type; - - if (!KnownHlslTypes.ContainsKey(fieldType.GetFullMetadataName())) - { - _ = dependencies.Add(fieldType); - } + _ = pair.Fields.Remove(entry.Type); } - queue.Enqueue((type, dependencies)); - } - - while (queue.Count > 0) - { - var entry = queue.Dequeue(); - - // No dependencies left, we can declare this type - if (entry.Fields.Count == 0) - { - // Remove the current type from dependencies of others - foreach (var pair in queue) - { - _ = pair.Fields.Remove(entry.Type); - } - - yield return entry.Type; - } - else queue.Enqueue(entry); + yield return entry.Type; } + else queue.Enqueue(entry); } } } diff --git a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.SyntaxReceiver.cs b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.SyntaxReceiver.cs index 7b8c2eff..8349eb3f 100644 --- a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.SyntaxReceiver.cs +++ b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.SyntaxReceiver.cs @@ -4,45 +4,43 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +public sealed partial class ShaderMethodSourceGenerator { - /// - public sealed partial class ShaderMethodSourceGenerator + /// + /// An that selects candidate nodes to process. + /// + private sealed class SyntaxReceiver : ISyntaxContextReceiver { /// - /// An that selects candidate nodes to process. + /// The list of info gathered during exploration. /// - private sealed class SyntaxReceiver : ISyntaxContextReceiver + private readonly List gatheredInfo = new(); + + /// + /// Gets the collection of gathered info to process. + /// + public IReadOnlyCollection GatheredInfo => this.gatheredInfo; + + /// + public void OnVisitSyntaxNode(GeneratorSyntaxContext context) { - /// - /// The list of info gathered during exploration. - /// - private readonly List gatheredInfo = new(); - - /// - /// Gets the collection of gathered info to process. - /// - public IReadOnlyCollection GatheredInfo => this.gatheredInfo; - - /// - public void OnVisitSyntaxNode(GeneratorSyntaxContext context) + if (context.Node is MethodDeclarationSyntax { AttributeLists: { Count: > 0 } } methodDeclaration && + context.SemanticModel.GetDeclaredSymbol(methodDeclaration) is IMethodSymbol methodSymbol && + context.SemanticModel.Compilation.GetTypeByMetadataName(typeof(ShaderMethodAttribute).FullName) is INamedTypeSymbol attributeSymbol && + methodSymbol.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, attributeSymbol))) { - if (context.Node is MethodDeclarationSyntax { AttributeLists: { Count: > 0 } } methodDeclaration && - context.SemanticModel.GetDeclaredSymbol(methodDeclaration) is IMethodSymbol methodSymbol && - context.SemanticModel.Compilation.GetTypeByMetadataName(typeof(ShaderMethodAttribute).FullName) is INamedTypeSymbol attributeSymbol && - methodSymbol.GetAttributes().Any(a => SymbolEqualityComparer.Default.Equals(a.AttributeClass, attributeSymbol))) - { - this.gatheredInfo.Add(new Item(methodDeclaration, methodSymbol)); - } + this.gatheredInfo.Add(new Item(methodDeclaration, methodSymbol)); } - - /// - /// A model for a group of item representing a discovered method to process. - /// - /// The instance for the target method declaration. - /// The instance for . - public sealed record Item(MethodDeclarationSyntax MethodDeclaration, IMethodSymbol MethodSymbol); } + + /// + /// A model for a group of item representing a discovered method to process. + /// + /// The instance for the target method declaration. + /// The instance for . + public sealed record Item(MethodDeclarationSyntax MethodDeclaration, IMethodSymbol MethodSymbol); } } - diff --git a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs index d309bac9..9ab3bdee 100644 --- a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs @@ -17,130 +17,128 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; #pragma warning disable CS0618, RS1024 -namespace ComputeSharp.SourceGenerators +namespace ComputeSharp.SourceGenerators; + +/// +/// A source generator for processing static methods referenced from compute shaders. +/// +[Generator] +public sealed partial class ShaderMethodSourceGenerator : ISourceGenerator { - /// - /// A source generator for processing static methods referenced from compute shaders. - /// - [Generator] - public sealed partial class ShaderMethodSourceGenerator : ISourceGenerator + /// + public void Initialize(GeneratorInitializationContext context) { - /// - public void Initialize(GeneratorInitializationContext context) + context.RegisterForSyntaxNotifications(static () => new SyntaxReceiver()); + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Get the syntax receiver with the candidate nodes + if (context.SyntaxContextReceiver is not SyntaxReceiver syntaxReceiver) { - context.RegisterForSyntaxNotifications(static () => new SyntaxReceiver()); + return; } - /// - public void Execute(GeneratorExecutionContext context) + foreach (SyntaxReceiver.Item item in syntaxReceiver.GatheredInfo) { - // Get the syntax receiver with the candidate nodes - if (context.SyntaxContextReceiver is not SyntaxReceiver syntaxReceiver) + SemanticModelProvider semanticModel = new(context.Compilation); + + try { - return; + OnExecute(context, item.MethodDeclaration, semanticModel, item.MethodSymbol); } - - foreach (SyntaxReceiver.Item item in syntaxReceiver.GatheredInfo) + catch { - SemanticModelProvider semanticModel = new(context.Compilation); - - try - { - OnExecute(context, item.MethodDeclaration, semanticModel, item.MethodSymbol); - } - catch - { - context.ReportDiagnostic(ShaderMethodSourceGeneratorError, item.MethodDeclaration, item.MethodSymbol); - } + context.ReportDiagnostic(ShaderMethodSourceGeneratorError, item.MethodDeclaration, item.MethodSymbol); } } - - /// - /// Processes a given target method. - /// - /// The input instance to use. - /// The node to process. - /// The with metadata on the types being processed. - /// The for . - private static void OnExecute(GeneratorExecutionContext context, MethodDeclarationSyntax methodDeclaration, SemanticModelProvider semanticModel, IMethodSymbol methodDeclarationSymbol) - { - // We need to sets to track all discovered custom types and static methods - HashSet discoveredTypes = new(SymbolEqualityComparer.Default); - Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); - - // Explore the syntax tree and extract the processed info - var (invokeMethod, processedMethods) = GetProcessedMethods(context, methodDeclaration, semanticModel, discoveredTypes, constantDefinitions); - var processedTypes = IShaderGenerator.GetProcessedTypes(discoveredTypes).ToArray(); - var processedConstants = IShaderGenerator.GetProcessedConstants(constantDefinitions); - - // Create the compilation unit with the source attribute - var source = - CompilationUnit().AddAttributeLists( - AttributeList(SingletonSeparatedList( - Attribute(IdentifierName(typeof(ShaderMethodSourceAttribute).FullName)).AddArgumentListArguments( - AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(methodDeclarationSymbol.GetFullMetadataName(true)))), - AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(invokeMethod))), - AttributeArgument(NestedArrayExpression(processedTypes)), - AttributeArgument(NestedArrayExpression(processedMethods)), - AttributeArgument(NestedArrayExpression(processedConstants))))) - .WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList())) - .WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)))) - .NormalizeWhitespace(eol: "\n") - .ToFullString(); - - // Add the method source attribute - context.AddSource(methodDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); - } - - /// - /// Gets a sequence of processed methods from a target method declaration. - /// - /// The current generator context in use. - /// The instance for the current method. - /// The instance for the method to process. - /// The collection of currently discovered types. - /// The collection of discovered constant definitions. - /// A sequence of processed methods in (main method and all captured methods). - [Pure] - private static (string TargetMethod, IEnumerable<(string Signature, string Definition)> ProcessedMethods) GetProcessedMethods( - GeneratorExecutionContext context, - MethodDeclarationSyntax methodDeclaration, - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary constantDefinitions) - { - Dictionary staticMethods = new(SymbolEqualityComparer.Default); - - ShaderSourceRewriter shaderSourceRewriter = new(semanticModel, discoveredTypes, staticMethods, constantDefinitions, context); - - // Rewrite the method syntax tree - var targetMethod = shaderSourceRewriter - .Visit(methodDeclaration)! - .WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier)) - .WithoutTrivia() - .NormalizeWhitespace(eol: "\n") - .ToFullString(); - - List<(string, string)> processedMethods = new(shaderSourceRewriter.LocalFunctions.Count); - - // Emit the extracted local functions - foreach (var localFunction in shaderSourceRewriter.LocalFunctions) - { - processedMethods.Add(( - localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString())); - } - - // Emit the discovered static methods - foreach (var staticMethod in staticMethods.Values) - { - processedMethods.Add(( - staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - staticMethod.NormalizeWhitespace(eol: "\n").ToFullString())); - } - - return (targetMethod, processedMethods); - } } -} + /// + /// Processes a given target method. + /// + /// The input instance to use. + /// The node to process. + /// The with metadata on the types being processed. + /// The for . + private static void OnExecute(GeneratorExecutionContext context, MethodDeclarationSyntax methodDeclaration, SemanticModelProvider semanticModel, IMethodSymbol methodDeclarationSymbol) + { + // We need to sets to track all discovered custom types and static methods + HashSet discoveredTypes = new(SymbolEqualityComparer.Default); + Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); + + // Explore the syntax tree and extract the processed info + var (invokeMethod, processedMethods) = GetProcessedMethods(context, methodDeclaration, semanticModel, discoveredTypes, constantDefinitions); + var processedTypes = IShaderGenerator.GetProcessedTypes(discoveredTypes).ToArray(); + var processedConstants = IShaderGenerator.GetProcessedConstants(constantDefinitions); + + // Create the compilation unit with the source attribute + var source = + CompilationUnit().AddAttributeLists( + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName(typeof(ShaderMethodSourceAttribute).FullName)).AddArgumentListArguments( + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(methodDeclarationSymbol.GetFullMetadataName(true)))), + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(invokeMethod))), + AttributeArgument(NestedArrayExpression(processedTypes)), + AttributeArgument(NestedArrayExpression(processedMethods)), + AttributeArgument(NestedArrayExpression(processedConstants))))) + .WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList())) + .WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)))) + .NormalizeWhitespace(eol: "\n") + .ToFullString(); + + // Add the method source attribute + context.AddSource(methodDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + + /// + /// Gets a sequence of processed methods from a target method declaration. + /// + /// The current generator context in use. + /// The instance for the current method. + /// The instance for the method to process. + /// The collection of currently discovered types. + /// The collection of discovered constant definitions. + /// A sequence of processed methods in (main method and all captured methods). + [Pure] + private static (string TargetMethod, IEnumerable<(string Signature, string Definition)> ProcessedMethods) GetProcessedMethods( + GeneratorExecutionContext context, + MethodDeclarationSyntax methodDeclaration, + SemanticModelProvider semanticModel, + ICollection discoveredTypes, + IDictionary constantDefinitions) + { + Dictionary staticMethods = new(SymbolEqualityComparer.Default); + + ShaderSourceRewriter shaderSourceRewriter = new(semanticModel, discoveredTypes, staticMethods, constantDefinitions, context); + + // Rewrite the method syntax tree + var targetMethod = shaderSourceRewriter + .Visit(methodDeclaration)! + .WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier)) + .WithoutTrivia() + .NormalizeWhitespace(eol: "\n") + .ToFullString(); + + List<(string, string)> processedMethods = new(shaderSourceRewriter.LocalFunctions.Count); + + // Emit the extracted local functions + foreach (var localFunction in shaderSourceRewriter.LocalFunctions) + { + processedMethods.Add(( + localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), + localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString())); + } + + // Emit the discovered static methods + foreach (var staticMethod in staticMethods.Values) + { + processedMethods.Add(( + staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), + staticMethod.NormalizeWhitespace(eol: "\n").ToFullString())); + } + + return (targetMethod, processedMethods); + } +} diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs index a1943062..1972ce8f 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs @@ -3,159 +3,90 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.SyntaxRewriters +namespace ComputeSharp.SourceGenerators.SyntaxRewriters; + +/// +/// A custom type that does postprocessing fixups on the shader main method. +/// +internal abstract class ExecuteMethodRewriter : CSharpSyntaxRewriter { /// - /// A custom type that does postprocessing fixups on the shader main method. + /// Creates a new instance with the specified parameters. /// - internal abstract class ExecuteMethodRewriter : CSharpSyntaxRewriter + /// The instance used to process the input tree. + public ExecuteMethodRewriter(ShaderSourceRewriter shaderSourceRewriter) + { + ShaderSourceRewriter = shaderSourceRewriter; + } + + /// + /// Gets the instance used to process the input tree. + /// + protected ShaderSourceRewriter ShaderSourceRewriter { get; } + + /// + public TNode? Visit(TNode? node) + where TNode : SyntaxNode + { + return (TNode?)base.Visit(node); + } + + /// + public override SyntaxNode? VisitParameterList(ParameterListSyntax node) + { + var updatedNode = (ParameterListSyntax)base.VisitParameterList(node)!; + + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(ThreadIds)} : SV_DispatchThreadID"))); + + if (ShaderSourceRewriter.IsGroupIdsUsed) + { + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(GroupIds)} : SV_GroupThreadID"))); + } + + if (ShaderSourceRewriter.IsGroupIdsIndexUsed) + { + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint __{nameof(GroupIds)}__get_Index : SV_GroupIndex"))); + } + + if (ShaderSourceRewriter.IsGridIdsUsed) + { + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(GridIds)} : SV_GroupID"))); + } + + return updatedNode; + } + + /// + /// A custom type specialized for compute shaders. + /// + public sealed class Compute : ExecuteMethodRewriter { /// /// Creates a new instance with the specified parameters. /// /// The instance used to process the input tree. - public ExecuteMethodRewriter(ShaderSourceRewriter shaderSourceRewriter) + public Compute(ShaderSourceRewriter shaderSourceRewriter) + : base(shaderSourceRewriter) { - ShaderSourceRewriter = shaderSourceRewriter; - } - - /// - /// Gets the instance used to process the input tree. - /// - protected ShaderSourceRewriter ShaderSourceRewriter { get; } - - /// - public TNode? Visit(TNode? node) - where TNode : SyntaxNode - { - return (TNode?)base.Visit(node); } /// - public override SyntaxNode? VisitParameterList(ParameterListSyntax node) + public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) { - var updatedNode = (ParameterListSyntax)base.VisitParameterList(node)!; + var updatedNode = ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!).WithModifiers(TokenList()); - updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(ThreadIds)} : SV_DispatchThreadID"))); - - if (ShaderSourceRewriter.IsGroupIdsUsed) - { - updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(GroupIds)} : SV_GroupThreadID"))); - } - - if (ShaderSourceRewriter.IsGroupIdsIndexUsed) - { - updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint __{nameof(GroupIds)}__get_Index : SV_GroupIndex"))); - } - - if (ShaderSourceRewriter.IsGridIdsUsed) - { - updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(GridIds)} : SV_GroupID"))); - } - - return updatedNode; - } - - /// - /// A custom type specialized for compute shaders. - /// - public sealed class Compute : ExecuteMethodRewriter - { - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance used to process the input tree. - public Compute(ShaderSourceRewriter shaderSourceRewriter) - : base(shaderSourceRewriter) - { - } - - /// - public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) - { - var updatedNode = ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!).WithModifiers(TokenList()); - - // When we're rewriting the main compute shader method, we need to insert a range - // check to ensure that invocation outside of the requested range are discarded. - // The following snippet creates this prologue before the user provided body: - // - // if (ThreadIds.x < __x && - // ThreadIds.y < __y && - // ThreadIds.z < __z) - // { - // - // } - BinaryExpressionSyntax rangeCheckExpression = - BinaryExpression(SyntaxKind.LogicalAndExpression, - BinaryExpression(SyntaxKind.LogicalAndExpression, - BinaryExpression(SyntaxKind.LessThanExpression, - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(nameof(ThreadIds)), - IdentifierName("x")), - IdentifierName("__x")), - BinaryExpression(SyntaxKind.LessThanExpression, - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(nameof(ThreadIds)), - IdentifierName("y")), - IdentifierName("__y"))), - BinaryExpression(SyntaxKind.LessThanExpression, - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(nameof(ThreadIds)), - IdentifierName("z")), - IdentifierName("__z"))); - - return updatedNode.WithBody(Block(IfStatement(rangeCheckExpression, updatedNode.Body!))); - } - } - - /// - /// A custom type specialized for compute shaders. - /// - public sealed class Pixel : ExecuteMethodRewriter - { - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance used to process the input tree. - public Pixel(ShaderSourceRewriter shaderSourceRewriter) - : base(shaderSourceRewriter) - { - } - - /// - public override SyntaxNode? VisitReturnStatement(ReturnStatementSyntax node) - { - var updatedNode = (ReturnStatementSyntax)base.VisitReturnStatement(node)!; - - // __outputTexture[ThreadIds.xy] = ; - return - ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - ElementAccessExpression(IdentifierName("__outputTexture")) - .AddArgumentListArguments( - Argument( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("ThreadIds"), - IdentifierName("xy")))), - updatedNode.Expression!)); - } - - /// - public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) - { - var updatedNode = ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!).WithModifiers(TokenList()); - - // Change the return type to void - updatedNode = updatedNode.WithReturnType(PredefinedType(Token(SyntaxKind.VoidKeyword))); - - // Same as above, but skipping the third check for the Z axis. - // This is because pixel shaders only ever run on 2D textures. - BinaryExpressionSyntax rangeCheckExpression = + // When we're rewriting the main compute shader method, we need to insert a range + // check to ensure that invocation outside of the requested range are discarded. + // The following snippet creates this prologue before the user provided body: + // + // if (ThreadIds.x < __x && + // ThreadIds.y < __y && + // ThreadIds.z < __z) + // { + // + // } + BinaryExpressionSyntax rangeCheckExpression = + BinaryExpression(SyntaxKind.LogicalAndExpression, BinaryExpression(SyntaxKind.LogicalAndExpression, BinaryExpression(SyntaxKind.LessThanExpression, MemberAccessExpression( @@ -168,25 +99,93 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters SyntaxKind.SimpleMemberAccessExpression, IdentifierName(nameof(ThreadIds)), IdentifierName("y")), - IdentifierName("__y"))); + IdentifierName("__y"))), + BinaryExpression(SyntaxKind.LessThanExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ThreadIds)), + IdentifierName("z")), + IdentifierName("__z"))); - return updatedNode.WithBody(Block(IfStatement(rangeCheckExpression, updatedNode.Body!))); - } + return updatedNode.WithBody(Block(IfStatement(rangeCheckExpression, updatedNode.Body!))); + } + } - /// - public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node) + /// + /// A custom type specialized for compute shaders. + /// + public sealed class Pixel : ExecuteMethodRewriter + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance used to process the input tree. + public Pixel(ShaderSourceRewriter shaderSourceRewriter) + : base(shaderSourceRewriter) + { + } + + /// + public override SyntaxNode? VisitReturnStatement(ReturnStatementSyntax node) + { + var updatedNode = (ReturnStatementSyntax)base.VisitReturnStatement(node)!; + + // __outputTexture[ThreadIds.xy] = ; + return + ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ElementAccessExpression(IdentifierName("__outputTexture")) + .AddArgumentListArguments( + Argument( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("ThreadIds"), + IdentifierName("xy")))), + updatedNode.Expression!)); + } + + /// + public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) + { + var updatedNode = ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!).WithModifiers(TokenList()); + + // Change the return type to void + updatedNode = updatedNode.WithReturnType(PredefinedType(Token(SyntaxKind.VoidKeyword))); + + // Same as above, but skipping the third check for the Z axis. + // This is because pixel shaders only ever run on 2D textures. + BinaryExpressionSyntax rangeCheckExpression = + BinaryExpression(SyntaxKind.LogicalAndExpression, + BinaryExpression(SyntaxKind.LessThanExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ThreadIds)), + IdentifierName("x")), + IdentifierName("__x")), + BinaryExpression(SyntaxKind.LessThanExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ThreadIds)), + IdentifierName("y")), + IdentifierName("__y"))); + + return updatedNode.WithBody(Block(IfStatement(rangeCheckExpression, updatedNode.Body!))); + } + + /// + public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node) + { + IdentifierNameSyntax updatedNode = (IdentifierNameSyntax)base.VisitIdentifierName(node)!; + + // Since pixel shaders are only ever executed on 2D textures, the special __z field can + // be removed and replaced with just numeric literal expressions, where the value is 1. + if (updatedNode.Identifier.Text == "__z") { - IdentifierNameSyntax updatedNode = (IdentifierNameSyntax)base.VisitIdentifierName(node)!; - - // Since pixel shaders are only ever executed on 2D textures, the special __z field can - // be removed and replaced with just numeric literal expressions, where the value is 1. - if (updatedNode.Identifier.Text == "__z") - { - return LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(1)); - } - - return updatedNode; + return LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(1)); } + + return updatedNode; } } } diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.Diagnostics.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.Diagnostics.cs index 9cea28a0..ea074239 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.Diagnostics.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.Diagnostics.cs @@ -4,203 +4,202 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; -namespace ComputeSharp.SourceGenerators.SyntaxRewriters +namespace ComputeSharp.SourceGenerators.SyntaxRewriters; + +/// +internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter { - /// - internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter + /// + public override SyntaxNode? VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpressionSyntax node) { - /// - public override SyntaxNode? VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpressionSyntax node) - { - var updatedNode = (AnonymousObjectCreationExpressionSyntax)base.VisitAnonymousObjectCreationExpression(node)!; + var updatedNode = (AnonymousObjectCreationExpressionSyntax)base.VisitAnonymousObjectCreationExpression(node)!; - Context.ReportDiagnostic(AnonymousObjectCreationExpression, node); + Context.ReportDiagnostic(AnonymousObjectCreationExpression, node); - return updatedNode; - } + return updatedNode; + } - /// - public override SyntaxNode? VisitAwaitExpression(AwaitExpressionSyntax node) - { - Context.ReportDiagnostic(AwaitExpression, node); + /// + public override SyntaxNode? VisitAwaitExpression(AwaitExpressionSyntax node) + { + Context.ReportDiagnostic(AwaitExpression, node); - return base.VisitAwaitExpression(node); - } + return base.VisitAwaitExpression(node); + } - /// - public override SyntaxNode? VisitCheckedExpression(CheckedExpressionSyntax node) - { - Context.ReportDiagnostic(CheckedExpression, node); + /// + public override SyntaxNode? VisitCheckedExpression(CheckedExpressionSyntax node) + { + Context.ReportDiagnostic(CheckedExpression, node); - return base.VisitCheckedExpression(node); - } + return base.VisitCheckedExpression(node); + } - /// - public override SyntaxNode? VisitCheckedStatement(CheckedStatementSyntax node) - { - Context.ReportDiagnostic(CheckedStatement, node); + /// + public override SyntaxNode? VisitCheckedStatement(CheckedStatementSyntax node) + { + Context.ReportDiagnostic(CheckedStatement, node); - return base.VisitCheckedStatement(node); - } + return base.VisitCheckedStatement(node); + } - /// - public override SyntaxNode? VisitFixedStatement(FixedStatementSyntax node) - { - Context.ReportDiagnostic(FixedStatement, node); + /// + public override SyntaxNode? VisitFixedStatement(FixedStatementSyntax node) + { + Context.ReportDiagnostic(FixedStatement, node); - return base.VisitFixedStatement(node); - } + return base.VisitFixedStatement(node); + } - /// - public override SyntaxNode? VisitForEachStatement(ForEachStatementSyntax node) - { - Context.ReportDiagnostic(ForEachStatement, node); + /// + public override SyntaxNode? VisitForEachStatement(ForEachStatementSyntax node) + { + Context.ReportDiagnostic(ForEachStatement, node); - return base.VisitForEachStatement(node); - } + return base.VisitForEachStatement(node); + } - /// - public override SyntaxNode? VisitForEachVariableStatement(ForEachVariableStatementSyntax node) - { - Context.ReportDiagnostic(ForEachStatement, node); + /// + public override SyntaxNode? VisitForEachVariableStatement(ForEachVariableStatementSyntax node) + { + Context.ReportDiagnostic(ForEachStatement, node); - return base.VisitForEachVariableStatement(node); - } + return base.VisitForEachVariableStatement(node); + } - /// - public override SyntaxNode? VisitLockStatement(LockStatementSyntax node) - { - Context.ReportDiagnostic(LockStatement, node); + /// + public override SyntaxNode? VisitLockStatement(LockStatementSyntax node) + { + Context.ReportDiagnostic(LockStatement, node); - return base.VisitLockStatement(node); - } + return base.VisitLockStatement(node); + } - /// - public override SyntaxNode? VisitQueryExpression(QueryExpressionSyntax node) - { - Context.ReportDiagnostic(QueryExpression, node); + /// + public override SyntaxNode? VisitQueryExpression(QueryExpressionSyntax node) + { + Context.ReportDiagnostic(QueryExpression, node); - return base.VisitQueryExpression(node); - } + return base.VisitQueryExpression(node); + } - /// - public override SyntaxNode? VisitRangeExpression(RangeExpressionSyntax node) - { - Context.ReportDiagnostic(RangeExpression, node); + /// + public override SyntaxNode? VisitRangeExpression(RangeExpressionSyntax node) + { + Context.ReportDiagnostic(RangeExpression, node); - return base.VisitRangeExpression(node); - } + return base.VisitRangeExpression(node); + } - /// - public override SyntaxNode? VisitRecursivePattern(RecursivePatternSyntax node) - { - Context.ReportDiagnostic(RecursivePattern, node); + /// + public override SyntaxNode? VisitRecursivePattern(RecursivePatternSyntax node) + { + Context.ReportDiagnostic(RecursivePattern, node); - return base.VisitRecursivePattern(node); - } + return base.VisitRecursivePattern(node); + } - /// - public override SyntaxNode? VisitRefType(RefTypeSyntax node) - { - Context.ReportDiagnostic(RefType, node); + /// + public override SyntaxNode? VisitRefType(RefTypeSyntax node) + { + Context.ReportDiagnostic(RefType, node); - return base.VisitRefType(node); - } + return base.VisitRefType(node); + } - /// - public override SyntaxNode? VisitRelationalPattern(RelationalPatternSyntax node) - { - Context.ReportDiagnostic(RelationalPattern, node); + /// + public override SyntaxNode? VisitRelationalPattern(RelationalPatternSyntax node) + { + Context.ReportDiagnostic(RelationalPattern, node); - return base.VisitRelationalPattern(node); - } + return base.VisitRelationalPattern(node); + } - /// - public override SyntaxNode? VisitSizeOfExpression(SizeOfExpressionSyntax node) - { - Context.ReportDiagnostic(SizeOfExpression, node); + /// + public override SyntaxNode? VisitSizeOfExpression(SizeOfExpressionSyntax node) + { + Context.ReportDiagnostic(SizeOfExpression, node); - return base.VisitSizeOfExpression(node); - } + return base.VisitSizeOfExpression(node); + } - /// - public override SyntaxNode? VisitStackAllocArrayCreationExpression(StackAllocArrayCreationExpressionSyntax node) - { - Context.ReportDiagnostic(StackAllocArrayCreationExpression, node); + /// + public override SyntaxNode? VisitStackAllocArrayCreationExpression(StackAllocArrayCreationExpressionSyntax node) + { + Context.ReportDiagnostic(StackAllocArrayCreationExpression, node); - return base.VisitStackAllocArrayCreationExpression(node); - } + return base.VisitStackAllocArrayCreationExpression(node); + } - /// - public override SyntaxNode? VisitThrowExpression(ThrowExpressionSyntax node) - { - Context.ReportDiagnostic(ThrowExpressionOrStatement, node); + /// + public override SyntaxNode? VisitThrowExpression(ThrowExpressionSyntax node) + { + Context.ReportDiagnostic(ThrowExpressionOrStatement, node); - return base.VisitThrowExpression(node); - } + return base.VisitThrowExpression(node); + } - /// - public override SyntaxNode? VisitThrowStatement(ThrowStatementSyntax node) - { - Context.ReportDiagnostic(ThrowExpressionOrStatement, node); + /// + public override SyntaxNode? VisitThrowStatement(ThrowStatementSyntax node) + { + Context.ReportDiagnostic(ThrowExpressionOrStatement, node); - return base.VisitThrowStatement(node); - } + return base.VisitThrowStatement(node); + } - /// - public override SyntaxNode? VisitTryStatement(TryStatementSyntax node) - { - Context.ReportDiagnostic(TryStatement, node); + /// + public override SyntaxNode? VisitTryStatement(TryStatementSyntax node) + { + Context.ReportDiagnostic(TryStatement, node); - return base.VisitTryStatement(node); - } + return base.VisitTryStatement(node); + } - /// - public override SyntaxNode? VisitTupleType(TupleTypeSyntax node) - { - Context.ReportDiagnostic(TupleType, node); + /// + public override SyntaxNode? VisitTupleType(TupleTypeSyntax node) + { + Context.ReportDiagnostic(TupleType, node); - return base.VisitTupleType(node); - } + return base.VisitTupleType(node); + } - /// - public override SyntaxNode? VisitUsingStatement(UsingStatementSyntax node) - { - Context.ReportDiagnostic(UsingStatementOrDeclaration, node); + /// + public override SyntaxNode? VisitUsingStatement(UsingStatementSyntax node) + { + Context.ReportDiagnostic(UsingStatementOrDeclaration, node); - return base.VisitUsingStatement(node); - } + return base.VisitUsingStatement(node); + } - /// - public override SyntaxNode? VisitYieldStatement(YieldStatementSyntax node) - { - Context.ReportDiagnostic(YieldStatement, node); + /// + public override SyntaxNode? VisitYieldStatement(YieldStatementSyntax node) + { + Context.ReportDiagnostic(YieldStatement, node); - return base.VisitYieldStatement(node); - } + return base.VisitYieldStatement(node); + } - /// - public override SyntaxNode? VisitFunctionPointerType(FunctionPointerTypeSyntax node) - { - Context.ReportDiagnostic(FunctionPointer, node); + /// + public override SyntaxNode? VisitFunctionPointerType(FunctionPointerTypeSyntax node) + { + Context.ReportDiagnostic(FunctionPointer, node); - return base.VisitFunctionPointerType(node); - } + return base.VisitFunctionPointerType(node); + } - /// - public override SyntaxNode? VisitPointerType(PointerTypeSyntax node) - { - Context.ReportDiagnostic(PointerType, node); + /// + public override SyntaxNode? VisitPointerType(PointerTypeSyntax node) + { + Context.ReportDiagnostic(PointerType, node); - return base.VisitPointerType(node); - } + return base.VisitPointerType(node); + } - /// - public override SyntaxNode? VisitUnsafeStatement(UnsafeStatementSyntax node) - { - Context.ReportDiagnostic(UnsafeStatement, node); + /// + public override SyntaxNode? VisitUnsafeStatement(UnsafeStatementSyntax node) + { + Context.ReportDiagnostic(UnsafeStatement, node); - return base.VisitUnsafeStatement(node); - } + return base.VisitUnsafeStatement(node); } } diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs index d346d8f4..607f53b9 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/HlslSourceRewriter.cs @@ -13,330 +13,329 @@ using Microsoft.CodeAnalysis.Operations; using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.SyntaxRewriters +namespace ComputeSharp.SourceGenerators.SyntaxRewriters; + +/// +/// A base type that processes C# source to convert to HLSL compliant code. +/// This class contains only the shared logic for all derived HLSL source rewriters. +/// +internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter { /// - /// A base type that processes C# source to convert to HLSL compliant code. - /// This class contains only the shared logic for all derived HLSL source rewriters. + /// The instance with semantic info on the target syntax tree. /// - internal abstract partial class HlslSourceRewriter : CSharpSyntaxRewriter + protected readonly SemanticModelProvider SemanticModel; + + /// + /// The collection of discovered custom types. + /// + protected readonly ICollection DiscoveredTypes; + + /// + /// The collection of discovered constant definitions. + /// + protected readonly IDictionary ConstantDefinitions; + + /// + /// The current generator context in use. + /// + protected readonly GeneratorExecutionContext Context; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance for the target syntax tree. + /// The set of discovered custom types. + /// The collection of discovered constant definitions. + /// The current generator context in use. + protected HlslSourceRewriter( + SemanticModelProvider semanticModel, + ICollection discoveredTypes, + IDictionary constantDefinitions, + GeneratorExecutionContext context) { - /// - /// The instance with semantic info on the target syntax tree. - /// - protected readonly SemanticModelProvider SemanticModel; + SemanticModel = semanticModel; + DiscoveredTypes = discoveredTypes; + ConstantDefinitions = constantDefinitions; + Context = context; + } - /// - /// The collection of discovered custom types. - /// - protected readonly ICollection DiscoveredTypes; + /// + /// Gets whether or not the shader uses a texture sampler at least once. + /// + public bool IsSamplerUsed { get; private set; } - /// - /// The collection of discovered constant definitions. - /// - protected readonly IDictionary ConstantDefinitions; + /// + public override SyntaxNode VisitCastExpression(CastExpressionSyntax node) + { + var updatedNode = (CastExpressionSyntax)base.VisitCastExpression(node)!; - /// - /// The current generator context in use. - /// - protected readonly GeneratorExecutionContext Context; + return updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); + } - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance for the target syntax tree. - /// The set of discovered custom types. - /// The collection of discovered constant definitions. - /// The current generator context in use. - protected HlslSourceRewriter( - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary constantDefinitions, - GeneratorExecutionContext context) + /// + public override SyntaxNode? VisitVariableDeclaration(VariableDeclarationSyntax node) + { + var updatedNode = (VariableDeclarationSyntax)base.VisitVariableDeclaration(node)!; + + if (SemanticModel.For(node).GetTypeInfo(node.Type).Type is ITypeSymbol { IsUnmanagedType: false } type) { - SemanticModel = semanticModel; - DiscoveredTypes = discoveredTypes; - ConstantDefinitions = constantDefinitions; - Context = context; + Context.ReportDiagnostic(InvalidObjectDeclaration, node, type); } - /// - /// Gets whether or not the shader uses a texture sampler at least once. - /// - public bool IsSamplerUsed { get; private set; } - - /// - public override SyntaxNode VisitCastExpression(CastExpressionSyntax node) + // If var is used, replace it with the explicit type + if (updatedNode.Type is IdentifierNameSyntax { IsVar: true }) { - var updatedNode = (CastExpressionSyntax)base.VisitCastExpression(node)!; - - return updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); - } - - /// - public override SyntaxNode? VisitVariableDeclaration(VariableDeclarationSyntax node) - { - var updatedNode = (VariableDeclarationSyntax)base.VisitVariableDeclaration(node)!; - - if (SemanticModel.For(node).GetTypeInfo(node.Type).Type is ITypeSymbol { IsUnmanagedType: false } type) - { - Context.ReportDiagnostic(InvalidObjectDeclaration, node, type); - } - - // If var is used, replace it with the explicit type - if (updatedNode.Type is IdentifierNameSyntax { IsVar: true }) - { - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); - } - - return updatedNode; - } - - /// - public override SyntaxNode VisitObjectCreationExpression(ObjectCreationExpressionSyntax node) - { - var updatedNode = (ObjectCreationExpressionSyntax)base.VisitObjectCreationExpression(node)!; - - if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol { IsUnmanagedType: false } type) - { - Context.ReportDiagnostic(InvalidObjectCreationExpression, node, type); - } - - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node, SemanticModel.For(node), DiscoveredTypes); - - // New objects use the default HLSL cast syntax, eg. (float4)0 - if (updatedNode.ArgumentList!.Arguments.Count == 0) - { - return CastExpression(updatedNode.Type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); - } - - // Add explicit casts for matrix constructors to help the overload resolution - if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol matrixType && - HlslKnownTypes.IsMatrixType(matrixType.GetFullMetadataName())) - { - for (int i = 0; i < node.ArgumentList!.Arguments.Count; i++) - { - IArgumentOperation argumentOperation = (IArgumentOperation)SemanticModel.For(node).GetOperation(node.ArgumentList.Arguments[i])!; - INamedTypeSymbol elementType = (INamedTypeSymbol)argumentOperation.Parameter!.Type; - - updatedNode = updatedNode.ReplaceNode( - updatedNode.ArgumentList!.Arguments[i].Expression, - CastExpression(IdentifierName(HlslKnownTypes.GetMappedName(elementType)), updatedNode.ArgumentList.Arguments[i].Expression)); - } - } - - return InvocationExpression(updatedNode.Type, updatedNode.ArgumentList!); - } - - /// - public override SyntaxNode VisitImplicitObjectCreationExpression(ImplicitObjectCreationExpressionSyntax node) - { - var updatedNode = (ImplicitObjectCreationExpressionSyntax)base.VisitImplicitObjectCreationExpression(node)!; - - if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol { IsUnmanagedType: false } type) - { - Context.ReportDiagnostic(InvalidObjectCreationExpression, node, type); - } - - TypeSyntax explicitType = IdentifierName("").ReplaceAndTrackType(node, SemanticModel.For(node), DiscoveredTypes); - - // Mutate the syntax like with explicit object creation expressions - if (updatedNode.ArgumentList!.Arguments.Count == 0) - { - return CastExpression(explicitType, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); - } - - // Add explicit casts like with the explicit object creation expressions above - if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol matrixType && - HlslKnownTypes.IsMatrixType(matrixType.GetFullMetadataName())) - { - for (int i = 0; i < node.ArgumentList.Arguments.Count; i++) - { - IArgumentOperation argumentOperation = (IArgumentOperation)SemanticModel.For(node).GetOperation(node.ArgumentList.Arguments[i])!; - INamedTypeSymbol elementType = (INamedTypeSymbol)argumentOperation.Parameter!.Type; - - updatedNode = updatedNode.ReplaceNode( - updatedNode.ArgumentList.Arguments[i].Expression, - CastExpression(IdentifierName(HlslKnownTypes.GetMappedName(elementType)), updatedNode.ArgumentList.Arguments[i].Expression)); - } - } - - return InvocationExpression(explicitType, updatedNode.ArgumentList); - } - - /// - public override SyntaxNode VisitDefaultExpression(DefaultExpressionSyntax node) - { - var updatedNode = (DefaultExpressionSyntax)base.VisitDefaultExpression(node)!; - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); + } - // A default expression becomes (T)0 in HLSL + return updatedNode; + } + + /// + public override SyntaxNode VisitObjectCreationExpression(ObjectCreationExpressionSyntax node) + { + var updatedNode = (ObjectCreationExpressionSyntax)base.VisitObjectCreationExpression(node)!; + + if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol { IsUnmanagedType: false } type) + { + Context.ReportDiagnostic(InvalidObjectCreationExpression, node, type); + } + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node, SemanticModel.For(node), DiscoveredTypes); + + // New objects use the default HLSL cast syntax, eg. (float4)0 + if (updatedNode.ArgumentList!.Arguments.Count == 0) + { return CastExpression(updatedNode.Type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); } - /// - public override SyntaxNode? VisitLiteralExpression(LiteralExpressionSyntax node) + // Add explicit casts for matrix constructors to help the overload resolution + if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol matrixType && + HlslKnownTypes.IsMatrixType(matrixType.GetFullMetadataName())) { - var updatedNode = (LiteralExpressionSyntax)base.VisitLiteralExpression(node)!; - - if (updatedNode.IsKind(SyntaxKind.DefaultLiteralExpression)) + for (int i = 0; i < node.ArgumentList!.Arguments.Count; i++) { - TypeSyntax type = node.TrackType(SemanticModel.For(node), DiscoveredTypes); + IArgumentOperation argumentOperation = (IArgumentOperation)SemanticModel.For(node).GetOperation(node.ArgumentList.Arguments[i])!; + INamedTypeSymbol elementType = (INamedTypeSymbol)argumentOperation.Parameter!.Type; - // Same HLSL-style expression in the form (T)0 - return CastExpression(type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + updatedNode = updatedNode.ReplaceNode( + updatedNode.ArgumentList!.Arguments[i].Expression, + CastExpression(IdentifierName(HlslKnownTypes.GetMappedName(elementType)), updatedNode.ArgumentList.Arguments[i].Expression)); } - else if (updatedNode.IsKind(SyntaxKind.NumericLiteralExpression) && - SemanticModel.For(node).GetOperation(node) is ILiteralOperation operation && - operation.Type is INamedTypeSymbol type) - { - // If the expression is a literal floating point value, we need to ensure the proper suffixes are - // used in the HLSL representation. Floating point values accept either f or F, but they don't work - // when the literal doesn't contain a decimal point. Since 32 bit floating point values are the default - // in HLSL, we can remove the suffix entirely. As for 64 bit values, we simply use the 'L' suffix. - if (type.GetFullMetadataName().Equals(typeof(float).FullName)) - { - string literal = updatedNode.Token.ValueText; - - // If the numeric literal is neither a decimal nor an exponential, add the ".0" suffix - if (literal.IndexOfAny(new[] { '.', 'E' }) == -1) - { - literal += ".0"; - } - - return updatedNode.WithToken(Literal(literal, 0f)); - } - else if (type.GetFullMetadataName().Equals(typeof(double).FullName)) - { - return updatedNode.WithToken(Literal(updatedNode.Token.ValueText + "L", 0d)); - } - } - else if (updatedNode.IsKind(SyntaxKind.StringLiteralExpression)) - { - Context.ReportDiagnostic(StringLiteralExpression, node); - } - - return updatedNode; } - /// - public override SyntaxNode? VisitElementAccessExpression(ElementAccessExpressionSyntax node) + return InvocationExpression(updatedNode.Type, updatedNode.ArgumentList!); + } + + /// + public override SyntaxNode VisitImplicitObjectCreationExpression(ImplicitObjectCreationExpressionSyntax node) + { + var updatedNode = (ImplicitObjectCreationExpressionSyntax)base.VisitImplicitObjectCreationExpression(node)!; + + if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol { IsUnmanagedType: false } type) { - var updatedNode = (ElementAccessExpressionSyntax)base.VisitElementAccessExpression(node)!; + Context.ReportDiagnostic(InvalidObjectCreationExpression, node, type); + } - if (SemanticModel.For(node).GetOperation(node) is IPropertyReferenceOperation operation) + TypeSyntax explicitType = IdentifierName("").ReplaceAndTrackType(node, SemanticModel.For(node), DiscoveredTypes); + + // Mutate the syntax like with explicit object creation expressions + if (updatedNode.ArgumentList!.Arguments.Count == 0) + { + return CastExpression(explicitType, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + + // Add explicit casts like with the explicit object creation expressions above + if (SemanticModel.For(node).GetTypeInfo(node).Type is ITypeSymbol matrixType && + HlslKnownTypes.IsMatrixType(matrixType.GetFullMetadataName())) + { + for (int i = 0; i < node.ArgumentList.Arguments.Count; i++) { - string propertyName = operation.Property.GetFullMetadataName(); + IArgumentOperation argumentOperation = (IArgumentOperation)SemanticModel.For(node).GetOperation(node.ArgumentList.Arguments[i])!; + INamedTypeSymbol elementType = (INamedTypeSymbol)argumentOperation.Parameter!.Type; - // Rewrite texture resource indices taking individual indices a vector argument, as per HLSL spec. - // For instance: texture[ThreadIds.X, ThreadIds.Y] will be rewritten as texture[int2(ThreadIds.X, ThreadIds.Y)]. - if (HlslKnownMembers.TryGetMappedResourceIndexerTypeName(propertyName, out string? mapping)) + updatedNode = updatedNode.ReplaceNode( + updatedNode.ArgumentList.Arguments[i].Expression, + CastExpression(IdentifierName(HlslKnownTypes.GetMappedName(elementType)), updatedNode.ArgumentList.Arguments[i].Expression)); + } + } + + return InvocationExpression(explicitType, updatedNode.ArgumentList); + } + + /// + public override SyntaxNode VisitDefaultExpression(DefaultExpressionSyntax node) + { + var updatedNode = (DefaultExpressionSyntax)base.VisitDefaultExpression(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); + + // A default expression becomes (T)0 in HLSL + return CastExpression(updatedNode.Type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + + /// + public override SyntaxNode? VisitLiteralExpression(LiteralExpressionSyntax node) + { + var updatedNode = (LiteralExpressionSyntax)base.VisitLiteralExpression(node)!; + + if (updatedNode.IsKind(SyntaxKind.DefaultLiteralExpression)) + { + TypeSyntax type = node.TrackType(SemanticModel.For(node), DiscoveredTypes); + + // Same HLSL-style expression in the form (T)0 + return CastExpression(type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + else if (updatedNode.IsKind(SyntaxKind.NumericLiteralExpression) && + SemanticModel.For(node).GetOperation(node) is ILiteralOperation operation && + operation.Type is INamedTypeSymbol type) + { + // If the expression is a literal floating point value, we need to ensure the proper suffixes are + // used in the HLSL representation. Floating point values accept either f or F, but they don't work + // when the literal doesn't contain a decimal point. Since 32 bit floating point values are the default + // in HLSL, we can remove the suffix entirely. As for 64 bit values, we simply use the 'L' suffix. + if (type.GetFullMetadataName().Equals(typeof(float).FullName)) + { + string literal = updatedNode.Token.ValueText; + + // If the numeric literal is neither a decimal nor an exponential, add the ".0" suffix + if (literal.IndexOfAny(new[] { '.', 'E' }) == -1) { - var index = InvocationExpression(IdentifierName(mapping!), ArgumentList(updatedNode.ArgumentList.Arguments)); - - return updatedNode.WithArgumentList(BracketedArgumentList(SingletonSeparatedList(Argument(index)))); + literal += ".0"; } - // Rewrite texture resource sampled accesses, if needed - if (HlslKnownMembers.TryGetMappedResourceSamplerAccessType(propertyName, out mapping)) + return updatedNode.WithToken(Literal(literal, 0f)); + } + else if (type.GetFullMetadataName().Equals(typeof(double).FullName)) + { + return updatedNode.WithToken(Literal(updatedNode.Token.ValueText + "L", 0d)); + } + } + else if (updatedNode.IsKind(SyntaxKind.StringLiteralExpression)) + { + Context.ReportDiagnostic(StringLiteralExpression, node); + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitElementAccessExpression(ElementAccessExpressionSyntax node) + { + var updatedNode = (ElementAccessExpressionSyntax)base.VisitElementAccessExpression(node)!; + + if (SemanticModel.For(node).GetOperation(node) is IPropertyReferenceOperation operation) + { + string propertyName = operation.Property.GetFullMetadataName(); + + // Rewrite texture resource indices taking individual indices a vector argument, as per HLSL spec. + // For instance: texture[ThreadIds.X, ThreadIds.Y] will be rewritten as texture[int2(ThreadIds.X, ThreadIds.Y)]. + if (HlslKnownMembers.TryGetMappedResourceIndexerTypeName(propertyName, out string? mapping)) + { + var index = InvocationExpression(IdentifierName(mapping!), ArgumentList(updatedNode.ArgumentList.Arguments)); + + return updatedNode.WithArgumentList(BracketedArgumentList(SingletonSeparatedList(Argument(index)))); + } + + // Rewrite texture resource sampled accesses, if needed + if (HlslKnownMembers.TryGetMappedResourceSamplerAccessType(propertyName, out mapping)) + { + IsSamplerUsed = true; + + // Get the syntax for the argument syntax transformation as described above + ArgumentSyntax coordinateSyntax = mapping switch { - IsSamplerUsed = true; + not null => Argument(InvocationExpression(IdentifierName(mapping!), ArgumentList(updatedNode.ArgumentList.Arguments))), + null => updatedNode.ArgumentList.Arguments[0] + }; - // Get the syntax for the argument syntax transformation as described above - ArgumentSyntax coordinateSyntax = mapping switch - { - not null => Argument(InvocationExpression(IdentifierName(mapping!), ArgumentList(updatedNode.ArgumentList.Arguments))), - null => updatedNode.ArgumentList.Arguments[0] - }; - - // Transform an indexer syntax into a sampling call with the implicit static linear sampler. - // For instance: texture[uv] will be rewritten as texture.SampleLevel(__sampler, uv, 0). - return - InvocationExpression( - MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - updatedNode.Expression, - IdentifierName("SampleLevel"))) - .AddArgumentListArguments( - Argument(IdentifierName("__sampler")), - coordinateSyntax, - Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0)))); - } - - // If the current property is a swizzled matrix indexer, ensure all the arguments are constants, and rewrite - // the property access to the corresponding HLSL syntax. For instance, m[M11, M12] will become m._m00_m01. - if (HlslKnownMembers.IsKnownMatrixIndexer(propertyName)) - { - bool isValid = true; - - // Validate the arguments - foreach (ArgumentSyntax argument in node.ArgumentList.Arguments) - { - if (SemanticModel.For(node).GetOperation(argument.Expression) is not IFieldReferenceOperation fieldReference || - !HlslKnownMembers.IsKnownMatrixIndex(fieldReference.Field.GetFullMetadataName())) - { - Context.ReportDiagnostic(NonConstantMatrixSwizzledIndex, argument); - - isValid = false; - } - } - - if (isValid) - { - // Rewrite the indexer as a property access - string hlslPropertyName = string.Join("", - from argument in node.ArgumentList.Arguments - let fieldReference = (IFieldReferenceOperation)SemanticModel.For(node).GetOperation(argument.Expression)! - let fieldName = fieldReference.Field.Name - let row = (char)(fieldName[1] - 1) - let column = (char)(fieldName[2] - 1) - select $"_m{row}{column}"); - - return MemberAccessExpression( + // Transform an indexer syntax into a sampling call with the implicit static linear sampler. + // For instance: texture[uv] will be rewritten as texture.SampleLevel(__sampler, uv, 0). + return + InvocationExpression( + MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, updatedNode.Expression, - IdentifierName(hlslPropertyName)); + IdentifierName("SampleLevel"))) + .AddArgumentListArguments( + Argument(IdentifierName("__sampler")), + coordinateSyntax, + Argument(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0)))); + } + + // If the current property is a swizzled matrix indexer, ensure all the arguments are constants, and rewrite + // the property access to the corresponding HLSL syntax. For instance, m[M11, M12] will become m._m00_m01. + if (HlslKnownMembers.IsKnownMatrixIndexer(propertyName)) + { + bool isValid = true; + + // Validate the arguments + foreach (ArgumentSyntax argument in node.ArgumentList.Arguments) + { + if (SemanticModel.For(node).GetOperation(argument.Expression) is not IFieldReferenceOperation fieldReference || + !HlslKnownMembers.IsKnownMatrixIndex(fieldReference.Field.GetFullMetadataName())) + { + Context.ReportDiagnostic(NonConstantMatrixSwizzledIndex, argument); + + isValid = false; } } - } - return updatedNode; + if (isValid) + { + // Rewrite the indexer as a property access + string hlslPropertyName = string.Join("", + from argument in node.ArgumentList.Arguments + let fieldReference = (IFieldReferenceOperation)SemanticModel.For(node).GetOperation(argument.Expression)! + let fieldName = fieldReference.Field.Name + let row = (char)(fieldName[1] - 1) + let column = (char)(fieldName[2] - 1) + select $"_m{row}{column}"); + + return MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + updatedNode.Expression, + IdentifierName(hlslPropertyName)); + } + } } - /// - public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node) + return updatedNode; + } + + /// + public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node) + { + var updatedNode = (IdentifierNameSyntax)base.VisitIdentifierName(node)!; + + if (SemanticModel.For(node).GetOperation(node) is IFieldReferenceOperation operation && + operation.Field.IsConst && + operation.Type!.TypeKind != TypeKind.Enum) { - var updatedNode = (IdentifierNameSyntax)base.VisitIdentifierName(node)!; + ConstantDefinitions[operation.Field] = ((IFormattable)operation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); - if (SemanticModel.For(node).GetOperation(node) is IFieldReferenceOperation operation && - operation.Field.IsConst && - operation.Type!.TypeKind != TypeKind.Enum) - { - ConstantDefinitions[operation.Field] = ((IFormattable)operation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); + var ownerTypeName = ((INamedTypeSymbol)operation.Field.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); + var constantName = $"__{ownerTypeName}__{operation.Field.Name}"; - var ownerTypeName = ((INamedTypeSymbol)operation.Field.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); - var constantName = $"__{ownerTypeName}__{operation.Field.Name}"; - - return IdentifierName(constantName); - } - - return updatedNode; + return IdentifierName(constantName); } - /// - public override SyntaxToken VisitToken(SyntaxToken token) + return updatedNode; + } + + /// + public override SyntaxToken VisitToken(SyntaxToken token) + { + SyntaxToken updatedToken = base.VisitToken(token); + + // Replace all identifier tokens when needed, to avoid colliding with HLSL keywords + if (updatedToken.IsKind(SyntaxKind.IdentifierToken) && + HlslKnownKeywords.TryGetMappedName(updatedToken.Text, out string? mapped)) { - SyntaxToken updatedToken = base.VisitToken(token); - - // Replace all identifier tokens when needed, to avoid colliding with HLSL keywords - if (updatedToken.IsKind(SyntaxKind.IdentifierToken) && - HlslKnownKeywords.TryGetMappedName(updatedToken.Text, out string? mapped)) - { - return ParseToken(mapped!); - } - - return updatedToken.WithoutTrivia(); + return ParseToken(mapped!); } + + return updatedToken.WithoutTrivia(); } } diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs index cd0c7d32..43261dbf 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -13,432 +13,431 @@ using Microsoft.CodeAnalysis.Operations; using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.SyntaxRewriters +namespace ComputeSharp.SourceGenerators.SyntaxRewriters; + +/// +/// A custom type that processes C# methods to convert to HLSL compliant code. +/// +internal sealed class ShaderSourceRewriter : HlslSourceRewriter { /// - /// A custom type that processes C# methods to convert to HLSL compliant code. + /// The type symbol for the shader type. /// - internal sealed class ShaderSourceRewriter : HlslSourceRewriter + private readonly INamedTypeSymbol? shaderType; + + /// + /// The collection of discovered static methods. + /// + private readonly IDictionary staticMethods; + + /// + /// The collection of processed local functions in the current tree. + /// + private readonly Dictionary localFunctions; + + /// + /// The list of implicit variables to declare at the start of the body. + /// + private readonly List implicitVariables; + + /// + /// Whether or not the current instance is processing a shader entry point. + /// + private readonly bool isEntryPoint; + + /// + /// The current tree being visited. + /// + private MethodDeclarationSyntax? currentMethod; + + /// + /// The current depth inside local declarations. + /// + private int localFunctionDepth; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The type symbol for the shader type. + /// The instance for the target syntax tree. + /// The set of discovered custom types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// The current generator context in use. + /// Whether or not the current instance is processing a shader entry point. + public ShaderSourceRewriter( + INamedTypeSymbol shaderType, + SemanticModelProvider semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions, + GeneratorExecutionContext context, + bool isEntryPoint) + : base(semanticModel, discoveredTypes, constantDefinitions, context) { - /// - /// The type symbol for the shader type. - /// - private readonly INamedTypeSymbol? shaderType; + this.shaderType = shaderType; + this.staticMethods = staticMethods; + this.localFunctions = new(); + this.implicitVariables = new(); + this.isEntryPoint = isEntryPoint; + } - /// - /// The collection of discovered static methods. - /// - private readonly IDictionary staticMethods; + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance for the target syntax tree. + /// The set of discovered custom types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// The current generator context in use. + public ShaderSourceRewriter( + SemanticModelProvider semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions, + GeneratorExecutionContext context) + : base(semanticModel, discoveredTypes, constantDefinitions, context) + { + this.staticMethods = staticMethods; + this.implicitVariables = new(); + this.localFunctions = new(); + } - /// - /// The collection of processed local functions in the current tree. - /// - private readonly Dictionary localFunctions; + /// + /// Gets the collection of processed local functions in the current tree. + /// + public IReadOnlyDictionary LocalFunctions => this.localFunctions; - /// - /// The list of implicit variables to declare at the start of the body. - /// - private readonly List implicitVariables; + /// + /// Gets whether or not the shader uses at least once (except ). + /// + public bool IsGroupIdsUsed { get; private set; } - /// - /// Whether or not the current instance is processing a shader entry point. - /// - private readonly bool isEntryPoint; + /// + /// Gets whether or not the shader uses tree being visited. - /// - private MethodDeclarationSyntax? currentMethod; + /// + /// Gets whether or not the shader uses at least once. + /// + public bool IsGridIdsUsed { get; set; } - /// - /// The current depth inside local declarations. - /// - private int localFunctionDepth; + /// + public MethodDeclarationSyntax? Visit(MethodDeclarationSyntax? node) + { + this.currentMethod = node; - /// - /// Creates a new instance with the specified parameters. - /// - /// The type symbol for the shader type. - /// The instance for the target syntax tree. - /// The set of discovered custom types. - /// The set of discovered and processed static methods. - /// The collection of discovered constant definitions. - /// The current generator context in use. - /// Whether or not the current instance is processing a shader entry point. - public ShaderSourceRewriter( - INamedTypeSymbol shaderType, - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary staticMethods, - IDictionary constantDefinitions, - GeneratorExecutionContext context, - bool isEntryPoint) - : base(semanticModel, discoveredTypes, constantDefinitions, context) + var updatedNode = (MethodDeclarationSyntax?)base.Visit(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); + + if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) { - this.shaderType = shaderType; - this.staticMethods = staticMethods; - this.localFunctions = new(); - this.implicitVariables = new(); - this.isEntryPoint = isEntryPoint; + Context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node); } - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance for the target syntax tree. - /// The set of discovered custom types. - /// The set of discovered and processed static methods. - /// The collection of discovered constant definitions. - /// The current generator context in use. - public ShaderSourceRewriter( - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary staticMethods, - IDictionary constantDefinitions, - GeneratorExecutionContext context) - : base(semanticModel, discoveredTypes, constantDefinitions, context) + if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) { - this.staticMethods = staticMethods; - this.implicitVariables = new(); - this.localFunctions = new(); + Context.ReportDiagnostic(UnsafeModifierOnMethodOrFunction, node); } - /// - /// Gets the collection of processed local functions in the current tree. - /// - public IReadOnlyDictionary LocalFunctions => this.localFunctions; - - /// - /// Gets whether or not the shader uses at least once (except ). - /// - public bool IsGroupIdsUsed { get; private set; } - - /// - /// Gets whether or not the shader uses at least once. - /// - public bool IsGridIdsUsed { get; set; } - - /// - public MethodDeclarationSyntax? Visit(MethodDeclarationSyntax? node) + if (updatedNode is not null) { - this.currentMethod = node; + var implicitBlock = Block(this.implicitVariables.Select(static v => LocalDeclarationStatement(v)).ToArray()); - var updatedNode = (MethodDeclarationSyntax?)base.Visit(node)!; - - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); - - if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) - { - Context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node); - } - - if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) - { - Context.ReportDiagnostic(UnsafeModifierOnMethodOrFunction, node); - } - - if (updatedNode is not null) - { - var implicitBlock = Block(this.implicitVariables.Select(static v => LocalDeclarationStatement(v)).ToArray()); - - // Add the tracked implicit declarations (at the start of the body) - updatedNode = updatedNode.WithBody(implicitBlock).AddBodyStatements(updatedNode.Body!.Statements.ToArray()); - } - - return updatedNode; + // Add the tracked implicit declarations (at the start of the body) + updatedNode = updatedNode.WithBody(implicitBlock).AddBodyStatements(updatedNode.Body!.Statements.ToArray()); } - /// - public override SyntaxNode VisitParameter(ParameterSyntax node) - { - var updatedNode = (ParameterSyntax)base.VisitParameter(node)!; + return updatedNode; + } - // Convert the C# parameter modifiers to the HLSL equivalent - SyntaxToken modifier = - node.Modifiers - .Where(static m => m.Kind() is SyntaxKind.OutKeyword or SyntaxKind.RefKeyword or SyntaxKind.InKeyword) - .Select(static m => m.Kind() switch + /// + public override SyntaxNode VisitParameter(ParameterSyntax node) + { + var updatedNode = (ParameterSyntax)base.VisitParameter(node)!; + + // Convert the C# parameter modifiers to the HLSL equivalent + SyntaxToken modifier = + node.Modifiers + .Where(static m => m.Kind() is SyntaxKind.OutKeyword or SyntaxKind.RefKeyword or SyntaxKind.InKeyword) + .Select(static m => m.Kind() switch + { + SyntaxKind.OutKeyword => m, + SyntaxKind.InKeyword => m, + SyntaxKind.RefKeyword => ParseToken("inout"), + _ => Token(SyntaxKind.None) + }).FirstOrDefault(); + + return updatedNode + .WithAttributeLists(default) + .ReplaceAndTrackType(updatedNode.Type!, node.Type!, SemanticModel.For(node), DiscoveredTypes) + .WithModifiers(TokenList(modifier)); + } + + /// + public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node) + { + var updatedNode = ((LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node)!); + + if (SemanticModel.For(node).GetOperation(node) is IOperation { Kind: OperationKind.UsingDeclaration }) + { + Context.ReportDiagnostic(UsingStatementOrDeclaration, node); + } + + return updatedNode.ReplaceAndTrackType(updatedNode.Declaration.Type, node.Declaration.Type, SemanticModel.For(node), DiscoveredTypes); + } + + /// + public override SyntaxNode? VisitDeclarationExpression(DeclarationExpressionSyntax node) + { + var updatedNode = (DeclarationExpressionSyntax)base.VisitDeclarationExpression(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); + + // Add the variable to the list of implicit declarations + this.implicitVariables.Add(VariableDeclaration(updatedNode.Type).AddVariables(VariableDeclarator(updatedNode.Designation.ToString()))); + + return IdentifierName(updatedNode.Designation.ToString()); + } + + /// + public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) + { + return + ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!) + .WithBlockBody() + .WithoutAccessibilityModifiers() + .WithAttributeLists(List()); + } + + /// + public override SyntaxNode? VisitLocalFunctionStatement(LocalFunctionStatementSyntax node) + { + this.localFunctionDepth++; + + var updatedNode = + ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) + .WithBlockBody() + .WithAttributeLists(List()) + .WithIdentifier(Identifier($"__{this.currentMethod!.Identifier.Text}__{node.Identifier.Text}")); + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + { + Context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node); + } + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + { + Context.ReportDiagnostic(UnsafeModifierOnMethodOrFunction, node); + } + + this.localFunctionDepth--; + + // HLSL doesn't support local functions, so we first process them as usual and then remove + // them from the current syntax tree completely. These will be added to the shader source + // as external static method with a special name to avoid conflicts with other methods. + // The name will simply be in the format: "____". + this.localFunctions.Add(updatedNode.Identifier.Text, updatedNode); + + return null; + } + + /// + public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) + { + var updatedNode = (MemberAccessExpressionSyntax)base.VisitMemberAccessExpression(node)!; + + if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression) && + SemanticModel.For(node).GetOperation(node) is IMemberReferenceOperation operation) + { + // If the member access is a constant, track it and replace the tree with the processed constant name + if (operation is IFieldReferenceOperation fieldOperation && + fieldOperation.Field.IsConst && + fieldOperation.Type!.TypeKind != TypeKind.Enum) + { + ConstantDefinitions[fieldOperation.Field] = ((IFormattable)fieldOperation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); + + var ownerTypeName = ((INamedTypeSymbol)fieldOperation.Field.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); + var constantName = $"__{ownerTypeName}__{fieldOperation.Field.Name}"; + + return IdentifierName(constantName); + } + + // If the current member access is a field or property access, check the lookup table + // to see if the member should be rewritten for HLSL compliance, and rewrite if needed. + if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping)) + { + // Mark which dispatch properties have been used, to optimize the declaration afterwards + if (operation.Member.IsStatic) { - SyntaxKind.OutKeyword => m, - SyntaxKind.InKeyword => m, - SyntaxKind.RefKeyword => ParseToken("inout"), - _ => Token(SyntaxKind.None) - }).FirstOrDefault(); + string typeName = operation.Member.ContainingType.GetFullMetadataName(); - return updatedNode - .WithAttributeLists(default) - .ReplaceAndTrackType(updatedNode.Type!, node.Type!, SemanticModel.For(node), DiscoveredTypes) - .WithModifiers(TokenList(modifier)); - } + if (mapping == $"__{nameof(GroupIds)}__get_Index") IsGroupIdsIndexUsed = true; + else if (typeName == typeof(GroupIds).FullName) IsGroupIdsUsed = true; + else if (typeName == typeof(GridIds).FullName) IsGridIdsUsed = true; - /// - public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node) - { - var updatedNode = ((LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node)!); - - if (SemanticModel.For(node).GetOperation(node) is IOperation { Kind: OperationKind.UsingDeclaration }) - { - Context.ReportDiagnostic(UsingStatementOrDeclaration, node); - } - - return updatedNode.ReplaceAndTrackType(updatedNode.Declaration.Type, node.Declaration.Type, SemanticModel.For(node), DiscoveredTypes); - } - - /// - public override SyntaxNode? VisitDeclarationExpression(DeclarationExpressionSyntax node) - { - var updatedNode = (DeclarationExpressionSyntax)base.VisitDeclarationExpression(node)!; - - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, SemanticModel.For(node), DiscoveredTypes); - - // Add the variable to the list of implicit declarations - this.implicitVariables.Add(VariableDeclaration(updatedNode.Type).AddVariables(VariableDeclarator(updatedNode.Designation.ToString()))); - - return IdentifierName(updatedNode.Designation.ToString()); - } - - /// - public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) - { - return - ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!) - .WithBlockBody() - .WithoutAccessibilityModifiers() - .WithAttributeLists(List()); - } - - /// - public override SyntaxNode? VisitLocalFunctionStatement(LocalFunctionStatementSyntax node) - { - this.localFunctionDepth++; - - var updatedNode = - ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) - .WithBlockBody() - .WithAttributeLists(List()) - .WithIdentifier(Identifier($"__{this.currentMethod!.Identifier.Text}__{node.Identifier.Text}")); - - updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, SemanticModel.For(node), DiscoveredTypes); - - if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) - { - Context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node); - } - - if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) - { - Context.ReportDiagnostic(UnsafeModifierOnMethodOrFunction, node); - } - - this.localFunctionDepth--; - - // HLSL doesn't support local functions, so we first process them as usual and then remove - // them from the current syntax tree completely. These will be added to the shader source - // as external static method with a special name to avoid conflicts with other methods. - // The name will simply be in the format: "____". - this.localFunctions.Add(updatedNode.Identifier.Text, updatedNode); - - return null; - } - - /// - public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) - { - var updatedNode = (MemberAccessExpressionSyntax)base.VisitMemberAccessExpression(node)!; - - if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression) && - SemanticModel.For(node).GetOperation(node) is IMemberReferenceOperation operation) - { - // If the member access is a constant, track it and replace the tree with the processed constant name - if (operation is IFieldReferenceOperation fieldOperation && - fieldOperation.Field.IsConst && - fieldOperation.Type!.TypeKind != TypeKind.Enum) - { - ConstantDefinitions[fieldOperation.Field] = ((IFormattable)fieldOperation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); - - var ownerTypeName = ((INamedTypeSymbol)fieldOperation.Field.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); - var constantName = $"__{ownerTypeName}__{fieldOperation.Field.Name}"; - - return IdentifierName(constantName); - } - - // If the current member access is a field or property access, check the lookup table - // to see if the member should be rewritten for HLSL compliance, and rewrite if needed. - if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping)) - { - // Mark which dispatch properties have been used, to optimize the declaration afterwards - if (operation.Member.IsStatic) + // Check that the dispatch info types are only used from the main shader body + if (!this.isEntryPoint || this.localFunctionDepth > 0) { - string typeName = operation.Member.ContainingType.GetFullMetadataName(); - - if (mapping == $"__{nameof(GroupIds)}__get_Index") IsGroupIdsIndexUsed = true; - else if (typeName == typeof(GroupIds).FullName) IsGroupIdsUsed = true; - else if (typeName == typeof(GridIds).FullName) IsGridIdsUsed = true; - - // Check that the dispatch info types are only used from the main shader body - if (!this.isEntryPoint || this.localFunctionDepth > 0) + DiagnosticDescriptor? descriptor = typeName switch { - DiagnosticDescriptor? descriptor = typeName switch - { - _ when typeName == typeof(ThreadIds).FullName || typeName == typeof(ThreadIds.Normalized).FullName => InvalidThreadIdsUsage, - _ when typeName == typeof(GroupIds).FullName => InvalidGroupIdsUsage, - _ when typeName == typeof(GroupSize).FullName => InvalidGroupSizeUsage, - _ when typeName == typeof(GridIds).FullName => InvalidGridIdsUsage, - _ when typeName == typeof(DispatchSize).FullName => InvalidDispatchSizeUsage, - _ => null - }; + _ when typeName == typeof(ThreadIds).FullName || typeName == typeof(ThreadIds.Normalized).FullName => InvalidThreadIdsUsage, + _ when typeName == typeof(GroupIds).FullName => InvalidGroupIdsUsage, + _ when typeName == typeof(GroupSize).FullName => InvalidGroupSizeUsage, + _ when typeName == typeof(GridIds).FullName => InvalidGridIdsUsage, + _ when typeName == typeof(DispatchSize).FullName => InvalidDispatchSizeUsage, + _ => null + }; - if (descriptor is not null) - { - Context.ReportDiagnostic(descriptor, node); - } + if (descriptor is not null) + { + Context.ReportDiagnostic(descriptor, node); } } - - // Static and instance members are handled differently, with static members being - // converted into a literal expression, and instance getting an updated identifier. - // For instance, consider these three cases: - // - Vector3.One (static) => float3(1.0f, 1.0f, 1.0f) - // - ThreadIds.X (custom) => ThreadIds.x - // - uint3.X (instance) => [arg].x - return operation.Member.IsStatic switch - { - true => ParseExpression(mapping!), - false => updatedNode.WithName(IdentifierName(mapping!)) - }; } - // If the current member access is an access to any of the size properties in the available - // resource types (either buffer or texture types), then rewrite the subtree to transform the - // property access into an invocation of an autogenerated static helper method to get the target - // dimension for the buffer in use. The helper method is added to the list of static helpers. - if (operation is IPropertyReferenceOperation propertyOperation && - HlslKnownMembers.TryGetAccessorRankAndAxis(propertyOperation.Property.GetFullMetadataName(), out int rank, out int axis)) + // Static and instance members are handled differently, with static members being + // converted into a literal expression, and instance getting an updated identifier. + // For instance, consider these three cases: + // - Vector3.One (static) => float3(1.0f, 1.0f, 1.0f) + // - ThreadIds.X (custom) => ThreadIds.x + // - uint3.X (instance) => [arg].x + return operation.Member.IsStatic switch { - IMethodSymbol key = propertyOperation.Property.GetMethod!; - - if (!this.staticMethods.TryGetValue(key, out MethodDeclarationSyntax? methodSyntax)) - { - INamedTypeSymbol resourceType = (INamedTypeSymbol)SemanticModel.For(node).GetTypeInfo(node.Expression).Type!; - string resourceName = HlslKnownTypes.GetMappedName(resourceType); - - // Create a static method to get a specified dimension for a target resource type. - // The method will automatically create the necessary number of temporary variables - // depending on the rank of the input resource (eg. 2 for Texture2D resources). - // For instance, this code will generate the following tree for Texture2D.Width: - // - // static int __get_Dimension0(Texture2D texture) - // { - // uint _0, _1; - // texture.GetDimensions(_0, _1); - // - // return _0; - // } - methodSyntax = - MethodDeclaration(PredefinedType(Token(SyntaxKind.IntKeyword)), $"__get_Dimension{axis}") - .AddModifiers(Token(SyntaxKind.StaticKeyword)) - .AddParameterListParameters( - Parameter(Identifier("resource")) - .WithType(IdentifierName(resourceName))) - .WithBody(Block( - LocalDeclarationStatement( - VariableDeclaration(PredefinedType(Token(SyntaxKind.UIntKeyword))) - .AddVariables(Enumerable.Range(0, rank).Select(static i => VariableDeclarator(Identifier("_" + i))).ToArray())), - ExpressionStatement( - InvocationExpression(MemberAccessExpression( - SyntaxKind.SimpleMemberAccessExpression, - IdentifierName("resource"), - IdentifierName("GetDimensions"))) - .AddArgumentListArguments(Enumerable.Range(0, rank).Select(static i => Argument(IdentifierName("_" + i))).ToArray())), - ReturnStatement(IdentifierName("_" + axis)))); - - this.staticMethods.Add(key, methodSyntax); - } - - return InvocationExpression(IdentifierName(methodSyntax.Identifier)).AddArgumentListArguments(Argument(updatedNode.Expression)); - } + true => ParseExpression(mapping!), + false => updatedNode.WithName(IdentifierName(mapping!)) + }; } - return updatedNode; - } - - /// - public override SyntaxNode? VisitInvocationExpression(InvocationExpressionSyntax node) - { - var updatedNode = (InvocationExpressionSyntax)base.VisitInvocationExpression(node)!; - - if (SemanticModel.For(node).GetOperation(node) is IInvocationOperation operation && - operation.TargetMethod is IMethodSymbol method && - method.IsStatic) + // If the current member access is an access to any of the size properties in the available + // resource types (either buffer or texture types), then rewrite the subtree to transform the + // property access into an invocation of an autogenerated static helper method to get the target + // dimension for the buffer in use. The helper method is added to the list of static helpers. + if (operation is IPropertyReferenceOperation propertyOperation && + HlslKnownMembers.TryGetAccessorRankAndAxis(propertyOperation.Property.GetFullMetadataName(), out int rank, out int axis)) { - // If the invocation consists of invoking a static method that has a direct - // mapping to HLSL, rewrite the expression in the current invocation node. - // For instance: Math.Abs(expr) => abs(expr). - if (HlslKnownMethods.TryGetMappedName(method.GetFullMetadataName(), out string? mapping)) + IMethodSymbol key = propertyOperation.Property.GetMethod!; + + if (!this.staticMethods.TryGetValue(key, out MethodDeclarationSyntax? methodSyntax)) { - return updatedNode.WithExpression(ParseExpression(mapping!)); + INamedTypeSymbol resourceType = (INamedTypeSymbol)SemanticModel.For(node).GetTypeInfo(node.Expression).Type!; + string resourceName = HlslKnownTypes.GetMappedName(resourceType); + + // Create a static method to get a specified dimension for a target resource type. + // The method will automatically create the necessary number of temporary variables + // depending on the rank of the input resource (eg. 2 for Texture2D resources). + // For instance, this code will generate the following tree for Texture2D.Width: + // + // static int __get_Dimension0(Texture2D texture) + // { + // uint _0, _1; + // texture.GetDimensions(_0, _1); + // + // return _0; + // } + methodSyntax = + MethodDeclaration(PredefinedType(Token(SyntaxKind.IntKeyword)), $"__get_Dimension{axis}") + .AddModifiers(Token(SyntaxKind.StaticKeyword)) + .AddParameterListParameters( + Parameter(Identifier("resource")) + .WithType(IdentifierName(resourceName))) + .WithBody(Block( + LocalDeclarationStatement( + VariableDeclaration(PredefinedType(Token(SyntaxKind.UIntKeyword))) + .AddVariables(Enumerable.Range(0, rank).Select(static i => VariableDeclarator(Identifier("_" + i))).ToArray())), + ExpressionStatement( + InvocationExpression(MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("resource"), + IdentifierName("GetDimensions"))) + .AddArgumentListArguments(Enumerable.Range(0, rank).Select(static i => Argument(IdentifierName("_" + i))).ToArray())), + ReturnStatement(IdentifierName("_" + axis)))); + + this.staticMethods.Add(key, methodSyntax); } - // Update the name if the target is a local function. The exact schema for the - // updated name is detailed in the override handling the local function statement. - if (method.MethodKind == MethodKind.LocalFunction) - { - var functionIdentifier = $"__{this.currentMethod!.Identifier.Text}__{method.Name}"; - - return updatedNode.WithExpression(ParseExpression(functionIdentifier)); - } - - // If the method is an external static method, import and rewrite it as well. - // This assumes that the target method is actually part of the same compilation. - // We need to check the declaring type to avoid rewriting static methods in the shader - // type as well, as they will be processed by the generator in a different path. - if (!SymbolEqualityComparer.Default.Equals(this.shaderType, method.ContainingType)) - { - var methodIdentifier = method.GetFullMetadataName().ToHlslIdentifierName(); - - if (!this.staticMethods.ContainsKey(method)) - { - ShaderSourceRewriter shaderSourceRewriter = new(SemanticModel, DiscoveredTypes, this.staticMethods, ConstantDefinitions, Context); - MethodDeclarationSyntax - methodNode = (MethodDeclarationSyntax)method.DeclaringSyntaxReferences[0].GetSyntax(), - processedMethod = shaderSourceRewriter.Visit(methodNode)!.NormalizeWhitespace(eol: "\n").WithoutTrivia(); - - this.staticMethods.Add(method, processedMethod.WithIdentifier(Identifier(methodIdentifier))); - } - - return updatedNode.WithExpression(ParseExpression(methodIdentifier)); - } + return InvocationExpression(IdentifierName(methodSyntax.Identifier)).AddArgumentListArguments(Argument(updatedNode.Expression)); } - - return updatedNode; } - /// - public override SyntaxNode? VisitArgument(ArgumentSyntax node) + return updatedNode; + } + + /// + public override SyntaxNode? VisitInvocationExpression(InvocationExpressionSyntax node) + { + var updatedNode = (InvocationExpressionSyntax)base.VisitInvocationExpression(node)!; + + if (SemanticModel.For(node).GetOperation(node) is IInvocationOperation operation && + operation.TargetMethod is IMethodSymbol method && + method.IsStatic) { - var updatedNode = (ArgumentSyntax)base.VisitArgument(node)!; - - // Strip the ref keywords from arguments - updatedNode = updatedNode.WithRefKindKeyword(Token(SyntaxKind.None)); - - // Track and rewrite the discarded declaration - if (SemanticModel.For(node).GetOperation(node.Expression) is IDiscardOperation operation) + // If the invocation consists of invoking a static method that has a direct + // mapping to HLSL, rewrite the expression in the current invocation node. + // For instance: Math.Abs(expr) => abs(expr). + if (HlslKnownMethods.TryGetMappedName(method.GetFullMetadataName(), out string? mapping)) { - TypeSyntax typeSyntax = operation.Type!.TrackType(DiscoveredTypes); - string identifier = $"__implicit{this.implicitVariables.Count}"; - - // Add the variable to the list of implicit declarations - this.implicitVariables.Add(VariableDeclaration(typeSyntax).AddVariables(VariableDeclarator(identifier))); - - return updatedNode.WithExpression(IdentifierName(identifier)); + return updatedNode.WithExpression(ParseExpression(mapping!)); } - return updatedNode; + // Update the name if the target is a local function. The exact schema for the + // updated name is detailed in the override handling the local function statement. + if (method.MethodKind == MethodKind.LocalFunction) + { + var functionIdentifier = $"__{this.currentMethod!.Identifier.Text}__{method.Name}"; + + return updatedNode.WithExpression(ParseExpression(functionIdentifier)); + } + + // If the method is an external static method, import and rewrite it as well. + // This assumes that the target method is actually part of the same compilation. + // We need to check the declaring type to avoid rewriting static methods in the shader + // type as well, as they will be processed by the generator in a different path. + if (!SymbolEqualityComparer.Default.Equals(this.shaderType, method.ContainingType)) + { + var methodIdentifier = method.GetFullMetadataName().ToHlslIdentifierName(); + + if (!this.staticMethods.ContainsKey(method)) + { + ShaderSourceRewriter shaderSourceRewriter = new(SemanticModel, DiscoveredTypes, this.staticMethods, ConstantDefinitions, Context); + MethodDeclarationSyntax + methodNode = (MethodDeclarationSyntax)method.DeclaringSyntaxReferences[0].GetSyntax(), + processedMethod = shaderSourceRewriter.Visit(methodNode)!.NormalizeWhitespace(eol: "\n").WithoutTrivia(); + + this.staticMethods.Add(method, processedMethod.WithIdentifier(Identifier(methodIdentifier))); + } + + return updatedNode.WithExpression(ParseExpression(methodIdentifier)); + } } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitArgument(ArgumentSyntax node) + { + var updatedNode = (ArgumentSyntax)base.VisitArgument(node)!; + + // Strip the ref keywords from arguments + updatedNode = updatedNode.WithRefKindKeyword(Token(SyntaxKind.None)); + + // Track and rewrite the discarded declaration + if (SemanticModel.For(node).GetOperation(node.Expression) is IDiscardOperation operation) + { + TypeSyntax typeSyntax = operation.Type!.TrackType(DiscoveredTypes); + string identifier = $"__implicit{this.implicitVariables.Count}"; + + // Add the variable to the list of implicit declarations + this.implicitVariables.Add(VariableDeclaration(typeSyntax).AddVariables(VariableDeclarator(identifier))); + + return updatedNode.WithExpression(IdentifierName(identifier)); + } + + return updatedNode; } } diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs index c98451b9..f80d5e49 100644 --- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs @@ -12,123 +12,122 @@ using Microsoft.CodeAnalysis.Operations; using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; -namespace ComputeSharp.SourceGenerators.SyntaxRewriters +namespace ComputeSharp.SourceGenerators.SyntaxRewriters; + +/// +/// A custom type that processes C# static field to convert to HLSL static fields (possibly constant). +/// +internal sealed class StaticFieldRewriter : HlslSourceRewriter { /// - /// A custom type that processes C# static field to convert to HLSL static fields (possibly constant). + /// Creates a new instance with the specified parameters. /// - internal sealed class StaticFieldRewriter : HlslSourceRewriter + /// The instance for the target syntax tree. + /// The set of discovered custom types. + /// The collection of discovered constant definitions. + /// The current generator context in use. + public StaticFieldRewriter( + SemanticModelProvider semanticModel, + ICollection discoveredTypes, + IDictionary constantDefinitions, + GeneratorExecutionContext context) + : base(semanticModel, discoveredTypes, constantDefinitions, context) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance for the target syntax tree. - /// The set of discovered custom types. - /// The collection of discovered constant definitions. - /// The current generator context in use. - public StaticFieldRewriter( - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary constantDefinitions, - GeneratorExecutionContext context) - : base(semanticModel, discoveredTypes, constantDefinitions, context) + } + + /// + public ExpressionSyntax? Visit(VariableDeclaratorSyntax? node) + { + if (node?.Initializer is EqualsValueClauseSyntax fieldInitializer) { + return ((EqualsValueClauseSyntax)Visit(fieldInitializer))!.Value; } - /// - public ExpressionSyntax? Visit(VariableDeclaratorSyntax? node) + return null; + } + + /// + public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) + { + var updatedNode = (MemberAccessExpressionSyntax)base.VisitMemberAccessExpression(node)!; + + if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression) && + SemanticModel.For(node).GetOperation(node) is IMemberReferenceOperation operation) { - if (node?.Initializer is EqualsValueClauseSyntax fieldInitializer) + // Track and replace constants + if (operation is IFieldReferenceOperation fieldOperation && + fieldOperation.Field.IsConst && + fieldOperation.Type!.TypeKind != TypeKind.Enum) { - return ((EqualsValueClauseSyntax)Visit(fieldInitializer))!.Value; + ConstantDefinitions[fieldOperation.Field] = ((IFormattable)fieldOperation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); + + var ownerTypeName = ((INamedTypeSymbol)fieldOperation.Field.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); + var constantName = $"__{ownerTypeName}__{fieldOperation.Field.Name}"; + + return IdentifierName(constantName); } - return null; - } - - /// - public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) - { - var updatedNode = (MemberAccessExpressionSyntax)base.VisitMemberAccessExpression(node)!; - - if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression) && - SemanticModel.For(node).GetOperation(node) is IMemberReferenceOperation operation) + if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping)) { - // Track and replace constants - if (operation is IFieldReferenceOperation fieldOperation && - fieldOperation.Field.IsConst && - fieldOperation.Type!.TypeKind != TypeKind.Enum) + if (operation.Member.IsStatic) { - ConstantDefinitions[fieldOperation.Field] = ((IFormattable)fieldOperation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); + string typeName = operation.Member.ContainingType.GetFullMetadataName(); - var ownerTypeName = ((INamedTypeSymbol)fieldOperation.Field.ContainingSymbol).ToDisplayString().ToHlslIdentifierName(); - var constantName = $"__{ownerTypeName}__{fieldOperation.Field.Name}"; - - return IdentifierName(constantName); - } - - if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping)) - { - if (operation.Member.IsStatic) + // Special dispatch types are not supported from static constants + DiagnosticDescriptor? descriptor = typeName switch { - string typeName = operation.Member.ContainingType.GetFullMetadataName(); - - // Special dispatch types are not supported from static constants - DiagnosticDescriptor? descriptor = typeName switch - { - _ when typeName == typeof(ThreadIds).FullName || typeName == typeof(ThreadIds.Normalized).FullName => InvalidThreadIdsUsage, - _ when typeName == typeof(GroupIds).FullName => InvalidGroupIdsUsage, - _ when typeName == typeof(GroupSize).FullName => InvalidGroupSizeUsage, - _ when typeName == typeof(GridIds).FullName => InvalidGridIdsUsage, - _ when typeName == typeof(DispatchSize).FullName => InvalidDispatchSizeUsage, - _ => null - }; - - if (descriptor is not null) - { - Context.ReportDiagnostic(descriptor, node); - } - } - - // Rewrite static and instance mapped members - return operation.Member.IsStatic switch - { - true => ParseExpression(mapping!), - false => updatedNode.WithName(IdentifierName(mapping!)) + _ when typeName == typeof(ThreadIds).FullName || typeName == typeof(ThreadIds.Normalized).FullName => InvalidThreadIdsUsage, + _ when typeName == typeof(GroupIds).FullName => InvalidGroupIdsUsage, + _ when typeName == typeof(GroupSize).FullName => InvalidGroupSizeUsage, + _ when typeName == typeof(GridIds).FullName => InvalidGridIdsUsage, + _ when typeName == typeof(DispatchSize).FullName => InvalidDispatchSizeUsage, + _ => null }; + + if (descriptor is not null) + { + Context.ReportDiagnostic(descriptor, node); + } } - } - return updatedNode; - } - - /// - public override SyntaxNode? VisitInvocationExpression(InvocationExpressionSyntax node) - { - var updatedNode = (InvocationExpressionSyntax)base.VisitInvocationExpression(node)!; - - if (SemanticModel.For(node).GetOperation(node) is IInvocationOperation operation && - operation.TargetMethod is IMethodSymbol method && - method.IsStatic) - { - // Rewrite HLSL intrinsic methods - if (HlslKnownMethods.TryGetMappedName(method.GetFullMetadataName(), out string? mapping)) + // Rewrite static and instance mapped members + return operation.Member.IsStatic switch { - return updatedNode.WithExpression(ParseExpression(mapping!)); - } + true => ParseExpression(mapping!), + false => updatedNode.WithName(IdentifierName(mapping!)) + }; } - - return updatedNode; } - /// - public override SyntaxNode? VisitArgument(ArgumentSyntax node) + return updatedNode; + } + + /// + public override SyntaxNode? VisitInvocationExpression(InvocationExpressionSyntax node) + { + var updatedNode = (InvocationExpressionSyntax)base.VisitInvocationExpression(node)!; + + if (SemanticModel.For(node).GetOperation(node) is IInvocationOperation operation && + operation.TargetMethod is IMethodSymbol method && + method.IsStatic) { - var updatedNode = (ArgumentSyntax)base.VisitArgument(node)!; - - updatedNode = updatedNode.WithRefKindKeyword(Token(SyntaxKind.None)); - - return updatedNode; + // Rewrite HLSL intrinsic methods + if (HlslKnownMethods.TryGetMappedName(method.GetFullMetadataName(), out string? mapping)) + { + return updatedNode.WithExpression(ParseExpression(mapping!)); + } } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitArgument(ArgumentSyntax node) + { + var updatedNode = (ArgumentSyntax)base.VisitArgument(node)!; + + updatedNode = updatedNode.WithRefKindKeyword(Token(SyntaxKind.None)); + + return updatedNode; } } diff --git a/src/ComputeSharp.SourceGenerators/System.Runtime.CompilerServices/IsExternalInit.cs b/src/ComputeSharp.SourceGenerators/System.Runtime.CompilerServices/IsExternalInit.cs index cadcf5a8..8c84cb00 100644 --- a/src/ComputeSharp.SourceGenerators/System.Runtime.CompilerServices/IsExternalInit.cs +++ b/src/ComputeSharp.SourceGenerators/System.Runtime.CompilerServices/IsExternalInit.cs @@ -4,14 +4,13 @@ using System.ComponentModel; -namespace System.Runtime.CompilerServices +namespace System.Runtime.CompilerServices; + +/// +/// Reserved to be used by the compiler for tracking metadata. +/// This class should not be used by developers in source code. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +internal static class IsExternalInit { - /// - /// Reserved to be used by the compiler for tracking metadata. - /// This class should not be used by developers in source code. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - internal static class IsExternalInit - { - } -} \ No newline at end of file +} diff --git a/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs b/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs index c5db9978..048876af 100644 --- a/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs @@ -1,12 +1,11 @@ using System; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An attribute that indicates that a target shader type should get an automatic constructor for all fields. +/// +[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] +public sealed class AutoConstructorAttribute : Attribute { - /// - /// An attribute that indicates that a target shader type should get an automatic constructor for all fields. - /// - [AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] - public sealed class AutoConstructorAttribute : Attribute - { - } -} \ No newline at end of file +} diff --git a/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs b/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs index 06f561ba..ac35796d 100644 --- a/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs @@ -1,46 +1,45 @@ using System; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An attribute that indicates that an array static field in a shader type will be shared in a thread group. +/// +/// This attribute can be used to declare fields as follows: +/// +/// struct MyShader : IComputeShader +/// { +/// [GroupShared(32)] +/// static float[] MyBuffer; +/// } +/// +/// +/// The buffer shouldn't be manually initialized, as each shader invocation will automatically receive the +/// right buffer in use for the thread group it belongs to. If there is an assignment for the field, it +/// will just be ignored in the shader. Additionally, buffer types are not allowed as array items. +/// +[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] +public sealed class GroupSharedAttribute : Attribute { /// - /// An attribute that indicates that an array static field in a shader type will be shared in a thread group. - /// - /// This attribute can be used to declare fields as follows: - /// - /// struct MyShader : IComputeShader - /// { - /// [GroupShared(32)] - /// static float[] MyBuffer; - /// } - /// - /// - /// The buffer shouldn't be manually initialized, as each shader invocation will automatically receive the - /// right buffer in use for the thread group it belongs to. If there is an assignment for the field, it - /// will just be ignored in the shader. Additionally, buffer types are not allowed as array items. + /// Creates a new instance with the specified parameters. /// - [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] - public sealed class GroupSharedAttribute : Attribute + public GroupSharedAttribute() { - /// - /// Creates a new instance with the specified parameters. - /// - public GroupSharedAttribute() - { - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The size of the shared buffer to declare. - public GroupSharedAttribute(int size) - { - Size = size; - } - - /// - /// Gets the size of the shared buffer being declared. - /// If , the thread group size will be used. - /// - public int? Size { get; } } -} \ No newline at end of file + + /// + /// Creates a new instance with the specified parameters. + /// + /// The size of the shared buffer to declare. + public GroupSharedAttribute(int size) + { + Size = size; + } + + /// + /// Gets the size of the shared buffer being declared. + /// If , the thread group size will be used. + /// + public int? Size { get; } +} diff --git a/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs b/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs index d644045c..3674883c 100644 --- a/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs @@ -1,16 +1,15 @@ using System; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An attribute that indicates that a method will be indirectly used in a compute shader. +/// This method is necessary for methods that are captured and used within a given shader +/// through a field (of some custom type). In order to be processed +/// correctly, wrapped methods need to have this attribute manually applied to them. +/// Methods also need to be static, though this can only be tested at runtime. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public sealed class ShaderMethodAttribute : Attribute { - /// - /// An attribute that indicates that a method will be indirectly used in a compute shader. - /// This method is necessary for methods that are captured and used within a given shader - /// through a field (of some custom type). In order to be processed - /// correctly, wrapped methods need to have this attribute manually applied to them. - /// Methods also need to be static, though this can only be tested at runtime. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public sealed class ShaderMethodAttribute : Attribute - { - } -} \ No newline at end of file +} diff --git a/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs b/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs index 2018643a..dd8e84ae 100644 --- a/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs +++ b/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs @@ -1,93 +1,92 @@ using System; using System.Collections.Generic; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +public sealed partial class ShaderMethodSourceAttribute : Attribute { - /// - public sealed partial class ShaderMethodSourceAttribute : Attribute + /// + /// Appends the mapped source code for the current method. + /// + /// The target instance to write to. + /// The mapping of already discovered constant names. + public void AppendConstants(ref ArrayPoolStringBuilder builder, HashSet mapping) { - /// - /// Appends the mapped source code for the current method. - /// - /// The target instance to write to. - /// The mapping of already discovered constant names. - public void AppendConstants(ref ArrayPoolStringBuilder builder, HashSet mapping) + foreach (KeyValuePair constant in this.constants) { - foreach (KeyValuePair constant in this.constants) + if (mapping.Add(constant.Key)) { - if (mapping.Add(constant.Key)) - { - builder.Append("#define "); - builder.Append(constant.Key); - builder.Append(' '); - builder.Append(constant.Value); - builder.Append('\n'); - } + builder.Append("#define "); + builder.Append(constant.Key); + builder.Append(' '); + builder.Append(constant.Value); + builder.Append('\n'); } } - - /// - /// Appends the discovered types for the current method. - /// - /// The target instance to write to. - /// The mapping of already discovered type names. - public void AppendTypes(ref ArrayPoolStringBuilder builder, HashSet mapping) - { - foreach (KeyValuePair type in this.types) - { - if (mapping.Add(type.Key)) - { - builder.Append('\n'); - builder.Append(type.Value); - builder.Append('\n'); - } - } - } - - /// - /// Appends the discovered forward declarations for the current method. - /// - /// The target instance to write to. - /// The mapping of already discovered type names. - public void AppendForwardDeclarations(ref ArrayPoolStringBuilder builder, HashSet mapping) - { - foreach (KeyValuePair method in this.methods) - { - if (mapping.Add(method.Key)) - { - builder.Append('\n'); - builder.Append(method.Key); - builder.Append('\n'); - } - } - } - - /// - /// Appends the discovered methods for the current method. - /// - /// The target instance to write to. - /// The mapping of already discovered type names. - public void AppendMethods(ref ArrayPoolStringBuilder builder, HashSet mapping) - { - foreach (KeyValuePair method in this.methods) - { - if (mapping.Remove(method.Key)) - { - builder.Append('\n'); - builder.Append(method.Value); - builder.Append('\n'); - } - } - } - - /// - /// Appends the mapped source code for the current method. - /// - /// The target instance to write to. - /// The name to bind the method to. - public void AppendMappedInvokeMethod(ref ArrayPoolStringBuilder builder, string name) - { - builder.Append(this.invokeMethod.Replace(InvokeMethodIdentifier, name)); - } } -} \ No newline at end of file + + /// + /// Appends the discovered types for the current method. + /// + /// The target instance to write to. + /// The mapping of already discovered type names. + public void AppendTypes(ref ArrayPoolStringBuilder builder, HashSet mapping) + { + foreach (KeyValuePair type in this.types) + { + if (mapping.Add(type.Key)) + { + builder.Append('\n'); + builder.Append(type.Value); + builder.Append('\n'); + } + } + } + + /// + /// Appends the discovered forward declarations for the current method. + /// + /// The target instance to write to. + /// The mapping of already discovered type names. + public void AppendForwardDeclarations(ref ArrayPoolStringBuilder builder, HashSet mapping) + { + foreach (KeyValuePair method in this.methods) + { + if (mapping.Add(method.Key)) + { + builder.Append('\n'); + builder.Append(method.Key); + builder.Append('\n'); + } + } + } + + /// + /// Appends the discovered methods for the current method. + /// + /// The target instance to write to. + /// The mapping of already discovered type names. + public void AppendMethods(ref ArrayPoolStringBuilder builder, HashSet mapping) + { + foreach (KeyValuePair method in this.methods) + { + if (mapping.Remove(method.Key)) + { + builder.Append('\n'); + builder.Append(method.Value); + builder.Append('\n'); + } + } + } + + /// + /// Appends the mapped source code for the current method. + /// + /// The target instance to write to. + /// The name to bind the method to. + public void AppendMappedInvokeMethod(ref ArrayPoolStringBuilder builder, string name) + { + builder.Append(this.invokeMethod.Replace(InvokeMethodIdentifier, name)); + } +} diff --git a/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs b/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs index fd76f48f..766005b3 100644 --- a/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs @@ -6,109 +6,108 @@ using System.Linq; using System.Reflection; using ComputeSharp.Core.Extensions; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// An attribute that contains info on a processed shader method that can be executed within a shader. +/// Instances of this attribute are generated from method annotated with . +/// +/// This attribute is not meant to be directly used by applications using ComputeSharp. +[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This attribute is not intended to be used directly by user code")] +public sealed partial class ShaderMethodSourceAttribute : Attribute { /// - /// An attribute that contains info on a processed shader method that can be executed within a shader. - /// Instances of this attribute are generated from method annotated with . + /// The identifier for the invoke method, for late binding. /// - /// This attribute is not meant to be directly used by applications using ComputeSharp. - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This attribute is not intended to be used directly by user code")] - public sealed partial class ShaderMethodSourceAttribute : Attribute + internal const string InvokeMethodIdentifier = "____"; + + /// + /// The fully qualified name of the current method. + /// + private readonly string methodName; + + /// + /// The source code for the target entry point method. + /// + private readonly string invokeMethod; + + /// + /// The collection of custom types. + /// + private readonly Dictionary types; + + /// + /// The collection of processed methods. + /// + private readonly Dictionary methods; + + /// + /// The collection of discovered constants. + /// + private readonly Dictionary constants; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The fully qualified name of the current method. + /// The source code for the target entry point method. + /// The collection of custom types. + /// The collection of processed methods. + /// The collection of discovered constants. + public ShaderMethodSourceAttribute(string methodName, string invokeMethod, object[] types, object[] methods, object[] constants) { - /// - /// The identifier for the invoke method, for late binding. - /// - internal const string InvokeMethodIdentifier = "____"; - - /// - /// The fully qualified name of the current method. - /// - private readonly string methodName; - - /// - /// The source code for the target entry point method. - /// - private readonly string invokeMethod; - - /// - /// The collection of custom types. - /// - private readonly Dictionary types; - - /// - /// The collection of processed methods. - /// - private readonly Dictionary methods; - - /// - /// The collection of discovered constants. - /// - private readonly Dictionary constants; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The fully qualified name of the current method. - /// The source code for the target entry point method. - /// The collection of custom types. - /// The collection of processed methods. - /// The collection of discovered constants. - public ShaderMethodSourceAttribute(string methodName, string invokeMethod, object[] types, object[] methods, object[] constants) - { - this.methodName = methodName; - this.invokeMethod = invokeMethod; - this.types = types.Cast().ToDictionary(static c => c[0], static c => c[1]); - this.methods = methods.Cast().ToDictionary(static c => c[0], static c => c[1]); - this.constants = constants.Cast().ToDictionary(static c => c[0], static c => c[1]); - } - - /// - /// Gets the associated instance for a specified delegate. - /// - /// The input instance to get info for. - /// The name of the shader field containing . - /// The associated instance for the given delegate. - [Pure] - public static ShaderMethodSourceAttribute GetForDelegate(Delegate function, string name) - { - if (!function.Method.IsStatic) - { - return ThrowArgumentExceptionForNonStaticMethod(name); - } - - var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); - string methodName = function.Method.GetFullName(); - - foreach (var attribute in attributes) - { - if (attribute.methodName.Equals(methodName)) - { - return attribute; - } - } - - return ThrowArgumentExceptionForMissingShaderMethodAttribute(name); - } - - /// - /// Throws an when a given is not static. - /// - /// The name of the shader field containing the invalid method. - private static ShaderMethodSourceAttribute ThrowArgumentExceptionForNonStaticMethod(string name) - { - throw new ArgumentException($"The captured delegate \"{name}\" was wrapping a non static method (only static methods are supported for captured delegates).", name); - } - - /// - /// Throws an when a given doesn't have applied to it. - /// - /// The name of the shader field containing the invalid method. - private static ShaderMethodSourceAttribute ThrowArgumentExceptionForMissingShaderMethodAttribute(string name) - { - throw new ArgumentException($"The captured delegate \"{name}\" was wrapping a method without the [ShaderMethod] attribute applied to it.", name); - } + this.methodName = methodName; + this.invokeMethod = invokeMethod; + this.types = types.Cast().ToDictionary(static c => c[0], static c => c[1]); + this.methods = methods.Cast().ToDictionary(static c => c[0], static c => c[1]); + this.constants = constants.Cast().ToDictionary(static c => c[0], static c => c[1]); } -} \ No newline at end of file + + /// + /// Gets the associated instance for a specified delegate. + /// + /// The input instance to get info for. + /// The name of the shader field containing . + /// The associated instance for the given delegate. + [Pure] + public static ShaderMethodSourceAttribute GetForDelegate(Delegate function, string name) + { + if (!function.Method.IsStatic) + { + return ThrowArgumentExceptionForNonStaticMethod(name); + } + + var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); + string methodName = function.Method.GetFullName(); + + foreach (var attribute in attributes) + { + if (attribute.methodName.Equals(methodName)) + { + return attribute; + } + } + + return ThrowArgumentExceptionForMissingShaderMethodAttribute(name); + } + + /// + /// Throws an when a given is not static. + /// + /// The name of the shader field containing the invalid method. + private static ShaderMethodSourceAttribute ThrowArgumentExceptionForNonStaticMethod(string name) + { + throw new ArgumentException($"The captured delegate \"{name}\" was wrapping a non static method (only static methods are supported for captured delegates).", name); + } + + /// + /// Throws an when a given doesn't have applied to it. + /// + /// The name of the shader field containing the invalid method. + private static ShaderMethodSourceAttribute ThrowArgumentExceptionForMissingShaderMethodAttribute(string name) + { + throw new ArgumentException($"The captured delegate \"{name}\" was wrapping a method without the [ShaderMethod] attribute applied to it.", name); + } +} diff --git a/src/ComputeSharp/Core/Dispatch/DispatchSize.cs b/src/ComputeSharp/Core/Dispatch/DispatchSize.cs index d29c13cf..60b7b696 100644 --- a/src/ComputeSharp/Core/Dispatch/DispatchSize.cs +++ b/src/ComputeSharp/Core/Dispatch/DispatchSize.cs @@ -1,211 +1,210 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that indicates the size of the current shader dispatch being executed. +/// That is, it enables a shader to access info on the targeted number of invocations along each axis. +/// +public static class DispatchSize { /// - /// A that indicates the size of the current shader dispatch being executed. - /// That is, it enables a shader to access info on the targeted number of invocations along each axis. + /// Gets the total number of dispatch invocations being executed. /// - public static class DispatchSize - { - /// - /// Gets the total number of dispatch invocations being executed. - /// - public static int Count => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(Count)}"); + public static int Count => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(Count)}"); - /// - /// Gets the number of dispatch invocations being executed on the X axis. - /// - public static int X => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(X)}"); + /// + /// Gets the number of dispatch invocations being executed on the X axis. + /// + public static int X => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(X)}"); - /// - /// Gets the number of dispatch invocations being executed on the Y axis. - /// - public static int Y => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(Y)}"); + /// + /// Gets the number of dispatch invocations being executed on the Y axis. + /// + public static int Y => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(Y)}"); - /// - /// Gets the number of dispatch invocations being executed on the Z axis. - /// - public static int Z => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(Z)}"); + /// + /// Gets the number of dispatch invocations being executed on the Z axis. + /// + public static int Z => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(Z)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(XZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(YZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZZ)}"); - } + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(DispatchSize)}.{nameof(ZZZ)}"); } diff --git a/src/ComputeSharp/Core/Dispatch/GridIds.cs b/src/ComputeSharp/Core/Dispatch/GridIds.cs index d2439ae9..c8e6ff5f 100644 --- a/src/ComputeSharp/Core/Dispatch/GridIds.cs +++ b/src/ComputeSharp/Core/Dispatch/GridIds.cs @@ -1,206 +1,205 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that indicates the ids of the current thread group within the dispatch grid. +/// That is, it enables a shader to access info on the index of the current thread group with respect to the dispatch grid. +/// +public static class GridIds { /// - /// A that indicates the ids of the current thread group within the dispatch grid. - /// That is, it enables a shader to access info on the index of the current thread group with respect to the dispatch grid. + /// Gets the X id of the current thread with respect to the dispatch group. /// - public static class GridIds - { - /// - /// Gets the X id of the current thread with respect to the dispatch group. - /// - public static int X => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(X)}"); + public static int X => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(X)}"); - /// - /// Gets the Y id of the current thread with respect to the dispatch group. - /// - public static int Y => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(Y)}"); + /// + /// Gets the Y id of the current thread with respect to the dispatch group. + /// + public static int Y => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(Y)}"); - /// - /// Gets the Z id of the current thread with respect to the dispatch group. - /// - public static int Z => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(Z)}"); + /// + /// Gets the Z id of the current thread with respect to the dispatch group. + /// + public static int Z => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(Z)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(XZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(YZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZZ)}"); - } + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(GridIds)}.{nameof(ZZZ)}"); } diff --git a/src/ComputeSharp/Core/Dispatch/GroupIds.cs b/src/ComputeSharp/Core/Dispatch/GroupIds.cs index 27c639d5..56eb5865 100644 --- a/src/ComputeSharp/Core/Dispatch/GroupIds.cs +++ b/src/ComputeSharp/Core/Dispatch/GroupIds.cs @@ -1,211 +1,210 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that indicates the ids of a given GPU thread running a compute shader within a dispatch group. +/// That is, it enables a shader to access info on the index of the current thread with respect to the currently running group. +/// +public static class GroupIds { /// - /// A that indicates the ids of a given GPU thread running a compute shader within a dispatch group. - /// That is, it enables a shader to access info on the index of the current thread with respect to the currently running group. + /// Gets the flattened index of the current thread with respect to the dispatch group. /// - public static class GroupIds - { - /// - /// Gets the flattened index of the current thread with respect to the dispatch group. - /// - public static int Index => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(Index)}"); + public static int Index => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(Index)}"); - /// - /// Gets the X id of the current thread with respect to the dispatch group. - /// - public static int X => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(X)}"); + /// + /// Gets the X id of the current thread with respect to the dispatch group. + /// + public static int X => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(X)}"); - /// - /// Gets the Y id of the current thread with respect to the dispatch group. - /// - public static int Y => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(Y)}"); + /// + /// Gets the Y id of the current thread with respect to the dispatch group. + /// + public static int Y => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(Y)}"); - /// - /// Gets the Z id of the current thread with respect to the dispatch group. - /// - public static int Z => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(Z)}"); + /// + /// Gets the Z id of the current thread with respect to the dispatch group. + /// + public static int Z => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(Z)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(XZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(YZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZZ)}"); - } + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(GroupIds)}.{nameof(ZZZ)}"); } diff --git a/src/ComputeSharp/Core/Dispatch/GroupSize.cs b/src/ComputeSharp/Core/Dispatch/GroupSize.cs index 92f757bd..da359a3e 100644 --- a/src/ComputeSharp/Core/Dispatch/GroupSize.cs +++ b/src/ComputeSharp/Core/Dispatch/GroupSize.cs @@ -1,211 +1,210 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that indicates the size info of a given GPU thread group running a compute shader. +/// That is, it enables a shader to access info on the size of the thread groups being used. +/// +public static class GroupSize { /// - /// A that indicates the size info of a given GPU thread group running a compute shader. - /// That is, it enables a shader to access info on the size of the thread groups being used. + /// Gets the total size of the current thread group. /// - public static class GroupSize - { - /// - /// Gets the total size of the current thread group. - /// - public static int Count => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(Count)}"); + public static int Count => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(Count)}"); - /// - /// Gets the size of the X axis of the current thread group. - /// - public static int X => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(X)}"); + /// + /// Gets the size of the X axis of the current thread group. + /// + public static int X => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(X)}"); - /// - /// Gets the size of the Y axis of the current thread group. - /// - public static int Y => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(Y)}"); + /// + /// Gets the size of the Y axis of the current thread group. + /// + public static int Y => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(Y)}"); - /// - /// Gets the size of the Z axis of the current thread group. - /// - public static int Z => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(Z)}"); + /// + /// Gets the size of the Z axis of the current thread group. + /// + public static int Z => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(Z)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(XZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(YZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZZ)}"); - } + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(GroupSize)}.{nameof(ZZZ)}"); } diff --git a/src/ComputeSharp/Core/Dispatch/ThreadIds.Normalized.cs b/src/ComputeSharp/Core/Dispatch/ThreadIds.Normalized.cs index b637dd51..602258e3 100644 --- a/src/ComputeSharp/Core/Dispatch/ThreadIds.Normalized.cs +++ b/src/ComputeSharp/Core/Dispatch/ThreadIds.Normalized.cs @@ -1,211 +1,210 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +public static partial class ThreadIds { - /// - public static partial class ThreadIds + /// + /// A that indicates the normalized ids of a given GPU thread running a compute shader. + /// These ids represent equivalent info to those from , but normalized in the [0, 1] range. + /// The range used for the normalization is the one given by the target dispatch size (see ). + /// + public static class Normalized { /// - /// A that indicates the normalized ids of a given GPU thread running a compute shader. - /// These ids represent equivalent info to those from , but normalized in the [0, 1] range. - /// The range used for the normalization is the one given by the target dispatch size (see ). + /// Gets the normalized X id of the current thread. /// - public static class Normalized - { - /// - /// Gets the normalized X id of the current thread. - /// - public static float X => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(X)}"); + public static float X => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(X)}"); - /// - /// Gets the normalized Y id of the current thread. - /// - public static float Y => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(Y)}"); + /// + /// Gets the normalized Y id of the current thread. + /// + public static float Y => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(Y)}"); - /// - /// Gets the normalized Z id of the current thread. - /// - public static float Z => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(Z)}"); + /// + /// Gets the normalized Z id of the current thread. + /// + public static float Z => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(Z)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 XX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XX)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 XX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XX)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 XY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XY)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 XY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XY)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 XZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZ)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 XZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZ)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 YX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YX)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 YX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YX)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 YY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YY)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 YY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YY)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 YZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZ)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 YZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZ)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 ZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZX)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 ZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZX)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 ZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZY)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 ZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZY)}"); - /// - /// Gets a value with the components , . - /// - public static Float2 ZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZ)}"); + /// + /// Gets a value with the components , . + /// + public static Float2 ZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XXX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XXX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XXX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XXX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XXY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XXY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XXY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XXY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XXZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XXZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XXZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XXZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XYX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XYX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XYX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XYX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XYY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XYY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XYY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XYY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XYZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XYZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XYZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XYZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 XZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 XZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(XZZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YXX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YXX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YXX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YXX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YXY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YXY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YXY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YXY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YXZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YXZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YXZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YXZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YYX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YYX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YYX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YYX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YYY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YYY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YYY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YYY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YYZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YYZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YYZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YYZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 YZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 YZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(YZZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZXX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZXX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZXX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZXX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZXY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZXY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZXY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZXY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZXZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZXZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZXZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZXZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZYX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZYX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZYX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZYX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZYY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZYY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZYY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZYY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZYZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZYZ)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZYZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZYZ)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZX)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZZX => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZX)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZY)}"); + /// + /// Gets a value with the components , , . + /// + public static Float3 ZZY => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZY)}"); - /// - /// Gets a value with the components , , . - /// - public static Float3 ZZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZZ)}"); - } + /// + /// Gets a value with the components , , . + /// + public static Float3 ZZZ => throw new InvalidExecutionContextException($"{typeof(Normalized)}.{nameof(ZZZ)}"); } } diff --git a/src/ComputeSharp/Core/Dispatch/ThreadIds.cs b/src/ComputeSharp/Core/Dispatch/ThreadIds.cs index c7f9beed..29151b58 100644 --- a/src/ComputeSharp/Core/Dispatch/ThreadIds.cs +++ b/src/ComputeSharp/Core/Dispatch/ThreadIds.cs @@ -1,206 +1,205 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that indicates the ids of a given GPU thread running a compute shader. +/// That is, it enables a shader to access info on the current iteration index along each axis. +/// +public static partial class ThreadIds { /// - /// A that indicates the ids of a given GPU thread running a compute shader. - /// That is, it enables a shader to access info on the current iteration index along each axis. + /// Gets the X id of the current thread. /// - public static partial class ThreadIds - { - /// - /// Gets the X id of the current thread. - /// - public static int X => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(X)}"); + public static int X => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(X)}"); - /// - /// Gets the Y id of the current thread. - /// - public static int Y => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(Y)}"); + /// + /// Gets the Y id of the current thread. + /// + public static int Y => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(Y)}"); - /// - /// Gets the Z id of the current thread. - /// - public static int Z => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(Z)}"); + /// + /// Gets the Z id of the current thread. + /// + public static int Z => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(Z)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZ)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZX)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZX)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZY)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZY)}"); - /// - /// Gets an value with the components , . - /// - public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZ)}"); + /// + /// Gets an value with the components , . + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(XZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(YZZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZXX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZXX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZXY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZXY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZXZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZXZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZYX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZYX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZYY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZYY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZYZ)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZYZ)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZX)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZX)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZY)}"); + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZY)}"); - /// - /// Gets an value with the components , , . - /// - public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZZ)}"); - } + /// + /// Gets an value with the components , , . + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(ThreadIds)}.{nameof(ZZZ)}"); } diff --git a/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs b/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs index dacf8db3..274cad30 100644 --- a/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs +++ b/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs @@ -1,19 +1,18 @@ using System; -namespace ComputeSharp.Exceptions +namespace ComputeSharp.Exceptions; + +/// +/// A custom that indicates when an HLSL-only API is called from C# +/// +public sealed class InvalidExecutionContextException : InvalidOperationException { /// - /// A custom that indicates when an HLSL-only API is called from C# + /// Creates a new instance. /// - public sealed class InvalidExecutionContextException : InvalidOperationException + /// The name of the caller API. + internal InvalidExecutionContextException(string name) + : base($"The API {name} can only be used from within an HLSL shader.") { - /// - /// Creates a new instance. - /// - /// The name of the caller API. - internal InvalidExecutionContextException(string name) - : base($"The API {name} can only be used from within an HLSL shader.") - { - } } } diff --git a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs index fbff690b..5be517bf 100644 --- a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs +++ b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs @@ -2,31 +2,30 @@ using System.Linq; using System.Reflection; -namespace ComputeSharp.Core.Extensions +namespace ComputeSharp.Core.Extensions; + +/// +/// A that provides extension methods for the type. +/// +internal static class MethodInfoExtensions { /// - /// A that provides extension methods for the type. + /// Gets a fully qualified name for the input method, including parameters. /// - internal static class MethodInfoExtensions + /// The input instance. + /// A fully qualified name for , including parameters. + [Pure] + public static string GetFullName(this MethodInfo method) { - /// - /// Gets a fully qualified name for the input method, including parameters. - /// - /// The input instance. - /// A fully qualified name for , including parameters. - [Pure] - public static string GetFullName(this MethodInfo method) + var parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName)); + + if (method.IsGenericMethod) { - var parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName)); + var arguments = string.Join(", ", method.GetGenericArguments().Select(static t => t.FullName)); - if (method.IsGenericMethod) - { - var arguments = string.Join(", ", method.GetGenericArguments().Select(static t => t.FullName)); - - return $"{method.DeclaringType!.FullName!.Replace('+', '.')}.{method.Name}<{arguments}>({parameters})"; - } - - return $"{method.DeclaringType!.FullName!.Replace('+', '.')}.{method.Name}({parameters})"; + return $"{method.DeclaringType!.FullName!.Replace('+', '.')}.{method.Name}<{arguments}>({parameters})"; } + + return $"{method.DeclaringType!.FullName!.Replace('+', '.')}.{method.Name}({parameters})"; } } diff --git a/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs b/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs index 20baf93f..7ea5a097 100644 --- a/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs +++ b/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs @@ -1,43 +1,42 @@ using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; -namespace ComputeSharp.Core.Helpers +namespace ComputeSharp.Core.Helpers; + +/// +/// A with helper methods to work with alignment and padding. +/// +internal static class AlignmentHelper { /// - /// A with helper methods to work with alignment and padding. + /// Pads the input size so that its pitch is aligned to a multiple of a specified length. /// - internal static class AlignmentHelper + /// The input size to pad, if needed. + /// The target alignment. + /// The padded value relative to the given inputs. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Pad(int size, int alignment) { - /// - /// Pads the input size so that its pitch is aligned to a multiple of a specified length. - /// - /// The input size to pad, if needed. - /// The target alignment. - /// The padded value relative to the given inputs. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Pad(int size, int alignment) + return (size + alignment - 1) & ~(alignment - 1); + } + + /// + /// Aligns a given offset to a specified boundary, if a given size increment would have crossed it. + /// + /// The starting offset to align, if needed. + /// The size increment to apply to . + /// The alignment boundary to calculate the final offset. + /// A valid starting offset for the specified alignment. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int AlignToBoundary(int offset, int size, int alignment) + { + if ((uint)offset / (uint)alignment == (uint)(offset + size - 1) / (uint)alignment) { - return (size + alignment - 1) & ~(alignment - 1); + return offset; } - /// - /// Aligns a given offset to a specified boundary, if a given size increment would have crossed it. - /// - /// The starting offset to align, if needed. - /// The size increment to apply to . - /// The alignment boundary to calculate the final offset. - /// A valid starting offset for the specified alignment. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int AlignToBoundary(int offset, int size, int alignment) - { - if ((uint)offset / (uint)alignment == (uint)(offset + size - 1) / (uint)alignment) - { - return offset; - } - - return (offset + alignment - 1) & ~(alignment - 1); - } + return (offset + alignment - 1) & ~(alignment - 1); } } diff --git a/src/ComputeSharp/Core/Interfaces/IComputeShader.cs b/src/ComputeSharp/Core/Interfaces/IComputeShader.cs index d69191ad..24f0ad15 100644 --- a/src/ComputeSharp/Core/Interfaces/IComputeShader.cs +++ b/src/ComputeSharp/Core/Interfaces/IComputeShader.cs @@ -2,16 +2,15 @@ #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An representing a compute shader. +/// +public interface IComputeShader : IShader { /// - /// An representing a compute shader. + /// Executes the current compute shader. /// - public interface IComputeShader : IShader - { - /// - /// Executes the current compute shader. - /// - void Execute(); - } + void Execute(); } diff --git a/src/ComputeSharp/Core/Interfaces/IPixelShader{TPixel}.cs b/src/ComputeSharp/Core/Interfaces/IPixelShader{TPixel}.cs index bf15cf6c..9e15d6af 100644 --- a/src/ComputeSharp/Core/Interfaces/IPixelShader{TPixel}.cs +++ b/src/ComputeSharp/Core/Interfaces/IPixelShader{TPixel}.cs @@ -2,18 +2,17 @@ #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An representing a pixel shader. +/// +public interface IPixelShader : IShader + where TPixel : unmanaged { /// - /// An representing a pixel shader. + /// Executes the current pixel shader. /// - public interface IPixelShader : IShader - where TPixel : unmanaged - { - /// - /// Executes the current pixel shader. - /// - /// The pixel value for the current invocation. - TPixel Execute(); - } + /// The pixel value for the current invocation. + TPixel Execute(); } diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs index 29af4b67..98d5a513 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs @@ -1,25 +1,24 @@ using System; using System.ComponentModel; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// A base representing a data loader for a shader being dispatched. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This interface is not intended to be used directly by user code")] +public interface IDispatchDataLoader { /// - /// A base representing a data loader for a shader being dispatched. + /// Loads the captured values used by the shader to be dispatched. /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This interface is not intended to be used directly by user code")] - public interface IDispatchDataLoader - { - /// - /// Loads the captured values used by the shader to be dispatched. - /// - /// The sequence of serialized captured values. - void LoadCapturedValues(ReadOnlySpan data); + /// The sequence of serialized captured values. + void LoadCapturedValues(ReadOnlySpan data); - /// - /// Loads the captured resources used by the shader to be dispatched. - /// - /// The sequence of serialized resources. - void LoadCapturedResources(ReadOnlySpan data); - } + /// + /// Loads the captured resources used by the shader to be dispatched. + /// + /// The sequence of serialized resources. + void LoadCapturedResources(ReadOnlySpan data); } diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs index 4ad4b3ce..41d11b88 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs @@ -1,21 +1,20 @@ using System; using System.ComponentModel; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// A base representing a metadatadata loader for a shader being dispatched. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This interface is not intended to be used directly by user code")] +public interface IDispatchMetadataLoader { /// - /// A base representing a metadatadata loader for a shader being dispatched. + /// Loads an opaque metadata handle from the given shader metadata. /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This interface is not intended to be used directly by user code")] - public interface IDispatchMetadataLoader - { - /// - /// Loads an opaque metadata handle from the given shader metadata. - /// - /// The serialized metadata for the current shader. - /// The sequence of resource descriptors for the current shader. - /// The resulting opaque metadata handle. - void LoadMetadataHandle(ReadOnlySpan serializedMetadata, ReadOnlySpan resourceDescriptors, out IntPtr result); - } + /// The serialized metadata for the current shader. + /// The sequence of resource descriptors for the current shader. + /// The resulting opaque metadata handle. + void LoadMetadataHandle(ReadOnlySpan serializedMetadata, ReadOnlySpan resourceDescriptors, out IntPtr result); } diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs index df2e5523..1814a2fb 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs @@ -1,69 +1,68 @@ using System; using System.ComponentModel; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// A base representing a given shader that can be dispatched. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This interface is not intended to be used directly by user code")] +public interface IShader { /// - /// A base representing a given shader that can be dispatched. + /// Gets a unique dispatch identifier for the shader. /// + /// The unique dispatch identifier for the shader. [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This interface is not intended to be used directly by user code")] - public interface IShader + [Obsolete("This method is not intended to be used directly by user code")] + int GetDispatchId() { - /// - /// Gets a unique dispatch identifier for the shader. - /// - /// The unique dispatch identifier for the shader. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be used directly by user code")] - int GetDispatchId() - { - throw new NotImplementedException(); - } + throw new NotImplementedException(); + } - /// - /// Loads the dispatch data for the shader. - /// - /// The type of data loader being used. - /// The instance to use to load the data. - /// The device the shader is being dispatched on. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The number of iterations to run on the Z axis. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] - void LoadDispatchData(ref TDataLoader loader, GraphicsDevice device, int x, int y, int z) - where TDataLoader : struct, IDispatchDataLoader - { - throw new NotImplementedException(); - } + /// + /// Loads the dispatch data for the shader. + /// + /// The type of data loader being used. + /// The instance to use to load the data. + /// The device the shader is being dispatched on. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + void LoadDispatchData(ref TDataLoader loader, GraphicsDevice device, int x, int y, int z) + where TDataLoader : struct, IDispatchDataLoader + { + throw new NotImplementedException(); + } - /// - /// Loads an opaque metadata handle from the metadata of the current shader. - /// - /// The type of data loader being used. - /// The instance to use to load the data. - /// The resulting opaque metadata handle. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] - void LoadDispatchMetadata(ref TMetadataLoader loader, out IntPtr result) - where TMetadataLoader : struct, IDispatchMetadataLoader - { - throw new NotImplementedException(); - } + /// + /// Loads an opaque metadata handle from the metadata of the current shader. + /// + /// The type of data loader being used. + /// The instance to use to load the data. + /// The resulting opaque metadata handle. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + void LoadDispatchMetadata(ref TMetadataLoader loader, out IntPtr result) + where TMetadataLoader : struct, IDispatchMetadataLoader + { + throw new NotImplementedException(); + } - /// - /// Builds the HLSL source code for the current shader instance. - /// - /// The resulting instance containing the HLSL source. - /// The number of threads in each thread group for the X axis. - /// The number of threads in each thread group for the Y axis. - /// The number of threads in each thread group for the Z axis. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] - void BuildHlslString(out ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ) - { - throw new NotImplementedException(); - } + /// + /// Builds the HLSL source code for the current shader instance. + /// + /// The resulting instance containing the HLSL source. + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + void BuildHlslString(out ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ) + { + throw new NotImplementedException(); } } diff --git a/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs b/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs index 80e133e2..587a56d3 100644 --- a/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs +++ b/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs @@ -1,24 +1,23 @@ using System; -namespace ComputeSharp.Core.Intrinsics.Attributes +namespace ComputeSharp.Core.Intrinsics.Attributes; + +/// +/// An attribute indicating the native member name of a given HLSL intrinsic. +/// +internal sealed class HlslIntrinsicNameAttribute : Attribute { /// - /// An attribute indicating the native member name of a given HLSL intrinsic. + /// Creates a new instance with the specified parameters. /// - internal sealed class HlslIntrinsicNameAttribute : Attribute + /// The name of the HLSL intrinsic. + public HlslIntrinsicNameAttribute(string name) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The name of the HLSL intrinsic. - public HlslIntrinsicNameAttribute(string name) - { - Name = name; - } - - /// - /// Gets the name of the HLSL intrinsic. - /// - public string Name { get; } + Name = name; } + + /// + /// Gets the name of the HLSL intrinsic. + /// + public string Name { get; } } diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.cs b/src/ComputeSharp/Core/Intrinsics/Hlsl.cs index a1b321f8..535b8b38 100644 --- a/src/ComputeSharp/Core/Intrinsics/Hlsl.cs +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.cs @@ -1,320 +1,319 @@ using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the supported HLSL intrinsic functions that can be used in compute shaders. +/// +public static partial class Hlsl { /// - /// A that maps the supported HLSL intrinsic functions that can be used in compute shaders. + /// Blocks execution of all threads in a group until all memory accesses have been completed. /// - public static partial class Hlsl - { - /// - /// Blocks execution of all threads in a group until all memory accesses have been completed. - /// - /// - /// A memory barrier guarantees that outstanding memory operations have completed. - /// Threads are synchronized at GroupSync barriers. - /// This may stall a thread or threads if memory operations are in progress. - /// 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 void AllMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrier)}()"); + /// + /// A memory barrier guarantees that outstanding memory operations have completed. + /// Threads are synchronized at GroupSync barriers. + /// This may stall a thread or threads if memory operations are in progress. + /// 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 void AllMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrier)}()"); - /// - /// Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call. - /// - /// - /// A memory barrier guarantees that outstanding memory operations have completed. - /// Threads are synchronized at GroupSync barriers. - /// This may stall a thread or threads if memory operations are in progress. - /// 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 void AllMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrierWithGroupSync)}()"); + /// + /// Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call. + /// + /// + /// A memory barrier guarantees that outstanding memory operations have completed. + /// Threads are synchronized at GroupSync barriers. + /// This may stall a thread or threads if memory operations are in progress. + /// 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 void AllMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrierWithGroupSync)}()"); - /// - /// Blocks execution of all threads in a group until all device memory accesses have been completed. - /// - /// 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 void DeviceMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrier)}()"); + /// + /// Blocks execution of all threads in a group until all device memory accesses have been completed. + /// + /// 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 void DeviceMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrier)}()"); - /// - /// Blocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call. - /// - /// 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 void DeviceMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrierWithGroupSync)}()"); + /// + /// Blocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call. + /// + /// 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 void DeviceMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrierWithGroupSync)}()"); - /// - /// Blocks execution of all threads in a group until all group shared accesses have been completed. - /// - /// 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 void GroupMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrier)}()"); + /// + /// Blocks execution of all threads in a group until all group shared accesses have been completed. + /// + /// 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 void GroupMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrier)}()"); - /// - /// Blocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call. - /// - /// 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 void GroupMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrierWithGroupSync)}()"); + /// + /// Blocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call. + /// + /// 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 void GroupMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrierWithGroupSync)}()"); - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedAdd(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedAdd(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedAdd(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedAdd(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value. - /// The original input value. - /// 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 void InterlockedAdd(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + /// 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 void InterlockedAdd(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value. - /// The original input value. - /// 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 void InterlockedAdd(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + /// 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 void InterlockedAdd(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedAnd(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedAnd(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedAnd(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedAnd(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value. - /// The original input value. - /// 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 void InterlockedAnd(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + /// 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 void InterlockedAnd(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value. - /// The original input value. - /// 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 void InterlockedAnd(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + /// 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 void InterlockedAnd(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Atomically compares the destination with the comparison value. If they are identical, the destination - /// is overwritten with the input value. The original value is set to the destination's original value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - /// The original value. - /// 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 void InterlockedCompareExchange(ref int destination, int comparison, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Atomically compares the destination with the comparison value. If they are identical, the destination + /// is overwritten with the input value. The original value is set to the destination's original value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + /// The original value. + /// 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 void InterlockedCompareExchange(ref int destination, int comparison, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Atomically compares the destination with the comparison value. If they are identical, the destination - /// is overwritten with the input value. The original value is set to the destination's original value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - /// The original value. - /// 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 void InterlockedCompareExchange(ref uint destination, uint comparison, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Atomically compares the destination with the comparison value. If they are identical, the destination + /// is overwritten with the input value. The original value is set to the destination's original value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + /// The original value. + /// 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 void InterlockedCompareExchange(ref uint destination, uint comparison, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Atomically compares the destination to the comparison value. If they - /// are identical, the destination is overwritten with the input value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - /// 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 void InterlockedCompareStore(ref int destination, int comparison, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Atomically compares the destination to the comparison value. If they + /// are identical, the destination is overwritten with the input value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + /// 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 void InterlockedCompareStore(ref int destination, int comparison, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Atomically compares the destination to the comparison value. If they - /// are identical, the destination is overwritten with the input value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - /// 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 void InterlockedCompareStore(ref uint destination, uint comparison, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Atomically compares the destination to the comparison value. If they + /// are identical, the destination is overwritten with the input value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + /// 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 void InterlockedCompareStore(ref uint destination, uint comparison, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Assigns value to dest and returns the original value. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedExchange(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Assigns value to dest and returns the original value. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedExchange(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Assigns value to dest and returns the original value. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedExchange(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Assigns value to dest and returns the original value. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedExchange(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedMax(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedMax(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedMax(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedMax(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedMax(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedMax(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedMax(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedMax(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedMin(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedMin(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedMin(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedMin(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedMin(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedMin(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedMin(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedMin(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedOr(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedOr(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedOr(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedOr(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedOr(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedOr(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedOr(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedOr(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedXor(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedXor(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - /// 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 void InterlockedXor(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)})"); + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + /// 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 void InterlockedXor(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)})"); - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedXor(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedXor(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - /// The original value. - /// 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 void InterlockedXor(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); - } + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + /// The original value. + /// 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 void InterlockedXor(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); } diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs b/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs index 1dfe6e6d..6369f90b 100644 --- a/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs @@ -2,18041 +2,18040 @@ using ComputeSharp.Core.Intrinsics.Attributes; using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +public static partial class Hlsl { - /// - public static partial class Hlsl - { - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static int Abs(int x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int2 Abs(Int2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int3 Abs(Int3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int4 Abs(Int4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int1x1 Abs(Int1x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int1x2 Abs(Int1x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int1x3 Abs(Int1x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int1x4 Abs(Int1x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int2x1 Abs(Int2x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int2x2 Abs(Int2x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int2x3 Abs(Int2x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int2x4 Abs(Int2x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int3x1 Abs(Int3x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int3x2 Abs(Int3x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int3x3 Abs(Int3x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int3x4 Abs(Int3x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int4x1 Abs(Int4x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int4x2 Abs(Int4x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int4x3 Abs(Int4x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Int4x4 Abs(Int4x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static float Abs(float x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float2 Abs(Float2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float3 Abs(Float3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float4 Abs(Float4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float1x1 Abs(Float1x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float1x2 Abs(Float1x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float1x3 Abs(Float1x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float1x4 Abs(Float1x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float2x1 Abs(Float2x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float2x2 Abs(Float2x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float2x3 Abs(Float2x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float2x4 Abs(Float2x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float3x1 Abs(Float3x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float3x2 Abs(Float3x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float3x3 Abs(Float3x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float3x4 Abs(Float3x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float4x1 Abs(Float4x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float4x2 Abs(Float4x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float4x3 Abs(Float4x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Float4x4 Abs(Float4x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static double Abs(double x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double2 Abs(Double2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double3 Abs(Double3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double4 Abs(Double4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double1x1 Abs(Double1x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double1x2 Abs(Double1x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double1x3 Abs(Double1x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double1x4 Abs(Double1x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double2x1 Abs(Double2x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double2x2 Abs(Double2x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double2x3 Abs(Double2x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double2x4 Abs(Double2x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double3x1 Abs(Double3x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double3x2 Abs(Double3x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double3x3 Abs(Double3x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double3x4 Abs(Double3x4 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double4x1 Abs(Double4x1 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double4x2 Abs(Double4x2 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double4x3 Abs(Double4x3 x) => default; - - /// - /// Returns the absolute value of the specified value. - /// - /// The specified value. - /// The absolute value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("abs")] - public static Double4x4 Abs(Double4x4 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static float Acos(float x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float2 Acos(Float2 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float3 Acos(Float3 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float4 Acos(Float4 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float1x1 Acos(Float1x1 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float1x2 Acos(Float1x2 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float1x3 Acos(Float1x3 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float1x4 Acos(Float1x4 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float2x1 Acos(Float2x1 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float2x2 Acos(Float2x2 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float2x3 Acos(Float2x3 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float2x4 Acos(Float2x4 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float3x1 Acos(Float3x1 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float3x2 Acos(Float3x2 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float3x3 Acos(Float3x3 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float3x4 Acos(Float3x4 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float4x1 Acos(Float4x1 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float4x2 Acos(Float4x2 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float4x3 Acos(Float4x3 x) => default; - - /// - /// Returns the arccosine of the specified value. - /// - /// The specified value. Each component should be a floating-point within the range [-1, 1]. - /// The arccosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("acos")] - public static Float4x4 Acos(Float4x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(int x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int1x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int1x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int1x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int1x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int2x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int2x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int2x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int2x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int3x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int3x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int3x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int3x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int4x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int4x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int4x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Int4x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(float x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float1x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float1x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float1x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float1x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float2x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float2x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float2x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float2x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float3x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float3x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float3x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float3x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float4x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float4x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float4x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Float4x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(bool x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool1x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool1x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool1x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool1x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool2x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool2x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool2x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool2x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool3x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool3x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool3x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool3x4 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool4x1 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool4x2 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool4x3 x) => default; - - /// - /// Determines if all components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not all components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("all")] - public static bool All(Bool4x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(int x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int1x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int1x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int1x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int1x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int2x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int2x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int2x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int2x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int3x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int3x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int3x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int3x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int4x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int4x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int4x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Int4x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(float x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float1x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float1x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float1x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float1x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float2x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float2x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float2x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float2x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float3x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float3x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float3x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float3x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float4x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float4x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float4x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Float4x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(bool x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool1x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool1x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool1x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool1x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool2x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool2x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool2x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool2x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool3x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool3x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool3x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool3x4 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool4x1 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool4x2 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool4x3 x) => default; - - /// - /// Determines if any components of the specified value are non-zero. - /// - /// The specified value. - /// Whether or not any components of the parameter are non-zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("any")] - public static bool Any(Bool4x4 x) => default; - - /// - /// Reinterprets a cast value (two 32-bit values) into a double precision floating-point value. - /// - /// The low 32-bit pattern of the input value. - /// The high 32-bit pattern of the input value. - /// The input (two 32-bit values) recast as a double precision floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asdouble")] - public static double AsDouble(uint lowbits, uint highbits) => default; - - /// - /// Reinterprets a cast value (two 32-bit values) into a double precision floating-point value. - /// - /// The low 32-bit pattern of the input value. - /// The high 32-bit pattern of the input value. - /// The input (two 32-bit values) recast as a double precision floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asdouble")] - public static Double2 AsDouble(UInt2 lowbits, UInt2 highbits) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static float AsFloat(int x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2 AsFloat(Int2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3 AsFloat(Int3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4 AsFloat(Int4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x1 AsFloat(Int1x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x2 AsFloat(Int1x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x3 AsFloat(Int1x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x4 AsFloat(Int1x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x1 AsFloat(Int2x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x2 AsFloat(Int2x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x3 AsFloat(Int2x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x4 AsFloat(Int2x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x1 AsFloat(Int3x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x2 AsFloat(Int3x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x3 AsFloat(Int3x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x4 AsFloat(Int3x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x1 AsFloat(Int4x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x2 AsFloat(Int4x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x3 AsFloat(Int4x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x4 AsFloat(Int4x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static float AsFloat(uint x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2 AsFloat(UInt2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3 AsFloat(UInt3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4 AsFloat(UInt4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x1 AsFloat(UInt1x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x2 AsFloat(UInt1x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x3 AsFloat(UInt1x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float1x4 AsFloat(UInt1x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x1 AsFloat(UInt2x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x2 AsFloat(UInt2x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x3 AsFloat(UInt2x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float2x4 AsFloat(UInt2x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x1 AsFloat(UInt3x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x2 AsFloat(UInt3x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x3 AsFloat(UInt3x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float3x4 AsFloat(UInt3x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x1 AsFloat(UInt4x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x2 AsFloat(UInt4x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x3 AsFloat(UInt4x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as a floating-point number. - /// - /// The input value. - /// The input interpreted as a floating-point number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asfloat")] - public static Float4x4 AsFloat(UInt4x4 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static float Asin(float x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float2 Asin(Float2 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float3 Asin(Float3 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float4 Asin(Float4 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float1x1 Asin(Float1x1 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float1x2 Asin(Float1x2 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float1x3 Asin(Float1x3 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float1x4 Asin(Float1x4 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float2x1 Asin(Float2x1 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float2x2 Asin(Float2x2 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float2x3 Asin(Float2x3 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float2x4 Asin(Float2x4 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float3x1 Asin(Float3x1 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float3x2 Asin(Float3x2 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float3x3 Asin(Float3x3 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float3x4 Asin(Float3x4 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float4x1 Asin(Float4x1 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float4x2 Asin(Float4x2 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float4x3 Asin(Float4x3 x) => default; - - /// - /// Returns the arcsine of the specified value. - /// - /// The specified value. - /// The arcsine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asin")] - public static Float4x4 Asin(Float4x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static int AsInt(float x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2 AsInt(Float2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3 AsInt(Float3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4 AsInt(Float4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x1 AsInt(Float1x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x2 AsInt(Float1x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x3 AsInt(Float1x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x4 AsInt(Float1x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x1 AsInt(Float2x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x2 AsInt(Float2x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x3 AsInt(Float2x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x4 AsInt(Float2x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x1 AsInt(Float3x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x2 AsInt(Float3x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x3 AsInt(Float3x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x4 AsInt(Float3x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x1 AsInt(Float4x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x2 AsInt(Float4x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x3 AsInt(Float4x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x4 AsInt(Float4x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static int AsInt(uint x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2 AsInt(UInt2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3 AsInt(UInt3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4 AsInt(UInt4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x1 AsInt(UInt1x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x2 AsInt(UInt1x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x3 AsInt(UInt1x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int1x4 AsInt(UInt1x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x1 AsInt(UInt2x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x2 AsInt(UInt2x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x3 AsInt(UInt2x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int2x4 AsInt(UInt2x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x1 AsInt(UInt3x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x2 AsInt(UInt3x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x3 AsInt(UInt3x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int3x4 AsInt(UInt3x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x1 AsInt(UInt4x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x2 AsInt(UInt4x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x3 AsInt(UInt4x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an integer number. - /// - /// The input value. - /// The input interpreted as an integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asint")] - public static Int4x4 AsInt(UInt4x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static uint AsUInt(float x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2 AsUInt(Float2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3 AsUInt(Float3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4 AsUInt(Float4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x1 AsUInt(Float1x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x2 AsUInt(Float1x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x3 AsUInt(Float1x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x4 AsUInt(Float1x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x1 AsUInt(Float2x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x2 AsUInt(Float2x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x3 AsUInt(Float2x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x4 AsUInt(Float2x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x1 AsUInt(Float3x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x2 AsUInt(Float3x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x3 AsUInt(Float3x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x4 AsUInt(Float3x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x1 AsUInt(Float4x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x2 AsUInt(Float4x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x3 AsUInt(Float4x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x4 AsUInt(Float4x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static uint AsUInt(int x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2 AsUInt(Int2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3 AsUInt(Int3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4 AsUInt(Int4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x1 AsUInt(Int1x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x2 AsUInt(Int1x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x3 AsUInt(Int1x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt1x4 AsUInt(Int1x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x1 AsUInt(Int2x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x2 AsUInt(Int2x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x3 AsUInt(Int2x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt2x4 AsUInt(Int2x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x1 AsUInt(Int3x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x2 AsUInt(Int3x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x3 AsUInt(Int3x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt3x4 AsUInt(Int3x4 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x1 AsUInt(Int4x1 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x2 AsUInt(Int4x2 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x3 AsUInt(Int4x3 x) => default; - - /// - /// Interprets the bit pattern of an input value as an unsigned integer number. - /// - /// The input value. - /// The input interpreted as an unsigned integer number. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("asuint")] - public static UInt4x4 AsUInt(Int4x4 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static float Atan(float x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float2 Atan(Float2 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float3 Atan(Float3 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float4 Atan(Float4 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float1x1 Atan(Float1x1 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float1x2 Atan(Float1x2 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float1x3 Atan(Float1x3 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float1x4 Atan(Float1x4 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float2x1 Atan(Float2x1 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float2x2 Atan(Float2x2 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float2x3 Atan(Float2x3 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float2x4 Atan(Float2x4 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float3x1 Atan(Float3x1 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float3x2 Atan(Float3x2 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float3x3 Atan(Float3x3 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float3x4 Atan(Float3x4 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float4x1 Atan(Float4x1 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float4x2 Atan(Float4x2 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float4x3 Atan(Float4x3 x) => default; - - /// - /// Returns the arctangent of the specified value. - /// - /// The specified value. - /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("atan")] - public static Float4x4 Atan(Float4x4 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static float Atan2(float y, float x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float2 Atan2(Float2 y, Float2 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float3 Atan2(Float3 y, Float3 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float4 Atan2(Float4 y, Float4 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float1x1 Atan2(Float1x1 y, Float1x1 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float1x2 Atan2(Float1x2 y, Float1x2 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float1x3 Atan2(Float1x3 y, Float1x3 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float1x4 Atan2(Float1x4 y, Float1x4 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float2x1 Atan2(Float2x1 y, Float2x1 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float2x2 Atan2(Float2x2 y, Float2x2 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float2x3 Atan2(Float2x3 y, Float2x3 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float2x4 Atan2(Float2x4 y, Float2x4 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float3x1 Atan2(Float3x1 y, Float3x1 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float3x2 Atan2(Float3x2 y, Float3x2 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float3x3 Atan2(Float3x3 y, Float3x3 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float3x4 Atan2(Float3x4 y, Float3x4 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float4x1 Atan2(Float4x1 y, Float4x1 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float4x2 Atan2(Float4x2 y, Float4x2 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float4x3 Atan2(Float4x3 y, Float4x3 x) => default; - - /// - /// Returns the arctangent of two values (y, x). - /// - /// The y value. - /// The x value. - /// The arctangent 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. - [Pure] - [HlslIntrinsicName("atan2")] - public static Float4x4 Atan2(Float4x4 y, Float4x4 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static float Ceil(float x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float2 Ceil(Float2 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float3 Ceil(Float3 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float4 Ceil(Float4 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float1x1 Ceil(Float1x1 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float1x2 Ceil(Float1x2 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float1x3 Ceil(Float1x3 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float1x4 Ceil(Float1x4 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float2x1 Ceil(Float2x1 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float2x2 Ceil(Float2x2 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float2x3 Ceil(Float2x3 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float2x4 Ceil(Float2x4 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float3x1 Ceil(Float3x1 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float3x2 Ceil(Float3x2 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float3x3 Ceil(Float3x3 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float3x4 Ceil(Float3x4 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float4x1 Ceil(Float4x1 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float4x2 Ceil(Float4x2 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float4x3 Ceil(Float4x3 x) => default; - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value. - /// - /// The specified value. - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ceil")] - public static Float4x4 Ceil(Float4x4 x) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static float Clamp(float x, float min, float max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float2 Clamp(Float2 x, Float2 min, Float2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float3 Clamp(Float3 x, Float3 min, Float3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float4 Clamp(Float4 x, Float4 min, Float4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float1x1 Clamp(Float1x1 x, Float1x1 min, Float1x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float1x2 Clamp(Float1x2 x, Float1x2 min, Float1x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float1x3 Clamp(Float1x3 x, Float1x3 min, Float1x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float1x4 Clamp(Float1x4 x, Float1x4 min, Float1x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float2x1 Clamp(Float2x1 x, Float2x1 min, Float2x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float2x2 Clamp(Float2x2 x, Float2x2 min, Float2x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float2x3 Clamp(Float2x3 x, Float2x3 min, Float2x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float2x4 Clamp(Float2x4 x, Float2x4 min, Float2x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float3x1 Clamp(Float3x1 x, Float3x1 min, Float3x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float3x2 Clamp(Float3x2 x, Float3x2 min, Float3x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float3x3 Clamp(Float3x3 x, Float3x3 min, Float3x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float3x4 Clamp(Float3x4 x, Float3x4 min, Float3x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float4x1 Clamp(Float4x1 x, Float4x1 min, Float4x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float4x2 Clamp(Float4x2 x, Float4x2 min, Float4x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float4x3 Clamp(Float4x3 x, Float4x3 min, Float4x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Float4x4 Clamp(Float4x4 x, Float4x4 min, Float4x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static int Clamp(int x, int min, int max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int2 Clamp(Int2 x, Int2 min, Int2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int3 Clamp(Int3 x, Int3 min, Int3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int4 Clamp(Int4 x, Int4 min, Int4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int1x1 Clamp(Int1x1 x, Int1x1 min, Int1x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int1x2 Clamp(Int1x2 x, Int1x2 min, Int1x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int1x3 Clamp(Int1x3 x, Int1x3 min, Int1x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int1x4 Clamp(Int1x4 x, Int1x4 min, Int1x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int2x1 Clamp(Int2x1 x, Int2x1 min, Int2x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int2x2 Clamp(Int2x2 x, Int2x2 min, Int2x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int2x3 Clamp(Int2x3 x, Int2x3 min, Int2x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int2x4 Clamp(Int2x4 x, Int2x4 min, Int2x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int3x1 Clamp(Int3x1 x, Int3x1 min, Int3x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int3x2 Clamp(Int3x2 x, Int3x2 min, Int3x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int3x3 Clamp(Int3x3 x, Int3x3 min, Int3x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int3x4 Clamp(Int3x4 x, Int3x4 min, Int3x4 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int4x1 Clamp(Int4x1 x, Int4x1 min, Int4x1 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int4x2 Clamp(Int4x2 x, Int4x2 min, Int4x2 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int4x3 Clamp(Int4x3 x, Int4x3 min, Int4x3 max) => default; - - /// - /// Clamps the specified value to the specified minimum and maximum range. - /// - /// The value to clamp. - /// The specified minimum range. - /// The specified maximum range. - /// The clamped value for the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("clamp")] - public static Int4x4 Clamp(Int4x4 x, Int4x4 min, Int4x4 max) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static float Cos(float x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float2 Cos(Float2 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float3 Cos(Float3 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float4 Cos(Float4 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float1x1 Cos(Float1x1 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float1x2 Cos(Float1x2 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float1x3 Cos(Float1x3 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float1x4 Cos(Float1x4 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float2x1 Cos(Float2x1 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float2x2 Cos(Float2x2 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float2x3 Cos(Float2x3 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float2x4 Cos(Float2x4 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float3x1 Cos(Float3x1 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float3x2 Cos(Float3x2 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float3x3 Cos(Float3x3 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float3x4 Cos(Float3x4 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float4x1 Cos(Float4x1 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float4x2 Cos(Float4x2 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float4x3 Cos(Float4x3 x) => default; - - /// - /// Returns the cosine of the specified value. - /// - /// The specified value, in radians. - /// The cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cos")] - public static Float4x4 Cos(Float4x4 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static float Cosh(float x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float2 Cosh(Float2 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float3 Cosh(Float3 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float4 Cosh(Float4 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float1x1 Cosh(Float1x1 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float1x2 Cosh(Float1x2 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float1x3 Cosh(Float1x3 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float1x4 Cosh(Float1x4 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float2x1 Cosh(Float2x1 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float2x2 Cosh(Float2x2 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float2x3 Cosh(Float2x3 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float2x4 Cosh(Float2x4 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float3x1 Cosh(Float3x1 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float3x2 Cosh(Float3x2 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float3x3 Cosh(Float3x3 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float3x4 Cosh(Float3x4 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float4x1 Cosh(Float4x1 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float4x2 Cosh(Float4x2 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float4x3 Cosh(Float4x3 x) => default; - - /// - /// Returns the hyperbolic cosine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic cosine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cosh")] - public static Float4x4 Cosh(Float4x4 x) => default; - - /// - /// Counts the number of bits (per component) in the input integer. - /// - /// The input value. - /// The number of bits. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("countbits")] - public static uint CountBits(uint x) => default; - - /// - /// Counts the number of bits (per component) in the input integer. - /// - /// The input value. - /// The number of bits. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("countbits")] - public static UInt2 CountBits(UInt2 x) => default; - - /// - /// Counts the number of bits (per component) in the input integer. - /// - /// The input value. - /// The number of bits. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("countbits")] - public static UInt3 CountBits(UInt3 x) => default; - - /// - /// Counts the number of bits (per component) in the input integer. - /// - /// The input value. - /// The number of bits. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("countbits")] - public static UInt4 CountBits(UInt4 x) => default; - - /// - /// Returns the cross product of two floating-point, 3D vectors. - /// - /// The first floating-point, 3D vector. - /// The second floating-point, 3D vector. - /// The number of bits. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("cross")] - public static Float3 Cross(Float3 x, Float3 y) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static float Degrees(float x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float2 Degrees(Float2 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float3 Degrees(Float3 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float4 Degrees(Float4 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float1x1 Degrees(Float1x1 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float1x2 Degrees(Float1x2 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float1x3 Degrees(Float1x3 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float1x4 Degrees(Float1x4 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float2x1 Degrees(Float2x1 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float2x2 Degrees(Float2x2 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float2x3 Degrees(Float2x3 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float2x4 Degrees(Float2x4 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float3x1 Degrees(Float3x1 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float3x2 Degrees(Float3x2 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float3x3 Degrees(Float3x3 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float3x4 Degrees(Float3x4 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float4x1 Degrees(Float4x1 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float4x2 Degrees(Float4x2 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float4x3 Degrees(Float4x3 x) => default; - - /// - /// Converts the specified value from radians to degrees. - /// - /// The specified value. - /// The result of converting the parameter from radians to degrees. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("degrees")] - public static Float4x4 Degrees(Float4x4 x) => default; - - /// - /// Returns the determinant of the specified floating-point, square matrix. - /// - /// The specified value. - /// The floating-point, scalar value that represents the determinant of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("determinant")] - public static float Determinant(Float1x1 m) => default; - - /// - /// Returns the determinant of the specified floating-point, square matrix. - /// - /// The specified value. - /// The floating-point, scalar value that represents the determinant of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("determinant")] - public static float Determinant(Float2x2 m) => default; - - /// - /// Returns the determinant of the specified floating-point, square matrix. - /// - /// The specified value. - /// The floating-point, scalar value that represents the determinant of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("determinant")] - public static float Determinant(Float3x3 m) => default; - - /// - /// Returns the determinant of the specified floating-point, square matrix. - /// - /// The specified value. - /// The floating-point, scalar value that represents the determinant of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("determinant")] - public static float Determinant(Float4x4 m) => default; - - /// - /// Returns a distance scalar between two vectors. - /// - /// The first floating-point vector to compare. - /// The second floating-point vector to compare. - /// A floating-point, scalar value that represents the distance between the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("distance")] - public static Float2 Distance(Float2 x, Float2 y) => default; - - /// - /// Returns a distance scalar between two vectors. - /// - /// The first floating-point vector to compare. - /// The second floating-point vector to compare. - /// A floating-point, scalar value that represents the distance between the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("distance")] - public static Float3 Distance(Float3 x, Float3 y) => default; - - /// - /// Returns a distance scalar between two vectors. - /// - /// The first floating-point vector to compare. - /// The second floating-point vector to compare. - /// A floating-point, scalar value that represents the distance between the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("distance")] - public static Float4 Distance(Float4 x, Float4 y) => default; - - /// - /// Returns the dot product of two vectors. - /// - /// The first vector. - /// The second vector. - /// The dot product of the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("dot")] - public static float Dot(Float2 x, Float2 y) => default; - - /// - /// Returns the dot product of two vectors. - /// - /// The first vector. - /// The second vector. - /// The dot product of the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("dot")] - public static float Dot(Float3 x, Float3 y) => default; - - /// - /// Returns the dot product of two vectors. - /// - /// The first vector. - /// The second vector. - /// The dot product of the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("dot")] - public static float Dot(Float4 x, Float4 y) => default; - - /// - /// Returns the dot product of two vectors. - /// - /// The first vector. - /// The second vector. - /// The dot product of the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("dot")] - public static int Dot(Int2 x, Int2 y) => default; - - /// - /// Returns the dot product of two vectors. - /// - /// The first vector. - /// The second vector. - /// The dot product of the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("dot")] - public static int Dot(Int3 x, Int3 y) => default; - - /// - /// Returns the dot product of two vectors. - /// - /// The first vector. - /// The second vector. - /// The dot product of the parameter and the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("dot")] - public static int Dot(Int4 x, Int4 y) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static float Exp(float x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float2 Exp(Float2 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float3 Exp(Float3 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float4 Exp(Float4 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float1x1 Exp(Float1x1 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float1x2 Exp(Float1x2 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float1x3 Exp(Float1x3 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float1x4 Exp(Float1x4 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float2x1 Exp(Float2x1 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float2x2 Exp(Float2x2 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float2x3 Exp(Float2x3 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float2x4 Exp(Float2x4 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float3x1 Exp(Float3x1 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float3x2 Exp(Float3x2 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float3x3 Exp(Float3x3 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float3x4 Exp(Float3x4 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float4x1 Exp(Float4x1 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float4x2 Exp(Float4x2 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float4x3 Exp(Float4x3 x) => default; - - /// - /// Returns the base-e exponential of the specified value. - /// - /// The specified value. - /// The base-e exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp")] - public static Float4x4 Exp(Float4x4 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static float Exp2(float x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float2 Exp2(Float2 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float3 Exp2(Float3 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float4 Exp2(Float4 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float1x1 Exp2(Float1x1 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float1x2 Exp2(Float1x2 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float1x3 Exp2(Float1x3 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float1x4 Exp2(Float1x4 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float2x1 Exp2(Float2x1 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float2x2 Exp2(Float2x2 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float2x3 Exp2(Float2x3 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float2x4 Exp2(Float2x4 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float3x1 Exp2(Float3x1 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float3x2 Exp2(Float3x2 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float3x3 Exp2(Float3x3 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float3x4 Exp2(Float3x4 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float4x1 Exp2(Float4x1 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float4x2 Exp2(Float4x2 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float4x3 Exp2(Float4x3 x) => default; - - /// - /// Returns the base-2 exponential of the specified value. - /// - /// The specified value. - /// The base-2 exponential of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("exp2")] - public static Float4x4 Exp2(Float4x4 x) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static int FirstBitHigh(int value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static Int2 FirstBitHigh(Int2 value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static Int3 FirstBitHigh(Int3 value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static Int4 FirstBitHigh(Int4 value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static uint FirstBitHigh(uint value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static UInt2 FirstBitHigh(UInt2 value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static UInt3 FirstBitHigh(UInt3 value) => default; - - /// - /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbithigh")] - public static UInt4 FirstBitHigh(UInt4 value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static int FirstBitLow(int value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static Int2 FirstBitLow(Int2 value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static Int3 FirstBitLow(Int3 value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static Int4 FirstBitLow(Int4 value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static uint FirstBitLow(uint value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static UInt2 FirstBitLow(UInt2 value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static UInt3 FirstBitLow(UInt3 value) => default; - - /// - /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. - /// - /// The input value. - /// The location of the first set bit. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("firstbitlow")] - public static UInt4 FirstBitLow(UInt4 value) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static float Floor(float x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float2 Floor(Float2 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float3 Floor(Float3 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float4 Floor(Float4 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float1x1 Floor(Float1x1 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float1x2 Floor(Float1x2 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float1x3 Floor(Float1x3 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float1x4 Floor(Float1x4 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float2x1 Floor(Float2x1 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float2x2 Floor(Float2x2 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float2x3 Floor(Float2x3 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float2x4 Floor(Float2x4 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float3x1 Floor(Float3x1 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float3x2 Floor(Float3x2 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float3x3 Floor(Float3x3 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float3x4 Floor(Float3x4 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float4x1 Floor(Float4x1 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float4x2 Floor(Float4x2 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float4x3 Floor(Float4x3 x) => default; - - /// - /// Returns the largest integer that is less than or equal to the specified value. - /// - /// The specified value. - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("floor")] - public static Float4x4 Floor(Float4x4 x) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static double FusedMultiplyAccumulate(double a, double b, double c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double2 FusedMultiplyAccumulate(Double2 a, Double2 b, Double2 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double3 FusedMultiplyAccumulate(Double3 a, Double3 b, Double3 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double4 FusedMultiplyAccumulate(Double4 a, Double4 b, Double4 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double1x1 FusedMultiplyAccumulate(Double1x1 a, Double1x1 b, Double1x1 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double1x2 FusedMultiplyAccumulate(Double1x2 a, Double1x2 b, Double1x2 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double1x3 FusedMultiplyAccumulate(Double1x3 a, Double1x3 b, Double1x3 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double1x4 FusedMultiplyAccumulate(Double1x4 a, Double1x4 b, Double1x4 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double2x1 FusedMultiplyAccumulate(Double2x1 a, Double2x1 b, Double2x1 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double2x2 FusedMultiplyAccumulate(Double2x2 a, Double2x2 b, Double2x2 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double2x3 FusedMultiplyAccumulate(Double2x3 a, Double2x3 b, Double2x3 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double2x4 FusedMultiplyAccumulate(Double2x4 a, Double2x4 b, Double2x4 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double3x1 FusedMultiplyAccumulate(Double3x1 a, Double3x1 b, Double3x1 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double3x2 FusedMultiplyAccumulate(Double3x2 a, Double3x2 b, Double3x2 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double3x3 FusedMultiplyAccumulate(Double3x3 a, Double3x3 b, Double3x3 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double3x4 FusedMultiplyAccumulate(Double3x4 a, Double3x4 b, Double3x4 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double4x1 FusedMultiplyAccumulate(Double4x1 a, Double4x1 b, Double4x1 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double4x2 FusedMultiplyAccumulate(Double4x2 a, Double4x2 b, Double4x2 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double4x3 FusedMultiplyAccumulate(Double4x3 a, Double4x3 b, Double4x3 c) => default; - - /// - /// Returns the double-precision fused multiply-addition of a * b + c. - /// - /// The first value in the fused multiply-addition. - /// The second value in the fused multiply-addition. - /// The third value in the fused multiply-addition. - /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fma")] - public static Double4x4 FusedMultiplyAccumulate(Double4x4 a, Double4x4 b, Double4x4 c) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static float Fmod(float x, float y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float2 Fmod(Float2 x, Float2 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float3 Fmod(Float3 x, Float3 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float4 Fmod(Float4 x, Float4 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float1x1 Fmod(Float1x1 x, Float1x1 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float1x2 Fmod(Float1x2 x, Float1x2 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float1x3 Fmod(Float1x3 x, Float1x3 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float1x4 Fmod(Float1x4 x, Float1x4 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float2x1 Fmod(Float2x1 x, Float2x1 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float2x2 Fmod(Float2x2 x, Float2x2 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float2x3 Fmod(Float2x3 x, Float2x3 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float2x4 Fmod(Float2x4 x, Float2x4 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float3x1 Fmod(Float3x1 x, Float3x1 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float3x2 Fmod(Float3x2 x, Float3x2 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float3x3 Fmod(Float3x3 x, Float3x3 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float3x4 Fmod(Float3x4 x, Float3x4 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float4x1 Fmod(Float4x1 x, Float4x1 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float4x2 Fmod(Float4x2 x, Float4x2 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float4x3 Fmod(Float4x3 x, Float4x3 y) => default; - - /// - /// Returns the floating-point remainder of x / y. - /// - /// The floating-point dividend. - /// The floating-point divisor. - /// The floating-point remainder of the x parameter divided by the y parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("fmod")] - public static Float4x4 Fmod(Float4x4 x, Float4x4 y) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static float Frac(float x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float2 Frac(Float2 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float3 Frac(Float3 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float4 Frac(Float4 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float1x1 Frac(Float1x1 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float1x2 Frac(Float1x2 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float1x3 Frac(Float1x3 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float1x4 Frac(Float1x4 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float2x1 Frac(Float2x1 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float2x2 Frac(Float2x2 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float2x3 Frac(Float2x3 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float2x4 Frac(Float2x4 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float3x1 Frac(Float3x1 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float3x2 Frac(Float3x2 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float3x3 Frac(Float3x3 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float3x4 Frac(Float3x4 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float4x1 Frac(Float4x1 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float4x2 Frac(Float4x2 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float4x3 Frac(Float4x3 x) => default; - - /// - /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. - /// - /// The specified value. - /// The fractional part of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("frac")] - public static Float4x4 Frac(Float4x4 x) => default; - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static float Frexp(float x, out float exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(float)}, {typeof(float)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float2 Frexp(Float2 x, out Float2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2)}, {typeof(Float2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float3 Frexp(Float3 x, out Float3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3)}, {typeof(Float3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float4 Frexp(Float4 x, out Float4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4)}, {typeof(Float4)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float1x1 Frexp(Float1x1 x, out Float1x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x1)}, {typeof(Float1x1)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float1x2 Frexp(Float1x2 x, out Float1x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x2)}, {typeof(Float1x2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float1x3 Frexp(Float1x3 x, out Float1x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x3)}, {typeof(Float1x3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float1x4 Frexp(Float1x4 x, out Float1x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x4)}, {typeof(Float1x4)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float2x1 Frexp(Float2x1 x, out Float2x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x1)}, {typeof(Float2x1)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float2x2 Frexp(Float2x2 x, out Float2x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x2)}, {typeof(Float2x2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float2x3 Frexp(Float2x3 x, out Float2x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x3)}, {typeof(Float2x3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float2x4 Frexp(Float2x4 x, out Float2x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x4)}, {typeof(Float2x4)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float3x1 Frexp(Float3x1 x, out Float3x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x1)}, {typeof(Float3x1)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float3x2 Frexp(Float3x2 x, out Float3x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x2)}, {typeof(Float3x2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float3x3 Frexp(Float3x3 x, out Float3x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x3)}, {typeof(Float3x3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float3x4 Frexp(Float3x4 x, out Float3x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x4)}, {typeof(Float3x4)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float4x1 Frexp(Float4x1 x, out Float4x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x1)}, {typeof(Float4x1)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float4x2 Frexp(Float4x2 x, out Float4x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x2)}, {typeof(Float4x2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float4x3 Frexp(Float4x3 x, out Float4x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x3)}, {typeof(Float4x3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value. - /// - /// The specified floating-point value. - /// The returned exponent of the input parameter. - /// The mantissa of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [HlslIntrinsicName("frexp")] - public static Float4x4 Frexp(Float4x4 x, out Float4x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x4)}, {typeof(Float4x4)})"); - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static bool IsFinite(float x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool2 IsFinite(Float2 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool3 IsFinite(Float3 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool4 IsFinite(Float4 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool1x1 IsFinite(Float1x1 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool1x2 IsFinite(Float1x2 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool1x3 IsFinite(Float1x3 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool1x4 IsFinite(Float1x4 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool2x1 IsFinite(Float2x1 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool2x2 IsFinite(Float2x2 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool2x3 IsFinite(Float2x3 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool2x4 IsFinite(Float2x4 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool3x1 IsFinite(Float3x1 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool3x2 IsFinite(Float3x2 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool3x3 IsFinite(Float3x3 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool3x4 IsFinite(Float3x4 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool4x1 IsFinite(Float4x1 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool4x2 IsFinite(Float4x2 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool4x3 IsFinite(Float4x3 x) => default; - - /// - /// Determines if the specified floating-point value is finite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is finite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isfinite")] - public static Bool4x4 IsFinite(Float4x4 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static bool IsInfinite(float x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool2 IsInfinite(Float2 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool3 IsInfinite(Float3 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool4 IsInfinite(Float4 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool1x1 IsInfinite(Float1x1 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool1x2 IsInfinite(Float1x2 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool1x3 IsInfinite(Float1x3 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool1x4 IsInfinite(Float1x4 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool2x1 IsInfinite(Float2x1 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool2x2 IsInfinite(Float2x2 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool2x3 IsInfinite(Float2x3 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool2x4 IsInfinite(Float2x4 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool3x1 IsInfinite(Float3x1 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool3x2 IsInfinite(Float3x2 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool3x3 IsInfinite(Float3x3 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool3x4 IsInfinite(Float3x4 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool4x1 IsInfinite(Float4x1 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool4x2 IsInfinite(Float4x2 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool4x3 IsInfinite(Float4x3 x) => default; - - /// - /// Determines if the specified value is infinite. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is infinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isinf")] - public static Bool4x4 IsInfinite(Float4x4 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static bool IsNaN(float x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool2 IsNaN(Float2 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool3 IsNaN(Float3 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool4 IsNaN(Float4 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool1x1 IsNaN(Float1x1 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool1x2 IsNaN(Float1x2 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool1x3 IsNaN(Float1x3 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool1x4 IsNaN(Float1x4 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool2x1 IsNaN(Float2x1 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool2x2 IsNaN(Float2x2 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool2x3 IsNaN(Float2x3 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool2x4 IsNaN(Float2x4 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool3x1 IsNaN(Float3x1 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool3x2 IsNaN(Float3x2 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool3x3 IsNaN(Float3x3 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool3x4 IsNaN(Float3x4 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool4x1 IsNaN(Float4x1 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool4x2 IsNaN(Float4x2 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool4x3 IsNaN(Float4x3 x) => default; - - /// - /// Determines if the specified value is NAN or QNAN. - /// - /// The specified value. - /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("isnan")] - public static Bool4x4 IsNaN(Float4x4 x) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static float Ldexp(float x, float exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float2 Ldexp(Float2 x, Float2 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float3 Ldexp(Float3 x, Float3 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float4 Ldexp(Float4 x, Float4 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float1x1 Ldexp(Float1x1 x, Float1x1 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float1x2 Ldexp(Float1x2 x, Float1x2 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float1x3 Ldexp(Float1x3 x, Float1x3 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float1x4 Ldexp(Float1x4 x, Float1x4 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float2x1 Ldexp(Float2x1 x, Float2x1 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float2x2 Ldexp(Float2x2 x, Float2x2 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float2x3 Ldexp(Float2x3 x, Float2x3 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float2x4 Ldexp(Float2x4 x, Float2x4 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float3x1 Ldexp(Float3x1 x, Float3x1 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float3x2 Ldexp(Float3x2 x, Float3x2 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float3x3 Ldexp(Float3x3 x, Float3x3 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float3x4 Ldexp(Float3x4 x, Float3x4 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float4x1 Ldexp(Float4x1 x, Float4x1 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float4x2 Ldexp(Float4x2 x, Float4x2 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float4x3 Ldexp(Float4x3 x, Float4x3 exp) => default; - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. - /// - /// The specified value. - /// The specified exponent. - /// The result of multiplying the parameter by two, raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("ldexp")] - public static Float4x4 Ldexp(Float4x4 x, Float4x4 exp) => default; - - /// - /// Returns the length of the specified floating-point vector. - /// - /// The specified floating-point vector. - /// A floating-point scalar that represents the length of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("length")] - public static float Length(Float2 x) => default; - - /// - /// Returns the length of the specified floating-point vector. - /// - /// The specified floating-point vector. - /// A floating-point scalar that represents the length of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("length")] - public static float Length(Float3 x) => default; - - /// - /// Returns the length of the specified floating-point vector. - /// - /// The specified floating-point vector. - /// A floating-point scalar that represents the length of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("length")] - public static float Length(Float4 x) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static float Lerp(float x, float y, float s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float2 Lerp(Float2 x, Float2 y, Float2 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float3 Lerp(Float3 x, Float3 y, Float3 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float4 Lerp(Float4 x, Float4 y, Float4 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float1x1 Lerp(Float1x1 x, Float1x1 y, Float1x1 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float1x2 Lerp(Float1x2 x, Float1x2 y, Float1x2 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float1x3 Lerp(Float1x3 x, Float1x3 y, Float1x3 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float1x4 Lerp(Float1x4 x, Float1x4 y, Float1x4 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float2x1 Lerp(Float2x1 x, Float2x1 y, Float2x1 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float2x2 Lerp(Float2x2 x, Float2x2 y, Float2x2 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float2x3 Lerp(Float2x3 x, Float2x3 y, Float2x3 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float2x4 Lerp(Float2x4 x, Float2x4 y, Float2x4 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float3x1 Lerp(Float3x1 x, Float3x1 y, Float3x1 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float3x2 Lerp(Float3x2 x, Float3x2 y, Float3x2 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float3x3 Lerp(Float3x3 x, Float3x3 y, Float3x3 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float3x4 Lerp(Float3x4 x, Float3x4 y, Float3x4 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float4x1 Lerp(Float4x1 x, Float4x1 y, Float4x1 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float4x2 Lerp(Float4x2 x, Float4x2 y, Float4x2 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float4x3 Lerp(Float4x3 x, Float4x3 y, Float4x3 s) => default; - - /// - /// Performs a linear interpolation. - /// - /// The first-floating point value. - /// The second-floating point value. - /// A value that linearly interpolates between the two inputs. - /// The result of the linear interpolation. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("lerp")] - public static Float4x4 Lerp(Float4x4 x, Float4x4 y, Float4x4 s) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static float Log(float x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float2 Log(Float2 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float3 Log(Float3 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float4 Log(Float4 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float1x1 Log(Float1x1 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float1x2 Log(Float1x2 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float1x3 Log(Float1x3 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float1x4 Log(Float1x4 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float2x1 Log(Float2x1 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float2x2 Log(Float2x2 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float2x3 Log(Float2x3 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float2x4 Log(Float2x4 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float3x1 Log(Float3x1 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float3x2 Log(Float3x2 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float3x3 Log(Float3x3 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float3x4 Log(Float3x4 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float4x1 Log(Float4x1 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float4x2 Log(Float4x2 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float4x3 Log(Float4x3 x) => default; - - /// - /// Returns the base-e logarithm of the specified value. - /// - /// The specified value. - /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log")] - public static Float4x4 Log(Float4x4 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static float Log10(float x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float2 Log10(Float2 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float3 Log10(Float3 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float4 Log10(Float4 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float1x1 Log10(Float1x1 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float1x2 Log10(Float1x2 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float1x3 Log10(Float1x3 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float1x4 Log10(Float1x4 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float2x1 Log10(Float2x1 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float2x2 Log10(Float2x2 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float2x3 Log10(Float2x3 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float2x4 Log10(Float2x4 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float3x1 Log10(Float3x1 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float3x2 Log10(Float3x2 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float3x3 Log10(Float3x3 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float3x4 Log10(Float3x4 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float4x1 Log10(Float4x1 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float4x2 Log10(Float4x2 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float4x3 Log10(Float4x3 x) => default; - - /// - /// Returns the base-10 logarithm of the specified value. - /// - /// The specified value. - /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log10")] - public static Float4x4 Log10(Float4x4 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static float Log2(float x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float2 Log2(Float2 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float3 Log2(Float3 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float4 Log2(Float4 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float1x1 Log2(Float1x1 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float1x2 Log2(Float1x2 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float1x3 Log2(Float1x3 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float1x4 Log2(Float1x4 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float2x1 Log2(Float2x1 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float2x2 Log2(Float2x2 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float2x3 Log2(Float2x3 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float2x4 Log2(Float2x4 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float3x1 Log2(Float3x1 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float3x2 Log2(Float3x2 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float3x3 Log2(Float3x3 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float3x4 Log2(Float3x4 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float4x1 Log2(Float4x1 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float4x2 Log2(Float4x2 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float4x3 Log2(Float4x3 x) => default; - - /// - /// Returns the base-2 logarithm of the specified value. - /// - /// The specified value. - /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("log2")] - public static Float4x4 Log2(Float4x4 x) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static float Max(float x, float y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float2 Max(Float2 x, Float2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float3 Max(Float3 x, Float3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float4 Max(Float4 x, Float4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float1x1 Max(Float1x1 x, Float1x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float1x2 Max(Float1x2 x, Float1x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float1x3 Max(Float1x3 x, Float1x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float1x4 Max(Float1x4 x, Float1x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float2x1 Max(Float2x1 x, Float2x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float2x2 Max(Float2x2 x, Float2x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float2x3 Max(Float2x3 x, Float2x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float2x4 Max(Float2x4 x, Float2x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float3x1 Max(Float3x1 x, Float3x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float3x2 Max(Float3x2 x, Float3x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float3x3 Max(Float3x3 x, Float3x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float3x4 Max(Float3x4 x, Float3x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float4x1 Max(Float4x1 x, Float4x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float4x2 Max(Float4x2 x, Float4x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float4x3 Max(Float4x3 x, Float4x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Float4x4 Max(Float4x4 x, Float4x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static double Max(double x, double y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double2 Max(Double2 x, Double2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double3 Max(Double3 x, Double3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double4 Max(Double4 x, Double4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double1x1 Max(Double1x1 x, Double1x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double1x2 Max(Double1x2 x, Double1x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double1x3 Max(Double1x3 x, Double1x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double1x4 Max(Double1x4 x, Double1x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double2x1 Max(Double2x1 x, Double2x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double2x2 Max(Double2x2 x, Double2x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double2x3 Max(Double2x3 x, Double2x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double2x4 Max(Double2x4 x, Double2x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double3x1 Max(Double3x1 x, Double3x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double3x2 Max(Double3x2 x, Double3x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double3x3 Max(Double3x3 x, Double3x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double3x4 Max(Double3x4 x, Double3x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double4x1 Max(Double4x1 x, Double4x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double4x2 Max(Double4x2 x, Double4x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double4x3 Max(Double4x3 x, Double4x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Double4x4 Max(Double4x4 x, Double4x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static int Max(int x, int y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int2 Max(Int2 x, Int2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int3 Max(Int3 x, Int3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int4 Max(Int4 x, Int4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int1x1 Max(Int1x1 x, Int1x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int1x2 Max(Int1x2 x, Int1x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int1x3 Max(Int1x3 x, Int1x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int1x4 Max(Int1x4 x, Int1x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int2x1 Max(Int2x1 x, Int2x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int2x2 Max(Int2x2 x, Int2x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int2x3 Max(Int2x3 x, Int2x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int2x4 Max(Int2x4 x, Int2x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int3x1 Max(Int3x1 x, Int3x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int3x2 Max(Int3x2 x, Int3x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int3x3 Max(Int3x3 x, Int3x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int3x4 Max(Int3x4 x, Int3x4 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int4x1 Max(Int4x1 x, Int4x1 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int4x2 Max(Int4x2 x, Int4x2 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int4x3 Max(Int4x3 x, Int4x3 y) => default; - - /// - /// Selects the greater between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the largest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("max")] - public static Int4x4 Max(Int4x4 x, Int4x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static float Min(float x, float y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float2 Min(Float2 x, Float2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float3 Min(Float3 x, Float3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float4 Min(Float4 x, Float4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float1x1 Min(Float1x1 x, Float1x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float1x2 Min(Float1x2 x, Float1x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float1x3 Min(Float1x3 x, Float1x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float1x4 Min(Float1x4 x, Float1x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float2x1 Min(Float2x1 x, Float2x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float2x2 Min(Float2x2 x, Float2x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float2x3 Min(Float2x3 x, Float2x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float2x4 Min(Float2x4 x, Float2x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float3x1 Min(Float3x1 x, Float3x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float3x2 Min(Float3x2 x, Float3x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float3x3 Min(Float3x3 x, Float3x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float3x4 Min(Float3x4 x, Float3x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float4x1 Min(Float4x1 x, Float4x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float4x2 Min(Float4x2 x, Float4x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float4x3 Min(Float4x3 x, Float4x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Float4x4 Min(Float4x4 x, Float4x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static double Min(double x, double y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double2 Min(Double2 x, Double2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double3 Min(Double3 x, Double3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double4 Min(Double4 x, Double4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double1x1 Min(Double1x1 x, Double1x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double1x2 Min(Double1x2 x, Double1x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double1x3 Min(Double1x3 x, Double1x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double1x4 Min(Double1x4 x, Double1x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double2x1 Min(Double2x1 x, Double2x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double2x2 Min(Double2x2 x, Double2x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double2x3 Min(Double2x3 x, Double2x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double2x4 Min(Double2x4 x, Double2x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double3x1 Min(Double3x1 x, Double3x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double3x2 Min(Double3x2 x, Double3x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double3x3 Min(Double3x3 x, Double3x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double3x4 Min(Double3x4 x, Double3x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double4x1 Min(Double4x1 x, Double4x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double4x2 Min(Double4x2 x, Double4x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double4x3 Min(Double4x3 x, Double4x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Double4x4 Min(Double4x4 x, Double4x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static int Min(int x, int y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int2 Min(Int2 x, Int2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int3 Min(Int3 x, Int3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int4 Min(Int4 x, Int4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int1x1 Min(Int1x1 x, Int1x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int1x2 Min(Int1x2 x, Int1x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int1x3 Min(Int1x3 x, Int1x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int1x4 Min(Int1x4 x, Int1x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int2x1 Min(Int2x1 x, Int2x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int2x2 Min(Int2x2 x, Int2x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int2x3 Min(Int2x3 x, Int2x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int2x4 Min(Int2x4 x, Int2x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int3x1 Min(Int3x1 x, Int3x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int3x2 Min(Int3x2 x, Int3x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int3x3 Min(Int3x3 x, Int3x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int3x4 Min(Int3x4 x, Int3x4 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int4x1 Min(Int4x1 x, Int4x1 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int4x2 Min(Int4x2 x, Int4x2 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int4x3 Min(Int4x3 x, Int4x3 y) => default; - - /// - /// Selects the lesser between two inputs. - /// - /// The first input value. - /// The second input value. - /// The or parameter, whichever is the smallest value. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("min")] - public static Int4x4 Min(Int4x4 x, Int4x4 y) => default; - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static float Modf(float x, out float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(float)}, {typeof(float)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float2 Modf(Float2 x, out Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2)}, {typeof(Float2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float3 Modf(Float3 x, out Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3)}, {typeof(Float3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float4 Modf(Float4 x, out Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4)}, {typeof(Float4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float1x1 Modf(Float1x1 x, out Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x1)}, {typeof(Float1x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float1x2 Modf(Float1x2 x, out Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x2)}, {typeof(Float1x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float1x3 Modf(Float1x3 x, out Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x3)}, {typeof(Float1x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float1x4 Modf(Float1x4 x, out Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x4)}, {typeof(Float1x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float2x1 Modf(Float2x1 x, out Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x1)}, {typeof(Float2x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float2x2 Modf(Float2x2 x, out Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x2)}, {typeof(Float2x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float2x3 Modf(Float2x3 x, out Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x3)}, {typeof(Float2x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float2x4 Modf(Float2x4 x, out Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x4)}, {typeof(Float2x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float3x1 Modf(Float3x1 x, out Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x1)}, {typeof(Float3x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float3x2 Modf(Float3x2 x, out Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x2)}, {typeof(Float3x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float3x3 Modf(Float3x3 x, out Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x3)}, {typeof(Float3x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float3x4 Modf(Float3x4 x, out Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x4)}, {typeof(Float3x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float4x1 Modf(Float4x1 x, out Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x1)}, {typeof(Float4x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float4x2 Modf(Float4x2 x, out Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x2)}, {typeof(Float4x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float4x3 Modf(Float4x3 x, out Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x3)}, {typeof(Float4x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Float4x4 Modf(Float4x4 x, out Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x4)}, {typeof(Float4x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static int Modf(int x, out int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(int)}, {typeof(int)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int2 Modf(Int2 x, out Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2)}, {typeof(Int2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int3 Modf(Int3 x, out Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3)}, {typeof(Int3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int4 Modf(Int4 x, out Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4)}, {typeof(Int4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int1x1 Modf(Int1x1 x, out Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x1)}, {typeof(Int1x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int1x2 Modf(Int1x2 x, out Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x2)}, {typeof(Int1x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int1x3 Modf(Int1x3 x, out Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x3)}, {typeof(Int1x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int1x4 Modf(Int1x4 x, out Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x4)}, {typeof(Int1x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int2x1 Modf(Int2x1 x, out Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x1)}, {typeof(Int2x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int2x2 Modf(Int2x2 x, out Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x2)}, {typeof(Int2x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int2x3 Modf(Int2x3 x, out Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x3)}, {typeof(Int2x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int2x4 Modf(Int2x4 x, out Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x4)}, {typeof(Int2x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int3x1 Modf(Int3x1 x, out Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x1)}, {typeof(Int3x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int3x2 Modf(Int3x2 x, out Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x2)}, {typeof(Int3x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int3x3 Modf(Int3x3 x, out Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x3)}, {typeof(Int3x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int3x4 Modf(Int3x4 x, out Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x4)}, {typeof(Int3x4)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int4x1 Modf(Int4x1 x, out Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x1)}, {typeof(Int4x1)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int4x2 Modf(Int4x2 x, out Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x2)}, {typeof(Int4x2)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int4x3 Modf(Int4x3 x, out Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x3)}, {typeof(Int4x3)})"); - - /// - /// Splits a value into fractional and integer parts, each with the same sign as the input value. - /// - /// The input value. - /// The resulting integer portion. - /// The signed-fractional portion 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. - [Pure] - [HlslIntrinsicName("modf")] - public static Int4x4 Modf(Int4x4 x, out Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x4)}, {typeof(Int4x4)})"); - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(float x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(int x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(float x, Float2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(float x, Float3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(float x, Float4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(int x, Int2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(int x, Int3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(int x, Int4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x1 Mul(float x, Float1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x2 Mul(float x, Float1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x3 Mul(float x, Float1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x4 Mul(float x, Float1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x1 Mul(float x, Float2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x2 Mul(float x, Float2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x3 Mul(float x, Float2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x4 Mul(float x, Float2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x1 Mul(float x, Float3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x2 Mul(float x, Float3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x3 Mul(float x, Float3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x4 Mul(float x, Float3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x1 Mul(float x, Float4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x2 Mul(float x, Float4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x3 Mul(float x, Float4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x4 Mul(float x, Float4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x1 Mul(int x, Int1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x2 Mul(int x, Int1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x3 Mul(int x, Int1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x4 Mul(int x, Int1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x1 Mul(int x, Int2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x2 Mul(int x, Int2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x3 Mul(int x, Int2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x4 Mul(int x, Int2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x1 Mul(int x, Int3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x2 Mul(int x, Int3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x3 Mul(int x, Int3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x4 Mul(int x, Int3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x1 Mul(int x, Int4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x2 Mul(int x, Int4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x3 Mul(int x, Int4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x4 Mul(int x, Int4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float2 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float3 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float4 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int2 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int3 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int4 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float2 x, Float2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float3 x, Float3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float4 x, Float4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int2 x, Int2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int3 x, Int3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int4 x, Int4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float2 x, Float2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float2 x, Float2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float2 x, Float2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float2 x, Float2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float3 x, Float3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float3 x, Float3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float3 x, Float3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float3 x, Float3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float4 x, Float4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float4 x, Float4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float4 x, Float4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float4 x, Float4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int2 x, Int2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int2 x, Int2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int2 x, Int2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int2 x, Int2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int3 x, Int3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int3 x, Int3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int3 x, Int3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int3 x, Int3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int4 x, Int4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int4 x, Int4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int4 x, Int4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int4 x, Int4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x1 Mul(Float1x1 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x2 Mul(Float1x2 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x3 Mul(Float1x3 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x4 Mul(Float1x4 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x1 Mul(Float2x1 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x2 Mul(Float2x2 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x3 Mul(Float2x3 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x4 Mul(Float2x4 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x1 Mul(Float3x1 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x2 Mul(Float3x2 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x3 Mul(Float3x3 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x4 Mul(Float3x4 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x1 Mul(Float4x1 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x2 Mul(Float4x2 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x3 Mul(Float4x3 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x4 Mul(Float4x4 x, float y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x1 Mul(Int1x1 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x2 Mul(Int1x2 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x3 Mul(Int1x3 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x4 Mul(Int1x4 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x1 Mul(Int2x1 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x2 Mul(Int2x2 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x3 Mul(Int2x3 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x4 Mul(Int2x4 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x1 Mul(Int3x1 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x2 Mul(Int3x2 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x3 Mul(Int3x3 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x4 Mul(Int3x4 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x1 Mul(Int4x1 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x2 Mul(Int4x2 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x3 Mul(Int4x3 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x4 Mul(Int4x4 x, int y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float1x2 x, Float2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float1x3 x, Float3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static float Mul(Float1x4 x, Float4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float2x2 x, Float2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float2x3 x, Float3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2 Mul(Float2x4 x, Float4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float3x2 x, Float2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float3x3 x, Float3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3 Mul(Float3x4 x, Float4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float4x2 x, Float2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float4x3 x, Float3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4 Mul(Float4x4 x, Float4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int1x2 x, Int2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int1x3 x, Int3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static int Mul(Int1x4 x, Int4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int2x2 x, Int2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int2x3 x, Int3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2 Mul(Int2x4 x, Int4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int3x2 x, Int2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int3x3 x, Int3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3 Mul(Int3x4 x, Int4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int4x2 x, Int2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int4x3 x, Int3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4 Mul(Int4x4 x, Int4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x1 Mul(Float1x1 x, Float1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x2 Mul(Float1x1 x, Float1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x3 Mul(Float1x1 x, Float1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x4 Mul(Float1x1 x, Float1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x1 Mul(Float1x2 x, Float2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x2 Mul(Float1x2 x, Float2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x3 Mul(Float1x2 x, Float2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x4 Mul(Float1x2 x, Float2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x1 Mul(Float1x3 x, Float3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x2 Mul(Float1x3 x, Float3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x3 Mul(Float1x3 x, Float3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x4 Mul(Float1x3 x, Float3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x1 Mul(Float1x4 x, Float4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x2 Mul(Float1x4 x, Float4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x3 Mul(Float1x4 x, Float4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float1x4 Mul(Float1x4 x, Float4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x1 Mul(Float2x1 x, Float1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x2 Mul(Float2x1 x, Float1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x3 Mul(Float2x1 x, Float1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x4 Mul(Float2x1 x, Float1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x1 Mul(Float2x2 x, Float2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x2 Mul(Float2x2 x, Float2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x3 Mul(Float2x2 x, Float2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x4 Mul(Float2x2 x, Float2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x1 Mul(Float2x3 x, Float3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x2 Mul(Float2x3 x, Float3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x3 Mul(Float2x3 x, Float3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x4 Mul(Float2x3 x, Float3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x1 Mul(Float2x4 x, Float4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x2 Mul(Float2x4 x, Float4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x3 Mul(Float2x4 x, Float4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float2x4 Mul(Float2x4 x, Float4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x1 Mul(Float3x1 x, Float1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x2 Mul(Float3x1 x, Float1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x3 Mul(Float3x1 x, Float1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x4 Mul(Float3x1 x, Float1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x1 Mul(Float3x2 x, Float2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x2 Mul(Float3x2 x, Float2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x3 Mul(Float3x2 x, Float2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x4 Mul(Float3x2 x, Float2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x1 Mul(Float3x3 x, Float3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x2 Mul(Float3x3 x, Float3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x3 Mul(Float3x3 x, Float3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x4 Mul(Float3x3 x, Float3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x1 Mul(Float3x4 x, Float4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x2 Mul(Float3x4 x, Float4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x3 Mul(Float3x4 x, Float4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float3x4 Mul(Float3x4 x, Float4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x1 Mul(Float4x1 x, Float1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x2 Mul(Float4x1 x, Float1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x3 Mul(Float4x1 x, Float1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x4 Mul(Float4x1 x, Float1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x1 Mul(Float4x2 x, Float2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x2 Mul(Float4x2 x, Float2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x3 Mul(Float4x2 x, Float2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x4 Mul(Float4x2 x, Float2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x1 Mul(Float4x3 x, Float3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x2 Mul(Float4x3 x, Float3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x3 Mul(Float4x3 x, Float3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x4 Mul(Float4x3 x, Float3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x1 Mul(Float4x4 x, Float4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x2 Mul(Float4x4 x, Float4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x3 Mul(Float4x4 x, Float4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Float4x4 Mul(Float4x4 x, Float4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x1 Mul(Int1x1 x, Int1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x2 Mul(Int1x1 x, Int1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x3 Mul(Int1x1 x, Int1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x4 Mul(Int1x1 x, Int1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x1 Mul(Int1x2 x, Int2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x2 Mul(Int1x2 x, Int2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x3 Mul(Int1x2 x, Int2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x4 Mul(Int1x2 x, Int2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x1 Mul(Int1x3 x, Int3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x2 Mul(Int1x3 x, Int3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x3 Mul(Int1x3 x, Int3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x4 Mul(Int1x3 x, Int3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x1 Mul(Int1x4 x, Int4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x2 Mul(Int1x4 x, Int4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x3 Mul(Int1x4 x, Int4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int1x4 Mul(Int1x4 x, Int4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x1 Mul(Int2x1 x, Int1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x2 Mul(Int2x1 x, Int1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x3 Mul(Int2x1 x, Int1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x4 Mul(Int2x1 x, Int1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x1 Mul(Int2x2 x, Int2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x2 Mul(Int2x2 x, Int2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x3 Mul(Int2x2 x, Int2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x4 Mul(Int2x2 x, Int2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x1 Mul(Int2x3 x, Int3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x2 Mul(Int2x3 x, Int3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x3 Mul(Int2x3 x, Int3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x4 Mul(Int2x3 x, Int3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x1 Mul(Int2x4 x, Int4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x2 Mul(Int2x4 x, Int4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x3 Mul(Int2x4 x, Int4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int2x4 Mul(Int2x4 x, Int4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x1 Mul(Int3x1 x, Int1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x2 Mul(Int3x1 x, Int1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x3 Mul(Int3x1 x, Int1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x4 Mul(Int3x1 x, Int1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x1 Mul(Int3x2 x, Int2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x2 Mul(Int3x2 x, Int2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x3 Mul(Int3x2 x, Int2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x4 Mul(Int3x2 x, Int2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x1 Mul(Int3x3 x, Int3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x2 Mul(Int3x3 x, Int3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x3 Mul(Int3x3 x, Int3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x4 Mul(Int3x3 x, Int3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x1 Mul(Int3x4 x, Int4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x2 Mul(Int3x4 x, Int4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x3 Mul(Int3x4 x, Int4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int3x4 Mul(Int3x4 x, Int4x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x1 Mul(Int4x1 x, Int1x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x2 Mul(Int4x1 x, Int1x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x3 Mul(Int4x1 x, Int1x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x4 Mul(Int4x1 x, Int1x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x1 Mul(Int4x2 x, Int2x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x2 Mul(Int4x2 x, Int2x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x3 Mul(Int4x2 x, Int2x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x4 Mul(Int4x2 x, Int2x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x1 Mul(Int4x3 x, Int3x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x2 Mul(Int4x3 x, Int3x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x3 Mul(Int4x3 x, Int3x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x4 Mul(Int4x3 x, Int3x4 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x1 Mul(Int4x4 x, Int4x1 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x2 Mul(Int4x4 x, Int4x2 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x3 Mul(Int4x4 x, Int4x3 y) => default; - - /// - /// Multiplies two values using matrix math. - /// - /// The first input value. - /// The second input value. - /// The result of times . The result has the dimension -rows by -columns. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("mul")] - public static Int4x4 Mul(Int4x4 x, Int4x4 y) => default; - - /// - /// Normalizes the specified floating-point vector according to x / length(x). - /// - /// The specified floating-point vector. - /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("normalize")] - public static float Normalize(Float2 x) => default; - - /// - /// Normalizes the specified floating-point vector according to x / length(x). - /// - /// The specified floating-point vector. - /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("normalize")] - public static float Normalize(Float3 x) => default; - - /// - /// Normalizes the specified floating-point vector according to x / length(x). - /// - /// The specified floating-point vector. - /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("normalize")] - public static float Normalize(Float4 x) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static float Pow(float x, float y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float2 Pow(Float2 x, Float2 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float3 Pow(Float3 x, Float3 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float4 Pow(Float4 x, Float4 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float1x1 Pow(Float1x1 x, Float1x1 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float1x2 Pow(Float1x2 x, Float1x2 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float1x3 Pow(Float1x3 x, Float1x3 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float1x4 Pow(Float1x4 x, Float1x4 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float2x1 Pow(Float2x1 x, Float2x1 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float2x2 Pow(Float2x2 x, Float2x2 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float2x3 Pow(Float2x3 x, Float2x3 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float2x4 Pow(Float2x4 x, Float2x4 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float3x1 Pow(Float3x1 x, Float3x1 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float3x2 Pow(Float3x2 x, Float3x2 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float3x3 Pow(Float3x3 x, Float3x3 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float3x4 Pow(Float3x4 x, Float3x4 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float4x1 Pow(Float4x1 x, Float4x1 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float4x2 Pow(Float4x2 x, Float4x2 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float4x3 Pow(Float4x3 x, Float4x3 y) => default; - - /// - /// Returns the specified value raised to the specified power. - /// - /// The specified value. - /// The specified power. - /// The parameter raised to the power of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("pow")] - public static Float4x4 Pow(Float4x4 x, Float4x4 y) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static float Radians(float x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float2 Radians(Float2 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float3 Radians(Float3 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float4 Radians(Float4 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float1x1 Radians(Float1x1 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float1x2 Radians(Float1x2 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float1x3 Radians(Float1x3 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float1x4 Radians(Float1x4 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float2x1 Radians(Float2x1 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float2x2 Radians(Float2x2 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float2x3 Radians(Float2x3 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float2x4 Radians(Float2x4 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float3x1 Radians(Float3x1 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float3x2 Radians(Float3x2 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float3x3 Radians(Float3x3 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float3x4 Radians(Float3x4 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float4x1 Radians(Float4x1 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float4x2 Radians(Float4x2 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float4x3 Radians(Float4x3 x) => default; - - /// - /// Converts the specified value from degrees to radians. - /// - /// The specified value. - /// The parameter converted from degrees to radians. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("radians")] - public static Float4x4 Radians(Float4x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static float Rcp(float x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float2 Rcp(Float2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float3 Rcp(Float3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float4 Rcp(Float4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float1x1 Rcp(Float1x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float1x2 Rcp(Float1x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float1x3 Rcp(Float1x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float1x4 Rcp(Float1x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float2x1 Rcp(Float2x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float2x2 Rcp(Float2x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float2x3 Rcp(Float2x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float2x4 Rcp(Float2x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float3x1 Rcp(Float3x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float3x2 Rcp(Float3x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float3x3 Rcp(Float3x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float3x4 Rcp(Float3x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float4x1 Rcp(Float4x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float4x2 Rcp(Float4x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float4x3 Rcp(Float4x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Float4x4 Rcp(Float4x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static double Rcp(double x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double2 Rcp(Double2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double3 Rcp(Double3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double4 Rcp(Double4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double1x1 Rcp(Double1x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double1x2 Rcp(Double1x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double1x3 Rcp(Double1x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double1x4 Rcp(Double1x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double2x1 Rcp(Double2x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double2x2 Rcp(Double2x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double2x3 Rcp(Double2x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double2x4 Rcp(Double2x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double3x1 Rcp(Double3x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double3x2 Rcp(Double3x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double3x3 Rcp(Double3x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double3x4 Rcp(Double3x4 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double4x1 Rcp(Double4x1 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double4x2 Rcp(Double4x2 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double4x3 Rcp(Double4x3 x) => default; - - /// - /// Calculates a fast, approximate, per-component reciprocal. - /// - /// The input value. - /// The reciprocal of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rcp")] - public static Double4x4 Rcp(Double4x4 x) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static float Reflect(float i, float n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float2 Reflect(Float2 i, Float2 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float3 Reflect(Float3 i, Float3 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float4 Reflect(Float4 i, Float4 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float1x1 Reflect(Float1x1 i, Float1x1 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float1x2 Reflect(Float1x2 i, Float1x2 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float1x3 Reflect(Float1x3 i, Float1x3 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float1x4 Reflect(Float1x4 i, Float1x4 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float2x1 Reflect(Float2x1 i, Float2x1 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float2x2 Reflect(Float2x2 i, Float2x2 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float2x3 Reflect(Float2x3 i, Float2x3 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float2x4 Reflect(Float2x4 i, Float2x4 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float3x1 Reflect(Float3x1 i, Float3x1 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float3x2 Reflect(Float3x2 i, Float3x2 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float3x3 Reflect(Float3x3 i, Float3x3 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float3x4 Reflect(Float3x4 i, Float3x4 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float4x1 Reflect(Float4x1 i, Float4x1 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float4x2 Reflect(Float4x2 i, Float4x2 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float4x3 Reflect(Float4x3 i, Float4x3 n) => default; - - /// - /// Returns a reflection vector using an incident ray and a surface normal. - /// - /// A floating-point, incident vector. - /// A floating-point, normal vector. - /// A floating-point, reflection vector. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reflect")] - public static Float4x4 Reflect(Float4x4 i, Float4x4 n) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static float Refract(float i, float n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float2 Refract(Float2 i, Float2 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float3 Refract(Float3 i, Float3 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float4 Refract(Float4 i, Float4 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float1x1 Refract(Float1x1 i, Float1x1 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float1x2 Refract(Float1x2 i, Float1x2 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float1x3 Refract(Float1x3 i, Float1x3 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float1x4 Refract(Float1x4 i, Float1x4 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float2x1 Refract(Float2x1 i, Float2x1 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float2x2 Refract(Float2x2 i, Float2x2 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float2x3 Refract(Float2x3 i, Float2x3 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float2x4 Refract(Float2x4 i, Float2x4 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float3x1 Refract(Float3x1 i, Float3x1 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float3x2 Refract(Float3x2 i, Float3x2 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float3x3 Refract(Float3x3 i, Float3x3 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float3x4 Refract(Float3x4 i, Float3x4 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float4x1 Refract(Float4x1 i, Float4x1 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float4x2 Refract(Float4x2 i, Float4x2 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float4x3 Refract(Float4x3 i, Float4x3 n, float f) => default; - - /// - /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. - /// - /// A floating-point, ray direction vector. - /// A floating-point, surface normal vector. - /// A floating-point, refraction index scalar. - /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("refract")] - public static Float4x4 Refract(Float4x4 i, Float4x4 n, float f) => default; - - /// - /// Reverses the order of the bits, per component. - /// - /// The input value. - /// The input value, with the bit order reversed. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reversebits")] - public static uint ReverseBits(uint x) => default; - - /// - /// Reverses the order of the bits, per component. - /// - /// The input value. - /// The input value, with the bit order reversed. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reversebits")] - public static UInt2 ReverseBits(UInt2 x) => default; - - /// - /// Reverses the order of the bits, per component. - /// - /// The input value. - /// The input value, with the bit order reversed. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reversebits")] - public static UInt3 ReverseBits(UInt3 x) => default; - - /// - /// Reverses the order of the bits, per component. - /// - /// The input value. - /// The input value, with the bit order reversed. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("reversebits")] - public static UInt4 ReverseBits(UInt4 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static float Round(float x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float2 Round(Float2 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float3 Round(Float3 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float4 Round(Float4 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float1x1 Round(Float1x1 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float1x2 Round(Float1x2 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float1x3 Round(Float1x3 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float1x4 Round(Float1x4 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float2x1 Round(Float2x1 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float2x2 Round(Float2x2 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float2x3 Round(Float2x3 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float2x4 Round(Float2x4 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float3x1 Round(Float3x1 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float3x2 Round(Float3x2 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float3x3 Round(Float3x3 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float3x4 Round(Float3x4 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float4x1 Round(Float4x1 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float4x2 Round(Float4x2 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float4x3 Round(Float4x3 x) => default; - - /// - /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. - /// - /// The specified value. - /// The parameter, rounded to the nearest integer within a floating-point type. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("round")] - public static Float4x4 Round(Float4x4 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static float Rsqrt(float x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float2 Rsqrt(Float2 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float3 Rsqrt(Float3 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float4 Rsqrt(Float4 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float1x1 Rsqrt(Float1x1 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float1x2 Rsqrt(Float1x2 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float1x3 Rsqrt(Float1x3 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float1x4 Rsqrt(Float1x4 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float2x1 Rsqrt(Float2x1 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float2x2 Rsqrt(Float2x2 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float2x3 Rsqrt(Float2x3 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float2x4 Rsqrt(Float2x4 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float3x1 Rsqrt(Float3x1 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float3x2 Rsqrt(Float3x2 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float3x3 Rsqrt(Float3x3 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float3x4 Rsqrt(Float3x4 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float4x1 Rsqrt(Float4x1 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float4x2 Rsqrt(Float4x2 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float4x3 Rsqrt(Float4x3 x) => default; - - /// - /// Returns the reciprocal of the square root of the specified value. - /// - /// The specified value. - /// The reciprocal of the square root of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("rsqrt")] - public static Float4x4 Rsqrt(Float4x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static float Saturate(float x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float2 Saturate(Float2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float3 Saturate(Float3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float4 Saturate(Float4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float1x1 Saturate(Float1x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float1x2 Saturate(Float1x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float1x3 Saturate(Float1x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float1x4 Saturate(Float1x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float2x1 Saturate(Float2x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float2x2 Saturate(Float2x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float2x3 Saturate(Float2x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float2x4 Saturate(Float2x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float3x1 Saturate(Float3x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float3x2 Saturate(Float3x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float3x3 Saturate(Float3x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float3x4 Saturate(Float3x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float4x1 Saturate(Float4x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float4x2 Saturate(Float4x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float4x3 Saturate(Float4x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Float4x4 Saturate(Float4x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static double Saturate(double x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double2 Saturate(Double2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double3 Saturate(Double3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double4 Saturate(Double4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double1x1 Saturate(Double1x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double1x2 Saturate(Double1x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double1x3 Saturate(Double1x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double1x4 Saturate(Double1x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double2x1 Saturate(Double2x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double2x2 Saturate(Double2x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double2x3 Saturate(Double2x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double2x4 Saturate(Double2x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double3x1 Saturate(Double3x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double3x2 Saturate(Double3x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double3x3 Saturate(Double3x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double3x4 Saturate(Double3x4 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double4x1 Saturate(Double4x1 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double4x2 Saturate(Double4x2 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double4x3 Saturate(Double4x3 x) => default; - - /// - /// Clamps the specified value within the range of 0 to 1. - /// - /// The specified value. - /// The parameter, clamped within the range of 0 to 1. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("saturate")] - public static Double4x4 Saturate(Double4x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static int Sign(float x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2 Sign(Float2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3 Sign(Float3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4 Sign(Float4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x1 Sign(Float1x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x2 Sign(Float1x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x3 Sign(Float1x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x4 Sign(Float1x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x1 Sign(Float2x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x2 Sign(Float2x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x3 Sign(Float2x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x4 Sign(Float2x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x1 Sign(Float3x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x2 Sign(Float3x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x3 Sign(Float3x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x4 Sign(Float3x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x1 Sign(Float4x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x2 Sign(Float4x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x3 Sign(Float4x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x4 Sign(Float4x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static int Sign(int x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2 Sign(Int2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3 Sign(Int3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4 Sign(Int4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x1 Sign(Int1x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x2 Sign(Int1x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x3 Sign(Int1x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int1x4 Sign(Int1x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x1 Sign(Int2x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x2 Sign(Int2x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x3 Sign(Int2x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int2x4 Sign(Int2x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x1 Sign(Int3x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x2 Sign(Int3x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x3 Sign(Int3x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int3x4 Sign(Int3x4 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x1 Sign(Int4x1 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x2 Sign(Int4x2 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x3 Sign(Int4x3 x) => default; - - /// - /// Returns the sign of the input value. - /// - /// The specified value. - /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sign")] - public static Int4x4 Sign(Int4x4 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static float Sin(float x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float2 Sin(Float2 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float3 Sin(Float3 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float4 Sin(Float4 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float1x1 Sin(Float1x1 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float1x2 Sin(Float1x2 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float1x3 Sin(Float1x3 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float1x4 Sin(Float1x4 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float2x1 Sin(Float2x1 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float2x2 Sin(Float2x2 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float2x3 Sin(Float2x3 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float2x4 Sin(Float2x4 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float3x1 Sin(Float3x1 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float3x2 Sin(Float3x2 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float3x3 Sin(Float3x3 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float3x4 Sin(Float3x4 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float4x1 Sin(Float4x1 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float4x2 Sin(Float4x2 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float4x3 Sin(Float4x3 x) => default; - - /// - /// Returns the sine of the specified value. - /// - /// The specified value, in radians. - /// The sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sin")] - public static Float4x4 Sin(Float4x4 x) => default; - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(float x, out float sin, out float cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float2 x, out Float2 sin, out Float2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2)}, {typeof(Float2)}, {typeof(Float2)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float3 x, out Float3 sin, out Float3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3)}, {typeof(Float3)}, {typeof(Float3)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float4 x, out Float4 sin, out Float4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4)}, {typeof(Float4)}, {typeof(Float4)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float1x1 x, out Float1x1 sin, out Float1x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x1)}, {typeof(Float1x1)}, {typeof(Float1x1)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float1x2 x, out Float1x2 sin, out Float1x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x2)}, {typeof(Float1x2)}, {typeof(Float1x2)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float1x3 x, out Float1x3 sin, out Float1x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x3)}, {typeof(Float1x3)}, {typeof(Float1x3)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float1x4 x, out Float1x4 sin, out Float1x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x4)}, {typeof(Float1x4)}, {typeof(Float1x4)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float2x1 x, out Float2x1 sin, out Float2x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x1)}, {typeof(Float2x1)}, {typeof(Float2x1)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float2x2 x, out Float2x2 sin, out Float2x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x2)}, {typeof(Float2x2)}, {typeof(Float2x2)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float2x3 x, out Float2x3 sin, out Float2x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x3)}, {typeof(Float2x3)}, {typeof(Float2x3)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float2x4 x, out Float2x4 sin, out Float2x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x4)}, {typeof(Float2x4)}, {typeof(Float2x4)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float3x1 x, out Float3x1 sin, out Float3x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x1)}, {typeof(Float3x1)}, {typeof(Float3x1)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float3x2 x, out Float3x2 sin, out Float3x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x2)}, {typeof(Float3x2)}, {typeof(Float3x2)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float3x3 x, out Float3x3 sin, out Float3x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x3)}, {typeof(Float3x3)}, {typeof(Float3x3)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float3x4 x, out Float3x4 sin, out Float3x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x4)}, {typeof(Float3x4)}, {typeof(Float3x4)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float4x1 x, out Float4x1 sin, out Float4x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x1)}, {typeof(Float4x1)}, {typeof(Float4x1)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float4x2 x, out Float4x2 sin, out Float4x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x2)}, {typeof(Float4x2)}, {typeof(Float4x2)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float4x3 x, out Float4x3 sin, out Float4x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x3)}, {typeof(Float4x3)}, {typeof(Float4x3)})"); - - /// - /// Returns the sine and cosine of a specified value. - /// - /// The specified value, in radians. - /// The resulting sine. - /// The resulting cosine. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sincos")] - public static void SinCos(Float4x4 x, out Float4x4 sin, out Float4x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x4)}, {typeof(Float4x4)}, {typeof(Float4x4)})"); - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static float Sinh(float x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float2 Sinh(Float2 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float3 Sinh(Float3 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float4 Sinh(Float4 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float1x1 Sinh(Float1x1 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float1x2 Sinh(Float1x2 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float1x3 Sinh(Float1x3 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float1x4 Sinh(Float1x4 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float2x1 Sinh(Float2x1 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float2x2 Sinh(Float2x2 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float2x3 Sinh(Float2x3 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float2x4 Sinh(Float2x4 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float3x1 Sinh(Float3x1 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float3x2 Sinh(Float3x2 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float3x3 Sinh(Float3x3 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float3x4 Sinh(Float3x4 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float4x1 Sinh(Float4x1 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float4x2 Sinh(Float4x2 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float4x3 Sinh(Float4x3 x) => default; - - /// - /// Returns the hyperbolic sine of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic sine of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sinh")] - public static Float4x4 Sinh(Float4x4 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static float SmoothStep(float min, float max, float x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float2 SmoothStep(Float2 min, Float2 max, Float2 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float3 SmoothStep(Float3 min, Float3 max, Float3 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float4 SmoothStep(Float4 min, Float4 max, Float4 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float1x1 SmoothStep(Float1x1 min, Float1x1 max, Float1x1 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float1x2 SmoothStep(Float1x2 min, Float1x2 max, Float1x2 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float1x3 SmoothStep(Float1x3 min, Float1x3 max, Float1x3 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float1x4 SmoothStep(Float1x4 min, Float1x4 max, Float1x4 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float2x1 SmoothStep(Float2x1 min, Float2x1 max, Float2x1 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float2x2 SmoothStep(Float2x2 min, Float2x2 max, Float2x2 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float2x3 SmoothStep(Float2x3 min, Float2x3 max, Float2x3 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float2x4 SmoothStep(Float2x4 min, Float2x4 max, Float2x4 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float3x1 SmoothStep(Float3x1 min, Float3x1 max, Float3x1 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float3x2 SmoothStep(Float3x2 min, Float3x2 max, Float3x2 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float3x3 SmoothStep(Float3x3 min, Float3x3 max, Float3x3 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float3x4 SmoothStep(Float3x4 min, Float3x4 max, Float3x4 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float4x1 SmoothStep(Float4x1 min, Float4x1 max, Float4x1 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float4x2 SmoothStep(Float4x2 min, Float4x2 max, Float4x2 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float4x3 SmoothStep(Float4x3 min, Float4x3 max, Float4x3 x) => default; - - /// - /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. - /// - /// The specified minimum range. - /// The specified maximum range. - /// The specified value to be interpolated. - /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("smoothstep")] - public static Float4x4 SmoothStep(Float4x4 min, Float4x4 max, Float4x4 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static float Sqrt(float x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float2 Sqrt(Float2 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float3 Sqrt(Float3 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float4 Sqrt(Float4 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float1x1 Sqrt(Float1x1 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float1x2 Sqrt(Float1x2 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float1x3 Sqrt(Float1x3 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float1x4 Sqrt(Float1x4 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float2x1 Sqrt(Float2x1 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float2x2 Sqrt(Float2x2 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float2x3 Sqrt(Float2x3 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float2x4 Sqrt(Float2x4 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float3x1 Sqrt(Float3x1 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float3x2 Sqrt(Float3x2 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float3x3 Sqrt(Float3x3 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float3x4 Sqrt(Float3x4 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float4x1 Sqrt(Float4x1 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float4x2 Sqrt(Float4x2 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float4x3 Sqrt(Float4x3 x) => default; - - /// - /// Returns the square root of the specified floating-point value, per component. - /// - /// The specified floating-point value. - /// The square root of the parameter, per component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("sqrt")] - public static Float4x4 Sqrt(Float4x4 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static float Step(float y, float x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float2 Step(Float2 y, Float2 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float3 Step(Float3 y, Float3 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float4 Step(Float4 y, Float4 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float1x1 Step(Float1x1 y, Float1x1 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float1x2 Step(Float1x2 y, Float1x2 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float1x3 Step(Float1x3 y, Float1x3 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float1x4 Step(Float1x4 y, Float1x4 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float2x1 Step(Float2x1 y, Float2x1 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float2x2 Step(Float2x2 y, Float2x2 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float2x3 Step(Float2x3 y, Float2x3 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float2x4 Step(Float2x4 y, Float2x4 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float3x1 Step(Float3x1 y, Float3x1 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float3x2 Step(Float3x2 y, Float3x2 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float3x3 Step(Float3x3 y, Float3x3 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float3x4 Step(Float3x4 y, Float3x4 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float4x1 Step(Float4x1 y, Float4x1 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float4x2 Step(Float4x2 y, Float4x2 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float4x3 Step(Float4x3 y, Float4x3 x) => default; - - /// - /// Compares two values, returning 0 or 1 based on which value is greater. - /// - /// The first specified floating-point value. - /// The second specified floating-point value. - /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("step")] - public static Float4x4 Step(Float4x4 y, Float4x4 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static float Tan(float x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float2 Tan(Float2 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float3 Tan(Float3 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float4 Tan(Float4 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float1x1 Tan(Float1x1 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float1x2 Tan(Float1x2 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float1x3 Tan(Float1x3 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float1x4 Tan(Float1x4 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float2x1 Tan(Float2x1 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float2x2 Tan(Float2x2 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float2x3 Tan(Float2x3 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float2x4 Tan(Float2x4 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float3x1 Tan(Float3x1 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float3x2 Tan(Float3x2 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float3x3 Tan(Float3x3 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float3x4 Tan(Float3x4 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float4x1 Tan(Float4x1 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float4x2 Tan(Float4x2 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float4x3 Tan(Float4x3 x) => default; - - /// - /// Returns the tangent of the specified value. - /// - /// The specified value, in radians. - /// The tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tan")] - public static Float4x4 Tan(Float4x4 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static float Tanh(float x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float2 Tanh(Float2 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float3 Tanh(Float3 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float4 Tanh(Float4 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float1x1 Tanh(Float1x1 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float1x2 Tanh(Float1x2 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float1x3 Tanh(Float1x3 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float1x4 Tanh(Float1x4 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float2x1 Tanh(Float2x1 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float2x2 Tanh(Float2x2 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float2x3 Tanh(Float2x3 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float2x4 Tanh(Float2x4 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float3x1 Tanh(Float3x1 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float3x2 Tanh(Float3x2 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float3x3 Tanh(Float3x3 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float3x4 Tanh(Float3x4 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float4x1 Tanh(Float4x1 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float4x2 Tanh(Float4x2 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float4x3 Tanh(Float4x3 x) => default; - - /// - /// Returns the hyperbolic tangent of the specified value. - /// - /// The specified value, in radians. - /// The hyperbolic tangent of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("tanh")] - public static Float4x4 Tanh(Float4x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float2x1 Transpose(Float1x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float3x1 Transpose(Float1x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float4x1 Transpose(Float1x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float1x2 Transpose(Float2x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float3x2 Transpose(Float2x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float4x2 Transpose(Float2x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float1x3 Transpose(Float3x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float2x3 Transpose(Float3x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float4x3 Transpose(Float3x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float1x4 Transpose(Float4x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float2x4 Transpose(Float4x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Float3x4 Transpose(Float4x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int2x1 Transpose(Int1x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int3x1 Transpose(Int1x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int4x1 Transpose(Int1x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int1x2 Transpose(Int2x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int3x2 Transpose(Int2x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int4x2 Transpose(Int2x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int1x3 Transpose(Int3x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int2x3 Transpose(Int3x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int4x3 Transpose(Int3x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int1x4 Transpose(Int4x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int2x4 Transpose(Int4x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Int3x4 Transpose(Int4x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool2x1 Transpose(Bool1x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool3x1 Transpose(Bool1x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool4x1 Transpose(Bool1x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool1x2 Transpose(Bool2x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool3x2 Transpose(Bool2x3 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool4x2 Transpose(Bool2x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool1x3 Transpose(Bool3x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool2x3 Transpose(Bool3x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool4x3 Transpose(Bool3x4 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool1x4 Transpose(Bool4x1 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool2x4 Transpose(Bool4x2 x) => default; - - /// - /// Transposes the specified input matrix. - /// - /// The specified matrix. - /// The transposed value of the parameter. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("transpose")] - public static Bool3x4 Transpose(Bool4x3 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static float Trunc(float x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float2 Trunc(Float2 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float3 Trunc(Float3 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float4 Trunc(Float4 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float1x1 Trunc(Float1x1 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float1x2 Trunc(Float1x2 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float1x3 Trunc(Float1x3 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float1x4 Trunc(Float1x4 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float2x1 Trunc(Float2x1 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float2x2 Trunc(Float2x2 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float2x3 Trunc(Float2x3 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float2x4 Trunc(Float2x4 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float3x1 Trunc(Float3x1 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float3x2 Trunc(Float3x2 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float3x3 Trunc(Float3x3 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float3x4 Trunc(Float3x4 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float4x1 Trunc(Float4x1 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float4x2 Trunc(Float4x2 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float4x3 Trunc(Float4x3 x) => default; - - /// - /// Truncates a floating-point value to the integer component. - /// - /// The specified input. - /// The input value truncated to an integer component. - /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. - [Pure] - [HlslIntrinsicName("trunc")] - public static Float4x4 Trunc(Float4x4 x) => default; - } + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static int Abs(int x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2 Abs(Int2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3 Abs(Int3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4 Abs(Int4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x1 Abs(Int1x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x2 Abs(Int1x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x3 Abs(Int1x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x4 Abs(Int1x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x1 Abs(Int2x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x2 Abs(Int2x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x3 Abs(Int2x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x4 Abs(Int2x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x1 Abs(Int3x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x2 Abs(Int3x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x3 Abs(Int3x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x4 Abs(Int3x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x1 Abs(Int4x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x2 Abs(Int4x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x3 Abs(Int4x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x4 Abs(Int4x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static float Abs(float x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2 Abs(Float2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3 Abs(Float3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4 Abs(Float4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x1 Abs(Float1x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x2 Abs(Float1x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x3 Abs(Float1x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x4 Abs(Float1x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x1 Abs(Float2x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x2 Abs(Float2x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x3 Abs(Float2x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x4 Abs(Float2x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x1 Abs(Float3x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x2 Abs(Float3x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x3 Abs(Float3x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x4 Abs(Float3x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x1 Abs(Float4x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x2 Abs(Float4x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x3 Abs(Float4x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x4 Abs(Float4x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static double Abs(double x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double2 Abs(Double2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double3 Abs(Double3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double4 Abs(Double4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double1x1 Abs(Double1x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double1x2 Abs(Double1x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double1x3 Abs(Double1x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double1x4 Abs(Double1x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double2x1 Abs(Double2x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double2x2 Abs(Double2x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double2x3 Abs(Double2x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double2x4 Abs(Double2x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double3x1 Abs(Double3x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double3x2 Abs(Double3x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double3x3 Abs(Double3x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double3x4 Abs(Double3x4 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double4x1 Abs(Double4x1 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double4x2 Abs(Double4x2 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double4x3 Abs(Double4x3 x) => default; + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("abs")] + public static Double4x4 Abs(Double4x4 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static float Acos(float x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2 Acos(Float2 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3 Acos(Float3 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4 Acos(Float4 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x1 Acos(Float1x1 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x2 Acos(Float1x2 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x3 Acos(Float1x3 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x4 Acos(Float1x4 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x1 Acos(Float2x1 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x2 Acos(Float2x2 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x3 Acos(Float2x3 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x4 Acos(Float2x4 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x1 Acos(Float3x1 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x2 Acos(Float3x2 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x3 Acos(Float3x3 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x4 Acos(Float3x4 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x1 Acos(Float4x1 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x2 Acos(Float4x2 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x3 Acos(Float4x3 x) => default; + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x4 Acos(Float4x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(int x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(float x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(bool x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x4 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x1 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x2 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x3 x) => default; + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(int x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(float x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(bool x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x4 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x1 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x2 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x3 x) => default; + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x4 x) => default; + + /// + /// Reinterprets a cast value (two 32-bit values) into a double precision floating-point value. + /// + /// The low 32-bit pattern of the input value. + /// The high 32-bit pattern of the input value. + /// The input (two 32-bit values) recast as a double precision floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asdouble")] + public static double AsDouble(uint lowbits, uint highbits) => default; + + /// + /// Reinterprets a cast value (two 32-bit values) into a double precision floating-point value. + /// + /// The low 32-bit pattern of the input value. + /// The high 32-bit pattern of the input value. + /// The input (two 32-bit values) recast as a double precision floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asdouble")] + public static Double2 AsDouble(UInt2 lowbits, UInt2 highbits) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static float AsFloat(int x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2 AsFloat(Int2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3 AsFloat(Int3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4 AsFloat(Int4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x1 AsFloat(Int1x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x2 AsFloat(Int1x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x3 AsFloat(Int1x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x4 AsFloat(Int1x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x1 AsFloat(Int2x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x2 AsFloat(Int2x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x3 AsFloat(Int2x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x4 AsFloat(Int2x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x1 AsFloat(Int3x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x2 AsFloat(Int3x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x3 AsFloat(Int3x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x4 AsFloat(Int3x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x1 AsFloat(Int4x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x2 AsFloat(Int4x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x3 AsFloat(Int4x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x4 AsFloat(Int4x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static float AsFloat(uint x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2 AsFloat(UInt2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3 AsFloat(UInt3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4 AsFloat(UInt4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x1 AsFloat(UInt1x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x2 AsFloat(UInt1x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x3 AsFloat(UInt1x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x4 AsFloat(UInt1x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x1 AsFloat(UInt2x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x2 AsFloat(UInt2x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x3 AsFloat(UInt2x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x4 AsFloat(UInt2x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x1 AsFloat(UInt3x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x2 AsFloat(UInt3x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x3 AsFloat(UInt3x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x4 AsFloat(UInt3x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x1 AsFloat(UInt4x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x2 AsFloat(UInt4x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x3 AsFloat(UInt4x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x4 AsFloat(UInt4x4 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static float Asin(float x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2 Asin(Float2 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3 Asin(Float3 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4 Asin(Float4 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x1 Asin(Float1x1 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x2 Asin(Float1x2 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x3 Asin(Float1x3 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x4 Asin(Float1x4 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x1 Asin(Float2x1 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x2 Asin(Float2x2 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x3 Asin(Float2x3 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x4 Asin(Float2x4 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x1 Asin(Float3x1 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x2 Asin(Float3x2 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x3 Asin(Float3x3 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x4 Asin(Float3x4 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x1 Asin(Float4x1 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x2 Asin(Float4x2 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x3 Asin(Float4x3 x) => default; + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x4 Asin(Float4x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static int AsInt(float x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2 AsInt(Float2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3 AsInt(Float3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4 AsInt(Float4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x1 AsInt(Float1x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x2 AsInt(Float1x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x3 AsInt(Float1x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x4 AsInt(Float1x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x1 AsInt(Float2x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x2 AsInt(Float2x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x3 AsInt(Float2x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x4 AsInt(Float2x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x1 AsInt(Float3x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x2 AsInt(Float3x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x3 AsInt(Float3x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x4 AsInt(Float3x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x1 AsInt(Float4x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x2 AsInt(Float4x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x3 AsInt(Float4x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x4 AsInt(Float4x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static int AsInt(uint x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2 AsInt(UInt2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3 AsInt(UInt3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4 AsInt(UInt4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x1 AsInt(UInt1x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x2 AsInt(UInt1x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x3 AsInt(UInt1x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x4 AsInt(UInt1x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x1 AsInt(UInt2x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x2 AsInt(UInt2x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x3 AsInt(UInt2x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x4 AsInt(UInt2x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x1 AsInt(UInt3x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x2 AsInt(UInt3x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x3 AsInt(UInt3x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x4 AsInt(UInt3x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x1 AsInt(UInt4x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x2 AsInt(UInt4x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x3 AsInt(UInt4x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x4 AsInt(UInt4x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static uint AsUInt(float x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2 AsUInt(Float2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3 AsUInt(Float3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4 AsUInt(Float4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x1 AsUInt(Float1x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x2 AsUInt(Float1x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x3 AsUInt(Float1x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x4 AsUInt(Float1x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x1 AsUInt(Float2x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x2 AsUInt(Float2x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x3 AsUInt(Float2x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x4 AsUInt(Float2x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x1 AsUInt(Float3x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x2 AsUInt(Float3x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x3 AsUInt(Float3x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x4 AsUInt(Float3x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x1 AsUInt(Float4x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x2 AsUInt(Float4x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x3 AsUInt(Float4x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x4 AsUInt(Float4x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static uint AsUInt(int x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2 AsUInt(Int2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3 AsUInt(Int3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4 AsUInt(Int4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x1 AsUInt(Int1x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x2 AsUInt(Int1x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x3 AsUInt(Int1x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x4 AsUInt(Int1x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x1 AsUInt(Int2x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x2 AsUInt(Int2x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x3 AsUInt(Int2x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x4 AsUInt(Int2x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x1 AsUInt(Int3x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x2 AsUInt(Int3x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x3 AsUInt(Int3x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x4 AsUInt(Int3x4 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x1 AsUInt(Int4x1 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x2 AsUInt(Int4x2 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x3 AsUInt(Int4x3 x) => default; + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x4 AsUInt(Int4x4 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static float Atan(float x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2 Atan(Float2 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3 Atan(Float3 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4 Atan(Float4 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x1 Atan(Float1x1 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x2 Atan(Float1x2 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x3 Atan(Float1x3 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x4 Atan(Float1x4 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x1 Atan(Float2x1 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x2 Atan(Float2x2 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x3 Atan(Float2x3 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x4 Atan(Float2x4 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x1 Atan(Float3x1 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x2 Atan(Float3x2 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x3 Atan(Float3x3 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x4 Atan(Float3x4 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x1 Atan(Float4x1 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x2 Atan(Float4x2 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x3 Atan(Float4x3 x) => default; + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x4 Atan(Float4x4 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static float Atan2(float y, float x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2 Atan2(Float2 y, Float2 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3 Atan2(Float3 y, Float3 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4 Atan2(Float4 y, Float4 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x1 Atan2(Float1x1 y, Float1x1 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x2 Atan2(Float1x2 y, Float1x2 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x3 Atan2(Float1x3 y, Float1x3 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x4 Atan2(Float1x4 y, Float1x4 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x1 Atan2(Float2x1 y, Float2x1 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x2 Atan2(Float2x2 y, Float2x2 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x3 Atan2(Float2x3 y, Float2x3 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x4 Atan2(Float2x4 y, Float2x4 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x1 Atan2(Float3x1 y, Float3x1 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x2 Atan2(Float3x2 y, Float3x2 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x3 Atan2(Float3x3 y, Float3x3 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x4 Atan2(Float3x4 y, Float3x4 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x1 Atan2(Float4x1 y, Float4x1 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x2 Atan2(Float4x2 y, Float4x2 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x3 Atan2(Float4x3 y, Float4x3 x) => default; + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent 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. + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x4 Atan2(Float4x4 y, Float4x4 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static float Ceil(float x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2 Ceil(Float2 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3 Ceil(Float3 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4 Ceil(Float4 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x1 Ceil(Float1x1 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x2 Ceil(Float1x2 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x3 Ceil(Float1x3 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x4 Ceil(Float1x4 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x1 Ceil(Float2x1 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x2 Ceil(Float2x2 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x3 Ceil(Float2x3 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x4 Ceil(Float2x4 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x1 Ceil(Float3x1 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x2 Ceil(Float3x2 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x3 Ceil(Float3x3 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x4 Ceil(Float3x4 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x1 Ceil(Float4x1 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x2 Ceil(Float4x2 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x3 Ceil(Float4x3 x) => default; + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x4 Ceil(Float4x4 x) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static float Clamp(float x, float min, float max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2 Clamp(Float2 x, Float2 min, Float2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3 Clamp(Float3 x, Float3 min, Float3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4 Clamp(Float4 x, Float4 min, Float4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x1 Clamp(Float1x1 x, Float1x1 min, Float1x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x2 Clamp(Float1x2 x, Float1x2 min, Float1x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x3 Clamp(Float1x3 x, Float1x3 min, Float1x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x4 Clamp(Float1x4 x, Float1x4 min, Float1x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x1 Clamp(Float2x1 x, Float2x1 min, Float2x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x2 Clamp(Float2x2 x, Float2x2 min, Float2x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x3 Clamp(Float2x3 x, Float2x3 min, Float2x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x4 Clamp(Float2x4 x, Float2x4 min, Float2x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x1 Clamp(Float3x1 x, Float3x1 min, Float3x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x2 Clamp(Float3x2 x, Float3x2 min, Float3x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x3 Clamp(Float3x3 x, Float3x3 min, Float3x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x4 Clamp(Float3x4 x, Float3x4 min, Float3x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x1 Clamp(Float4x1 x, Float4x1 min, Float4x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x2 Clamp(Float4x2 x, Float4x2 min, Float4x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x3 Clamp(Float4x3 x, Float4x3 min, Float4x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x4 Clamp(Float4x4 x, Float4x4 min, Float4x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static int Clamp(int x, int min, int max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2 Clamp(Int2 x, Int2 min, Int2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3 Clamp(Int3 x, Int3 min, Int3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4 Clamp(Int4 x, Int4 min, Int4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x1 Clamp(Int1x1 x, Int1x1 min, Int1x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x2 Clamp(Int1x2 x, Int1x2 min, Int1x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x3 Clamp(Int1x3 x, Int1x3 min, Int1x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x4 Clamp(Int1x4 x, Int1x4 min, Int1x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x1 Clamp(Int2x1 x, Int2x1 min, Int2x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x2 Clamp(Int2x2 x, Int2x2 min, Int2x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x3 Clamp(Int2x3 x, Int2x3 min, Int2x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x4 Clamp(Int2x4 x, Int2x4 min, Int2x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x1 Clamp(Int3x1 x, Int3x1 min, Int3x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x2 Clamp(Int3x2 x, Int3x2 min, Int3x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x3 Clamp(Int3x3 x, Int3x3 min, Int3x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x4 Clamp(Int3x4 x, Int3x4 min, Int3x4 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x1 Clamp(Int4x1 x, Int4x1 min, Int4x1 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x2 Clamp(Int4x2 x, Int4x2 min, Int4x2 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x3 Clamp(Int4x3 x, Int4x3 min, Int4x3 max) => default; + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x4 Clamp(Int4x4 x, Int4x4 min, Int4x4 max) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static float Cos(float x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2 Cos(Float2 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3 Cos(Float3 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4 Cos(Float4 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x1 Cos(Float1x1 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x2 Cos(Float1x2 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x3 Cos(Float1x3 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x4 Cos(Float1x4 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x1 Cos(Float2x1 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x2 Cos(Float2x2 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x3 Cos(Float2x3 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x4 Cos(Float2x4 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x1 Cos(Float3x1 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x2 Cos(Float3x2 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x3 Cos(Float3x3 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x4 Cos(Float3x4 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x1 Cos(Float4x1 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x2 Cos(Float4x2 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x3 Cos(Float4x3 x) => default; + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x4 Cos(Float4x4 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static float Cosh(float x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2 Cosh(Float2 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3 Cosh(Float3 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4 Cosh(Float4 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x1 Cosh(Float1x1 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x2 Cosh(Float1x2 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x3 Cosh(Float1x3 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x4 Cosh(Float1x4 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x1 Cosh(Float2x1 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x2 Cosh(Float2x2 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x3 Cosh(Float2x3 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x4 Cosh(Float2x4 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x1 Cosh(Float3x1 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x2 Cosh(Float3x2 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x3 Cosh(Float3x3 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x4 Cosh(Float3x4 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x1 Cosh(Float4x1 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x2 Cosh(Float4x2 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x3 Cosh(Float4x3 x) => default; + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x4 Cosh(Float4x4 x) => default; + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("countbits")] + public static uint CountBits(uint x) => default; + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("countbits")] + public static UInt2 CountBits(UInt2 x) => default; + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("countbits")] + public static UInt3 CountBits(UInt3 x) => default; + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("countbits")] + public static UInt4 CountBits(UInt4 x) => default; + + /// + /// Returns the cross product of two floating-point, 3D vectors. + /// + /// The first floating-point, 3D vector. + /// The second floating-point, 3D vector. + /// The number of bits. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("cross")] + public static Float3 Cross(Float3 x, Float3 y) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static float Degrees(float x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2 Degrees(Float2 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3 Degrees(Float3 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4 Degrees(Float4 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x1 Degrees(Float1x1 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x2 Degrees(Float1x2 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x3 Degrees(Float1x3 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x4 Degrees(Float1x4 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x1 Degrees(Float2x1 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x2 Degrees(Float2x2 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x3 Degrees(Float2x3 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x4 Degrees(Float2x4 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x1 Degrees(Float3x1 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x2 Degrees(Float3x2 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x3 Degrees(Float3x3 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x4 Degrees(Float3x4 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x1 Degrees(Float4x1 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x2 Degrees(Float4x2 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x3 Degrees(Float4x3 x) => default; + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x4 Degrees(Float4x4 x) => default; + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float1x1 m) => default; + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float2x2 m) => default; + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float3x3 m) => default; + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float4x4 m) => default; + + /// + /// Returns a distance scalar between two vectors. + /// + /// The first floating-point vector to compare. + /// The second floating-point vector to compare. + /// A floating-point, scalar value that represents the distance between the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("distance")] + public static Float2 Distance(Float2 x, Float2 y) => default; + + /// + /// Returns a distance scalar between two vectors. + /// + /// The first floating-point vector to compare. + /// The second floating-point vector to compare. + /// A floating-point, scalar value that represents the distance between the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("distance")] + public static Float3 Distance(Float3 x, Float3 y) => default; + + /// + /// Returns a distance scalar between two vectors. + /// + /// The first floating-point vector to compare. + /// The second floating-point vector to compare. + /// A floating-point, scalar value that represents the distance between the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("distance")] + public static Float4 Distance(Float4 x, Float4 y) => default; + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Float2 x, Float2 y) => default; + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Float3 x, Float3 y) => default; + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Float4 x, Float4 y) => default; + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("dot")] + public static int Dot(Int2 x, Int2 y) => default; + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("dot")] + public static int Dot(Int3 x, Int3 y) => default; + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("dot")] + public static int Dot(Int4 x, Int4 y) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static float Exp(float x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2 Exp(Float2 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3 Exp(Float3 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4 Exp(Float4 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x1 Exp(Float1x1 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x2 Exp(Float1x2 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x3 Exp(Float1x3 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x4 Exp(Float1x4 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x1 Exp(Float2x1 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x2 Exp(Float2x2 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x3 Exp(Float2x3 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x4 Exp(Float2x4 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x1 Exp(Float3x1 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x2 Exp(Float3x2 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x3 Exp(Float3x3 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x4 Exp(Float3x4 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x1 Exp(Float4x1 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x2 Exp(Float4x2 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x3 Exp(Float4x3 x) => default; + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x4 Exp(Float4x4 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static float Exp2(float x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2 Exp2(Float2 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3 Exp2(Float3 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4 Exp2(Float4 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x1 Exp2(Float1x1 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x2 Exp2(Float1x2 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x3 Exp2(Float1x3 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x4 Exp2(Float1x4 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x1 Exp2(Float2x1 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x2 Exp2(Float2x2 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x3 Exp2(Float2x3 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x4 Exp2(Float2x4 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x1 Exp2(Float3x1 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x2 Exp2(Float3x2 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x3 Exp2(Float3x3 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x4 Exp2(Float3x4 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x1 Exp2(Float4x1 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x2 Exp2(Float4x2 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x3 Exp2(Float4x3 x) => default; + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x4 Exp2(Float4x4 x) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static int FirstBitHigh(int value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static Int2 FirstBitHigh(Int2 value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static Int3 FirstBitHigh(Int3 value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static Int4 FirstBitHigh(Int4 value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static uint FirstBitHigh(uint value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static UInt2 FirstBitHigh(UInt2 value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static UInt3 FirstBitHigh(UInt3 value) => default; + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static UInt4 FirstBitHigh(UInt4 value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static int FirstBitLow(int value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static Int2 FirstBitLow(Int2 value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static Int3 FirstBitLow(Int3 value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static Int4 FirstBitLow(Int4 value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static uint FirstBitLow(uint value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static UInt2 FirstBitLow(UInt2 value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static UInt3 FirstBitLow(UInt3 value) => default; + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static UInt4 FirstBitLow(UInt4 value) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static float Floor(float x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2 Floor(Float2 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3 Floor(Float3 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4 Floor(Float4 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x1 Floor(Float1x1 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x2 Floor(Float1x2 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x3 Floor(Float1x3 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x4 Floor(Float1x4 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x1 Floor(Float2x1 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x2 Floor(Float2x2 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x3 Floor(Float2x3 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x4 Floor(Float2x4 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x1 Floor(Float3x1 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x2 Floor(Float3x2 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x3 Floor(Float3x3 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x4 Floor(Float3x4 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x1 Floor(Float4x1 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x2 Floor(Float4x2 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x3 Floor(Float4x3 x) => default; + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x4 Floor(Float4x4 x) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static double FusedMultiplyAccumulate(double a, double b, double c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double2 FusedMultiplyAccumulate(Double2 a, Double2 b, Double2 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double3 FusedMultiplyAccumulate(Double3 a, Double3 b, Double3 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double4 FusedMultiplyAccumulate(Double4 a, Double4 b, Double4 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x1 FusedMultiplyAccumulate(Double1x1 a, Double1x1 b, Double1x1 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x2 FusedMultiplyAccumulate(Double1x2 a, Double1x2 b, Double1x2 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x3 FusedMultiplyAccumulate(Double1x3 a, Double1x3 b, Double1x3 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x4 FusedMultiplyAccumulate(Double1x4 a, Double1x4 b, Double1x4 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x1 FusedMultiplyAccumulate(Double2x1 a, Double2x1 b, Double2x1 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x2 FusedMultiplyAccumulate(Double2x2 a, Double2x2 b, Double2x2 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x3 FusedMultiplyAccumulate(Double2x3 a, Double2x3 b, Double2x3 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x4 FusedMultiplyAccumulate(Double2x4 a, Double2x4 b, Double2x4 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x1 FusedMultiplyAccumulate(Double3x1 a, Double3x1 b, Double3x1 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x2 FusedMultiplyAccumulate(Double3x2 a, Double3x2 b, Double3x2 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x3 FusedMultiplyAccumulate(Double3x3 a, Double3x3 b, Double3x3 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x4 FusedMultiplyAccumulate(Double3x4 a, Double3x4 b, Double3x4 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x1 FusedMultiplyAccumulate(Double4x1 a, Double4x1 b, Double4x1 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x2 FusedMultiplyAccumulate(Double4x2 a, Double4x2 b, Double4x2 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x3 FusedMultiplyAccumulate(Double4x3 a, Double4x3 b, Double4x3 c) => default; + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x4 FusedMultiplyAccumulate(Double4x4 a, Double4x4 b, Double4x4 c) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static float Fmod(float x, float y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2 Fmod(Float2 x, Float2 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3 Fmod(Float3 x, Float3 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4 Fmod(Float4 x, Float4 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x1 Fmod(Float1x1 x, Float1x1 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x2 Fmod(Float1x2 x, Float1x2 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x3 Fmod(Float1x3 x, Float1x3 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x4 Fmod(Float1x4 x, Float1x4 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x1 Fmod(Float2x1 x, Float2x1 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x2 Fmod(Float2x2 x, Float2x2 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x3 Fmod(Float2x3 x, Float2x3 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x4 Fmod(Float2x4 x, Float2x4 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x1 Fmod(Float3x1 x, Float3x1 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x2 Fmod(Float3x2 x, Float3x2 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x3 Fmod(Float3x3 x, Float3x3 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x4 Fmod(Float3x4 x, Float3x4 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x1 Fmod(Float4x1 x, Float4x1 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x2 Fmod(Float4x2 x, Float4x2 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x3 Fmod(Float4x3 x, Float4x3 y) => default; + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x4 Fmod(Float4x4 x, Float4x4 y) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static float Frac(float x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2 Frac(Float2 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3 Frac(Float3 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4 Frac(Float4 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x1 Frac(Float1x1 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x2 Frac(Float1x2 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x3 Frac(Float1x3 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x4 Frac(Float1x4 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x1 Frac(Float2x1 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x2 Frac(Float2x2 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x3 Frac(Float2x3 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x4 Frac(Float2x4 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x1 Frac(Float3x1 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x2 Frac(Float3x2 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x3 Frac(Float3x3 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x4 Frac(Float3x4 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x1 Frac(Float4x1 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x2 Frac(Float4x2 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x3 Frac(Float4x3 x) => default; + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x4 Frac(Float4x4 x) => default; + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static float Frexp(float x, out float exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(float)}, {typeof(float)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float2 Frexp(Float2 x, out Float2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float3 Frexp(Float3 x, out Float3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float4 Frexp(Float4 x, out Float4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float1x1 Frexp(Float1x1 x, out Float1x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float1x2 Frexp(Float1x2 x, out Float1x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float1x3 Frexp(Float1x3 x, out Float1x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float1x4 Frexp(Float1x4 x, out Float1x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float2x1 Frexp(Float2x1 x, out Float2x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float2x2 Frexp(Float2x2 x, out Float2x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float2x3 Frexp(Float2x3 x, out Float2x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float2x4 Frexp(Float2x4 x, out Float2x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float3x1 Frexp(Float3x1 x, out Float3x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float3x2 Frexp(Float3x2 x, out Float3x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float3x3 Frexp(Float3x3 x, out Float3x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float3x4 Frexp(Float3x4 x, out Float3x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float4x1 Frexp(Float4x1 x, out Float4x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float4x2 Frexp(Float4x2 x, out Float4x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float4x3 Frexp(Float4x3 x, out Float4x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [HlslIntrinsicName("frexp")] + public static Float4x4 Frexp(Float4x4 x, out Float4x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static bool IsFinite(float x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2 IsFinite(Float2 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3 IsFinite(Float3 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4 IsFinite(Float4 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x1 IsFinite(Float1x1 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x2 IsFinite(Float1x2 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x3 IsFinite(Float1x3 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x4 IsFinite(Float1x4 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x1 IsFinite(Float2x1 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x2 IsFinite(Float2x2 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x3 IsFinite(Float2x3 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x4 IsFinite(Float2x4 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x1 IsFinite(Float3x1 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x2 IsFinite(Float3x2 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x3 IsFinite(Float3x3 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x4 IsFinite(Float3x4 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x1 IsFinite(Float4x1 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x2 IsFinite(Float4x2 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x3 IsFinite(Float4x3 x) => default; + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x4 IsFinite(Float4x4 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static bool IsInfinite(float x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2 IsInfinite(Float2 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3 IsInfinite(Float3 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4 IsInfinite(Float4 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x1 IsInfinite(Float1x1 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x2 IsInfinite(Float1x2 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x3 IsInfinite(Float1x3 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x4 IsInfinite(Float1x4 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x1 IsInfinite(Float2x1 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x2 IsInfinite(Float2x2 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x3 IsInfinite(Float2x3 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x4 IsInfinite(Float2x4 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x1 IsInfinite(Float3x1 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x2 IsInfinite(Float3x2 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x3 IsInfinite(Float3x3 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x4 IsInfinite(Float3x4 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x1 IsInfinite(Float4x1 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x2 IsInfinite(Float4x2 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x3 IsInfinite(Float4x3 x) => default; + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x4 IsInfinite(Float4x4 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static bool IsNaN(float x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2 IsNaN(Float2 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3 IsNaN(Float3 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4 IsNaN(Float4 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x1 IsNaN(Float1x1 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x2 IsNaN(Float1x2 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x3 IsNaN(Float1x3 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x4 IsNaN(Float1x4 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x1 IsNaN(Float2x1 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x2 IsNaN(Float2x2 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x3 IsNaN(Float2x3 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x4 IsNaN(Float2x4 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x1 IsNaN(Float3x1 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x2 IsNaN(Float3x2 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x3 IsNaN(Float3x3 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x4 IsNaN(Float3x4 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x1 IsNaN(Float4x1 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x2 IsNaN(Float4x2 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x3 IsNaN(Float4x3 x) => default; + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x4 IsNaN(Float4x4 x) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static float Ldexp(float x, float exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2 Ldexp(Float2 x, Float2 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3 Ldexp(Float3 x, Float3 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4 Ldexp(Float4 x, Float4 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x1 Ldexp(Float1x1 x, Float1x1 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x2 Ldexp(Float1x2 x, Float1x2 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x3 Ldexp(Float1x3 x, Float1x3 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x4 Ldexp(Float1x4 x, Float1x4 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x1 Ldexp(Float2x1 x, Float2x1 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x2 Ldexp(Float2x2 x, Float2x2 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x3 Ldexp(Float2x3 x, Float2x3 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x4 Ldexp(Float2x4 x, Float2x4 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x1 Ldexp(Float3x1 x, Float3x1 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x2 Ldexp(Float3x2 x, Float3x2 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x3 Ldexp(Float3x3 x, Float3x3 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x4 Ldexp(Float3x4 x, Float3x4 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x1 Ldexp(Float4x1 x, Float4x1 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x2 Ldexp(Float4x2 x, Float4x2 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x3 Ldexp(Float4x3 x, Float4x3 exp) => default; + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x4 Ldexp(Float4x4 x, Float4x4 exp) => default; + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("length")] + public static float Length(Float2 x) => default; + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("length")] + public static float Length(Float3 x) => default; + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("length")] + public static float Length(Float4 x) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static float Lerp(float x, float y, float s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2 Lerp(Float2 x, Float2 y, Float2 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3 Lerp(Float3 x, Float3 y, Float3 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4 Lerp(Float4 x, Float4 y, Float4 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x1 Lerp(Float1x1 x, Float1x1 y, Float1x1 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x2 Lerp(Float1x2 x, Float1x2 y, Float1x2 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x3 Lerp(Float1x3 x, Float1x3 y, Float1x3 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x4 Lerp(Float1x4 x, Float1x4 y, Float1x4 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x1 Lerp(Float2x1 x, Float2x1 y, Float2x1 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x2 Lerp(Float2x2 x, Float2x2 y, Float2x2 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x3 Lerp(Float2x3 x, Float2x3 y, Float2x3 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x4 Lerp(Float2x4 x, Float2x4 y, Float2x4 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x1 Lerp(Float3x1 x, Float3x1 y, Float3x1 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x2 Lerp(Float3x2 x, Float3x2 y, Float3x2 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x3 Lerp(Float3x3 x, Float3x3 y, Float3x3 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x4 Lerp(Float3x4 x, Float3x4 y, Float3x4 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x1 Lerp(Float4x1 x, Float4x1 y, Float4x1 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x2 Lerp(Float4x2 x, Float4x2 y, Float4x2 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x3 Lerp(Float4x3 x, Float4x3 y, Float4x3 s) => default; + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x4 Lerp(Float4x4 x, Float4x4 y, Float4x4 s) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static float Log(float x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float2 Log(Float2 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float3 Log(Float3 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float4 Log(Float4 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x1 Log(Float1x1 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x2 Log(Float1x2 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x3 Log(Float1x3 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x4 Log(Float1x4 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x1 Log(Float2x1 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x2 Log(Float2x2 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x3 Log(Float2x3 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x4 Log(Float2x4 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x1 Log(Float3x1 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x2 Log(Float3x2 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x3 Log(Float3x3 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x4 Log(Float3x4 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x1 Log(Float4x1 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x2 Log(Float4x2 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x3 Log(Float4x3 x) => default; + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x4 Log(Float4x4 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static float Log10(float x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2 Log10(Float2 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3 Log10(Float3 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4 Log10(Float4 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x1 Log10(Float1x1 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x2 Log10(Float1x2 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x3 Log10(Float1x3 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x4 Log10(Float1x4 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x1 Log10(Float2x1 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x2 Log10(Float2x2 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x3 Log10(Float2x3 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x4 Log10(Float2x4 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x1 Log10(Float3x1 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x2 Log10(Float3x2 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x3 Log10(Float3x3 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x4 Log10(Float3x4 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x1 Log10(Float4x1 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x2 Log10(Float4x2 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x3 Log10(Float4x3 x) => default; + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x4 Log10(Float4x4 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static float Log2(float x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2 Log2(Float2 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3 Log2(Float3 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4 Log2(Float4 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x1 Log2(Float1x1 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x2 Log2(Float1x2 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x3 Log2(Float1x3 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x4 Log2(Float1x4 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x1 Log2(Float2x1 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x2 Log2(Float2x2 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x3 Log2(Float2x3 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x4 Log2(Float2x4 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x1 Log2(Float3x1 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x2 Log2(Float3x2 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x3 Log2(Float3x3 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x4 Log2(Float3x4 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x1 Log2(Float4x1 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x2 Log2(Float4x2 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x3 Log2(Float4x3 x) => default; + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x4 Log2(Float4x4 x) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static float Max(float x, float y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float2 Max(Float2 x, Float2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float3 Max(Float3 x, Float3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float4 Max(Float4 x, Float4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x1 Max(Float1x1 x, Float1x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x2 Max(Float1x2 x, Float1x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x3 Max(Float1x3 x, Float1x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x4 Max(Float1x4 x, Float1x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x1 Max(Float2x1 x, Float2x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x2 Max(Float2x2 x, Float2x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x3 Max(Float2x3 x, Float2x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x4 Max(Float2x4 x, Float2x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x1 Max(Float3x1 x, Float3x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x2 Max(Float3x2 x, Float3x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x3 Max(Float3x3 x, Float3x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x4 Max(Float3x4 x, Float3x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x1 Max(Float4x1 x, Float4x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x2 Max(Float4x2 x, Float4x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x3 Max(Float4x3 x, Float4x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x4 Max(Float4x4 x, Float4x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static double Max(double x, double y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double2 Max(Double2 x, Double2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double3 Max(Double3 x, Double3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double4 Max(Double4 x, Double4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double1x1 Max(Double1x1 x, Double1x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double1x2 Max(Double1x2 x, Double1x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double1x3 Max(Double1x3 x, Double1x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double1x4 Max(Double1x4 x, Double1x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double2x1 Max(Double2x1 x, Double2x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double2x2 Max(Double2x2 x, Double2x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double2x3 Max(Double2x3 x, Double2x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double2x4 Max(Double2x4 x, Double2x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double3x1 Max(Double3x1 x, Double3x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double3x2 Max(Double3x2 x, Double3x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double3x3 Max(Double3x3 x, Double3x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double3x4 Max(Double3x4 x, Double3x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double4x1 Max(Double4x1 x, Double4x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double4x2 Max(Double4x2 x, Double4x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double4x3 Max(Double4x3 x, Double4x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Double4x4 Max(Double4x4 x, Double4x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static int Max(int x, int y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int2 Max(Int2 x, Int2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int3 Max(Int3 x, Int3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int4 Max(Int4 x, Int4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x1 Max(Int1x1 x, Int1x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x2 Max(Int1x2 x, Int1x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x3 Max(Int1x3 x, Int1x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x4 Max(Int1x4 x, Int1x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x1 Max(Int2x1 x, Int2x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x2 Max(Int2x2 x, Int2x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x3 Max(Int2x3 x, Int2x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x4 Max(Int2x4 x, Int2x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x1 Max(Int3x1 x, Int3x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x2 Max(Int3x2 x, Int3x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x3 Max(Int3x3 x, Int3x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x4 Max(Int3x4 x, Int3x4 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x1 Max(Int4x1 x, Int4x1 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x2 Max(Int4x2 x, Int4x2 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x3 Max(Int4x3 x, Int4x3 y) => default; + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x4 Max(Int4x4 x, Int4x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static float Min(float x, float y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float2 Min(Float2 x, Float2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float3 Min(Float3 x, Float3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float4 Min(Float4 x, Float4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x1 Min(Float1x1 x, Float1x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x2 Min(Float1x2 x, Float1x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x3 Min(Float1x3 x, Float1x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x4 Min(Float1x4 x, Float1x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x1 Min(Float2x1 x, Float2x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x2 Min(Float2x2 x, Float2x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x3 Min(Float2x3 x, Float2x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x4 Min(Float2x4 x, Float2x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x1 Min(Float3x1 x, Float3x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x2 Min(Float3x2 x, Float3x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x3 Min(Float3x3 x, Float3x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x4 Min(Float3x4 x, Float3x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x1 Min(Float4x1 x, Float4x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x2 Min(Float4x2 x, Float4x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x3 Min(Float4x3 x, Float4x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x4 Min(Float4x4 x, Float4x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static double Min(double x, double y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double2 Min(Double2 x, Double2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double3 Min(Double3 x, Double3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double4 Min(Double4 x, Double4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double1x1 Min(Double1x1 x, Double1x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double1x2 Min(Double1x2 x, Double1x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double1x3 Min(Double1x3 x, Double1x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double1x4 Min(Double1x4 x, Double1x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double2x1 Min(Double2x1 x, Double2x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double2x2 Min(Double2x2 x, Double2x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double2x3 Min(Double2x3 x, Double2x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double2x4 Min(Double2x4 x, Double2x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double3x1 Min(Double3x1 x, Double3x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double3x2 Min(Double3x2 x, Double3x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double3x3 Min(Double3x3 x, Double3x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double3x4 Min(Double3x4 x, Double3x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double4x1 Min(Double4x1 x, Double4x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double4x2 Min(Double4x2 x, Double4x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double4x3 Min(Double4x3 x, Double4x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Double4x4 Min(Double4x4 x, Double4x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static int Min(int x, int y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int2 Min(Int2 x, Int2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int3 Min(Int3 x, Int3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int4 Min(Int4 x, Int4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x1 Min(Int1x1 x, Int1x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x2 Min(Int1x2 x, Int1x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x3 Min(Int1x3 x, Int1x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x4 Min(Int1x4 x, Int1x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x1 Min(Int2x1 x, Int2x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x2 Min(Int2x2 x, Int2x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x3 Min(Int2x3 x, Int2x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x4 Min(Int2x4 x, Int2x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x1 Min(Int3x1 x, Int3x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x2 Min(Int3x2 x, Int3x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x3 Min(Int3x3 x, Int3x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x4 Min(Int3x4 x, Int3x4 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x1 Min(Int4x1 x, Int4x1 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x2 Min(Int4x2 x, Int4x2 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x3 Min(Int4x3 x, Int4x3 y) => default; + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x4 Min(Int4x4 x, Int4x4 y) => default; + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static float Modf(float x, out float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(float)}, {typeof(float)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float2 Modf(Float2 x, out Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float3 Modf(Float3 x, out Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float4 Modf(Float4 x, out Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x1 Modf(Float1x1 x, out Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x2 Modf(Float1x2 x, out Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x3 Modf(Float1x3 x, out Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x4 Modf(Float1x4 x, out Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x1 Modf(Float2x1 x, out Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x2 Modf(Float2x2 x, out Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x3 Modf(Float2x3 x, out Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x4 Modf(Float2x4 x, out Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x1 Modf(Float3x1 x, out Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x2 Modf(Float3x2 x, out Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x3 Modf(Float3x3 x, out Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x4 Modf(Float3x4 x, out Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x1 Modf(Float4x1 x, out Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x2 Modf(Float4x2 x, out Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x3 Modf(Float4x3 x, out Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x4 Modf(Float4x4 x, out Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static int Modf(int x, out int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(int)}, {typeof(int)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int2 Modf(Int2 x, out Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int3 Modf(Int3 x, out Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int4 Modf(Int4 x, out Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x1 Modf(Int1x1 x, out Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x1)}, {typeof(Int1x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x2 Modf(Int1x2 x, out Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x2)}, {typeof(Int1x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x3 Modf(Int1x3 x, out Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x3)}, {typeof(Int1x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x4 Modf(Int1x4 x, out Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x4)}, {typeof(Int1x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x1 Modf(Int2x1 x, out Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x1)}, {typeof(Int2x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x2 Modf(Int2x2 x, out Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x2)}, {typeof(Int2x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x3 Modf(Int2x3 x, out Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x3)}, {typeof(Int2x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x4 Modf(Int2x4 x, out Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x4)}, {typeof(Int2x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x1 Modf(Int3x1 x, out Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x1)}, {typeof(Int3x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x2 Modf(Int3x2 x, out Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x2)}, {typeof(Int3x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x3 Modf(Int3x3 x, out Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x3)}, {typeof(Int3x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x4 Modf(Int3x4 x, out Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x4)}, {typeof(Int3x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x1 Modf(Int4x1 x, out Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x1)}, {typeof(Int4x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x2 Modf(Int4x2 x, out Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x2)}, {typeof(Int4x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x3 Modf(Int4x3 x, out Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x3)}, {typeof(Int4x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion 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. + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x4 Modf(Int4x4 x, out Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x4)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(float x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(int x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(float x, Float2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(float x, Float3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(float x, Float4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(int x, Int2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(int x, Int3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(int x, Int4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(float x, Float1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(float x, Float1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(float x, Float1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(float x, Float1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(float x, Float2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(float x, Float2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(float x, Float2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(float x, Float2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(float x, Float3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(float x, Float3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(float x, Float3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(float x, Float3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(float x, Float4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(float x, Float4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(float x, Float4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(float x, Float4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(int x, Int1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(int x, Int1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(int x, Int1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(int x, Int1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(int x, Int2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(int x, Int2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(int x, Int2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(int x, Int2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(int x, Int3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(int x, Int3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(int x, Int3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(int x, Int3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(int x, Int4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(int x, Int4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(int x, Int4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(int x, Int4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float2 x, Float2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float3 x, Float3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float4 x, Float4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int2 x, Int2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int3 x, Int3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int4 x, Int4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float2 x, Float2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2 x, Float2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float2 x, Float2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float2 x, Float2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float3 x, Float3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float3 x, Float3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3 x, Float3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float3 x, Float3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float4 x, Float4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float4 x, Float4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float4 x, Float4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4 x, Float4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int2 x, Int2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2 x, Int2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int2 x, Int2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int2 x, Int2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int3 x, Int3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int3 x, Int3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3 x, Int3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int3 x, Int3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int4 x, Int4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int4 x, Int4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int4 x, Int4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4 x, Int4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x1 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x2 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x3 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x4 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x1 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x2 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x3 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x4 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x1 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x2 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x3 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x4 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x1 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x2 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x3 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x4 x, float y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x1 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x2 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x3 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x4 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x1 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x2 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x3 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x4 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x1 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x2 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x3 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x4 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x1 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x2 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x3 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x4 x, int y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float1x2 x, Float2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float1x3 x, Float3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float1x4 x, Float4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2x2 x, Float2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2x3 x, Float3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2x4 x, Float4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3x2 x, Float2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3x3 x, Float3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3x4 x, Float4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4x2 x, Float2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4x3 x, Float3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4x4 x, Float4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int1x2 x, Int2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int1x3 x, Int3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int1x4 x, Int4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2x2 x, Int2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2x3 x, Int3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2x4 x, Int4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3x2 x, Int2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3x3 x, Int3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3x4 x, Int4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4x2 x, Int2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4x3 x, Int3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4x4 x, Int4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x1 x, Float1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x1 x, Float1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x1 x, Float1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x1 x, Float1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x2 x, Float2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x2 x, Float2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x2 x, Float2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x2 x, Float2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x3 x, Float3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x3 x, Float3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x3 x, Float3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x3 x, Float3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x4 x, Float4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x4 x, Float4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x4 x, Float4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x4 x, Float4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x1 x, Float1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x1 x, Float1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x1 x, Float1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x1 x, Float1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x2 x, Float2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x2 x, Float2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x2 x, Float2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x2 x, Float2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x3 x, Float3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x3 x, Float3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x3 x, Float3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x3 x, Float3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x4 x, Float4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x4 x, Float4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x4 x, Float4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x4 x, Float4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x1 x, Float1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x1 x, Float1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x1 x, Float1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x1 x, Float1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x2 x, Float2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x2 x, Float2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x2 x, Float2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x2 x, Float2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x3 x, Float3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x3 x, Float3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x3 x, Float3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x3 x, Float3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x4 x, Float4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x4 x, Float4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x4 x, Float4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x4 x, Float4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x1 x, Float1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x1 x, Float1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x1 x, Float1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x1 x, Float1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x2 x, Float2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x2 x, Float2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x2 x, Float2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x2 x, Float2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x3 x, Float3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x3 x, Float3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x3 x, Float3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x3 x, Float3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x4 x, Float4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x4 x, Float4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x4 x, Float4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x4 x, Float4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x1 x, Int1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x1 x, Int1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x1 x, Int1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x1 x, Int1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x2 x, Int2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x2 x, Int2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x2 x, Int2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x2 x, Int2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x3 x, Int3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x3 x, Int3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x3 x, Int3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x3 x, Int3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x4 x, Int4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x4 x, Int4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x4 x, Int4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x4 x, Int4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x1 x, Int1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x1 x, Int1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x1 x, Int1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x1 x, Int1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x2 x, Int2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x2 x, Int2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x2 x, Int2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x2 x, Int2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x3 x, Int3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x3 x, Int3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x3 x, Int3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x3 x, Int3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x4 x, Int4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x4 x, Int4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x4 x, Int4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x4 x, Int4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x1 x, Int1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x1 x, Int1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x1 x, Int1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x1 x, Int1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x2 x, Int2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x2 x, Int2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x2 x, Int2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x2 x, Int2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x3 x, Int3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x3 x, Int3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x3 x, Int3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x3 x, Int3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x4 x, Int4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x4 x, Int4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x4 x, Int4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x4 x, Int4x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x1 x, Int1x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x1 x, Int1x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x1 x, Int1x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x1 x, Int1x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x2 x, Int2x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x2 x, Int2x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x2 x, Int2x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x2 x, Int2x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x3 x, Int3x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x3 x, Int3x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x3 x, Int3x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x3 x, Int3x4 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x4 x, Int4x1 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x4 x, Int4x2 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x4 x, Int4x3 y) => default; + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x4 x, Int4x4 y) => default; + + /// + /// Normalizes the specified floating-point vector according to x / length(x). + /// + /// The specified floating-point vector. + /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("normalize")] + public static float Normalize(Float2 x) => default; + + /// + /// Normalizes the specified floating-point vector according to x / length(x). + /// + /// The specified floating-point vector. + /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("normalize")] + public static float Normalize(Float3 x) => default; + + /// + /// Normalizes the specified floating-point vector according to x / length(x). + /// + /// The specified floating-point vector. + /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("normalize")] + public static float Normalize(Float4 x) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static float Pow(float x, float y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2 Pow(Float2 x, Float2 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3 Pow(Float3 x, Float3 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4 Pow(Float4 x, Float4 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x1 Pow(Float1x1 x, Float1x1 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x2 Pow(Float1x2 x, Float1x2 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x3 Pow(Float1x3 x, Float1x3 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x4 Pow(Float1x4 x, Float1x4 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x1 Pow(Float2x1 x, Float2x1 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x2 Pow(Float2x2 x, Float2x2 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x3 Pow(Float2x3 x, Float2x3 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x4 Pow(Float2x4 x, Float2x4 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x1 Pow(Float3x1 x, Float3x1 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x2 Pow(Float3x2 x, Float3x2 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x3 Pow(Float3x3 x, Float3x3 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x4 Pow(Float3x4 x, Float3x4 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x1 Pow(Float4x1 x, Float4x1 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x2 Pow(Float4x2 x, Float4x2 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x3 Pow(Float4x3 x, Float4x3 y) => default; + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x4 Pow(Float4x4 x, Float4x4 y) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static float Radians(float x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2 Radians(Float2 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3 Radians(Float3 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4 Radians(Float4 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x1 Radians(Float1x1 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x2 Radians(Float1x2 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x3 Radians(Float1x3 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x4 Radians(Float1x4 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x1 Radians(Float2x1 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x2 Radians(Float2x2 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x3 Radians(Float2x3 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x4 Radians(Float2x4 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x1 Radians(Float3x1 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x2 Radians(Float3x2 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x3 Radians(Float3x3 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x4 Radians(Float3x4 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x1 Radians(Float4x1 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x2 Radians(Float4x2 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x3 Radians(Float4x3 x) => default; + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x4 Radians(Float4x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static float Rcp(float x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2 Rcp(Float2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3 Rcp(Float3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4 Rcp(Float4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x1 Rcp(Float1x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x2 Rcp(Float1x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x3 Rcp(Float1x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x4 Rcp(Float1x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x1 Rcp(Float2x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x2 Rcp(Float2x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x3 Rcp(Float2x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x4 Rcp(Float2x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x1 Rcp(Float3x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x2 Rcp(Float3x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x3 Rcp(Float3x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x4 Rcp(Float3x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x1 Rcp(Float4x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x2 Rcp(Float4x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x3 Rcp(Float4x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x4 Rcp(Float4x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static double Rcp(double x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2 Rcp(Double2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3 Rcp(Double3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4 Rcp(Double4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x1 Rcp(Double1x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x2 Rcp(Double1x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x3 Rcp(Double1x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x4 Rcp(Double1x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x1 Rcp(Double2x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x2 Rcp(Double2x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x3 Rcp(Double2x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x4 Rcp(Double2x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x1 Rcp(Double3x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x2 Rcp(Double3x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x3 Rcp(Double3x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x4 Rcp(Double3x4 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x1 Rcp(Double4x1 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x2 Rcp(Double4x2 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x3 Rcp(Double4x3 x) => default; + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x4 Rcp(Double4x4 x) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static float Reflect(float i, float n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float2 Reflect(Float2 i, Float2 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float3 Reflect(Float3 i, Float3 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float4 Reflect(Float4 i, Float4 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float1x1 Reflect(Float1x1 i, Float1x1 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float1x2 Reflect(Float1x2 i, Float1x2 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float1x3 Reflect(Float1x3 i, Float1x3 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float1x4 Reflect(Float1x4 i, Float1x4 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float2x1 Reflect(Float2x1 i, Float2x1 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float2x2 Reflect(Float2x2 i, Float2x2 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float2x3 Reflect(Float2x3 i, Float2x3 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float2x4 Reflect(Float2x4 i, Float2x4 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float3x1 Reflect(Float3x1 i, Float3x1 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float3x2 Reflect(Float3x2 i, Float3x2 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float3x3 Reflect(Float3x3 i, Float3x3 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float3x4 Reflect(Float3x4 i, Float3x4 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float4x1 Reflect(Float4x1 i, Float4x1 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float4x2 Reflect(Float4x2 i, Float4x2 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float4x3 Reflect(Float4x3 i, Float4x3 n) => default; + + /// + /// Returns a reflection vector using an incident ray and a surface normal. + /// + /// A floating-point, incident vector. + /// A floating-point, normal vector. + /// A floating-point, reflection vector. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reflect")] + public static Float4x4 Reflect(Float4x4 i, Float4x4 n) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static float Refract(float i, float n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float2 Refract(Float2 i, Float2 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float3 Refract(Float3 i, Float3 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float4 Refract(Float4 i, Float4 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float1x1 Refract(Float1x1 i, Float1x1 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float1x2 Refract(Float1x2 i, Float1x2 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float1x3 Refract(Float1x3 i, Float1x3 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float1x4 Refract(Float1x4 i, Float1x4 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float2x1 Refract(Float2x1 i, Float2x1 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float2x2 Refract(Float2x2 i, Float2x2 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float2x3 Refract(Float2x3 i, Float2x3 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float2x4 Refract(Float2x4 i, Float2x4 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float3x1 Refract(Float3x1 i, Float3x1 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float3x2 Refract(Float3x2 i, Float3x2 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float3x3 Refract(Float3x3 i, Float3x3 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float3x4 Refract(Float3x4 i, Float3x4 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float4x1 Refract(Float4x1 i, Float4x1 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float4x2 Refract(Float4x2 i, Float4x2 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float4x3 Refract(Float4x3 i, Float4x3 n, float f) => default; + + /// + /// Returns a refraction vector using an entering ray, a surface normal, and a refraction index. + /// + /// A floating-point, ray direction vector. + /// A floating-point, surface normal vector. + /// A floating-point, refraction index scalar. + /// A floating-point, refraction vector. If the angle between the entering ray and the surface normal is too great for a given refraction index , the return value is 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("refract")] + public static Float4x4 Refract(Float4x4 i, Float4x4 n, float f) => default; + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reversebits")] + public static uint ReverseBits(uint x) => default; + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reversebits")] + public static UInt2 ReverseBits(UInt2 x) => default; + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reversebits")] + public static UInt3 ReverseBits(UInt3 x) => default; + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("reversebits")] + public static UInt4 ReverseBits(UInt4 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static float Round(float x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float2 Round(Float2 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float3 Round(Float3 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float4 Round(Float4 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x1 Round(Float1x1 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x2 Round(Float1x2 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x3 Round(Float1x3 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x4 Round(Float1x4 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x1 Round(Float2x1 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x2 Round(Float2x2 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x3 Round(Float2x3 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x4 Round(Float2x4 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x1 Round(Float3x1 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x2 Round(Float3x2 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x3 Round(Float3x3 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x4 Round(Float3x4 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x1 Round(Float4x1 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x2 Round(Float4x2 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x3 Round(Float4x3 x) => default; + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x4 Round(Float4x4 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static float Rsqrt(float x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2 Rsqrt(Float2 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3 Rsqrt(Float3 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4 Rsqrt(Float4 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x1 Rsqrt(Float1x1 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x2 Rsqrt(Float1x2 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x3 Rsqrt(Float1x3 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x4 Rsqrt(Float1x4 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x1 Rsqrt(Float2x1 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x2 Rsqrt(Float2x2 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x3 Rsqrt(Float2x3 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x4 Rsqrt(Float2x4 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x1 Rsqrt(Float3x1 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x2 Rsqrt(Float3x2 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x3 Rsqrt(Float3x3 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x4 Rsqrt(Float3x4 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x1 Rsqrt(Float4x1 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x2 Rsqrt(Float4x2 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x3 Rsqrt(Float4x3 x) => default; + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x4 Rsqrt(Float4x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static float Saturate(float x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2 Saturate(Float2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3 Saturate(Float3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4 Saturate(Float4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x1 Saturate(Float1x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x2 Saturate(Float1x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x3 Saturate(Float1x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x4 Saturate(Float1x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x1 Saturate(Float2x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x2 Saturate(Float2x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x3 Saturate(Float2x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x4 Saturate(Float2x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x1 Saturate(Float3x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x2 Saturate(Float3x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x3 Saturate(Float3x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x4 Saturate(Float3x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x1 Saturate(Float4x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x2 Saturate(Float4x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x3 Saturate(Float4x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x4 Saturate(Float4x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static double Saturate(double x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double2 Saturate(Double2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double3 Saturate(Double3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double4 Saturate(Double4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double1x1 Saturate(Double1x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double1x2 Saturate(Double1x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double1x3 Saturate(Double1x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double1x4 Saturate(Double1x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double2x1 Saturate(Double2x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double2x2 Saturate(Double2x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double2x3 Saturate(Double2x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double2x4 Saturate(Double2x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double3x1 Saturate(Double3x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double3x2 Saturate(Double3x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double3x3 Saturate(Double3x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double3x4 Saturate(Double3x4 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double4x1 Saturate(Double4x1 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double4x2 Saturate(Double4x2 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double4x3 Saturate(Double4x3 x) => default; + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("saturate")] + public static Double4x4 Saturate(Double4x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static int Sign(float x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2 Sign(Float2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3 Sign(Float3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4 Sign(Float4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x1 Sign(Float1x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x2 Sign(Float1x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x3 Sign(Float1x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x4 Sign(Float1x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x1 Sign(Float2x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x2 Sign(Float2x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x3 Sign(Float2x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x4 Sign(Float2x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x1 Sign(Float3x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x2 Sign(Float3x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x3 Sign(Float3x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x4 Sign(Float3x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x1 Sign(Float4x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x2 Sign(Float4x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x3 Sign(Float4x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x4 Sign(Float4x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static int Sign(int x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2 Sign(Int2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3 Sign(Int3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4 Sign(Int4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x1 Sign(Int1x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x2 Sign(Int1x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x3 Sign(Int1x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x4 Sign(Int1x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x1 Sign(Int2x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x2 Sign(Int2x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x3 Sign(Int2x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x4 Sign(Int2x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x1 Sign(Int3x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x2 Sign(Int3x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x3 Sign(Int3x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x4 Sign(Int3x4 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x1 Sign(Int4x1 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x2 Sign(Int4x2 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x3 Sign(Int4x3 x) => default; + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x4 Sign(Int4x4 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static float Sin(float x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2 Sin(Float2 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3 Sin(Float3 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4 Sin(Float4 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x1 Sin(Float1x1 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x2 Sin(Float1x2 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x3 Sin(Float1x3 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x4 Sin(Float1x4 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x1 Sin(Float2x1 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x2 Sin(Float2x2 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x3 Sin(Float2x3 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x4 Sin(Float2x4 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x1 Sin(Float3x1 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x2 Sin(Float3x2 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x3 Sin(Float3x3 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x4 Sin(Float3x4 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x1 Sin(Float4x1 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x2 Sin(Float4x2 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x3 Sin(Float4x3 x) => default; + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x4 Sin(Float4x4 x) => default; + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(float x, out float sin, out float cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2 x, out Float2 sin, out Float2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2)}, {typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3 x, out Float3 sin, out Float3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3)}, {typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4 x, out Float4 sin, out Float4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4)}, {typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x1 x, out Float1x1 sin, out Float1x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x1)}, {typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x2 x, out Float1x2 sin, out Float1x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x2)}, {typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x3 x, out Float1x3 sin, out Float1x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x3)}, {typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x4 x, out Float1x4 sin, out Float1x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x4)}, {typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x1 x, out Float2x1 sin, out Float2x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x1)}, {typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x2 x, out Float2x2 sin, out Float2x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x2)}, {typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x3 x, out Float2x3 sin, out Float2x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x3)}, {typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x4 x, out Float2x4 sin, out Float2x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x4)}, {typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x1 x, out Float3x1 sin, out Float3x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x1)}, {typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x2 x, out Float3x2 sin, out Float3x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x2)}, {typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x3 x, out Float3x3 sin, out Float3x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x3)}, {typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x4 x, out Float3x4 sin, out Float3x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x4)}, {typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x1 x, out Float4x1 sin, out Float4x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x1)}, {typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x2 x, out Float4x2 sin, out Float4x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x2)}, {typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x3 x, out Float4x3 sin, out Float4x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x3)}, {typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x4 x, out Float4x4 sin, out Float4x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x4)}, {typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static float Sinh(float x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2 Sinh(Float2 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3 Sinh(Float3 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4 Sinh(Float4 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x1 Sinh(Float1x1 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x2 Sinh(Float1x2 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x3 Sinh(Float1x3 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x4 Sinh(Float1x4 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x1 Sinh(Float2x1 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x2 Sinh(Float2x2 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x3 Sinh(Float2x3 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x4 Sinh(Float2x4 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x1 Sinh(Float3x1 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x2 Sinh(Float3x2 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x3 Sinh(Float3x3 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x4 Sinh(Float3x4 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x1 Sinh(Float4x1 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x2 Sinh(Float4x2 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x3 Sinh(Float4x3 x) => default; + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x4 Sinh(Float4x4 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static float SmoothStep(float min, float max, float x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2 SmoothStep(Float2 min, Float2 max, Float2 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3 SmoothStep(Float3 min, Float3 max, Float3 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4 SmoothStep(Float4 min, Float4 max, Float4 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x1 SmoothStep(Float1x1 min, Float1x1 max, Float1x1 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x2 SmoothStep(Float1x2 min, Float1x2 max, Float1x2 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x3 SmoothStep(Float1x3 min, Float1x3 max, Float1x3 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x4 SmoothStep(Float1x4 min, Float1x4 max, Float1x4 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x1 SmoothStep(Float2x1 min, Float2x1 max, Float2x1 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x2 SmoothStep(Float2x2 min, Float2x2 max, Float2x2 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x3 SmoothStep(Float2x3 min, Float2x3 max, Float2x3 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x4 SmoothStep(Float2x4 min, Float2x4 max, Float2x4 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x1 SmoothStep(Float3x1 min, Float3x1 max, Float3x1 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x2 SmoothStep(Float3x2 min, Float3x2 max, Float3x2 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x3 SmoothStep(Float3x3 min, Float3x3 max, Float3x3 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x4 SmoothStep(Float3x4 min, Float3x4 max, Float3x4 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x1 SmoothStep(Float4x1 min, Float4x1 max, Float4x1 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x2 SmoothStep(Float4x2 min, Float4x2 max, Float4x2 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x3 SmoothStep(Float4x3 min, Float4x3 max, Float4x3 x) => default; + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x4 SmoothStep(Float4x4 min, Float4x4 max, Float4x4 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static float Sqrt(float x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2 Sqrt(Float2 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3 Sqrt(Float3 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4 Sqrt(Float4 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x1 Sqrt(Float1x1 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x2 Sqrt(Float1x2 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x3 Sqrt(Float1x3 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x4 Sqrt(Float1x4 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x1 Sqrt(Float2x1 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x2 Sqrt(Float2x2 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x3 Sqrt(Float2x3 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x4 Sqrt(Float2x4 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x1 Sqrt(Float3x1 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x2 Sqrt(Float3x2 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x3 Sqrt(Float3x3 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x4 Sqrt(Float3x4 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x1 Sqrt(Float4x1 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x2 Sqrt(Float4x2 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x3 Sqrt(Float4x3 x) => default; + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x4 Sqrt(Float4x4 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static float Step(float y, float x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float2 Step(Float2 y, Float2 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float3 Step(Float3 y, Float3 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float4 Step(Float4 y, Float4 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x1 Step(Float1x1 y, Float1x1 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x2 Step(Float1x2 y, Float1x2 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x3 Step(Float1x3 y, Float1x3 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x4 Step(Float1x4 y, Float1x4 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x1 Step(Float2x1 y, Float2x1 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x2 Step(Float2x2 y, Float2x2 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x3 Step(Float2x3 y, Float2x3 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x4 Step(Float2x4 y, Float2x4 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x1 Step(Float3x1 y, Float3x1 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x2 Step(Float3x2 y, Float3x2 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x3 Step(Float3x3 y, Float3x3 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x4 Step(Float3x4 y, Float3x4 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x1 Step(Float4x1 y, Float4x1 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x2 Step(Float4x2 y, Float4x2 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x3 Step(Float4x3 y, Float4x3 x) => default; + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x4 Step(Float4x4 y, Float4x4 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static float Tan(float x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2 Tan(Float2 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3 Tan(Float3 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4 Tan(Float4 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x1 Tan(Float1x1 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x2 Tan(Float1x2 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x3 Tan(Float1x3 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x4 Tan(Float1x4 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x1 Tan(Float2x1 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x2 Tan(Float2x2 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x3 Tan(Float2x3 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x4 Tan(Float2x4 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x1 Tan(Float3x1 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x2 Tan(Float3x2 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x3 Tan(Float3x3 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x4 Tan(Float3x4 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x1 Tan(Float4x1 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x2 Tan(Float4x2 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x3 Tan(Float4x3 x) => default; + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x4 Tan(Float4x4 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static float Tanh(float x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2 Tanh(Float2 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3 Tanh(Float3 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4 Tanh(Float4 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x1 Tanh(Float1x1 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x2 Tanh(Float1x2 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x3 Tanh(Float1x3 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x4 Tanh(Float1x4 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x1 Tanh(Float2x1 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x2 Tanh(Float2x2 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x3 Tanh(Float2x3 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x4 Tanh(Float2x4 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x1 Tanh(Float3x1 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x2 Tanh(Float3x2 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x3 Tanh(Float3x3 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x4 Tanh(Float3x4 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x1 Tanh(Float4x1 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x2 Tanh(Float4x2 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x3 Tanh(Float4x3 x) => default; + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x4 Tanh(Float4x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float2x1 Transpose(Float1x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float3x1 Transpose(Float1x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float4x1 Transpose(Float1x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float1x2 Transpose(Float2x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float3x2 Transpose(Float2x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float4x2 Transpose(Float2x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float1x3 Transpose(Float3x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float2x3 Transpose(Float3x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float4x3 Transpose(Float3x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float1x4 Transpose(Float4x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float2x4 Transpose(Float4x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float3x4 Transpose(Float4x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int2x1 Transpose(Int1x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int3x1 Transpose(Int1x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int4x1 Transpose(Int1x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int1x2 Transpose(Int2x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int3x2 Transpose(Int2x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int4x2 Transpose(Int2x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int1x3 Transpose(Int3x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int2x3 Transpose(Int3x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int4x3 Transpose(Int3x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int1x4 Transpose(Int4x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int2x4 Transpose(Int4x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int3x4 Transpose(Int4x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool2x1 Transpose(Bool1x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool3x1 Transpose(Bool1x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool4x1 Transpose(Bool1x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool1x2 Transpose(Bool2x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool3x2 Transpose(Bool2x3 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool4x2 Transpose(Bool2x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool1x3 Transpose(Bool3x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool2x3 Transpose(Bool3x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool4x3 Transpose(Bool3x4 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool1x4 Transpose(Bool4x1 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool2x4 Transpose(Bool4x2 x) => default; + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool3x4 Transpose(Bool4x3 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static float Trunc(float x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2 Trunc(Float2 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3 Trunc(Float3 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4 Trunc(Float4 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x1 Trunc(Float1x1 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x2 Trunc(Float1x2 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x3 Trunc(Float1x3 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x4 Trunc(Float1x4 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x1 Trunc(Float2x1 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x2 Trunc(Float2x2 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x3 Trunc(Float2x3 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x4 Trunc(Float2x4 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x1 Trunc(Float3x1 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x2 Trunc(Float3x2 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x3 Trunc(Float3x3 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x4 Trunc(Float3x4 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x1 Trunc(Float4x1 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x2 Trunc(Float4x2 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x3 Trunc(Float4x3 x) => default; + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x4 Trunc(Float4x4 x) => default; } diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.tt b/src/ComputeSharp/Core/Intrinsics/Hlsl.tt index ead4c7d9..f3b44c42 100644 --- a/src/ComputeSharp/Core/Intrinsics/Hlsl.tt +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.tt @@ -3,14 +3,13 @@ using System.Diagnostics.Contracts; using ComputeSharp.Core.Intrinsics.Attributes; using ComputeSharp.Exceptions; -namespace ComputeSharp +namespace ComputeSharp; + +/// +public static partial class Hlsl { - /// - public static partial class Hlsl - { <# PushIndent(" "); -PushIndent(" "); bool isFirst = true; @@ -61,8 +60,6 @@ foreach (var intrinsic in Intrinsics) } } -PopIndent(); PopIndent(); #> - } } diff --git a/src/ComputeSharp/Core/PixelTypes/Bgra32.cs b/src/ComputeSharp/Core/PixelTypes/Bgra32.cs index 3a9172d2..b0755c97 100644 --- a/src/ComputeSharp/Core/PixelTypes/Bgra32.cs +++ b/src/ComputeSharp/Core/PixelTypes/Bgra32.cs @@ -6,117 +6,116 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. +/// The color components are stored in blue, green, red, and alpha order (least significant to most significant byte). +/// The format is binary compatible with System.Drawing.Imaging.PixelFormat.Format32bppArgb. +/// +/// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. +/// +/// +/// This struct is fully mutable. +[StructLayout(LayoutKind.Sequential)] +public struct Bgra32 : IEquatable, IUnorm, IUnorm { /// - /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in blue, green, red, and alpha order (least significant to most significant byte). - /// The format is binary compatible with System.Drawing.Imaging.PixelFormat.Format32bppArgb. - /// - /// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - /// + /// The blue component. /// - /// This struct is fully mutable. - [StructLayout(LayoutKind.Sequential)] - public struct Bgra32 : IEquatable, IUnorm, IUnorm + public byte B; + + /// + /// The green component. + /// + public byte G; + + /// + /// The red component. + /// + public byte R; + + /// + /// The alpha component. + /// + public byte A; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Bgra32(byte r, byte g, byte b) { - /// - /// The blue component. - /// - public byte B; - - /// - /// The green component. - /// - public byte G; - - /// - /// The red component. - /// - public byte R; - - /// - /// The alpha component. - /// - public byte A; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Bgra32(byte r, byte g, byte b) - { - R = r; - G = g; - B = b; - A = byte.MaxValue; - } - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Bgra32(byte r, byte g, byte b, byte a) - { - R = r; - G = g; - B = b; - A = a; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public uint PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Bgra32 left, Bgra32 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Bgra32 left, Bgra32 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is Bgra32 other && Equals(other); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Bgra32 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})"; + R = r; + G = g; + B = b; + A = byte.MaxValue; } + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Bgra32(byte r, byte g, byte b, byte a) + { + R = r; + G = g; + B = b; + A = a; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public uint PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Bgra32 left, Bgra32 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Bgra32 left, Bgra32 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Bgra32 other && Equals(other); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Bgra32 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/R16.cs b/src/ComputeSharp/Core/PixelTypes/R16.cs index 8e6a8951..2647356a 100644 --- a/src/ComputeSharp/Core/PixelTypes/R16.cs +++ b/src/ComputeSharp/Core/PixelTypes/R16.cs @@ -5,77 +5,76 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing a single 16-bit unsigned normalized channel value. +/// +/// Ranges from [0, 0, 0, 0] to [1, 0, 0, 0] in vector form. +/// +/// +[StructLayout(LayoutKind.Sequential)] +public struct R16 : IEquatable, IUnorm { /// - /// Packed pixel type containing a single 16-bit unsigned normalized channel value. - /// - /// Ranges from [0, 0, 0, 0] to [1, 0, 0, 0] in vector form. - /// + /// The red component. /// - [StructLayout(LayoutKind.Sequential)] - public struct R16 : IEquatable, IUnorm + public ushort R; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + public R16(ushort r) { - /// - /// The red component. - /// - public ushort R; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - public R16(ushort r) - { - R = r; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public ushort PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(R16 left, R16 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(R16 left, R16 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is R16 R16 && Equals(R16); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(R16 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(R16)}({this.R})"; + R = r; } + + /// + /// Gets or sets the packed representation of the struct. + /// + public ushort PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(R16 left, R16 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(R16 left, R16 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is R16 R16 && Equals(R16); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(R16 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(R16)}({this.R})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/R8.cs b/src/ComputeSharp/Core/PixelTypes/R8.cs index cb627b96..b906f94a 100644 --- a/src/ComputeSharp/Core/PixelTypes/R8.cs +++ b/src/ComputeSharp/Core/PixelTypes/R8.cs @@ -5,77 +5,76 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing a single 8-bit unsigned normalized channel value. +/// +/// Ranges from [0, 0, 0, 0] to [1, 0, 0, 0] in vector form. +/// +/// +[StructLayout(LayoutKind.Sequential)] +public struct R8 : IEquatable, IUnorm { /// - /// Packed pixel type containing a single 8-bit unsigned normalized channel value. - /// - /// Ranges from [0, 0, 0, 0] to [1, 0, 0, 0] in vector form. - /// + /// The red component. /// - [StructLayout(LayoutKind.Sequential)] - public struct R8 : IEquatable, IUnorm + public byte R; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + public R8(byte r) { - /// - /// The red component. - /// - public byte R; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - public R8(byte r) - { - R = r; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public byte PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(R8 left, R8 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(R8 left, R8 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is R8 R8 && Equals(R8); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(R8 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(R8)}({this.R})"; + R = r; } + + /// + /// Gets or sets the packed representation of the struct. + /// + public byte PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(R8 left, R8 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(R8 left, R8 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is R8 R8 && Equals(R8); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(R8 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(R8)}({this.R})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/Rg16.cs b/src/ComputeSharp/Core/PixelTypes/Rg16.cs index 5da5ce6d..f67ebced 100644 --- a/src/ComputeSharp/Core/PixelTypes/Rg16.cs +++ b/src/ComputeSharp/Core/PixelTypes/Rg16.cs @@ -6,84 +6,83 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing two 8-bit unsigned normalized values ranging from 0 to 255. +/// +/// Ranges from [0, 0, 0, 0] to [1, 1, 0, 0] in vector form. +/// +/// +[StructLayout(LayoutKind.Sequential)] +public struct Rg16 : IEquatable, IUnorm, IUnorm { /// - /// Packed pixel type containing two 8-bit unsigned normalized values ranging from 0 to 255. - /// - /// Ranges from [0, 0, 0, 0] to [1, 1, 0, 0] in vector form. - /// + /// The red component. /// - [StructLayout(LayoutKind.Sequential)] - public struct Rg16 : IEquatable, IUnorm, IUnorm + public byte R; + + /// + /// The green component. + /// + public byte G; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + public Rg16(byte r, byte g) { - /// - /// The red component. - /// - public byte R; - - /// - /// The green component. - /// - public byte G; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - public Rg16(byte r, byte g) - { - R = r; - G = g; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public ushort PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Rg16 left, Rg16 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Rg16 left, Rg16 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is Rg16 rgba32 && Equals(rgba32); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Rg16 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(Rg16)}({this.R}, {this.G})"; + R = r; + G = g; } + + /// + /// Gets or sets the packed representation of the struct. + /// + public ushort PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rg16 left, Rg16 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rg16 left, Rg16 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rg16 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rg16 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rg16)}({this.R}, {this.G})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/Rg32.cs b/src/ComputeSharp/Core/PixelTypes/Rg32.cs index 8d0e39ba..d894532a 100644 --- a/src/ComputeSharp/Core/PixelTypes/Rg32.cs +++ b/src/ComputeSharp/Core/PixelTypes/Rg32.cs @@ -6,84 +6,83 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing two 16-bit unsigned normalized values ranging from 0 to 255. +/// +/// Ranges from [0, 0, 0, 0] to [1, 1, 0, 0] in vector form. +/// +/// +[StructLayout(LayoutKind.Sequential)] +public struct Rg32 : IEquatable, IUnorm, IUnorm { /// - /// Packed pixel type containing two 16-bit unsigned normalized values ranging from 0 to 255. - /// - /// Ranges from [0, 0, 0, 0] to [1, 1, 0, 0] in vector form. - /// + /// The red component. /// - [StructLayout(LayoutKind.Sequential)] - public struct Rg32 : IEquatable, IUnorm, IUnorm + public ushort R; + + /// + /// The green component. + /// + public ushort G; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + public Rg32(ushort r, ushort g) { - /// - /// The red component. - /// - public ushort R; - - /// - /// The green component. - /// - public ushort G; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - public Rg32(ushort r, ushort g) - { - R = r; - G = g; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public uint PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Rg32 left, Rg32 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Rg32 left, Rg32 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is Rg32 rgba32 && Equals(rgba32); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Rg32 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(Rg32)}({this.R}, {this.G})"; + R = r; + G = g; } + + /// + /// Gets or sets the packed representation of the struct. + /// + public uint PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rg32 left, Rg32 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rg32 left, Rg32 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rg32 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rg32 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rg32)}({this.R}, {this.G})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/Rgba32.cs b/src/ComputeSharp/Core/PixelTypes/Rgba32.cs index 7e21c856..c8779b2f 100644 --- a/src/ComputeSharp/Core/PixelTypes/Rgba32.cs +++ b/src/ComputeSharp/Core/PixelTypes/Rgba32.cs @@ -6,116 +6,115 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. +/// The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). +/// +/// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. +/// +/// +/// This struct is fully mutable. +[StructLayout(LayoutKind.Sequential)] +public struct Rgba32 : IEquatable, IUnorm, IUnorm { /// - /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). - /// - /// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - /// + /// The red component. /// - /// This struct is fully mutable. - [StructLayout(LayoutKind.Sequential)] - public struct Rgba32 : IEquatable, IUnorm, IUnorm + public byte R; + + /// + /// The green component. + /// + public byte G; + + /// + /// The blue component. + /// + public byte B; + + /// + /// The alpha component. + /// + public byte A; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba32(byte r, byte g, byte b) { - /// - /// The red component. - /// - public byte R; - - /// - /// The green component. - /// - public byte G; - - /// - /// The blue component. - /// - public byte B; - - /// - /// The alpha component. - /// - public byte A; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgba32(byte r, byte g, byte b) - { - this.R = r; - this.G = g; - this.B = b; - this.A = byte.MaxValue; - } - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgba32(byte r, byte g, byte b, byte a) - { - this.R = r; - this.G = g; - this.B = b; - this.A = a; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public uint PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Rgba32 left, Rgba32 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Rgba32 left, Rgba32 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is Rgba32 rgba32 && Equals(rgba32); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Rgba32 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})"; + this.R = r; + this.G = g; + this.B = b; + this.A = byte.MaxValue; } + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba32(byte r, byte g, byte b, byte a) + { + this.R = r; + this.G = g; + this.B = b; + this.A = a; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public uint PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rgba32 left, Rgba32 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rgba32 left, Rgba32 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rgba32 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rgba32 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/Rgba64.cs b/src/ComputeSharp/Core/PixelTypes/Rgba64.cs index 7d1c7eb1..bb77e891 100644 --- a/src/ComputeSharp/Core/PixelTypes/Rgba64.cs +++ b/src/ComputeSharp/Core/PixelTypes/Rgba64.cs @@ -6,116 +6,115 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// Packed pixel type containing four 16-bit unsigned normalized values ranging from 0 to 255. +/// The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). +/// +/// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. +/// +/// +/// This struct is fully mutable. +[StructLayout(LayoutKind.Sequential)] +public struct Rgba64 : IEquatable, IUnorm, IUnorm { /// - /// Packed pixel type containing four 16-bit unsigned normalized values ranging from 0 to 255. - /// The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). - /// - /// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. - /// + /// The red component. /// - /// This struct is fully mutable. - [StructLayout(LayoutKind.Sequential)] - public struct Rgba64 : IEquatable, IUnorm, IUnorm + public ushort R; + + /// + /// The green component. + /// + public ushort G; + + /// + /// The blue component. + /// + public ushort B; + + /// + /// The alpha component. + /// + public ushort A; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba64(ushort r, ushort g, ushort b) { - /// - /// The red component. - /// - public ushort R; - - /// - /// The green component. - /// - public ushort G; - - /// - /// The blue component. - /// - public ushort B; - - /// - /// The alpha component. - /// - public ushort A; - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgba64(ushort r, ushort g, ushort b) - { - this.R = r; - this.G = g; - this.B = b; - this.A = ushort.MaxValue; - } - - /// - /// Initializes a new instance of the struct. - /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Rgba64(ushort r, ushort g, ushort b, ushort a) - { - this.R = r; - this.G = g; - this.B = b; - this.A = a; - } - - /// - /// Gets or sets the packed representation of the struct. - /// - public ulong PackedValue - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - readonly get => Unsafe.As(ref Unsafe.AsRef(this)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - set => Unsafe.As(ref this) = value; - } - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Rgba64 left, Rgba64 right) => left.Equals(right); - - /// - /// Compares two objects for equality. - /// - /// The on the left side of the operand. - /// The on the right side of the operand. - /// - /// True if the parameter is not equal to the parameter; otherwise, false. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Rgba64 left, Rgba64 right) => !left.Equals(right); - - /// - public override readonly bool Equals(object? obj) => obj is Rgba64 rgba32 && Equals(rgba32); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool Equals(Rgba64 other) => PackedValue.Equals(other.PackedValue); - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override readonly int GetHashCode() => PackedValue.GetHashCode(); - - /// - public override readonly string ToString() => $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})"; + this.R = r; + this.G = g; + this.B = b; + this.A = ushort.MaxValue; } + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba64(ushort r, ushort g, ushort b, ushort a) + { + this.R = r; + this.G = g; + this.B = b; + this.A = a; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public ulong PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rgba64 left, Rgba64 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rgba64 left, Rgba64 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rgba64 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rgba64 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})"; } diff --git a/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs b/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs index 4f138d99..3a5d812f 100644 --- a/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs +++ b/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs @@ -1,16 +1,15 @@ using System; using System.ComponentModel; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// Indicates the supported HLSL pixel types to represent a given normalized pixel type. +/// +/// The type of pixels used on the GPU side. +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This interface is not intended to be used directly by user code")] +public interface IUnorm + where TPixel : unmanaged { - /// - /// Indicates the supported HLSL pixel types to represent a given normalized pixel type. - /// - /// The type of pixels used on the GPU side. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This interface is not intended to be used directly by user code")] - public interface IUnorm - where TPixel : unmanaged - { - } } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool.cs index 58b539b4..8f457f2c 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool.cs @@ -1,76 +1,75 @@ using System.Runtime.InteropServices; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that can be used in place of the type in HLSL shaders. +/// +[StructLayout(LayoutKind.Explicit, Size = sizeof(int), Pack = 4)] +public readonly struct Bool { /// - /// A that can be used in place of the type in HLSL shaders. + /// The wrapped value for the current instance. /// - [StructLayout(LayoutKind.Explicit, Size = sizeof(int), Pack = 4)] - public readonly struct Bool + [FieldOffset(0)] + private readonly bool Value; + + /// + /// Creates a new instance for a given value. + /// + /// . + private Bool(bool value) { - /// - /// The wrapped value for the current instance. - /// - [FieldOffset(0)] - private readonly bool Value; - - /// - /// Creates a new instance for a given value. - /// - /// . - private Bool(bool value) - { - Value = value; - } - - /// - public override bool Equals(object? obj) - { - return obj is Bool x && Value == x.Value; - } - - /// - public override int GetHashCode() - { - return Value.GetHashCode(); - } - - /// - public override string ToString() - { - return Value.ToString(); - } - - /// - /// Checks whether or not two instances represent the same value. - /// - /// The left instance. - /// The right instance. - public static bool operator ==(Bool left, Bool right) => left.Value == right.Value; - - /// - /// Checks whether or not two instances represent a different value. - /// - /// The left instance. - /// The right instance. - public static bool operator !=(Bool left, Bool right) => left.Value != right.Value; - - /// - /// Inverts the value represented by a given instance. - /// - /// The input instance. - public static Bool operator !(Bool x) => new(!x.Value); - - /// - /// Converts a given instance to its corresponding value. - /// - /// The input instance. - public static implicit operator bool(Bool x) => x.Value; - - /// - /// Converts a value to a corresponding instance. - /// - /// The input value. - public static implicit operator Bool(bool x) => new(x); + Value = value; } + + /// + public override bool Equals(object? obj) + { + return obj is Bool x && Value == x.Value; + } + + /// + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + /// + public override string ToString() + { + return Value.ToString(); + } + + /// + /// Checks whether or not two instances represent the same value. + /// + /// The left instance. + /// The right instance. + public static bool operator ==(Bool left, Bool right) => left.Value == right.Value; + + /// + /// Checks whether or not two instances represent a different value. + /// + /// The left instance. + /// The right instance. + public static bool operator !=(Bool left, Bool right) => left.Value != right.Value; + + /// + /// Inverts the value represented by a given instance. + /// + /// The input instance. + public static Bool operator !(Bool x) => new(!x.Value); + + /// + /// Converts a given instance to its corresponding value. + /// + /// The input instance. + public static implicit operator bool(Bool x) => x.Value; + + /// + /// Converts a value to a corresponding instance. + /// + /// The input value. + public static implicit operator Bool(bool x) => new(x); } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs index 95729603..9443d50e 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs @@ -1,45 +1,44 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Bool2 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to . /// - public partial struct Bool2 + public static Bool2 False => false; + + /// + /// Gets an value with all components set to . + /// + public static Bool2 True => true; + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool2 TrueX => new(true, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool2 TrueY => new(false, true); + + /// + /// 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) { - /// - /// Gets an value with all components set to . - /// - public static Bool2 False => false; - - /// - /// Gets an value with all components set to . - /// - public static Bool2 True => true; - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool2 TrueX => new(true, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool2 TrueY => new(false, true); - - /// - /// 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; - this.y = y; - } - - /// - /// 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); + this.x = x; + this.y = y; } + + /// + /// 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); } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs index da9d8886..a5818229 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs @@ -8,405 +8,404 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Bool2 { - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Bool2 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2), sizeof(Bool4)); + + [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. + /// 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 bool this[int i] => ref *(bool*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref bool 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 bool 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 Bool2 XX => ref *(Bool2*)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 Bool2 XY => ref *(Bool2*)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 Bool2 YX => ref *(Bool2*)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 Bool2 YY => ref *(Bool2*)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 Bool3 XXX => ref *(Bool3*)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 Bool3 XXY => ref *(Bool3*)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 Bool3 XYX => ref *(Bool3*)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 Bool3 XYY => ref *(Bool3*)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 Bool3 YXX => ref *(Bool3*)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 Bool3 YXY => ref *(Bool3*)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 Bool3 YYX => ref *(Bool3*)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 Bool3 YYY => ref *(Bool3*)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 Bool4 XXXX => ref *(Bool4*)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 Bool4 XXXY => ref *(Bool4*)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 Bool4 XXYX => ref *(Bool4*)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 Bool4 XXYY => ref *(Bool4*)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 Bool4 XYXX => ref *(Bool4*)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 Bool4 XYXY => ref *(Bool4*)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 Bool4 XYYX => ref *(Bool4*)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 Bool4 XYYY => ref *(Bool4*)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 Bool4 YXXX => ref *(Bool4*)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 Bool4 YXXY => ref *(Bool4*)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 Bool4 YXYX => ref *(Bool4*)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 Bool4 YXYY => ref *(Bool4*)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 Bool4 YYXX => ref *(Bool4*)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 Bool4 YYXY => ref *(Bool4*)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 Bool4 YYYX => ref *(Bool4*)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 Bool4 YYYY => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref bool 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 bool 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 Bool2 RR => ref *(Bool2*)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 Bool2 RG => ref *(Bool2*)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 Bool2 GR => ref *(Bool2*)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 Bool2 GG => ref *(Bool2*)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 Bool3 RRR => ref *(Bool3*)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 Bool3 RRG => ref *(Bool3*)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 Bool3 RGR => ref *(Bool3*)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 Bool3 RGG => ref *(Bool3*)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 Bool3 GRR => ref *(Bool3*)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 Bool3 GRG => ref *(Bool3*)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 Bool3 GGR => ref *(Bool3*)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 Bool3 GGG => ref *(Bool3*)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 Bool4 RRRR => ref *(Bool4*)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 Bool4 RRRG => ref *(Bool4*)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 Bool4 RRGR => ref *(Bool4*)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 Bool4 RRGG => ref *(Bool4*)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 Bool4 RGRR => ref *(Bool4*)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 Bool4 RGRG => ref *(Bool4*)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 Bool4 RGGR => ref *(Bool4*)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 Bool4 RGGG => ref *(Bool4*)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 Bool4 GRRR => ref *(Bool4*)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 Bool4 GRRG => ref *(Bool4*)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 Bool4 GRGR => ref *(Bool4*)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 Bool4 GRGG => ref *(Bool4*)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 Bool4 GGRR => ref *(Bool4*)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 Bool4 GGRG => ref *(Bool4*)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 Bool4 GGGR => ref *(Bool4*)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 Bool4 GGGG => ref *(Bool4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2), sizeof(Bool4)); + StringBuilder sb = new(); - [FieldOffset(0)] - private bool x; + sb.Append('<'); + sb.Append(this.x); + sb.Append(", "); + sb.Append(this.y); + sb.Append('>'); - [FieldOffset(4)] - private bool 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 bool this[int i] => ref *(bool*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref bool 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 bool 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 Bool2 XX => ref *(Bool2*)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 Bool2 XY => ref *(Bool2*)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 Bool2 YX => ref *(Bool2*)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 Bool2 YY => ref *(Bool2*)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 Bool3 XXX => ref *(Bool3*)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 Bool3 XXY => ref *(Bool3*)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 Bool3 XYX => ref *(Bool3*)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 Bool3 XYY => ref *(Bool3*)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 Bool3 YXX => ref *(Bool3*)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 Bool3 YXY => ref *(Bool3*)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 Bool3 YYX => ref *(Bool3*)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 Bool3 YYY => ref *(Bool3*)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 Bool4 XXXX => ref *(Bool4*)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 Bool4 XXXY => ref *(Bool4*)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 Bool4 XXYX => ref *(Bool4*)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 Bool4 XXYY => ref *(Bool4*)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 Bool4 XYXX => ref *(Bool4*)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 Bool4 XYXY => ref *(Bool4*)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 Bool4 XYYX => ref *(Bool4*)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 Bool4 XYYY => ref *(Bool4*)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 Bool4 YXXX => ref *(Bool4*)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 Bool4 YXXY => ref *(Bool4*)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 Bool4 YXYX => ref *(Bool4*)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 Bool4 YXYY => ref *(Bool4*)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 Bool4 YYXX => ref *(Bool4*)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 Bool4 YYXY => ref *(Bool4*)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 Bool4 YYYX => ref *(Bool4*)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 Bool4 YYYY => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref bool 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 bool 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 Bool2 RR => ref *(Bool2*)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 Bool2 RG => ref *(Bool2*)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 Bool2 GR => ref *(Bool2*)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 Bool2 GG => ref *(Bool2*)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 Bool3 RRR => ref *(Bool3*)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 Bool3 RRG => ref *(Bool3*)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 Bool3 RGR => ref *(Bool3*)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 Bool3 RGG => ref *(Bool3*)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 Bool3 GRR => ref *(Bool3*)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 Bool3 GRG => ref *(Bool3*)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 Bool3 GGR => ref *(Bool3*)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 Bool3 GGG => ref *(Bool3*)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 Bool4 RRRR => ref *(Bool4*)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 Bool4 RRRG => ref *(Bool4*)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 Bool4 RRGR => ref *(Bool4*)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 Bool4 RRGG => ref *(Bool4*)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 Bool4 RGRR => ref *(Bool4*)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 Bool4 RGRG => ref *(Bool4*)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 Bool4 RGGR => ref *(Bool4*)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 Bool4 RGGG => ref *(Bool4*)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 Bool4 GRRR => ref *(Bool4*)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 Bool4 GRRG => ref *(Bool4*)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 Bool4 GRGR => ref *(Bool4*)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 Bool4 GRGG => ref *(Bool4*)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 Bool4 GGRR => ref *(Bool4*)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 Bool4 GGRG => ref *(Bool4*)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 Bool4 GGGR => ref *(Bool4*)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 Bool4 GGGG => ref *(Bool4*)UndefinedData; - - /// - public override readonly string ToString() - { - StringBuilder sb = new(); - - sb.Append('<'); - sb.Append(this.x); - sb.Append(", "); - sb.Append(this.y); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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; + return sb.ToString(); } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs index 0cef513a..466aeebc 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs @@ -1,76 +1,75 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Bool3 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to . /// - public partial struct Bool3 + public static Bool3 False => false; + + /// + /// Gets an value with all components set to . + /// + public static Bool3 True => true; + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool3 TrueX => new(true, false, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool3 TrueY => new(false, true, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool3 TrueZ => new(false, false, true); + + /// + /// 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. + /// The value to assign to the third vector component. + public Bool3(bool x, bool y, bool z) { - /// - /// Gets an value with all components set to . - /// - public static Bool3 False => false; - - /// - /// Gets an value with all components set to . - /// - public static Bool3 True => true; - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool3 TrueX => new(true, false, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool3 TrueY => new(false, true, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool3 TrueZ => new(false, false, true); - - /// - /// 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. - /// The value to assign to the third vector component. - public Bool3(bool x, bool y, bool z) - { - this.x = x; - this.y = y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - public Bool3(Bool2 xy, bool z) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second and thirt vector components. - public Bool3(bool x, Bool2 yz) - { - this.x = x; - this.y = yz.X; - this.z = yz.Y; - } - - /// - /// 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 Bool3(bool x) => new(x, x, x); + this.x = x; + this.y = y; + this.z = z; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Bool3(Bool2 xy, bool z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Bool3(bool x, Bool2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// 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 Bool3(bool x) => new(x, x, x); } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs index a7fa2070..0bc86fc1 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs @@ -8,1488 +8,1487 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Bool3 { - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Bool3 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3), sizeof(Bool4)); + + [FieldOffset(0)] + private bool x; + + [FieldOffset(4)] + private bool y; + + [FieldOffset(8)] + private bool z; + + /// + /// 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 bool this[int i] => ref *(bool*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref bool 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 bool Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref bool Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Bool2 XX => ref *(Bool2*)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 Bool2 XY => ref *(Bool2*)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 Bool2 XZ => ref *(Bool2*)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 Bool2 YX => ref *(Bool2*)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 Bool2 YY => ref *(Bool2*)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 Bool2 YZ => ref *(Bool2*)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 Bool2 ZX => ref *(Bool2*)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 Bool2 ZY => ref *(Bool2*)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 Bool2 ZZ => ref *(Bool2*)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 Bool3 XXX => ref *(Bool3*)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 Bool3 XXY => ref *(Bool3*)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 Bool3 XXZ => ref *(Bool3*)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 Bool3 XYX => ref *(Bool3*)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 Bool3 XYY => ref *(Bool3*)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 Bool3 XYZ => ref *(Bool3*)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 Bool3 XZX => ref *(Bool3*)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 Bool3 XZY => ref *(Bool3*)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 Bool3 XZZ => ref *(Bool3*)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 Bool3 YXX => ref *(Bool3*)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 Bool3 YXY => ref *(Bool3*)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 Bool3 YXZ => ref *(Bool3*)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 Bool3 YYX => ref *(Bool3*)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 Bool3 YYY => ref *(Bool3*)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 Bool3 YYZ => ref *(Bool3*)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 Bool3 YZX => ref *(Bool3*)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 Bool3 YZY => ref *(Bool3*)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 Bool3 YZZ => ref *(Bool3*)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 Bool3 ZXX => ref *(Bool3*)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 Bool3 ZXY => ref *(Bool3*)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 Bool3 ZXZ => ref *(Bool3*)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 Bool3 ZYX => ref *(Bool3*)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 Bool3 ZYY => ref *(Bool3*)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 Bool3 ZYZ => ref *(Bool3*)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 Bool3 ZZX => ref *(Bool3*)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 Bool3 ZZY => ref *(Bool3*)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 Bool3 ZZZ => ref *(Bool3*)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 Bool4 XXXX => ref *(Bool4*)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 Bool4 XXXY => ref *(Bool4*)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 Bool4 XXXZ => ref *(Bool4*)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 Bool4 XXYX => ref *(Bool4*)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 Bool4 XXYY => ref *(Bool4*)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 Bool4 XXYZ => ref *(Bool4*)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 Bool4 XXZX => ref *(Bool4*)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 Bool4 XXZY => ref *(Bool4*)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 Bool4 XXZZ => ref *(Bool4*)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 Bool4 XYXX => ref *(Bool4*)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 Bool4 XYXY => ref *(Bool4*)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 Bool4 XYXZ => ref *(Bool4*)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 Bool4 XYYX => ref *(Bool4*)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 Bool4 XYYY => ref *(Bool4*)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 Bool4 XYYZ => ref *(Bool4*)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 Bool4 XYZX => ref *(Bool4*)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 Bool4 XYZY => ref *(Bool4*)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 Bool4 XYZZ => ref *(Bool4*)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 Bool4 XZXX => ref *(Bool4*)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 Bool4 XZXY => ref *(Bool4*)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 Bool4 XZXZ => ref *(Bool4*)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 Bool4 XZYX => ref *(Bool4*)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 Bool4 XZYY => ref *(Bool4*)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 Bool4 XZYZ => ref *(Bool4*)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 Bool4 XZZX => ref *(Bool4*)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 Bool4 XZZY => ref *(Bool4*)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 Bool4 XZZZ => ref *(Bool4*)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 Bool4 YXXX => ref *(Bool4*)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 Bool4 YXXY => ref *(Bool4*)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 Bool4 YXXZ => ref *(Bool4*)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 Bool4 YXYX => ref *(Bool4*)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 Bool4 YXYY => ref *(Bool4*)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 Bool4 YXYZ => ref *(Bool4*)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 Bool4 YXZX => ref *(Bool4*)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 Bool4 YXZY => ref *(Bool4*)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 Bool4 YXZZ => ref *(Bool4*)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 Bool4 YYXX => ref *(Bool4*)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 Bool4 YYXY => ref *(Bool4*)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 Bool4 YYXZ => ref *(Bool4*)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 Bool4 YYYX => ref *(Bool4*)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 Bool4 YYYY => ref *(Bool4*)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 Bool4 YYYZ => ref *(Bool4*)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 Bool4 YYZX => ref *(Bool4*)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 Bool4 YYZY => ref *(Bool4*)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 Bool4 YYZZ => ref *(Bool4*)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 Bool4 YZXX => ref *(Bool4*)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 Bool4 YZXY => ref *(Bool4*)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 Bool4 YZXZ => ref *(Bool4*)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 Bool4 YZYX => ref *(Bool4*)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 Bool4 YZYY => ref *(Bool4*)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 Bool4 YZYZ => ref *(Bool4*)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 Bool4 YZZX => ref *(Bool4*)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 Bool4 YZZY => ref *(Bool4*)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 Bool4 YZZZ => ref *(Bool4*)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 Bool4 ZXXX => ref *(Bool4*)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 Bool4 ZXXY => ref *(Bool4*)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 Bool4 ZXXZ => ref *(Bool4*)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 Bool4 ZXYX => ref *(Bool4*)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 Bool4 ZXYY => ref *(Bool4*)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 Bool4 ZXYZ => ref *(Bool4*)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 Bool4 ZXZX => ref *(Bool4*)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 Bool4 ZXZY => ref *(Bool4*)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 Bool4 ZXZZ => ref *(Bool4*)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 Bool4 ZYXX => ref *(Bool4*)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 Bool4 ZYXY => ref *(Bool4*)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 Bool4 ZYXZ => ref *(Bool4*)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 Bool4 ZYYX => ref *(Bool4*)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 Bool4 ZYYY => ref *(Bool4*)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 Bool4 ZYYZ => ref *(Bool4*)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 Bool4 ZYZX => ref *(Bool4*)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 Bool4 ZYZY => ref *(Bool4*)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 Bool4 ZYZZ => ref *(Bool4*)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 Bool4 ZZXX => ref *(Bool4*)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 Bool4 ZZXY => ref *(Bool4*)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 Bool4 ZZXZ => ref *(Bool4*)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 Bool4 ZZYX => ref *(Bool4*)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 Bool4 ZZYY => ref *(Bool4*)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 Bool4 ZZYZ => ref *(Bool4*)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 Bool4 ZZZX => ref *(Bool4*)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 Bool4 ZZZY => ref *(Bool4*)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 Bool4 ZZZZ => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref bool 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 bool G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref bool B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Bool2 RR => ref *(Bool2*)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 Bool2 RG => ref *(Bool2*)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 Bool2 RB => ref *(Bool2*)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 Bool2 GR => ref *(Bool2*)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 Bool2 GG => ref *(Bool2*)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 Bool2 GB => ref *(Bool2*)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 Bool2 BR => ref *(Bool2*)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 Bool2 BG => ref *(Bool2*)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 Bool2 BB => ref *(Bool2*)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 Bool3 RRR => ref *(Bool3*)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 Bool3 RRG => ref *(Bool3*)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 Bool3 RRB => ref *(Bool3*)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 Bool3 RGR => ref *(Bool3*)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 Bool3 RGG => ref *(Bool3*)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 Bool3 RGB => ref *(Bool3*)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 Bool3 RBR => ref *(Bool3*)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 Bool3 RBG => ref *(Bool3*)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 Bool3 RBB => ref *(Bool3*)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 Bool3 GRR => ref *(Bool3*)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 Bool3 GRG => ref *(Bool3*)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 Bool3 GRB => ref *(Bool3*)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 Bool3 GGR => ref *(Bool3*)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 Bool3 GGG => ref *(Bool3*)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 Bool3 GGB => ref *(Bool3*)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 Bool3 GBR => ref *(Bool3*)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 Bool3 GBG => ref *(Bool3*)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 Bool3 GBB => ref *(Bool3*)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 Bool3 BRR => ref *(Bool3*)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 Bool3 BRG => ref *(Bool3*)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 Bool3 BRB => ref *(Bool3*)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 Bool3 BGR => ref *(Bool3*)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 Bool3 BGG => ref *(Bool3*)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 Bool3 BGB => ref *(Bool3*)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 Bool3 BBR => ref *(Bool3*)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 Bool3 BBG => ref *(Bool3*)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 Bool3 BBB => ref *(Bool3*)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 Bool4 RRRR => ref *(Bool4*)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 Bool4 RRRG => ref *(Bool4*)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 Bool4 RRRB => ref *(Bool4*)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 Bool4 RRGR => ref *(Bool4*)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 Bool4 RRGG => ref *(Bool4*)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 Bool4 RRGB => ref *(Bool4*)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 Bool4 RRBR => ref *(Bool4*)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 Bool4 RRBG => ref *(Bool4*)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 Bool4 RRBB => ref *(Bool4*)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 Bool4 RGRR => ref *(Bool4*)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 Bool4 RGRG => ref *(Bool4*)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 Bool4 RGRB => ref *(Bool4*)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 Bool4 RGGR => ref *(Bool4*)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 Bool4 RGGG => ref *(Bool4*)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 Bool4 RGGB => ref *(Bool4*)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 Bool4 RGBR => ref *(Bool4*)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 Bool4 RGBG => ref *(Bool4*)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 Bool4 RGBB => ref *(Bool4*)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 Bool4 RBRR => ref *(Bool4*)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 Bool4 RBRG => ref *(Bool4*)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 Bool4 RBRB => ref *(Bool4*)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 Bool4 RBGR => ref *(Bool4*)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 Bool4 RBGG => ref *(Bool4*)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 Bool4 RBGB => ref *(Bool4*)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 Bool4 RBBR => ref *(Bool4*)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 Bool4 RBBG => ref *(Bool4*)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 Bool4 RBBB => ref *(Bool4*)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 Bool4 GRRR => ref *(Bool4*)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 Bool4 GRRG => ref *(Bool4*)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 Bool4 GRRB => ref *(Bool4*)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 Bool4 GRGR => ref *(Bool4*)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 Bool4 GRGG => ref *(Bool4*)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 Bool4 GRGB => ref *(Bool4*)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 Bool4 GRBR => ref *(Bool4*)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 Bool4 GRBG => ref *(Bool4*)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 Bool4 GRBB => ref *(Bool4*)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 Bool4 GGRR => ref *(Bool4*)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 Bool4 GGRG => ref *(Bool4*)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 Bool4 GGRB => ref *(Bool4*)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 Bool4 GGGR => ref *(Bool4*)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 Bool4 GGGG => ref *(Bool4*)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 Bool4 GGGB => ref *(Bool4*)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 Bool4 GGBR => ref *(Bool4*)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 Bool4 GGBG => ref *(Bool4*)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 Bool4 GGBB => ref *(Bool4*)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 Bool4 GBRR => ref *(Bool4*)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 Bool4 GBRG => ref *(Bool4*)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 Bool4 GBRB => ref *(Bool4*)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 Bool4 GBGR => ref *(Bool4*)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 Bool4 GBGG => ref *(Bool4*)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 Bool4 GBGB => ref *(Bool4*)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 Bool4 GBBR => ref *(Bool4*)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 Bool4 GBBG => ref *(Bool4*)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 Bool4 GBBB => ref *(Bool4*)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 Bool4 BRRR => ref *(Bool4*)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 Bool4 BRRG => ref *(Bool4*)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 Bool4 BRRB => ref *(Bool4*)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 Bool4 BRGR => ref *(Bool4*)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 Bool4 BRGG => ref *(Bool4*)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 Bool4 BRGB => ref *(Bool4*)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 Bool4 BRBR => ref *(Bool4*)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 Bool4 BRBG => ref *(Bool4*)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 Bool4 BRBB => ref *(Bool4*)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 Bool4 BGRR => ref *(Bool4*)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 Bool4 BGRG => ref *(Bool4*)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 Bool4 BGRB => ref *(Bool4*)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 Bool4 BGGR => ref *(Bool4*)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 Bool4 BGGG => ref *(Bool4*)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 Bool4 BGGB => ref *(Bool4*)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 Bool4 BGBR => ref *(Bool4*)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 Bool4 BGBG => ref *(Bool4*)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 Bool4 BGBB => ref *(Bool4*)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 Bool4 BBRR => ref *(Bool4*)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 Bool4 BBRG => ref *(Bool4*)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 Bool4 BBRB => ref *(Bool4*)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 Bool4 BBGR => ref *(Bool4*)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 Bool4 BBGG => ref *(Bool4*)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 Bool4 BBGB => ref *(Bool4*)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 Bool4 BBBR => ref *(Bool4*)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 Bool4 BBBG => ref *(Bool4*)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 Bool4 BBBB => ref *(Bool4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3), sizeof(Bool4)); + StringBuilder sb = new(); - [FieldOffset(0)] - private bool x; + sb.Append('<'); + sb.Append(this.x); + sb.Append(", "); + sb.Append(this.y); + sb.Append(", "); + sb.Append(this.z); + sb.Append('>'); - [FieldOffset(4)] - private bool y; - - [FieldOffset(8)] - private bool z; - - /// - /// 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 bool this[int i] => ref *(bool*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref bool 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 bool Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref bool Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Bool2 XX => ref *(Bool2*)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 Bool2 XY => ref *(Bool2*)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 Bool2 XZ => ref *(Bool2*)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 Bool2 YX => ref *(Bool2*)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 Bool2 YY => ref *(Bool2*)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 Bool2 YZ => ref *(Bool2*)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 Bool2 ZX => ref *(Bool2*)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 Bool2 ZY => ref *(Bool2*)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 Bool2 ZZ => ref *(Bool2*)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 Bool3 XXX => ref *(Bool3*)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 Bool3 XXY => ref *(Bool3*)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 Bool3 XXZ => ref *(Bool3*)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 Bool3 XYX => ref *(Bool3*)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 Bool3 XYY => ref *(Bool3*)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 Bool3 XYZ => ref *(Bool3*)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 Bool3 XZX => ref *(Bool3*)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 Bool3 XZY => ref *(Bool3*)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 Bool3 XZZ => ref *(Bool3*)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 Bool3 YXX => ref *(Bool3*)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 Bool3 YXY => ref *(Bool3*)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 Bool3 YXZ => ref *(Bool3*)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 Bool3 YYX => ref *(Bool3*)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 Bool3 YYY => ref *(Bool3*)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 Bool3 YYZ => ref *(Bool3*)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 Bool3 YZX => ref *(Bool3*)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 Bool3 YZY => ref *(Bool3*)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 Bool3 YZZ => ref *(Bool3*)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 Bool3 ZXX => ref *(Bool3*)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 Bool3 ZXY => ref *(Bool3*)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 Bool3 ZXZ => ref *(Bool3*)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 Bool3 ZYX => ref *(Bool3*)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 Bool3 ZYY => ref *(Bool3*)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 Bool3 ZYZ => ref *(Bool3*)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 Bool3 ZZX => ref *(Bool3*)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 Bool3 ZZY => ref *(Bool3*)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 Bool3 ZZZ => ref *(Bool3*)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 Bool4 XXXX => ref *(Bool4*)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 Bool4 XXXY => ref *(Bool4*)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 Bool4 XXXZ => ref *(Bool4*)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 Bool4 XXYX => ref *(Bool4*)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 Bool4 XXYY => ref *(Bool4*)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 Bool4 XXYZ => ref *(Bool4*)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 Bool4 XXZX => ref *(Bool4*)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 Bool4 XXZY => ref *(Bool4*)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 Bool4 XXZZ => ref *(Bool4*)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 Bool4 XYXX => ref *(Bool4*)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 Bool4 XYXY => ref *(Bool4*)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 Bool4 XYXZ => ref *(Bool4*)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 Bool4 XYYX => ref *(Bool4*)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 Bool4 XYYY => ref *(Bool4*)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 Bool4 XYYZ => ref *(Bool4*)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 Bool4 XYZX => ref *(Bool4*)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 Bool4 XYZY => ref *(Bool4*)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 Bool4 XYZZ => ref *(Bool4*)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 Bool4 XZXX => ref *(Bool4*)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 Bool4 XZXY => ref *(Bool4*)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 Bool4 XZXZ => ref *(Bool4*)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 Bool4 XZYX => ref *(Bool4*)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 Bool4 XZYY => ref *(Bool4*)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 Bool4 XZYZ => ref *(Bool4*)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 Bool4 XZZX => ref *(Bool4*)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 Bool4 XZZY => ref *(Bool4*)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 Bool4 XZZZ => ref *(Bool4*)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 Bool4 YXXX => ref *(Bool4*)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 Bool4 YXXY => ref *(Bool4*)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 Bool4 YXXZ => ref *(Bool4*)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 Bool4 YXYX => ref *(Bool4*)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 Bool4 YXYY => ref *(Bool4*)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 Bool4 YXYZ => ref *(Bool4*)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 Bool4 YXZX => ref *(Bool4*)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 Bool4 YXZY => ref *(Bool4*)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 Bool4 YXZZ => ref *(Bool4*)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 Bool4 YYXX => ref *(Bool4*)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 Bool4 YYXY => ref *(Bool4*)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 Bool4 YYXZ => ref *(Bool4*)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 Bool4 YYYX => ref *(Bool4*)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 Bool4 YYYY => ref *(Bool4*)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 Bool4 YYYZ => ref *(Bool4*)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 Bool4 YYZX => ref *(Bool4*)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 Bool4 YYZY => ref *(Bool4*)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 Bool4 YYZZ => ref *(Bool4*)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 Bool4 YZXX => ref *(Bool4*)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 Bool4 YZXY => ref *(Bool4*)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 Bool4 YZXZ => ref *(Bool4*)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 Bool4 YZYX => ref *(Bool4*)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 Bool4 YZYY => ref *(Bool4*)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 Bool4 YZYZ => ref *(Bool4*)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 Bool4 YZZX => ref *(Bool4*)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 Bool4 YZZY => ref *(Bool4*)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 Bool4 YZZZ => ref *(Bool4*)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 Bool4 ZXXX => ref *(Bool4*)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 Bool4 ZXXY => ref *(Bool4*)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 Bool4 ZXXZ => ref *(Bool4*)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 Bool4 ZXYX => ref *(Bool4*)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 Bool4 ZXYY => ref *(Bool4*)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 Bool4 ZXYZ => ref *(Bool4*)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 Bool4 ZXZX => ref *(Bool4*)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 Bool4 ZXZY => ref *(Bool4*)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 Bool4 ZXZZ => ref *(Bool4*)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 Bool4 ZYXX => ref *(Bool4*)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 Bool4 ZYXY => ref *(Bool4*)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 Bool4 ZYXZ => ref *(Bool4*)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 Bool4 ZYYX => ref *(Bool4*)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 Bool4 ZYYY => ref *(Bool4*)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 Bool4 ZYYZ => ref *(Bool4*)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 Bool4 ZYZX => ref *(Bool4*)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 Bool4 ZYZY => ref *(Bool4*)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 Bool4 ZYZZ => ref *(Bool4*)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 Bool4 ZZXX => ref *(Bool4*)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 Bool4 ZZXY => ref *(Bool4*)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 Bool4 ZZXZ => ref *(Bool4*)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 Bool4 ZZYX => ref *(Bool4*)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 Bool4 ZZYY => ref *(Bool4*)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 Bool4 ZZYZ => ref *(Bool4*)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 Bool4 ZZZX => ref *(Bool4*)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 Bool4 ZZZY => ref *(Bool4*)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 Bool4 ZZZZ => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref bool 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 bool G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref bool B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Bool2 RR => ref *(Bool2*)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 Bool2 RG => ref *(Bool2*)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 Bool2 RB => ref *(Bool2*)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 Bool2 GR => ref *(Bool2*)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 Bool2 GG => ref *(Bool2*)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 Bool2 GB => ref *(Bool2*)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 Bool2 BR => ref *(Bool2*)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 Bool2 BG => ref *(Bool2*)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 Bool2 BB => ref *(Bool2*)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 Bool3 RRR => ref *(Bool3*)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 Bool3 RRG => ref *(Bool3*)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 Bool3 RRB => ref *(Bool3*)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 Bool3 RGR => ref *(Bool3*)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 Bool3 RGG => ref *(Bool3*)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 Bool3 RGB => ref *(Bool3*)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 Bool3 RBR => ref *(Bool3*)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 Bool3 RBG => ref *(Bool3*)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 Bool3 RBB => ref *(Bool3*)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 Bool3 GRR => ref *(Bool3*)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 Bool3 GRG => ref *(Bool3*)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 Bool3 GRB => ref *(Bool3*)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 Bool3 GGR => ref *(Bool3*)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 Bool3 GGG => ref *(Bool3*)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 Bool3 GGB => ref *(Bool3*)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 Bool3 GBR => ref *(Bool3*)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 Bool3 GBG => ref *(Bool3*)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 Bool3 GBB => ref *(Bool3*)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 Bool3 BRR => ref *(Bool3*)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 Bool3 BRG => ref *(Bool3*)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 Bool3 BRB => ref *(Bool3*)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 Bool3 BGR => ref *(Bool3*)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 Bool3 BGG => ref *(Bool3*)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 Bool3 BGB => ref *(Bool3*)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 Bool3 BBR => ref *(Bool3*)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 Bool3 BBG => ref *(Bool3*)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 Bool3 BBB => ref *(Bool3*)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 Bool4 RRRR => ref *(Bool4*)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 Bool4 RRRG => ref *(Bool4*)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 Bool4 RRRB => ref *(Bool4*)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 Bool4 RRGR => ref *(Bool4*)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 Bool4 RRGG => ref *(Bool4*)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 Bool4 RRGB => ref *(Bool4*)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 Bool4 RRBR => ref *(Bool4*)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 Bool4 RRBG => ref *(Bool4*)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 Bool4 RRBB => ref *(Bool4*)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 Bool4 RGRR => ref *(Bool4*)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 Bool4 RGRG => ref *(Bool4*)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 Bool4 RGRB => ref *(Bool4*)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 Bool4 RGGR => ref *(Bool4*)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 Bool4 RGGG => ref *(Bool4*)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 Bool4 RGGB => ref *(Bool4*)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 Bool4 RGBR => ref *(Bool4*)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 Bool4 RGBG => ref *(Bool4*)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 Bool4 RGBB => ref *(Bool4*)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 Bool4 RBRR => ref *(Bool4*)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 Bool4 RBRG => ref *(Bool4*)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 Bool4 RBRB => ref *(Bool4*)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 Bool4 RBGR => ref *(Bool4*)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 Bool4 RBGG => ref *(Bool4*)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 Bool4 RBGB => ref *(Bool4*)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 Bool4 RBBR => ref *(Bool4*)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 Bool4 RBBG => ref *(Bool4*)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 Bool4 RBBB => ref *(Bool4*)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 Bool4 GRRR => ref *(Bool4*)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 Bool4 GRRG => ref *(Bool4*)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 Bool4 GRRB => ref *(Bool4*)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 Bool4 GRGR => ref *(Bool4*)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 Bool4 GRGG => ref *(Bool4*)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 Bool4 GRGB => ref *(Bool4*)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 Bool4 GRBR => ref *(Bool4*)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 Bool4 GRBG => ref *(Bool4*)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 Bool4 GRBB => ref *(Bool4*)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 Bool4 GGRR => ref *(Bool4*)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 Bool4 GGRG => ref *(Bool4*)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 Bool4 GGRB => ref *(Bool4*)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 Bool4 GGGR => ref *(Bool4*)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 Bool4 GGGG => ref *(Bool4*)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 Bool4 GGGB => ref *(Bool4*)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 Bool4 GGBR => ref *(Bool4*)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 Bool4 GGBG => ref *(Bool4*)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 Bool4 GGBB => ref *(Bool4*)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 Bool4 GBRR => ref *(Bool4*)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 Bool4 GBRG => ref *(Bool4*)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 Bool4 GBRB => ref *(Bool4*)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 Bool4 GBGR => ref *(Bool4*)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 Bool4 GBGG => ref *(Bool4*)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 Bool4 GBGB => ref *(Bool4*)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 Bool4 GBBR => ref *(Bool4*)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 Bool4 GBBG => ref *(Bool4*)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 Bool4 GBBB => ref *(Bool4*)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 Bool4 BRRR => ref *(Bool4*)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 Bool4 BRRG => ref *(Bool4*)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 Bool4 BRRB => ref *(Bool4*)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 Bool4 BRGR => ref *(Bool4*)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 Bool4 BRGG => ref *(Bool4*)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 Bool4 BRGB => ref *(Bool4*)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 Bool4 BRBR => ref *(Bool4*)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 Bool4 BRBG => ref *(Bool4*)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 Bool4 BRBB => ref *(Bool4*)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 Bool4 BGRR => ref *(Bool4*)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 Bool4 BGRG => ref *(Bool4*)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 Bool4 BGRB => ref *(Bool4*)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 Bool4 BGGR => ref *(Bool4*)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 Bool4 BGGG => ref *(Bool4*)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 Bool4 BGGB => ref *(Bool4*)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 Bool4 BGBR => ref *(Bool4*)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 Bool4 BGBG => ref *(Bool4*)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 Bool4 BGBB => ref *(Bool4*)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 Bool4 BBRR => ref *(Bool4*)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 Bool4 BBRG => ref *(Bool4*)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 Bool4 BBRB => ref *(Bool4*)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 Bool4 BBGR => ref *(Bool4*)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 Bool4 BBGG => ref *(Bool4*)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 Bool4 BBGB => ref *(Bool4*)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 Bool4 BBBR => ref *(Bool4*)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 Bool4 BBBG => ref *(Bool4*)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 Bool4 BBBB => ref *(Bool4*)UndefinedData; - - /// - public override readonly string ToString() - { - StringBuilder sb = new(); - - sb.Append('<'); - sb.Append(this.x); - sb.Append(", "); - sb.Append(this.y); - sb.Append(", "); - sb.Append(this.z); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool3 operator !(Bool3 xyz) => default; + return sb.ToString(); } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool3 operator !(Bool3 xyz) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs index 7323ed77..59b34881 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs @@ -1,126 +1,125 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Bool4 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to . /// - public partial struct Bool4 + public static Bool4 False => false; + + /// + /// Gets an value with all components set to . + /// + public static Bool4 True => true; + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueX => new(true, false, false, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueY => new(false, true, false, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueZ => new(false, false, true, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueW => new(false, false, false, true); + + /// + /// 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. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Bool4(bool x, bool y, bool z, bool w) { - /// - /// Gets an value with all components set to . - /// - public static Bool4 False => false; - - /// - /// Gets an value with all components set to . - /// - public static Bool4 True => true; - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueX => new(true, false, false, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueY => new(false, true, false, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueZ => new(false, false, true, false); - - /// - /// Gets an value with the component set to , and the others to . - /// - public static Bool4 TrueW => new(false, false, false, true); - - /// - /// 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. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Bool4(bool x, bool y, bool z, bool w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Bool4(Bool2 xy, bool z, bool w) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - this.w = w; - } - - /// - /// 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. - /// The value to assign to the third and fourth vector components. - public Bool4(bool x, bool y, Bool2 zw) - { - this.x = x; - this.y = y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third and fourth vector components. - public Bool4(Bool2 xy, Bool2 zw) - { - this.x = xy.X; - this.y = xy.Y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first, second and third vector components. - /// The value to assign to the fourth vector component. - public Bool4(Bool3 xyz, bool w) - { - this.x = xyz.X; - this.y = xyz.Y; - this.z = xyz.Z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second, third and fourth vector components. - public Bool4(bool x, Bool3 yzw) - { - this.x = x; - this.y = yzw.X; - this.z = yzw.Y; - this.w = yzw.Z; - } - - /// - /// 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 Bool4(bool x) => new(x, x, x, x); + this.x = x; + this.y = y; + this.z = z; + this.w = w; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Bool4(Bool2 xy, bool z, bool w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// 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. + /// The value to assign to the third and fourth vector components. + public Bool4(bool x, bool y, Bool2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Bool4(Bool2 xy, Bool2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Bool4(Bool3 xyz, bool w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Bool4(bool x, Bool3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// 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 Bool4(bool x) => new(x, x, x, x); } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs index 8c4624f8..a23e5de7 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs @@ -8,4131 +8,4130 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Bool4 { - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Bool4 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4), sizeof(Bool4)); + + [FieldOffset(0)] + private bool x; + + [FieldOffset(4)] + private bool y; + + [FieldOffset(8)] + private bool z; + + [FieldOffset(12)] + private bool w; + + /// + /// 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 bool this[int i] => ref *(bool*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref bool 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 bool Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref bool Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the W component. + /// + public readonly ref bool W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Bool2 XX => ref *(Bool2*)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 Bool2 XY => ref *(Bool2*)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 Bool2 XZ => ref *(Bool2*)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 Bool2 XW => ref *(Bool2*)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 Bool2 YX => ref *(Bool2*)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 Bool2 YY => ref *(Bool2*)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 Bool2 YZ => ref *(Bool2*)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 Bool2 YW => ref *(Bool2*)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 Bool2 ZX => ref *(Bool2*)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 Bool2 ZY => ref *(Bool2*)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 Bool2 ZZ => ref *(Bool2*)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 Bool2 ZW => ref *(Bool2*)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 Bool2 WX => ref *(Bool2*)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 Bool2 WY => ref *(Bool2*)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 Bool2 WZ => ref *(Bool2*)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 Bool2 WW => ref *(Bool2*)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 Bool3 XXX => ref *(Bool3*)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 Bool3 XXY => ref *(Bool3*)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 Bool3 XXZ => ref *(Bool3*)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 Bool3 XXW => ref *(Bool3*)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 Bool3 XYX => ref *(Bool3*)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 Bool3 XYY => ref *(Bool3*)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 Bool3 XYZ => ref *(Bool3*)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 Bool3 XYW => ref *(Bool3*)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 Bool3 XZX => ref *(Bool3*)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 Bool3 XZY => ref *(Bool3*)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 Bool3 XZZ => ref *(Bool3*)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 Bool3 XZW => ref *(Bool3*)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 Bool3 XWX => ref *(Bool3*)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 Bool3 XWY => ref *(Bool3*)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 Bool3 XWZ => ref *(Bool3*)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 Bool3 XWW => ref *(Bool3*)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 Bool3 YXX => ref *(Bool3*)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 Bool3 YXY => ref *(Bool3*)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 Bool3 YXZ => ref *(Bool3*)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 Bool3 YXW => ref *(Bool3*)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 Bool3 YYX => ref *(Bool3*)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 Bool3 YYY => ref *(Bool3*)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 Bool3 YYZ => ref *(Bool3*)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 Bool3 YYW => ref *(Bool3*)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 Bool3 YZX => ref *(Bool3*)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 Bool3 YZY => ref *(Bool3*)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 Bool3 YZZ => ref *(Bool3*)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 Bool3 YZW => ref *(Bool3*)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 Bool3 YWX => ref *(Bool3*)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 Bool3 YWY => ref *(Bool3*)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 Bool3 YWZ => ref *(Bool3*)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 Bool3 YWW => ref *(Bool3*)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 Bool3 ZXX => ref *(Bool3*)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 Bool3 ZXY => ref *(Bool3*)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 Bool3 ZXZ => ref *(Bool3*)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 Bool3 ZXW => ref *(Bool3*)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 Bool3 ZYX => ref *(Bool3*)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 Bool3 ZYY => ref *(Bool3*)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 Bool3 ZYZ => ref *(Bool3*)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 Bool3 ZYW => ref *(Bool3*)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 Bool3 ZZX => ref *(Bool3*)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 Bool3 ZZY => ref *(Bool3*)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 Bool3 ZZZ => ref *(Bool3*)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 Bool3 ZZW => ref *(Bool3*)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 Bool3 ZWX => ref *(Bool3*)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 Bool3 ZWY => ref *(Bool3*)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 Bool3 ZWZ => ref *(Bool3*)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 Bool3 ZWW => ref *(Bool3*)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 Bool3 WXX => ref *(Bool3*)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 Bool3 WXY => ref *(Bool3*)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 Bool3 WXZ => ref *(Bool3*)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 Bool3 WXW => ref *(Bool3*)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 Bool3 WYX => ref *(Bool3*)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 Bool3 WYY => ref *(Bool3*)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 Bool3 WYZ => ref *(Bool3*)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 Bool3 WYW => ref *(Bool3*)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 Bool3 WZX => ref *(Bool3*)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 Bool3 WZY => ref *(Bool3*)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 Bool3 WZZ => ref *(Bool3*)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 Bool3 WZW => ref *(Bool3*)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 Bool3 WWX => ref *(Bool3*)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 Bool3 WWY => ref *(Bool3*)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 Bool3 WWZ => ref *(Bool3*)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 Bool3 WWW => ref *(Bool3*)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 Bool4 XXXX => ref *(Bool4*)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 Bool4 XXXY => ref *(Bool4*)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 Bool4 XXXZ => ref *(Bool4*)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 Bool4 XXXW => ref *(Bool4*)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 Bool4 XXYX => ref *(Bool4*)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 Bool4 XXYY => ref *(Bool4*)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 Bool4 XXYZ => ref *(Bool4*)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 Bool4 XXYW => ref *(Bool4*)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 Bool4 XXZX => ref *(Bool4*)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 Bool4 XXZY => ref *(Bool4*)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 Bool4 XXZZ => ref *(Bool4*)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 Bool4 XXZW => ref *(Bool4*)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 Bool4 XXWX => ref *(Bool4*)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 Bool4 XXWY => ref *(Bool4*)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 Bool4 XXWZ => ref *(Bool4*)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 Bool4 XXWW => ref *(Bool4*)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 Bool4 XYXX => ref *(Bool4*)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 Bool4 XYXY => ref *(Bool4*)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 Bool4 XYXZ => ref *(Bool4*)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 Bool4 XYXW => ref *(Bool4*)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 Bool4 XYYX => ref *(Bool4*)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 Bool4 XYYY => ref *(Bool4*)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 Bool4 XYYZ => ref *(Bool4*)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 Bool4 XYYW => ref *(Bool4*)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 Bool4 XYZX => ref *(Bool4*)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 Bool4 XYZY => ref *(Bool4*)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 Bool4 XYZZ => ref *(Bool4*)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 Bool4 XYZW => ref *(Bool4*)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 Bool4 XYWX => ref *(Bool4*)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 Bool4 XYWY => ref *(Bool4*)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 Bool4 XYWZ => ref *(Bool4*)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 Bool4 XYWW => ref *(Bool4*)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 Bool4 XZXX => ref *(Bool4*)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 Bool4 XZXY => ref *(Bool4*)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 Bool4 XZXZ => ref *(Bool4*)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 Bool4 XZXW => ref *(Bool4*)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 Bool4 XZYX => ref *(Bool4*)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 Bool4 XZYY => ref *(Bool4*)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 Bool4 XZYZ => ref *(Bool4*)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 Bool4 XZYW => ref *(Bool4*)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 Bool4 XZZX => ref *(Bool4*)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 Bool4 XZZY => ref *(Bool4*)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 Bool4 XZZZ => ref *(Bool4*)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 Bool4 XZZW => ref *(Bool4*)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 Bool4 XZWX => ref *(Bool4*)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 Bool4 XZWY => ref *(Bool4*)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 Bool4 XZWZ => ref *(Bool4*)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 Bool4 XZWW => ref *(Bool4*)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 Bool4 XWXX => ref *(Bool4*)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 Bool4 XWXY => ref *(Bool4*)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 Bool4 XWXZ => ref *(Bool4*)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 Bool4 XWXW => ref *(Bool4*)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 Bool4 XWYX => ref *(Bool4*)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 Bool4 XWYY => ref *(Bool4*)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 Bool4 XWYZ => ref *(Bool4*)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 Bool4 XWYW => ref *(Bool4*)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 Bool4 XWZX => ref *(Bool4*)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 Bool4 XWZY => ref *(Bool4*)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 Bool4 XWZZ => ref *(Bool4*)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 Bool4 XWZW => ref *(Bool4*)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 Bool4 XWWX => ref *(Bool4*)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 Bool4 XWWY => ref *(Bool4*)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 Bool4 XWWZ => ref *(Bool4*)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 Bool4 XWWW => ref *(Bool4*)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 Bool4 YXXX => ref *(Bool4*)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 Bool4 YXXY => ref *(Bool4*)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 Bool4 YXXZ => ref *(Bool4*)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 Bool4 YXXW => ref *(Bool4*)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 Bool4 YXYX => ref *(Bool4*)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 Bool4 YXYY => ref *(Bool4*)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 Bool4 YXYZ => ref *(Bool4*)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 Bool4 YXYW => ref *(Bool4*)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 Bool4 YXZX => ref *(Bool4*)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 Bool4 YXZY => ref *(Bool4*)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 Bool4 YXZZ => ref *(Bool4*)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 Bool4 YXZW => ref *(Bool4*)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 Bool4 YXWX => ref *(Bool4*)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 Bool4 YXWY => ref *(Bool4*)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 Bool4 YXWZ => ref *(Bool4*)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 Bool4 YXWW => ref *(Bool4*)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 Bool4 YYXX => ref *(Bool4*)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 Bool4 YYXY => ref *(Bool4*)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 Bool4 YYXZ => ref *(Bool4*)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 Bool4 YYXW => ref *(Bool4*)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 Bool4 YYYX => ref *(Bool4*)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 Bool4 YYYY => ref *(Bool4*)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 Bool4 YYYZ => ref *(Bool4*)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 Bool4 YYYW => ref *(Bool4*)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 Bool4 YYZX => ref *(Bool4*)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 Bool4 YYZY => ref *(Bool4*)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 Bool4 YYZZ => ref *(Bool4*)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 Bool4 YYZW => ref *(Bool4*)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 Bool4 YYWX => ref *(Bool4*)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 Bool4 YYWY => ref *(Bool4*)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 Bool4 YYWZ => ref *(Bool4*)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 Bool4 YYWW => ref *(Bool4*)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 Bool4 YZXX => ref *(Bool4*)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 Bool4 YZXY => ref *(Bool4*)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 Bool4 YZXZ => ref *(Bool4*)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 Bool4 YZXW => ref *(Bool4*)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 Bool4 YZYX => ref *(Bool4*)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 Bool4 YZYY => ref *(Bool4*)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 Bool4 YZYZ => ref *(Bool4*)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 Bool4 YZYW => ref *(Bool4*)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 Bool4 YZZX => ref *(Bool4*)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 Bool4 YZZY => ref *(Bool4*)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 Bool4 YZZZ => ref *(Bool4*)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 Bool4 YZZW => ref *(Bool4*)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 Bool4 YZWX => ref *(Bool4*)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 Bool4 YZWY => ref *(Bool4*)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 Bool4 YZWZ => ref *(Bool4*)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 Bool4 YZWW => ref *(Bool4*)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 Bool4 YWXX => ref *(Bool4*)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 Bool4 YWXY => ref *(Bool4*)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 Bool4 YWXZ => ref *(Bool4*)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 Bool4 YWXW => ref *(Bool4*)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 Bool4 YWYX => ref *(Bool4*)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 Bool4 YWYY => ref *(Bool4*)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 Bool4 YWYZ => ref *(Bool4*)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 Bool4 YWYW => ref *(Bool4*)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 Bool4 YWZX => ref *(Bool4*)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 Bool4 YWZY => ref *(Bool4*)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 Bool4 YWZZ => ref *(Bool4*)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 Bool4 YWZW => ref *(Bool4*)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 Bool4 YWWX => ref *(Bool4*)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 Bool4 YWWY => ref *(Bool4*)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 Bool4 YWWZ => ref *(Bool4*)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 Bool4 YWWW => ref *(Bool4*)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 Bool4 ZXXX => ref *(Bool4*)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 Bool4 ZXXY => ref *(Bool4*)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 Bool4 ZXXZ => ref *(Bool4*)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 Bool4 ZXXW => ref *(Bool4*)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 Bool4 ZXYX => ref *(Bool4*)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 Bool4 ZXYY => ref *(Bool4*)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 Bool4 ZXYZ => ref *(Bool4*)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 Bool4 ZXYW => ref *(Bool4*)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 Bool4 ZXZX => ref *(Bool4*)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 Bool4 ZXZY => ref *(Bool4*)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 Bool4 ZXZZ => ref *(Bool4*)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 Bool4 ZXZW => ref *(Bool4*)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 Bool4 ZXWX => ref *(Bool4*)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 Bool4 ZXWY => ref *(Bool4*)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 Bool4 ZXWZ => ref *(Bool4*)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 Bool4 ZXWW => ref *(Bool4*)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 Bool4 ZYXX => ref *(Bool4*)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 Bool4 ZYXY => ref *(Bool4*)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 Bool4 ZYXZ => ref *(Bool4*)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 Bool4 ZYXW => ref *(Bool4*)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 Bool4 ZYYX => ref *(Bool4*)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 Bool4 ZYYY => ref *(Bool4*)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 Bool4 ZYYZ => ref *(Bool4*)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 Bool4 ZYYW => ref *(Bool4*)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 Bool4 ZYZX => ref *(Bool4*)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 Bool4 ZYZY => ref *(Bool4*)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 Bool4 ZYZZ => ref *(Bool4*)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 Bool4 ZYZW => ref *(Bool4*)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 Bool4 ZYWX => ref *(Bool4*)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 Bool4 ZYWY => ref *(Bool4*)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 Bool4 ZYWZ => ref *(Bool4*)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 Bool4 ZYWW => ref *(Bool4*)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 Bool4 ZZXX => ref *(Bool4*)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 Bool4 ZZXY => ref *(Bool4*)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 Bool4 ZZXZ => ref *(Bool4*)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 Bool4 ZZXW => ref *(Bool4*)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 Bool4 ZZYX => ref *(Bool4*)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 Bool4 ZZYY => ref *(Bool4*)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 Bool4 ZZYZ => ref *(Bool4*)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 Bool4 ZZYW => ref *(Bool4*)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 Bool4 ZZZX => ref *(Bool4*)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 Bool4 ZZZY => ref *(Bool4*)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 Bool4 ZZZZ => ref *(Bool4*)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 Bool4 ZZZW => ref *(Bool4*)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 Bool4 ZZWX => ref *(Bool4*)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 Bool4 ZZWY => ref *(Bool4*)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 Bool4 ZZWZ => ref *(Bool4*)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 Bool4 ZZWW => ref *(Bool4*)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 Bool4 ZWXX => ref *(Bool4*)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 Bool4 ZWXY => ref *(Bool4*)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 Bool4 ZWXZ => ref *(Bool4*)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 Bool4 ZWXW => ref *(Bool4*)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 Bool4 ZWYX => ref *(Bool4*)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 Bool4 ZWYY => ref *(Bool4*)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 Bool4 ZWYZ => ref *(Bool4*)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 Bool4 ZWYW => ref *(Bool4*)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 Bool4 ZWZX => ref *(Bool4*)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 Bool4 ZWZY => ref *(Bool4*)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 Bool4 ZWZZ => ref *(Bool4*)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 Bool4 ZWZW => ref *(Bool4*)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 Bool4 ZWWX => ref *(Bool4*)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 Bool4 ZWWY => ref *(Bool4*)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 Bool4 ZWWZ => ref *(Bool4*)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 Bool4 ZWWW => ref *(Bool4*)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 Bool4 WXXX => ref *(Bool4*)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 Bool4 WXXY => ref *(Bool4*)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 Bool4 WXXZ => ref *(Bool4*)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 Bool4 WXXW => ref *(Bool4*)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 Bool4 WXYX => ref *(Bool4*)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 Bool4 WXYY => ref *(Bool4*)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 Bool4 WXYZ => ref *(Bool4*)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 Bool4 WXYW => ref *(Bool4*)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 Bool4 WXZX => ref *(Bool4*)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 Bool4 WXZY => ref *(Bool4*)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 Bool4 WXZZ => ref *(Bool4*)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 Bool4 WXZW => ref *(Bool4*)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 Bool4 WXWX => ref *(Bool4*)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 Bool4 WXWY => ref *(Bool4*)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 Bool4 WXWZ => ref *(Bool4*)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 Bool4 WXWW => ref *(Bool4*)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 Bool4 WYXX => ref *(Bool4*)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 Bool4 WYXY => ref *(Bool4*)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 Bool4 WYXZ => ref *(Bool4*)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 Bool4 WYXW => ref *(Bool4*)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 Bool4 WYYX => ref *(Bool4*)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 Bool4 WYYY => ref *(Bool4*)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 Bool4 WYYZ => ref *(Bool4*)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 Bool4 WYYW => ref *(Bool4*)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 Bool4 WYZX => ref *(Bool4*)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 Bool4 WYZY => ref *(Bool4*)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 Bool4 WYZZ => ref *(Bool4*)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 Bool4 WYZW => ref *(Bool4*)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 Bool4 WYWX => ref *(Bool4*)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 Bool4 WYWY => ref *(Bool4*)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 Bool4 WYWZ => ref *(Bool4*)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 Bool4 WYWW => ref *(Bool4*)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 Bool4 WZXX => ref *(Bool4*)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 Bool4 WZXY => ref *(Bool4*)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 Bool4 WZXZ => ref *(Bool4*)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 Bool4 WZXW => ref *(Bool4*)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 Bool4 WZYX => ref *(Bool4*)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 Bool4 WZYY => ref *(Bool4*)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 Bool4 WZYZ => ref *(Bool4*)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 Bool4 WZYW => ref *(Bool4*)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 Bool4 WZZX => ref *(Bool4*)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 Bool4 WZZY => ref *(Bool4*)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 Bool4 WZZZ => ref *(Bool4*)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 Bool4 WZZW => ref *(Bool4*)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 Bool4 WZWX => ref *(Bool4*)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 Bool4 WZWY => ref *(Bool4*)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 Bool4 WZWZ => ref *(Bool4*)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 Bool4 WZWW => ref *(Bool4*)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 Bool4 WWXX => ref *(Bool4*)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 Bool4 WWXY => ref *(Bool4*)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 Bool4 WWXZ => ref *(Bool4*)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 Bool4 WWXW => ref *(Bool4*)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 Bool4 WWYX => ref *(Bool4*)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 Bool4 WWYY => ref *(Bool4*)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 Bool4 WWYZ => ref *(Bool4*)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 Bool4 WWYW => ref *(Bool4*)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 Bool4 WWZX => ref *(Bool4*)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 Bool4 WWZY => ref *(Bool4*)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 Bool4 WWZZ => ref *(Bool4*)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 Bool4 WWZW => ref *(Bool4*)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 Bool4 WWWX => ref *(Bool4*)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 Bool4 WWWY => ref *(Bool4*)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 Bool4 WWWZ => ref *(Bool4*)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 Bool4 WWWW => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref bool 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 bool G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref bool B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the A component. + /// + public readonly ref bool A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Bool2 RR => ref *(Bool2*)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 Bool2 RG => ref *(Bool2*)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 Bool2 RB => ref *(Bool2*)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 Bool2 RA => ref *(Bool2*)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 Bool2 GR => ref *(Bool2*)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 Bool2 GG => ref *(Bool2*)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 Bool2 GB => ref *(Bool2*)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 Bool2 GA => ref *(Bool2*)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 Bool2 BR => ref *(Bool2*)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 Bool2 BG => ref *(Bool2*)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 Bool2 BB => ref *(Bool2*)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 Bool2 BA => ref *(Bool2*)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 Bool2 AR => ref *(Bool2*)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 Bool2 AG => ref *(Bool2*)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 Bool2 AB => ref *(Bool2*)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 Bool2 AA => ref *(Bool2*)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 Bool3 RRR => ref *(Bool3*)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 Bool3 RRG => ref *(Bool3*)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 Bool3 RRB => ref *(Bool3*)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 Bool3 RRA => ref *(Bool3*)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 Bool3 RGR => ref *(Bool3*)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 Bool3 RGG => ref *(Bool3*)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 Bool3 RGB => ref *(Bool3*)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 Bool3 RGA => ref *(Bool3*)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 Bool3 RBR => ref *(Bool3*)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 Bool3 RBG => ref *(Bool3*)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 Bool3 RBB => ref *(Bool3*)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 Bool3 RBA => ref *(Bool3*)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 Bool3 RAR => ref *(Bool3*)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 Bool3 RAG => ref *(Bool3*)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 Bool3 RAB => ref *(Bool3*)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 Bool3 RAA => ref *(Bool3*)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 Bool3 GRR => ref *(Bool3*)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 Bool3 GRG => ref *(Bool3*)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 Bool3 GRB => ref *(Bool3*)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 Bool3 GRA => ref *(Bool3*)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 Bool3 GGR => ref *(Bool3*)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 Bool3 GGG => ref *(Bool3*)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 Bool3 GGB => ref *(Bool3*)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 Bool3 GGA => ref *(Bool3*)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 Bool3 GBR => ref *(Bool3*)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 Bool3 GBG => ref *(Bool3*)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 Bool3 GBB => ref *(Bool3*)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 Bool3 GBA => ref *(Bool3*)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 Bool3 GAR => ref *(Bool3*)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 Bool3 GAG => ref *(Bool3*)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 Bool3 GAB => ref *(Bool3*)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 Bool3 GAA => ref *(Bool3*)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 Bool3 BRR => ref *(Bool3*)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 Bool3 BRG => ref *(Bool3*)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 Bool3 BRB => ref *(Bool3*)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 Bool3 BRA => ref *(Bool3*)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 Bool3 BGR => ref *(Bool3*)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 Bool3 BGG => ref *(Bool3*)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 Bool3 BGB => ref *(Bool3*)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 Bool3 BGA => ref *(Bool3*)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 Bool3 BBR => ref *(Bool3*)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 Bool3 BBG => ref *(Bool3*)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 Bool3 BBB => ref *(Bool3*)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 Bool3 BBA => ref *(Bool3*)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 Bool3 BAR => ref *(Bool3*)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 Bool3 BAG => ref *(Bool3*)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 Bool3 BAB => ref *(Bool3*)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 Bool3 BAA => ref *(Bool3*)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 Bool3 ARR => ref *(Bool3*)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 Bool3 ARG => ref *(Bool3*)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 Bool3 ARB => ref *(Bool3*)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 Bool3 ARA => ref *(Bool3*)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 Bool3 AGR => ref *(Bool3*)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 Bool3 AGG => ref *(Bool3*)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 Bool3 AGB => ref *(Bool3*)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 Bool3 AGA => ref *(Bool3*)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 Bool3 ABR => ref *(Bool3*)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 Bool3 ABG => ref *(Bool3*)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 Bool3 ABB => ref *(Bool3*)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 Bool3 ABA => ref *(Bool3*)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 Bool3 AAR => ref *(Bool3*)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 Bool3 AAG => ref *(Bool3*)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 Bool3 AAB => ref *(Bool3*)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 Bool3 AAA => ref *(Bool3*)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 Bool4 RRRR => ref *(Bool4*)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 Bool4 RRRG => ref *(Bool4*)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 Bool4 RRRB => ref *(Bool4*)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 Bool4 RRRA => ref *(Bool4*)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 Bool4 RRGR => ref *(Bool4*)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 Bool4 RRGG => ref *(Bool4*)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 Bool4 RRGB => ref *(Bool4*)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 Bool4 RRGA => ref *(Bool4*)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 Bool4 RRBR => ref *(Bool4*)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 Bool4 RRBG => ref *(Bool4*)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 Bool4 RRBB => ref *(Bool4*)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 Bool4 RRBA => ref *(Bool4*)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 Bool4 RRAR => ref *(Bool4*)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 Bool4 RRAG => ref *(Bool4*)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 Bool4 RRAB => ref *(Bool4*)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 Bool4 RRAA => ref *(Bool4*)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 Bool4 RGRR => ref *(Bool4*)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 Bool4 RGRG => ref *(Bool4*)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 Bool4 RGRB => ref *(Bool4*)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 Bool4 RGRA => ref *(Bool4*)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 Bool4 RGGR => ref *(Bool4*)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 Bool4 RGGG => ref *(Bool4*)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 Bool4 RGGB => ref *(Bool4*)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 Bool4 RGGA => ref *(Bool4*)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 Bool4 RGBR => ref *(Bool4*)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 Bool4 RGBG => ref *(Bool4*)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 Bool4 RGBB => ref *(Bool4*)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 Bool4 RGBA => ref *(Bool4*)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 Bool4 RGAR => ref *(Bool4*)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 Bool4 RGAG => ref *(Bool4*)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 Bool4 RGAB => ref *(Bool4*)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 Bool4 RGAA => ref *(Bool4*)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 Bool4 RBRR => ref *(Bool4*)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 Bool4 RBRG => ref *(Bool4*)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 Bool4 RBRB => ref *(Bool4*)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 Bool4 RBRA => ref *(Bool4*)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 Bool4 RBGR => ref *(Bool4*)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 Bool4 RBGG => ref *(Bool4*)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 Bool4 RBGB => ref *(Bool4*)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 Bool4 RBGA => ref *(Bool4*)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 Bool4 RBBR => ref *(Bool4*)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 Bool4 RBBG => ref *(Bool4*)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 Bool4 RBBB => ref *(Bool4*)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 Bool4 RBBA => ref *(Bool4*)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 Bool4 RBAR => ref *(Bool4*)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 Bool4 RBAG => ref *(Bool4*)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 Bool4 RBAB => ref *(Bool4*)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 Bool4 RBAA => ref *(Bool4*)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 Bool4 RARR => ref *(Bool4*)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 Bool4 RARG => ref *(Bool4*)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 Bool4 RARB => ref *(Bool4*)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 Bool4 RARA => ref *(Bool4*)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 Bool4 RAGR => ref *(Bool4*)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 Bool4 RAGG => ref *(Bool4*)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 Bool4 RAGB => ref *(Bool4*)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 Bool4 RAGA => ref *(Bool4*)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 Bool4 RABR => ref *(Bool4*)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 Bool4 RABG => ref *(Bool4*)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 Bool4 RABB => ref *(Bool4*)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 Bool4 RABA => ref *(Bool4*)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 Bool4 RAAR => ref *(Bool4*)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 Bool4 RAAG => ref *(Bool4*)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 Bool4 RAAB => ref *(Bool4*)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 Bool4 RAAA => ref *(Bool4*)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 Bool4 GRRR => ref *(Bool4*)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 Bool4 GRRG => ref *(Bool4*)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 Bool4 GRRB => ref *(Bool4*)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 Bool4 GRRA => ref *(Bool4*)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 Bool4 GRGR => ref *(Bool4*)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 Bool4 GRGG => ref *(Bool4*)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 Bool4 GRGB => ref *(Bool4*)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 Bool4 GRGA => ref *(Bool4*)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 Bool4 GRBR => ref *(Bool4*)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 Bool4 GRBG => ref *(Bool4*)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 Bool4 GRBB => ref *(Bool4*)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 Bool4 GRBA => ref *(Bool4*)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 Bool4 GRAR => ref *(Bool4*)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 Bool4 GRAG => ref *(Bool4*)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 Bool4 GRAB => ref *(Bool4*)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 Bool4 GRAA => ref *(Bool4*)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 Bool4 GGRR => ref *(Bool4*)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 Bool4 GGRG => ref *(Bool4*)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 Bool4 GGRB => ref *(Bool4*)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 Bool4 GGRA => ref *(Bool4*)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 Bool4 GGGR => ref *(Bool4*)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 Bool4 GGGG => ref *(Bool4*)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 Bool4 GGGB => ref *(Bool4*)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 Bool4 GGGA => ref *(Bool4*)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 Bool4 GGBR => ref *(Bool4*)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 Bool4 GGBG => ref *(Bool4*)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 Bool4 GGBB => ref *(Bool4*)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 Bool4 GGBA => ref *(Bool4*)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 Bool4 GGAR => ref *(Bool4*)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 Bool4 GGAG => ref *(Bool4*)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 Bool4 GGAB => ref *(Bool4*)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 Bool4 GGAA => ref *(Bool4*)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 Bool4 GBRR => ref *(Bool4*)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 Bool4 GBRG => ref *(Bool4*)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 Bool4 GBRB => ref *(Bool4*)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 Bool4 GBRA => ref *(Bool4*)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 Bool4 GBGR => ref *(Bool4*)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 Bool4 GBGG => ref *(Bool4*)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 Bool4 GBGB => ref *(Bool4*)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 Bool4 GBGA => ref *(Bool4*)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 Bool4 GBBR => ref *(Bool4*)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 Bool4 GBBG => ref *(Bool4*)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 Bool4 GBBB => ref *(Bool4*)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 Bool4 GBBA => ref *(Bool4*)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 Bool4 GBAR => ref *(Bool4*)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 Bool4 GBAG => ref *(Bool4*)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 Bool4 GBAB => ref *(Bool4*)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 Bool4 GBAA => ref *(Bool4*)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 Bool4 GARR => ref *(Bool4*)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 Bool4 GARG => ref *(Bool4*)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 Bool4 GARB => ref *(Bool4*)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 Bool4 GARA => ref *(Bool4*)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 Bool4 GAGR => ref *(Bool4*)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 Bool4 GAGG => ref *(Bool4*)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 Bool4 GAGB => ref *(Bool4*)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 Bool4 GAGA => ref *(Bool4*)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 Bool4 GABR => ref *(Bool4*)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 Bool4 GABG => ref *(Bool4*)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 Bool4 GABB => ref *(Bool4*)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 Bool4 GABA => ref *(Bool4*)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 Bool4 GAAR => ref *(Bool4*)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 Bool4 GAAG => ref *(Bool4*)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 Bool4 GAAB => ref *(Bool4*)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 Bool4 GAAA => ref *(Bool4*)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 Bool4 BRRR => ref *(Bool4*)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 Bool4 BRRG => ref *(Bool4*)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 Bool4 BRRB => ref *(Bool4*)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 Bool4 BRRA => ref *(Bool4*)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 Bool4 BRGR => ref *(Bool4*)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 Bool4 BRGG => ref *(Bool4*)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 Bool4 BRGB => ref *(Bool4*)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 Bool4 BRGA => ref *(Bool4*)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 Bool4 BRBR => ref *(Bool4*)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 Bool4 BRBG => ref *(Bool4*)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 Bool4 BRBB => ref *(Bool4*)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 Bool4 BRBA => ref *(Bool4*)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 Bool4 BRAR => ref *(Bool4*)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 Bool4 BRAG => ref *(Bool4*)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 Bool4 BRAB => ref *(Bool4*)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 Bool4 BRAA => ref *(Bool4*)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 Bool4 BGRR => ref *(Bool4*)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 Bool4 BGRG => ref *(Bool4*)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 Bool4 BGRB => ref *(Bool4*)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 Bool4 BGRA => ref *(Bool4*)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 Bool4 BGGR => ref *(Bool4*)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 Bool4 BGGG => ref *(Bool4*)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 Bool4 BGGB => ref *(Bool4*)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 Bool4 BGGA => ref *(Bool4*)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 Bool4 BGBR => ref *(Bool4*)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 Bool4 BGBG => ref *(Bool4*)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 Bool4 BGBB => ref *(Bool4*)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 Bool4 BGBA => ref *(Bool4*)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 Bool4 BGAR => ref *(Bool4*)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 Bool4 BGAG => ref *(Bool4*)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 Bool4 BGAB => ref *(Bool4*)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 Bool4 BGAA => ref *(Bool4*)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 Bool4 BBRR => ref *(Bool4*)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 Bool4 BBRG => ref *(Bool4*)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 Bool4 BBRB => ref *(Bool4*)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 Bool4 BBRA => ref *(Bool4*)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 Bool4 BBGR => ref *(Bool4*)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 Bool4 BBGG => ref *(Bool4*)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 Bool4 BBGB => ref *(Bool4*)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 Bool4 BBGA => ref *(Bool4*)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 Bool4 BBBR => ref *(Bool4*)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 Bool4 BBBG => ref *(Bool4*)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 Bool4 BBBB => ref *(Bool4*)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 Bool4 BBBA => ref *(Bool4*)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 Bool4 BBAR => ref *(Bool4*)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 Bool4 BBAG => ref *(Bool4*)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 Bool4 BBAB => ref *(Bool4*)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 Bool4 BBAA => ref *(Bool4*)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 Bool4 BARR => ref *(Bool4*)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 Bool4 BARG => ref *(Bool4*)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 Bool4 BARB => ref *(Bool4*)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 Bool4 BARA => ref *(Bool4*)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 Bool4 BAGR => ref *(Bool4*)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 Bool4 BAGG => ref *(Bool4*)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 Bool4 BAGB => ref *(Bool4*)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 Bool4 BAGA => ref *(Bool4*)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 Bool4 BABR => ref *(Bool4*)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 Bool4 BABG => ref *(Bool4*)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 Bool4 BABB => ref *(Bool4*)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 Bool4 BABA => ref *(Bool4*)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 Bool4 BAAR => ref *(Bool4*)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 Bool4 BAAG => ref *(Bool4*)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 Bool4 BAAB => ref *(Bool4*)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 Bool4 BAAA => ref *(Bool4*)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 Bool4 ARRR => ref *(Bool4*)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 Bool4 ARRG => ref *(Bool4*)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 Bool4 ARRB => ref *(Bool4*)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 Bool4 ARRA => ref *(Bool4*)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 Bool4 ARGR => ref *(Bool4*)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 Bool4 ARGG => ref *(Bool4*)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 Bool4 ARGB => ref *(Bool4*)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 Bool4 ARGA => ref *(Bool4*)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 Bool4 ARBR => ref *(Bool4*)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 Bool4 ARBG => ref *(Bool4*)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 Bool4 ARBB => ref *(Bool4*)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 Bool4 ARBA => ref *(Bool4*)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 Bool4 ARAR => ref *(Bool4*)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 Bool4 ARAG => ref *(Bool4*)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 Bool4 ARAB => ref *(Bool4*)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 Bool4 ARAA => ref *(Bool4*)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 Bool4 AGRR => ref *(Bool4*)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 Bool4 AGRG => ref *(Bool4*)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 Bool4 AGRB => ref *(Bool4*)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 Bool4 AGRA => ref *(Bool4*)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 Bool4 AGGR => ref *(Bool4*)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 Bool4 AGGG => ref *(Bool4*)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 Bool4 AGGB => ref *(Bool4*)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 Bool4 AGGA => ref *(Bool4*)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 Bool4 AGBR => ref *(Bool4*)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 Bool4 AGBG => ref *(Bool4*)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 Bool4 AGBB => ref *(Bool4*)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 Bool4 AGBA => ref *(Bool4*)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 Bool4 AGAR => ref *(Bool4*)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 Bool4 AGAG => ref *(Bool4*)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 Bool4 AGAB => ref *(Bool4*)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 Bool4 AGAA => ref *(Bool4*)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 Bool4 ABRR => ref *(Bool4*)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 Bool4 ABRG => ref *(Bool4*)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 Bool4 ABRB => ref *(Bool4*)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 Bool4 ABRA => ref *(Bool4*)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 Bool4 ABGR => ref *(Bool4*)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 Bool4 ABGG => ref *(Bool4*)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 Bool4 ABGB => ref *(Bool4*)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 Bool4 ABGA => ref *(Bool4*)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 Bool4 ABBR => ref *(Bool4*)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 Bool4 ABBG => ref *(Bool4*)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 Bool4 ABBB => ref *(Bool4*)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 Bool4 ABBA => ref *(Bool4*)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 Bool4 ABAR => ref *(Bool4*)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 Bool4 ABAG => ref *(Bool4*)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 Bool4 ABAB => ref *(Bool4*)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 Bool4 ABAA => ref *(Bool4*)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 Bool4 AARR => ref *(Bool4*)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 Bool4 AARG => ref *(Bool4*)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 Bool4 AARB => ref *(Bool4*)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 Bool4 AARA => ref *(Bool4*)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 Bool4 AAGR => ref *(Bool4*)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 Bool4 AAGG => ref *(Bool4*)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 Bool4 AAGB => ref *(Bool4*)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 Bool4 AAGA => ref *(Bool4*)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 Bool4 AABR => ref *(Bool4*)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 Bool4 AABG => ref *(Bool4*)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 Bool4 AABB => ref *(Bool4*)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 Bool4 AABA => ref *(Bool4*)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 Bool4 AAAR => ref *(Bool4*)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 Bool4 AAAG => ref *(Bool4*)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 Bool4 AAAB => ref *(Bool4*)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 Bool4 AAAA => ref *(Bool4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4), sizeof(Bool4)); - - [FieldOffset(0)] - private bool x; - - [FieldOffset(4)] - private bool y; - - [FieldOffset(8)] - private bool z; - - [FieldOffset(12)] - private bool w; - - /// - /// 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 bool this[int i] => ref *(bool*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref bool 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 bool Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref bool Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the W component. - /// - public readonly ref bool W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Bool2 XX => ref *(Bool2*)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 Bool2 XY => ref *(Bool2*)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 Bool2 XZ => ref *(Bool2*)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 Bool2 XW => ref *(Bool2*)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 Bool2 YX => ref *(Bool2*)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 Bool2 YY => ref *(Bool2*)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 Bool2 YZ => ref *(Bool2*)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 Bool2 YW => ref *(Bool2*)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 Bool2 ZX => ref *(Bool2*)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 Bool2 ZY => ref *(Bool2*)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 Bool2 ZZ => ref *(Bool2*)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 Bool2 ZW => ref *(Bool2*)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 Bool2 WX => ref *(Bool2*)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 Bool2 WY => ref *(Bool2*)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 Bool2 WZ => ref *(Bool2*)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 Bool2 WW => ref *(Bool2*)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 Bool3 XXX => ref *(Bool3*)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 Bool3 XXY => ref *(Bool3*)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 Bool3 XXZ => ref *(Bool3*)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 Bool3 XXW => ref *(Bool3*)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 Bool3 XYX => ref *(Bool3*)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 Bool3 XYY => ref *(Bool3*)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 Bool3 XYZ => ref *(Bool3*)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 Bool3 XYW => ref *(Bool3*)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 Bool3 XZX => ref *(Bool3*)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 Bool3 XZY => ref *(Bool3*)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 Bool3 XZZ => ref *(Bool3*)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 Bool3 XZW => ref *(Bool3*)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 Bool3 XWX => ref *(Bool3*)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 Bool3 XWY => ref *(Bool3*)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 Bool3 XWZ => ref *(Bool3*)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 Bool3 XWW => ref *(Bool3*)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 Bool3 YXX => ref *(Bool3*)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 Bool3 YXY => ref *(Bool3*)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 Bool3 YXZ => ref *(Bool3*)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 Bool3 YXW => ref *(Bool3*)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 Bool3 YYX => ref *(Bool3*)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 Bool3 YYY => ref *(Bool3*)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 Bool3 YYZ => ref *(Bool3*)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 Bool3 YYW => ref *(Bool3*)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 Bool3 YZX => ref *(Bool3*)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 Bool3 YZY => ref *(Bool3*)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 Bool3 YZZ => ref *(Bool3*)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 Bool3 YZW => ref *(Bool3*)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 Bool3 YWX => ref *(Bool3*)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 Bool3 YWY => ref *(Bool3*)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 Bool3 YWZ => ref *(Bool3*)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 Bool3 YWW => ref *(Bool3*)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 Bool3 ZXX => ref *(Bool3*)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 Bool3 ZXY => ref *(Bool3*)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 Bool3 ZXZ => ref *(Bool3*)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 Bool3 ZXW => ref *(Bool3*)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 Bool3 ZYX => ref *(Bool3*)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 Bool3 ZYY => ref *(Bool3*)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 Bool3 ZYZ => ref *(Bool3*)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 Bool3 ZYW => ref *(Bool3*)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 Bool3 ZZX => ref *(Bool3*)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 Bool3 ZZY => ref *(Bool3*)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 Bool3 ZZZ => ref *(Bool3*)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 Bool3 ZZW => ref *(Bool3*)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 Bool3 ZWX => ref *(Bool3*)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 Bool3 ZWY => ref *(Bool3*)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 Bool3 ZWZ => ref *(Bool3*)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 Bool3 ZWW => ref *(Bool3*)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 Bool3 WXX => ref *(Bool3*)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 Bool3 WXY => ref *(Bool3*)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 Bool3 WXZ => ref *(Bool3*)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 Bool3 WXW => ref *(Bool3*)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 Bool3 WYX => ref *(Bool3*)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 Bool3 WYY => ref *(Bool3*)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 Bool3 WYZ => ref *(Bool3*)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 Bool3 WYW => ref *(Bool3*)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 Bool3 WZX => ref *(Bool3*)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 Bool3 WZY => ref *(Bool3*)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 Bool3 WZZ => ref *(Bool3*)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 Bool3 WZW => ref *(Bool3*)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 Bool3 WWX => ref *(Bool3*)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 Bool3 WWY => ref *(Bool3*)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 Bool3 WWZ => ref *(Bool3*)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 Bool3 WWW => ref *(Bool3*)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 Bool4 XXXX => ref *(Bool4*)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 Bool4 XXXY => ref *(Bool4*)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 Bool4 XXXZ => ref *(Bool4*)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 Bool4 XXXW => ref *(Bool4*)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 Bool4 XXYX => ref *(Bool4*)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 Bool4 XXYY => ref *(Bool4*)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 Bool4 XXYZ => ref *(Bool4*)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 Bool4 XXYW => ref *(Bool4*)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 Bool4 XXZX => ref *(Bool4*)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 Bool4 XXZY => ref *(Bool4*)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 Bool4 XXZZ => ref *(Bool4*)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 Bool4 XXZW => ref *(Bool4*)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 Bool4 XXWX => ref *(Bool4*)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 Bool4 XXWY => ref *(Bool4*)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 Bool4 XXWZ => ref *(Bool4*)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 Bool4 XXWW => ref *(Bool4*)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 Bool4 XYXX => ref *(Bool4*)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 Bool4 XYXY => ref *(Bool4*)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 Bool4 XYXZ => ref *(Bool4*)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 Bool4 XYXW => ref *(Bool4*)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 Bool4 XYYX => ref *(Bool4*)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 Bool4 XYYY => ref *(Bool4*)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 Bool4 XYYZ => ref *(Bool4*)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 Bool4 XYYW => ref *(Bool4*)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 Bool4 XYZX => ref *(Bool4*)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 Bool4 XYZY => ref *(Bool4*)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 Bool4 XYZZ => ref *(Bool4*)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 Bool4 XYZW => ref *(Bool4*)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 Bool4 XYWX => ref *(Bool4*)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 Bool4 XYWY => ref *(Bool4*)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 Bool4 XYWZ => ref *(Bool4*)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 Bool4 XYWW => ref *(Bool4*)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 Bool4 XZXX => ref *(Bool4*)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 Bool4 XZXY => ref *(Bool4*)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 Bool4 XZXZ => ref *(Bool4*)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 Bool4 XZXW => ref *(Bool4*)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 Bool4 XZYX => ref *(Bool4*)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 Bool4 XZYY => ref *(Bool4*)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 Bool4 XZYZ => ref *(Bool4*)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 Bool4 XZYW => ref *(Bool4*)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 Bool4 XZZX => ref *(Bool4*)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 Bool4 XZZY => ref *(Bool4*)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 Bool4 XZZZ => ref *(Bool4*)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 Bool4 XZZW => ref *(Bool4*)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 Bool4 XZWX => ref *(Bool4*)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 Bool4 XZWY => ref *(Bool4*)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 Bool4 XZWZ => ref *(Bool4*)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 Bool4 XZWW => ref *(Bool4*)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 Bool4 XWXX => ref *(Bool4*)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 Bool4 XWXY => ref *(Bool4*)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 Bool4 XWXZ => ref *(Bool4*)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 Bool4 XWXW => ref *(Bool4*)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 Bool4 XWYX => ref *(Bool4*)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 Bool4 XWYY => ref *(Bool4*)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 Bool4 XWYZ => ref *(Bool4*)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 Bool4 XWYW => ref *(Bool4*)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 Bool4 XWZX => ref *(Bool4*)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 Bool4 XWZY => ref *(Bool4*)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 Bool4 XWZZ => ref *(Bool4*)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 Bool4 XWZW => ref *(Bool4*)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 Bool4 XWWX => ref *(Bool4*)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 Bool4 XWWY => ref *(Bool4*)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 Bool4 XWWZ => ref *(Bool4*)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 Bool4 XWWW => ref *(Bool4*)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 Bool4 YXXX => ref *(Bool4*)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 Bool4 YXXY => ref *(Bool4*)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 Bool4 YXXZ => ref *(Bool4*)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 Bool4 YXXW => ref *(Bool4*)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 Bool4 YXYX => ref *(Bool4*)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 Bool4 YXYY => ref *(Bool4*)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 Bool4 YXYZ => ref *(Bool4*)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 Bool4 YXYW => ref *(Bool4*)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 Bool4 YXZX => ref *(Bool4*)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 Bool4 YXZY => ref *(Bool4*)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 Bool4 YXZZ => ref *(Bool4*)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 Bool4 YXZW => ref *(Bool4*)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 Bool4 YXWX => ref *(Bool4*)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 Bool4 YXWY => ref *(Bool4*)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 Bool4 YXWZ => ref *(Bool4*)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 Bool4 YXWW => ref *(Bool4*)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 Bool4 YYXX => ref *(Bool4*)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 Bool4 YYXY => ref *(Bool4*)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 Bool4 YYXZ => ref *(Bool4*)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 Bool4 YYXW => ref *(Bool4*)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 Bool4 YYYX => ref *(Bool4*)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 Bool4 YYYY => ref *(Bool4*)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 Bool4 YYYZ => ref *(Bool4*)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 Bool4 YYYW => ref *(Bool4*)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 Bool4 YYZX => ref *(Bool4*)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 Bool4 YYZY => ref *(Bool4*)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 Bool4 YYZZ => ref *(Bool4*)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 Bool4 YYZW => ref *(Bool4*)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 Bool4 YYWX => ref *(Bool4*)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 Bool4 YYWY => ref *(Bool4*)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 Bool4 YYWZ => ref *(Bool4*)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 Bool4 YYWW => ref *(Bool4*)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 Bool4 YZXX => ref *(Bool4*)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 Bool4 YZXY => ref *(Bool4*)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 Bool4 YZXZ => ref *(Bool4*)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 Bool4 YZXW => ref *(Bool4*)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 Bool4 YZYX => ref *(Bool4*)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 Bool4 YZYY => ref *(Bool4*)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 Bool4 YZYZ => ref *(Bool4*)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 Bool4 YZYW => ref *(Bool4*)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 Bool4 YZZX => ref *(Bool4*)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 Bool4 YZZY => ref *(Bool4*)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 Bool4 YZZZ => ref *(Bool4*)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 Bool4 YZZW => ref *(Bool4*)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 Bool4 YZWX => ref *(Bool4*)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 Bool4 YZWY => ref *(Bool4*)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 Bool4 YZWZ => ref *(Bool4*)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 Bool4 YZWW => ref *(Bool4*)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 Bool4 YWXX => ref *(Bool4*)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 Bool4 YWXY => ref *(Bool4*)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 Bool4 YWXZ => ref *(Bool4*)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 Bool4 YWXW => ref *(Bool4*)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 Bool4 YWYX => ref *(Bool4*)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 Bool4 YWYY => ref *(Bool4*)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 Bool4 YWYZ => ref *(Bool4*)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 Bool4 YWYW => ref *(Bool4*)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 Bool4 YWZX => ref *(Bool4*)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 Bool4 YWZY => ref *(Bool4*)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 Bool4 YWZZ => ref *(Bool4*)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 Bool4 YWZW => ref *(Bool4*)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 Bool4 YWWX => ref *(Bool4*)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 Bool4 YWWY => ref *(Bool4*)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 Bool4 YWWZ => ref *(Bool4*)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 Bool4 YWWW => ref *(Bool4*)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 Bool4 ZXXX => ref *(Bool4*)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 Bool4 ZXXY => ref *(Bool4*)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 Bool4 ZXXZ => ref *(Bool4*)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 Bool4 ZXXW => ref *(Bool4*)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 Bool4 ZXYX => ref *(Bool4*)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 Bool4 ZXYY => ref *(Bool4*)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 Bool4 ZXYZ => ref *(Bool4*)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 Bool4 ZXYW => ref *(Bool4*)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 Bool4 ZXZX => ref *(Bool4*)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 Bool4 ZXZY => ref *(Bool4*)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 Bool4 ZXZZ => ref *(Bool4*)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 Bool4 ZXZW => ref *(Bool4*)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 Bool4 ZXWX => ref *(Bool4*)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 Bool4 ZXWY => ref *(Bool4*)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 Bool4 ZXWZ => ref *(Bool4*)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 Bool4 ZXWW => ref *(Bool4*)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 Bool4 ZYXX => ref *(Bool4*)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 Bool4 ZYXY => ref *(Bool4*)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 Bool4 ZYXZ => ref *(Bool4*)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 Bool4 ZYXW => ref *(Bool4*)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 Bool4 ZYYX => ref *(Bool4*)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 Bool4 ZYYY => ref *(Bool4*)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 Bool4 ZYYZ => ref *(Bool4*)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 Bool4 ZYYW => ref *(Bool4*)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 Bool4 ZYZX => ref *(Bool4*)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 Bool4 ZYZY => ref *(Bool4*)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 Bool4 ZYZZ => ref *(Bool4*)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 Bool4 ZYZW => ref *(Bool4*)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 Bool4 ZYWX => ref *(Bool4*)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 Bool4 ZYWY => ref *(Bool4*)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 Bool4 ZYWZ => ref *(Bool4*)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 Bool4 ZYWW => ref *(Bool4*)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 Bool4 ZZXX => ref *(Bool4*)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 Bool4 ZZXY => ref *(Bool4*)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 Bool4 ZZXZ => ref *(Bool4*)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 Bool4 ZZXW => ref *(Bool4*)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 Bool4 ZZYX => ref *(Bool4*)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 Bool4 ZZYY => ref *(Bool4*)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 Bool4 ZZYZ => ref *(Bool4*)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 Bool4 ZZYW => ref *(Bool4*)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 Bool4 ZZZX => ref *(Bool4*)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 Bool4 ZZZY => ref *(Bool4*)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 Bool4 ZZZZ => ref *(Bool4*)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 Bool4 ZZZW => ref *(Bool4*)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 Bool4 ZZWX => ref *(Bool4*)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 Bool4 ZZWY => ref *(Bool4*)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 Bool4 ZZWZ => ref *(Bool4*)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 Bool4 ZZWW => ref *(Bool4*)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 Bool4 ZWXX => ref *(Bool4*)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 Bool4 ZWXY => ref *(Bool4*)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 Bool4 ZWXZ => ref *(Bool4*)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 Bool4 ZWXW => ref *(Bool4*)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 Bool4 ZWYX => ref *(Bool4*)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 Bool4 ZWYY => ref *(Bool4*)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 Bool4 ZWYZ => ref *(Bool4*)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 Bool4 ZWYW => ref *(Bool4*)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 Bool4 ZWZX => ref *(Bool4*)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 Bool4 ZWZY => ref *(Bool4*)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 Bool4 ZWZZ => ref *(Bool4*)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 Bool4 ZWZW => ref *(Bool4*)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 Bool4 ZWWX => ref *(Bool4*)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 Bool4 ZWWY => ref *(Bool4*)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 Bool4 ZWWZ => ref *(Bool4*)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 Bool4 ZWWW => ref *(Bool4*)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 Bool4 WXXX => ref *(Bool4*)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 Bool4 WXXY => ref *(Bool4*)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 Bool4 WXXZ => ref *(Bool4*)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 Bool4 WXXW => ref *(Bool4*)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 Bool4 WXYX => ref *(Bool4*)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 Bool4 WXYY => ref *(Bool4*)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 Bool4 WXYZ => ref *(Bool4*)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 Bool4 WXYW => ref *(Bool4*)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 Bool4 WXZX => ref *(Bool4*)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 Bool4 WXZY => ref *(Bool4*)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 Bool4 WXZZ => ref *(Bool4*)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 Bool4 WXZW => ref *(Bool4*)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 Bool4 WXWX => ref *(Bool4*)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 Bool4 WXWY => ref *(Bool4*)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 Bool4 WXWZ => ref *(Bool4*)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 Bool4 WXWW => ref *(Bool4*)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 Bool4 WYXX => ref *(Bool4*)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 Bool4 WYXY => ref *(Bool4*)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 Bool4 WYXZ => ref *(Bool4*)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 Bool4 WYXW => ref *(Bool4*)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 Bool4 WYYX => ref *(Bool4*)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 Bool4 WYYY => ref *(Bool4*)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 Bool4 WYYZ => ref *(Bool4*)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 Bool4 WYYW => ref *(Bool4*)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 Bool4 WYZX => ref *(Bool4*)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 Bool4 WYZY => ref *(Bool4*)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 Bool4 WYZZ => ref *(Bool4*)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 Bool4 WYZW => ref *(Bool4*)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 Bool4 WYWX => ref *(Bool4*)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 Bool4 WYWY => ref *(Bool4*)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 Bool4 WYWZ => ref *(Bool4*)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 Bool4 WYWW => ref *(Bool4*)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 Bool4 WZXX => ref *(Bool4*)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 Bool4 WZXY => ref *(Bool4*)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 Bool4 WZXZ => ref *(Bool4*)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 Bool4 WZXW => ref *(Bool4*)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 Bool4 WZYX => ref *(Bool4*)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 Bool4 WZYY => ref *(Bool4*)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 Bool4 WZYZ => ref *(Bool4*)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 Bool4 WZYW => ref *(Bool4*)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 Bool4 WZZX => ref *(Bool4*)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 Bool4 WZZY => ref *(Bool4*)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 Bool4 WZZZ => ref *(Bool4*)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 Bool4 WZZW => ref *(Bool4*)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 Bool4 WZWX => ref *(Bool4*)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 Bool4 WZWY => ref *(Bool4*)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 Bool4 WZWZ => ref *(Bool4*)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 Bool4 WZWW => ref *(Bool4*)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 Bool4 WWXX => ref *(Bool4*)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 Bool4 WWXY => ref *(Bool4*)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 Bool4 WWXZ => ref *(Bool4*)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 Bool4 WWXW => ref *(Bool4*)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 Bool4 WWYX => ref *(Bool4*)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 Bool4 WWYY => ref *(Bool4*)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 Bool4 WWYZ => ref *(Bool4*)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 Bool4 WWYW => ref *(Bool4*)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 Bool4 WWZX => ref *(Bool4*)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 Bool4 WWZY => ref *(Bool4*)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 Bool4 WWZZ => ref *(Bool4*)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 Bool4 WWZW => ref *(Bool4*)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 Bool4 WWWX => ref *(Bool4*)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 Bool4 WWWY => ref *(Bool4*)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 Bool4 WWWZ => ref *(Bool4*)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 Bool4 WWWW => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref bool 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 bool G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref bool B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the A component. - /// - public readonly ref bool A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Bool2 RR => ref *(Bool2*)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 Bool2 RG => ref *(Bool2*)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 Bool2 RB => ref *(Bool2*)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 Bool2 RA => ref *(Bool2*)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 Bool2 GR => ref *(Bool2*)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 Bool2 GG => ref *(Bool2*)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 Bool2 GB => ref *(Bool2*)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 Bool2 GA => ref *(Bool2*)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 Bool2 BR => ref *(Bool2*)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 Bool2 BG => ref *(Bool2*)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 Bool2 BB => ref *(Bool2*)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 Bool2 BA => ref *(Bool2*)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 Bool2 AR => ref *(Bool2*)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 Bool2 AG => ref *(Bool2*)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 Bool2 AB => ref *(Bool2*)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 Bool2 AA => ref *(Bool2*)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 Bool3 RRR => ref *(Bool3*)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 Bool3 RRG => ref *(Bool3*)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 Bool3 RRB => ref *(Bool3*)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 Bool3 RRA => ref *(Bool3*)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 Bool3 RGR => ref *(Bool3*)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 Bool3 RGG => ref *(Bool3*)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 Bool3 RGB => ref *(Bool3*)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 Bool3 RGA => ref *(Bool3*)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 Bool3 RBR => ref *(Bool3*)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 Bool3 RBG => ref *(Bool3*)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 Bool3 RBB => ref *(Bool3*)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 Bool3 RBA => ref *(Bool3*)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 Bool3 RAR => ref *(Bool3*)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 Bool3 RAG => ref *(Bool3*)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 Bool3 RAB => ref *(Bool3*)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 Bool3 RAA => ref *(Bool3*)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 Bool3 GRR => ref *(Bool3*)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 Bool3 GRG => ref *(Bool3*)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 Bool3 GRB => ref *(Bool3*)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 Bool3 GRA => ref *(Bool3*)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 Bool3 GGR => ref *(Bool3*)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 Bool3 GGG => ref *(Bool3*)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 Bool3 GGB => ref *(Bool3*)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 Bool3 GGA => ref *(Bool3*)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 Bool3 GBR => ref *(Bool3*)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 Bool3 GBG => ref *(Bool3*)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 Bool3 GBB => ref *(Bool3*)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 Bool3 GBA => ref *(Bool3*)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 Bool3 GAR => ref *(Bool3*)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 Bool3 GAG => ref *(Bool3*)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 Bool3 GAB => ref *(Bool3*)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 Bool3 GAA => ref *(Bool3*)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 Bool3 BRR => ref *(Bool3*)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 Bool3 BRG => ref *(Bool3*)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 Bool3 BRB => ref *(Bool3*)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 Bool3 BRA => ref *(Bool3*)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 Bool3 BGR => ref *(Bool3*)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 Bool3 BGG => ref *(Bool3*)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 Bool3 BGB => ref *(Bool3*)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 Bool3 BGA => ref *(Bool3*)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 Bool3 BBR => ref *(Bool3*)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 Bool3 BBG => ref *(Bool3*)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 Bool3 BBB => ref *(Bool3*)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 Bool3 BBA => ref *(Bool3*)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 Bool3 BAR => ref *(Bool3*)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 Bool3 BAG => ref *(Bool3*)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 Bool3 BAB => ref *(Bool3*)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 Bool3 BAA => ref *(Bool3*)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 Bool3 ARR => ref *(Bool3*)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 Bool3 ARG => ref *(Bool3*)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 Bool3 ARB => ref *(Bool3*)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 Bool3 ARA => ref *(Bool3*)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 Bool3 AGR => ref *(Bool3*)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 Bool3 AGG => ref *(Bool3*)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 Bool3 AGB => ref *(Bool3*)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 Bool3 AGA => ref *(Bool3*)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 Bool3 ABR => ref *(Bool3*)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 Bool3 ABG => ref *(Bool3*)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 Bool3 ABB => ref *(Bool3*)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 Bool3 ABA => ref *(Bool3*)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 Bool3 AAR => ref *(Bool3*)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 Bool3 AAG => ref *(Bool3*)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 Bool3 AAB => ref *(Bool3*)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 Bool3 AAA => ref *(Bool3*)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 Bool4 RRRR => ref *(Bool4*)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 Bool4 RRRG => ref *(Bool4*)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 Bool4 RRRB => ref *(Bool4*)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 Bool4 RRRA => ref *(Bool4*)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 Bool4 RRGR => ref *(Bool4*)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 Bool4 RRGG => ref *(Bool4*)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 Bool4 RRGB => ref *(Bool4*)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 Bool4 RRGA => ref *(Bool4*)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 Bool4 RRBR => ref *(Bool4*)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 Bool4 RRBG => ref *(Bool4*)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 Bool4 RRBB => ref *(Bool4*)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 Bool4 RRBA => ref *(Bool4*)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 Bool4 RRAR => ref *(Bool4*)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 Bool4 RRAG => ref *(Bool4*)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 Bool4 RRAB => ref *(Bool4*)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 Bool4 RRAA => ref *(Bool4*)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 Bool4 RGRR => ref *(Bool4*)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 Bool4 RGRG => ref *(Bool4*)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 Bool4 RGRB => ref *(Bool4*)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 Bool4 RGRA => ref *(Bool4*)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 Bool4 RGGR => ref *(Bool4*)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 Bool4 RGGG => ref *(Bool4*)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 Bool4 RGGB => ref *(Bool4*)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 Bool4 RGGA => ref *(Bool4*)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 Bool4 RGBR => ref *(Bool4*)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 Bool4 RGBG => ref *(Bool4*)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 Bool4 RGBB => ref *(Bool4*)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 Bool4 RGBA => ref *(Bool4*)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 Bool4 RGAR => ref *(Bool4*)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 Bool4 RGAG => ref *(Bool4*)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 Bool4 RGAB => ref *(Bool4*)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 Bool4 RGAA => ref *(Bool4*)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 Bool4 RBRR => ref *(Bool4*)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 Bool4 RBRG => ref *(Bool4*)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 Bool4 RBRB => ref *(Bool4*)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 Bool4 RBRA => ref *(Bool4*)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 Bool4 RBGR => ref *(Bool4*)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 Bool4 RBGG => ref *(Bool4*)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 Bool4 RBGB => ref *(Bool4*)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 Bool4 RBGA => ref *(Bool4*)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 Bool4 RBBR => ref *(Bool4*)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 Bool4 RBBG => ref *(Bool4*)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 Bool4 RBBB => ref *(Bool4*)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 Bool4 RBBA => ref *(Bool4*)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 Bool4 RBAR => ref *(Bool4*)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 Bool4 RBAG => ref *(Bool4*)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 Bool4 RBAB => ref *(Bool4*)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 Bool4 RBAA => ref *(Bool4*)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 Bool4 RARR => ref *(Bool4*)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 Bool4 RARG => ref *(Bool4*)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 Bool4 RARB => ref *(Bool4*)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 Bool4 RARA => ref *(Bool4*)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 Bool4 RAGR => ref *(Bool4*)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 Bool4 RAGG => ref *(Bool4*)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 Bool4 RAGB => ref *(Bool4*)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 Bool4 RAGA => ref *(Bool4*)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 Bool4 RABR => ref *(Bool4*)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 Bool4 RABG => ref *(Bool4*)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 Bool4 RABB => ref *(Bool4*)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 Bool4 RABA => ref *(Bool4*)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 Bool4 RAAR => ref *(Bool4*)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 Bool4 RAAG => ref *(Bool4*)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 Bool4 RAAB => ref *(Bool4*)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 Bool4 RAAA => ref *(Bool4*)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 Bool4 GRRR => ref *(Bool4*)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 Bool4 GRRG => ref *(Bool4*)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 Bool4 GRRB => ref *(Bool4*)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 Bool4 GRRA => ref *(Bool4*)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 Bool4 GRGR => ref *(Bool4*)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 Bool4 GRGG => ref *(Bool4*)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 Bool4 GRGB => ref *(Bool4*)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 Bool4 GRGA => ref *(Bool4*)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 Bool4 GRBR => ref *(Bool4*)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 Bool4 GRBG => ref *(Bool4*)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 Bool4 GRBB => ref *(Bool4*)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 Bool4 GRBA => ref *(Bool4*)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 Bool4 GRAR => ref *(Bool4*)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 Bool4 GRAG => ref *(Bool4*)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 Bool4 GRAB => ref *(Bool4*)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 Bool4 GRAA => ref *(Bool4*)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 Bool4 GGRR => ref *(Bool4*)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 Bool4 GGRG => ref *(Bool4*)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 Bool4 GGRB => ref *(Bool4*)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 Bool4 GGRA => ref *(Bool4*)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 Bool4 GGGR => ref *(Bool4*)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 Bool4 GGGG => ref *(Bool4*)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 Bool4 GGGB => ref *(Bool4*)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 Bool4 GGGA => ref *(Bool4*)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 Bool4 GGBR => ref *(Bool4*)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 Bool4 GGBG => ref *(Bool4*)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 Bool4 GGBB => ref *(Bool4*)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 Bool4 GGBA => ref *(Bool4*)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 Bool4 GGAR => ref *(Bool4*)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 Bool4 GGAG => ref *(Bool4*)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 Bool4 GGAB => ref *(Bool4*)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 Bool4 GGAA => ref *(Bool4*)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 Bool4 GBRR => ref *(Bool4*)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 Bool4 GBRG => ref *(Bool4*)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 Bool4 GBRB => ref *(Bool4*)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 Bool4 GBRA => ref *(Bool4*)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 Bool4 GBGR => ref *(Bool4*)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 Bool4 GBGG => ref *(Bool4*)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 Bool4 GBGB => ref *(Bool4*)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 Bool4 GBGA => ref *(Bool4*)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 Bool4 GBBR => ref *(Bool4*)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 Bool4 GBBG => ref *(Bool4*)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 Bool4 GBBB => ref *(Bool4*)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 Bool4 GBBA => ref *(Bool4*)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 Bool4 GBAR => ref *(Bool4*)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 Bool4 GBAG => ref *(Bool4*)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 Bool4 GBAB => ref *(Bool4*)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 Bool4 GBAA => ref *(Bool4*)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 Bool4 GARR => ref *(Bool4*)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 Bool4 GARG => ref *(Bool4*)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 Bool4 GARB => ref *(Bool4*)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 Bool4 GARA => ref *(Bool4*)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 Bool4 GAGR => ref *(Bool4*)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 Bool4 GAGG => ref *(Bool4*)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 Bool4 GAGB => ref *(Bool4*)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 Bool4 GAGA => ref *(Bool4*)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 Bool4 GABR => ref *(Bool4*)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 Bool4 GABG => ref *(Bool4*)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 Bool4 GABB => ref *(Bool4*)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 Bool4 GABA => ref *(Bool4*)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 Bool4 GAAR => ref *(Bool4*)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 Bool4 GAAG => ref *(Bool4*)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 Bool4 GAAB => ref *(Bool4*)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 Bool4 GAAA => ref *(Bool4*)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 Bool4 BRRR => ref *(Bool4*)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 Bool4 BRRG => ref *(Bool4*)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 Bool4 BRRB => ref *(Bool4*)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 Bool4 BRRA => ref *(Bool4*)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 Bool4 BRGR => ref *(Bool4*)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 Bool4 BRGG => ref *(Bool4*)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 Bool4 BRGB => ref *(Bool4*)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 Bool4 BRGA => ref *(Bool4*)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 Bool4 BRBR => ref *(Bool4*)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 Bool4 BRBG => ref *(Bool4*)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 Bool4 BRBB => ref *(Bool4*)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 Bool4 BRBA => ref *(Bool4*)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 Bool4 BRAR => ref *(Bool4*)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 Bool4 BRAG => ref *(Bool4*)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 Bool4 BRAB => ref *(Bool4*)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 Bool4 BRAA => ref *(Bool4*)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 Bool4 BGRR => ref *(Bool4*)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 Bool4 BGRG => ref *(Bool4*)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 Bool4 BGRB => ref *(Bool4*)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 Bool4 BGRA => ref *(Bool4*)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 Bool4 BGGR => ref *(Bool4*)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 Bool4 BGGG => ref *(Bool4*)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 Bool4 BGGB => ref *(Bool4*)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 Bool4 BGGA => ref *(Bool4*)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 Bool4 BGBR => ref *(Bool4*)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 Bool4 BGBG => ref *(Bool4*)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 Bool4 BGBB => ref *(Bool4*)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 Bool4 BGBA => ref *(Bool4*)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 Bool4 BGAR => ref *(Bool4*)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 Bool4 BGAG => ref *(Bool4*)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 Bool4 BGAB => ref *(Bool4*)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 Bool4 BGAA => ref *(Bool4*)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 Bool4 BBRR => ref *(Bool4*)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 Bool4 BBRG => ref *(Bool4*)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 Bool4 BBRB => ref *(Bool4*)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 Bool4 BBRA => ref *(Bool4*)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 Bool4 BBGR => ref *(Bool4*)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 Bool4 BBGG => ref *(Bool4*)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 Bool4 BBGB => ref *(Bool4*)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 Bool4 BBGA => ref *(Bool4*)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 Bool4 BBBR => ref *(Bool4*)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 Bool4 BBBG => ref *(Bool4*)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 Bool4 BBBB => ref *(Bool4*)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 Bool4 BBBA => ref *(Bool4*)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 Bool4 BBAR => ref *(Bool4*)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 Bool4 BBAG => ref *(Bool4*)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 Bool4 BBAB => ref *(Bool4*)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 Bool4 BBAA => ref *(Bool4*)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 Bool4 BARR => ref *(Bool4*)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 Bool4 BARG => ref *(Bool4*)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 Bool4 BARB => ref *(Bool4*)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 Bool4 BARA => ref *(Bool4*)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 Bool4 BAGR => ref *(Bool4*)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 Bool4 BAGG => ref *(Bool4*)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 Bool4 BAGB => ref *(Bool4*)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 Bool4 BAGA => ref *(Bool4*)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 Bool4 BABR => ref *(Bool4*)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 Bool4 BABG => ref *(Bool4*)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 Bool4 BABB => ref *(Bool4*)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 Bool4 BABA => ref *(Bool4*)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 Bool4 BAAR => ref *(Bool4*)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 Bool4 BAAG => ref *(Bool4*)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 Bool4 BAAB => ref *(Bool4*)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 Bool4 BAAA => ref *(Bool4*)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 Bool4 ARRR => ref *(Bool4*)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 Bool4 ARRG => ref *(Bool4*)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 Bool4 ARRB => ref *(Bool4*)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 Bool4 ARRA => ref *(Bool4*)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 Bool4 ARGR => ref *(Bool4*)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 Bool4 ARGG => ref *(Bool4*)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 Bool4 ARGB => ref *(Bool4*)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 Bool4 ARGA => ref *(Bool4*)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 Bool4 ARBR => ref *(Bool4*)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 Bool4 ARBG => ref *(Bool4*)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 Bool4 ARBB => ref *(Bool4*)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 Bool4 ARBA => ref *(Bool4*)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 Bool4 ARAR => ref *(Bool4*)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 Bool4 ARAG => ref *(Bool4*)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 Bool4 ARAB => ref *(Bool4*)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 Bool4 ARAA => ref *(Bool4*)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 Bool4 AGRR => ref *(Bool4*)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 Bool4 AGRG => ref *(Bool4*)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 Bool4 AGRB => ref *(Bool4*)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 Bool4 AGRA => ref *(Bool4*)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 Bool4 AGGR => ref *(Bool4*)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 Bool4 AGGG => ref *(Bool4*)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 Bool4 AGGB => ref *(Bool4*)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 Bool4 AGGA => ref *(Bool4*)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 Bool4 AGBR => ref *(Bool4*)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 Bool4 AGBG => ref *(Bool4*)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 Bool4 AGBB => ref *(Bool4*)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 Bool4 AGBA => ref *(Bool4*)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 Bool4 AGAR => ref *(Bool4*)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 Bool4 AGAG => ref *(Bool4*)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 Bool4 AGAB => ref *(Bool4*)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 Bool4 AGAA => ref *(Bool4*)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 Bool4 ABRR => ref *(Bool4*)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 Bool4 ABRG => ref *(Bool4*)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 Bool4 ABRB => ref *(Bool4*)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 Bool4 ABRA => ref *(Bool4*)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 Bool4 ABGR => ref *(Bool4*)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 Bool4 ABGG => ref *(Bool4*)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 Bool4 ABGB => ref *(Bool4*)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 Bool4 ABGA => ref *(Bool4*)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 Bool4 ABBR => ref *(Bool4*)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 Bool4 ABBG => ref *(Bool4*)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 Bool4 ABBB => ref *(Bool4*)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 Bool4 ABBA => ref *(Bool4*)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 Bool4 ABAR => ref *(Bool4*)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 Bool4 ABAG => ref *(Bool4*)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 Bool4 ABAB => ref *(Bool4*)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 Bool4 ABAA => ref *(Bool4*)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 Bool4 AARR => ref *(Bool4*)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 Bool4 AARG => ref *(Bool4*)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 Bool4 AARB => ref *(Bool4*)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 Bool4 AARA => ref *(Bool4*)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 Bool4 AAGR => ref *(Bool4*)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 Bool4 AAGG => ref *(Bool4*)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 Bool4 AAGB => ref *(Bool4*)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 Bool4 AAGA => ref *(Bool4*)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 Bool4 AABR => ref *(Bool4*)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 Bool4 AABG => ref *(Bool4*)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 Bool4 AABB => ref *(Bool4*)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 Bool4 AABA => ref *(Bool4*)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 Bool4 AAAR => ref *(Bool4*)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 Bool4 AAAG => ref *(Bool4*)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 Bool4 AAAB => ref *(Bool4*)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 Bool4 AAAA => ref *(Bool4*)UndefinedData; - - /// - public override readonly string ToString() - { - StringBuilder sb = new(); - - sb.Append('<'); - sb.Append(this.x); - sb.Append(", "); - sb.Append(this.y); - sb.Append(", "); - sb.Append(this.z); - sb.Append(", "); - sb.Append(this.w); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool4 operator !(Bool4 xyzw) => default; + StringBuilder sb = new(); + + sb.Append('<'); + sb.Append(this.x); + sb.Append(", "); + sb.Append(this.y); + sb.Append(", "); + sb.Append(this.z); + sb.Append(", "); + sb.Append(this.w); + sb.Append('>'); + + return sb.ToString(); } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool4 operator !(Bool4 xyzw) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs index 6c5668b4..634ac252 100644 --- a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs @@ -5,2432 +5,2431 @@ using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers; using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #endif -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] +public unsafe partial struct Bool1x1 { - /// - [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] - public unsafe partial struct Bool1x1 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x1), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Bool1x1(bool m11) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x1), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - public Bool1x1(bool m11) - { - this.m11 = m11; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// 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 Bool1x1(bool x) - { - Bool1x1 matrix; - - matrix.m11 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool1x1 operator !(Bool1x1 matrix) => default; + this.m11 = m11; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Bool1x2 + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// 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 Bool1x1(bool x) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x2), sizeof(Bool4)); + Bool1x1 matrix; - [FieldOffset(0)] - private bool m11; + matrix.m11 = x; - [FieldOffset(4)] - private bool m12; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - public Bool1x2(bool m11, bool m12) - { - this.m11 = m11; - this.m12 = m12; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// 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 Bool1x2(bool x) - { - Bool1x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool1x2 operator !(Bool1x2 matrix) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Bool1x2(Bool2 vector) => *(Bool1x2*)&vector; + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Bool1x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool1x1 operator !(Bool1x1 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Bool1x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x2), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Bool1x2(bool m11, bool m12) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x3), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - public Bool1x3(bool m11, bool m12, bool m13) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// 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 Bool1x2(bool x) + { + Bool1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool1x2 operator !(Bool1x2 matrix) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool1x2(Bool2 vector) => *(Bool1x2*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Bool1x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x3), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Bool1x3(bool m11, bool m12, bool m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// 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 Bool1x3(bool x) - { - Bool1x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool1x3 operator !(Bool1x3 matrix) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Bool1x3(Bool3 vector) => *(Bool1x3*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// 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 Bool1x3(bool x) + { + Bool1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Bool1x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool1x3 operator !(Bool1x3 matrix) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool1x3(Bool3 vector) => *(Bool1x3*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Bool1x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x4), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Bool1x4(bool m11, bool m12, bool m13, bool m14) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x4), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m14; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - public Bool1x4(bool m11, bool m12, bool m13, bool m14) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// 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 Bool1x4(bool x) - { - Bool1x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool1x4 operator !(Bool1x4 matrix) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Bool1x4(Bool4 vector) => *(Bool1x4*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// 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 Bool1x4(bool x) + { + Bool1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Bool2x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool1x4 operator !(Bool1x4 matrix) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool1x4(Bool4 vector) => *(Bool1x4*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Bool2x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x1), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Bool2x1(bool m11, bool m21) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x1), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m21; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - public Bool2x1(bool m11, bool m21) - { - this.m11 = m11; - this.m21 = m21; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// 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 Bool2x1(bool x) - { - Bool2x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool2x1 operator !(Bool2x1 matrix) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Bool2(Bool2x1 matrix) => *(Bool2*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// 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 Bool2x1(bool x) + { + Bool2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool2x1 operator !(Bool2x1 matrix) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool2(Bool2x1 matrix) => *(Bool2*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Bool2x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x2), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m21; + + [FieldOffset(12)] + private bool m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Bool2x2(bool m11, bool m12, bool m21, bool m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Bool2x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Bool2x2(Bool2 row1, Bool2 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x2), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m21; - - [FieldOffset(12)] - private bool m22; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - public Bool2x2(bool m11, bool m12, bool m21, bool m22) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Bool2x2(Bool2 row1, Bool2 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// 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 Bool2x2(bool x) - { - Bool2x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool2x2 operator !(Bool2x2 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// 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 Bool2x2(bool x) + { + Bool2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool2x2 operator !(Bool2x2 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct Bool2x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x3), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m21; + + [FieldOffset(16)] + private bool m22; + + [FieldOffset(20)] + private bool m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Bool2x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct Bool2x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Bool2x3(Bool3 row1, Bool3 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x3), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m21; - - [FieldOffset(16)] - private bool m22; - - [FieldOffset(20)] - private bool m23; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - public Bool2x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Bool2x3(Bool3 row1, Bool3 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// 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 Bool2x3(bool x) - { - Bool2x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool2x3 operator !(Bool2x3 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// 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 Bool2x3(bool x) + { + Bool2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool2x3 operator !(Bool2x3 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct Bool2x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x4), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + [FieldOffset(16)] + private bool m21; + + [FieldOffset(20)] + private bool m22; + + [FieldOffset(24)] + private bool m23; + + [FieldOffset(28)] + private bool m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Bool2x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct Bool2x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Bool2x4(Bool4 row1, Bool4 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x4), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m14; - - [FieldOffset(16)] - private bool m21; - - [FieldOffset(20)] - private bool m22; - - [FieldOffset(24)] - private bool m23; - - [FieldOffset(28)] - private bool m24; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - public Bool2x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Bool2x4(Bool4 row1, Bool4 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref bool M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// 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 Bool2x4(bool x) - { - Bool2x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool2x4 operator !(Bool2x4 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref bool M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// 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 Bool2x4(bool x) + { + Bool2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Bool3x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool2x4 operator !(Bool2x4 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Bool3x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x1), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m21; + + [FieldOffset(8)] + private bool m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Bool3x1(bool m11, bool m21, bool m31) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x1), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m21; - - [FieldOffset(8)] - private bool m31; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - public Bool3x1(bool m11, bool m21, bool m31) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// 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 Bool3x1(bool x) - { - Bool3x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool3x1 operator !(Bool3x1 matrix) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Bool3(Bool3x1 matrix) => *(Bool3*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// 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 Bool3x1(bool x) + { + Bool3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool3x1 operator !(Bool3x1 matrix) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool3(Bool3x1 matrix) => *(Bool3*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct Bool3x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x2), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m21; + + [FieldOffset(12)] + private bool m22; + + [FieldOffset(16)] + private bool m31; + + [FieldOffset(20)] + private bool m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Bool3x2(bool m11, bool m12, bool m21, bool m22, bool m31, bool m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct Bool3x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Bool3x2(Bool2 row1, Bool2 row2, Bool2 row3) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x2), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m21; - - [FieldOffset(12)] - private bool m22; - - [FieldOffset(16)] - private bool m31; - - [FieldOffset(20)] - private bool m32; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - public Bool3x2(bool m11, bool m12, bool m21, bool m22, bool m31, bool m32) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Bool3x2(Bool2 row1, Bool2 row2, Bool2 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// 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 Bool3x2(bool x) - { - Bool3x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool3x2 operator !(Bool3x2 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// 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 Bool3x2(bool x) + { + Bool3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] - public unsafe partial struct Bool3x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool3x2 operator !(Bool3x2 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] +public unsafe partial struct Bool3x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x3), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m21; + + [FieldOffset(16)] + private bool m22; + + [FieldOffset(20)] + private bool m23; + + [FieldOffset(24)] + private bool m31; + + [FieldOffset(28)] + private bool m32; + + [FieldOffset(32)] + private bool m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Bool3x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23, bool m31, bool m32, bool m33) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x3), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m21; - - [FieldOffset(16)] - private bool m22; - - [FieldOffset(20)] - private bool m23; - - [FieldOffset(24)] - private bool m31; - - [FieldOffset(28)] - private bool m32; - - [FieldOffset(32)] - private bool m33; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - public Bool3x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23, bool m31, bool m32, bool m33) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Bool3x3(Bool3 row1, Bool3 row2, Bool3 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Bool3x3(Bool3 row1, Bool3 row2, Bool3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// 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 Bool3x3(bool x) - { - Bool3x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool3x3 operator !(Bool3x3 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// 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 Bool3x3(bool x) + { + Bool3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct Bool3x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool3x3 operator !(Bool3x3 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct Bool3x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x4), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + [FieldOffset(16)] + private bool m21; + + [FieldOffset(20)] + private bool m22; + + [FieldOffset(24)] + private bool m23; + + [FieldOffset(28)] + private bool m24; + + [FieldOffset(32)] + private bool m31; + + [FieldOffset(36)] + private bool m32; + + [FieldOffset(40)] + private bool m33; + + [FieldOffset(44)] + private bool m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Bool3x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24, bool m31, bool m32, bool m33, bool m34) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x4), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m14; - - [FieldOffset(16)] - private bool m21; - - [FieldOffset(20)] - private bool m22; - - [FieldOffset(24)] - private bool m23; - - [FieldOffset(28)] - private bool m24; - - [FieldOffset(32)] - private bool m31; - - [FieldOffset(36)] - private bool m32; - - [FieldOffset(40)] - private bool m33; - - [FieldOffset(44)] - private bool m34; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - public Bool3x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24, bool m31, bool m32, bool m33, bool m34) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Bool3x4(Bool4 row1, Bool4 row2, Bool4 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Bool3x4(Bool4 row1, Bool4 row2, Bool4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref bool M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref bool M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// 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 Bool3x4(bool x) - { - Bool3x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool3x4 operator !(Bool3x4 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref bool M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref bool M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// 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 Bool3x4(bool x) + { + Bool3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Bool4x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool3x4 operator !(Bool3x4 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Bool4x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x1), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m21; + + [FieldOffset(8)] + private bool m31; + + [FieldOffset(12)] + private bool m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Bool4x1(bool m11, bool m21, bool m31, bool m41) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x1), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m21; - - [FieldOffset(8)] - private bool m31; - - [FieldOffset(12)] - private bool m41; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [4, 1]. - public Bool4x1(bool m11, bool m21, bool m31, bool m41) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - this.m41 = m41; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 bool this[int row] => ref *(bool*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// 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 Bool4x1(bool x) - { - Bool4x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - matrix.m41 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool4x1 operator !(Bool4x1 matrix) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Bool4(Bool4x1 matrix) => *(Bool4*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// 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 Bool4x1(bool x) + { + Bool4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool4x1 operator !(Bool4x1 matrix) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool4(Bool4x1 matrix) => *(Bool4*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct Bool4x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x2), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m21; + + [FieldOffset(12)] + private bool m22; + + [FieldOffset(16)] + private bool m31; + + [FieldOffset(20)] + private bool m32; + + [FieldOffset(24)] + private bool m41; + + [FieldOffset(28)] + private bool m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Bool4x2(bool m11, bool m12, bool m21, bool m22, bool m31, bool m32, bool m41, bool m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct Bool4x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Bool4x2(Bool2 row1, Bool2 row2, Bool2 row3, Bool2 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x2), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m21; - - [FieldOffset(12)] - private bool m22; - - [FieldOffset(16)] - private bool m31; - - [FieldOffset(20)] - private bool m32; - - [FieldOffset(24)] - private bool m41; - - [FieldOffset(28)] - private bool m42; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - public Bool4x2(bool m11, bool m12, bool m21, bool m22, bool m31, bool m32, bool m41, bool m42) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - this.m41 = m41; - this.m42 = m42; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Bool4x2(Bool2 row1, Bool2 row2, Bool2 row3, Bool2 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m41 = row4.X; - this.m42 = row4.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool2 this[int row] => ref *(Bool2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref bool M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// 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 Bool4x2(bool x) - { - Bool4x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m41 = x; - matrix.m42 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool4x2 operator !(Bool4x2 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref bool M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// 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 Bool4x2(bool x) + { + Bool4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool4x2 operator !(Bool4x2 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct Bool4x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x3), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m21; + + [FieldOffset(16)] + private bool m22; + + [FieldOffset(20)] + private bool m23; + + [FieldOffset(24)] + private bool m31; + + [FieldOffset(28)] + private bool m32; + + [FieldOffset(32)] + private bool m33; + + [FieldOffset(36)] + private bool m41; + + [FieldOffset(40)] + private bool m42; + + [FieldOffset(44)] + private bool m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Bool4x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23, bool m31, bool m32, bool m33, bool m41, bool m42, bool m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct Bool4x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Bool4x3(Bool3 row1, Bool3 row2, Bool3 row3, Bool3 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x3), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m21; - - [FieldOffset(16)] - private bool m22; - - [FieldOffset(20)] - private bool m23; - - [FieldOffset(24)] - private bool m31; - - [FieldOffset(28)] - private bool m32; - - [FieldOffset(32)] - private bool m33; - - [FieldOffset(36)] - private bool m41; - - [FieldOffset(40)] - private bool m42; - - [FieldOffset(44)] - private bool m43; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - public Bool4x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23, bool m31, bool m32, bool m33, bool m41, bool m42, bool m43) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Bool4x3(Bool3 row1, Bool3 row2, Bool3 row3, Bool3 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool3 this[int row] => ref *(Bool3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref bool M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref bool M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// 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 Bool4x3(bool x) - { - Bool4x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool4x3 operator !(Bool4x3 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref bool M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref bool M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// 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 Bool4x3(bool x) + { + Bool4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool4x3 operator !(Bool4x3 matrix) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] +public unsafe partial struct Bool4x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x4), sizeof(Bool4)); + + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + [FieldOffset(16)] + private bool m21; + + [FieldOffset(20)] + private bool m22; + + [FieldOffset(24)] + private bool m23; + + [FieldOffset(28)] + private bool m24; + + [FieldOffset(32)] + private bool m31; + + [FieldOffset(36)] + private bool m32; + + [FieldOffset(40)] + private bool m33; + + [FieldOffset(44)] + private bool m34; + + [FieldOffset(48)] + private bool m41; + + [FieldOffset(52)] + private bool m42; + + [FieldOffset(56)] + private bool m43; + + [FieldOffset(60)] + private bool m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Bool4x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24, bool m31, bool m32, bool m33, bool m34, bool m41, bool m42, bool m43, bool m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; } - /// - [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] - public unsafe partial struct Bool4x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Bool4x4(Bool4 row1, Bool4 row2, Bool4 row3, Bool4 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x4), sizeof(Bool4)); - - [FieldOffset(0)] - private bool m11; - - [FieldOffset(4)] - private bool m12; - - [FieldOffset(8)] - private bool m13; - - [FieldOffset(12)] - private bool m14; - - [FieldOffset(16)] - private bool m21; - - [FieldOffset(20)] - private bool m22; - - [FieldOffset(24)] - private bool m23; - - [FieldOffset(28)] - private bool m24; - - [FieldOffset(32)] - private bool m31; - - [FieldOffset(36)] - private bool m32; - - [FieldOffset(40)] - private bool m33; - - [FieldOffset(44)] - private bool m34; - - [FieldOffset(48)] - private bool m41; - - [FieldOffset(52)] - private bool m42; - - [FieldOffset(56)] - private bool m43; - - [FieldOffset(60)] - private bool m44; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - /// The value to assign to the component at position [4, 4]. - public Bool4x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24, bool m31, bool m32, bool m33, bool m34, bool m41, bool m42, bool m43, bool m44) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - this.m44 = m44; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Bool4x4(Bool4 row1, Bool4 row2, Bool4 row3, Bool4 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - this.m44 = row4.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Bool4 this[int row] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref bool M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref bool M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref bool M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref bool M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 4]. - /// - public readonly ref bool M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); - - /// - /// 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 Bool4x4(bool x) - { - Bool4x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - matrix.m44 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Bool4x4 operator !(Bool4x4 matrix) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Bool4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref bool M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref bool M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref bool M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref bool M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref bool M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref bool M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref bool M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref bool M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref bool M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref bool M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref bool M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref bool M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref bool M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref bool M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref bool M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public readonly ref bool M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); + + /// + /// 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 Bool4x4(bool x) + { + Bool4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Bool4x4 operator !(Bool4x4 matrix) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.cs b/src/ComputeSharp/Core/Primitives/Double/Double2.cs index d18591e1..342b7c1d 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double2.cs +++ b/src/ComputeSharp/Core/Primitives/Double/Double2.cs @@ -1,66 +1,65 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Double2 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Double2 + public static Double2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Double2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double2 UnitY => new(0, 1); + + /// + /// 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 Double2(double x, double y) { - /// - /// Gets an value with all components set to 0. - /// - public static Double2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Double2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double2 UnitY => new(0, 1); - - /// - /// 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 Double2(double x, double y) - { - this.x = x; - this.y = y; - } - - /// - /// 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 Double2(double x) => new(x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int2(Double2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt2(Double2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Float2(Double2 xy) => default; + this.x = x; + this.y = y; } + + /// + /// 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 Double2(double x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int2(Double2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt2(Double2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Float2(Double2 xy) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs b/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs index 1c7fdde0..ff0fd365 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs +++ b/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs @@ -10,446 +10,445 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] +public unsafe partial struct Double2 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] - public unsafe partial struct Double2 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2), sizeof(Double4)); + + [FieldOffset(0)] + private double x; + + [FieldOffset(8)] + private double 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 double this[int i] => ref *(double*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref double 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 double 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 Double2 XX => ref *(Double2*)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 Double2 XY => ref *(Double2*)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 Double2 YX => ref *(Double2*)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 Double2 YY => ref *(Double2*)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 Double3 XXX => ref *(Double3*)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 Double3 XXY => ref *(Double3*)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 Double3 XYX => ref *(Double3*)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 Double3 XYY => ref *(Double3*)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 Double3 YXX => ref *(Double3*)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 Double3 YXY => ref *(Double3*)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 Double3 YYX => ref *(Double3*)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 Double3 YYY => ref *(Double3*)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 Double4 XXXX => ref *(Double4*)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 Double4 XXXY => ref *(Double4*)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 Double4 XXYX => ref *(Double4*)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 Double4 XXYY => ref *(Double4*)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 Double4 XYXX => ref *(Double4*)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 Double4 XYXY => ref *(Double4*)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 Double4 XYYX => ref *(Double4*)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 Double4 XYYY => ref *(Double4*)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 Double4 YXXX => ref *(Double4*)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 Double4 YXXY => ref *(Double4*)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 Double4 YXYX => ref *(Double4*)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 Double4 YXYY => ref *(Double4*)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 Double4 YYXX => ref *(Double4*)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 Double4 YYXY => ref *(Double4*)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 Double4 YYYX => ref *(Double4*)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 Double4 YYYY => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref double 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 double 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 Double2 RR => ref *(Double2*)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 Double2 RG => ref *(Double2*)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 Double2 GR => ref *(Double2*)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 Double2 GG => ref *(Double2*)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 Double3 RRR => ref *(Double3*)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 Double3 RRG => ref *(Double3*)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 Double3 RGR => ref *(Double3*)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 Double3 RGG => ref *(Double3*)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 Double3 GRR => ref *(Double3*)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 Double3 GRG => ref *(Double3*)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 Double3 GGR => ref *(Double3*)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 Double3 GGG => ref *(Double3*)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 Double4 RRRR => ref *(Double4*)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 Double4 RRRG => ref *(Double4*)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 Double4 RRGR => ref *(Double4*)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 Double4 RRGG => ref *(Double4*)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 Double4 RGRR => ref *(Double4*)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 Double4 RGRG => ref *(Double4*)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 Double4 RGGR => ref *(Double4*)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 Double4 RGGG => ref *(Double4*)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 Double4 GRRR => ref *(Double4*)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 Double4 GRRG => ref *(Double4*)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 Double4 GRGR => ref *(Double4*)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 Double4 GRGG => ref *(Double4*)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 Double4 GGRR => ref *(Double4*)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 Double4 GGRG => ref *(Double4*)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 Double4 GGGR => ref *(Double4*)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 Double4 GGGG => ref *(Double4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2), sizeof(Double4)); - - [FieldOffset(0)] - private double x; - - [FieldOffset(8)] - private double 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 double this[int i] => ref *(double*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref double 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 double 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 Double2 XX => ref *(Double2*)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 Double2 XY => ref *(Double2*)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 Double2 YX => ref *(Double2*)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 Double2 YY => ref *(Double2*)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 Double3 XXX => ref *(Double3*)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 Double3 XXY => ref *(Double3*)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 Double3 XYX => ref *(Double3*)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 Double3 XYY => ref *(Double3*)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 Double3 YXX => ref *(Double3*)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 Double3 YXY => ref *(Double3*)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 Double3 YYX => ref *(Double3*)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 Double3 YYY => ref *(Double3*)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 Double4 XXXX => ref *(Double4*)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 Double4 XXXY => ref *(Double4*)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 Double4 XXYX => ref *(Double4*)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 Double4 XXYY => ref *(Double4*)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 Double4 XYXX => ref *(Double4*)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 Double4 XYXY => ref *(Double4*)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 Double4 XYYX => ref *(Double4*)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 Double4 XYYY => ref *(Double4*)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 Double4 YXXX => ref *(Double4*)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 Double4 YXXY => ref *(Double4*)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 Double4 YXYX => ref *(Double4*)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 Double4 YXYY => ref *(Double4*)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 Double4 YYXX => ref *(Double4*)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 Double4 YYXY => ref *(Double4*)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 Double4 YYYX => ref *(Double4*)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 Double4 YYYY => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref double 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 double 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 Double2 RR => ref *(Double2*)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 Double2 RG => ref *(Double2*)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 Double2 GR => ref *(Double2*)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 Double2 GG => ref *(Double2*)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 Double3 RRR => ref *(Double3*)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 Double3 RRG => ref *(Double3*)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 Double3 RGR => ref *(Double3*)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 Double3 RGG => ref *(Double3*)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 Double3 GRR => ref *(Double3*)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 Double3 GRG => ref *(Double3*)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 Double3 GGR => ref *(Double3*)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 Double3 GGG => ref *(Double3*)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 Double4 RRRR => ref *(Double4*)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 Double4 RRRG => ref *(Double4*)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 Double4 RRGR => ref *(Double4*)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 Double4 RRGG => ref *(Double4*)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 Double4 RGRR => ref *(Double4*)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 Double4 RGRG => ref *(Double4*)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 Double4 RGGR => ref *(Double4*)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 Double4 RGGG => ref *(Double4*)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 Double4 GRRR => ref *(Double4*)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 Double4 GRRG => ref *(Double4*)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 Double4 GRGR => ref *(Double4*)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 Double4 GRGG => ref *(Double4*)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 Double4 GGRR => ref *(Double4*)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 Double4 GGRG => ref *(Double4*)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 Double4 GGGR => ref *(Double4*)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 Double4 GGGG => ref *(Double4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double2 operator -(Double2 xy) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double2 operator +(Double2 left, Double2 right) => default; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double2 operator /(Double2 left, Double2 right) => default; - - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double2 operator *(Double2 left, Double2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double2 operator -(Double2 left, Double2 right) => default; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double2 operator -(Double2 xy) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double2 operator +(Double2 left, Double2 right) => default; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double2 operator /(Double2 left, Double2 right) => default; + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double2 operator *(Double2 left, Double2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double2 operator -(Double2 left, Double2 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.cs b/src/ComputeSharp/Core/Primitives/Double/Double3.cs index b5ef0088..6a461641 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double3.cs +++ b/src/ComputeSharp/Core/Primitives/Double/Double3.cs @@ -1,97 +1,96 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Double3 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Double3 + public static Double3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Double3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double3 UnitZ => new(0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + public Double3(double x, double y, double z) { - /// - /// Gets an value with all components set to 0. - /// - public static Double3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Double3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double3 UnitZ => new(0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - public Double3(double x, double y, double z) - { - this.x = x; - this.y = y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - public Double3(Double2 xy, double z) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second and thirt vector components. - public Double3(double x, Double2 yz) - { - this.x = x; - this.y = yz.X; - this.z = yz.Y; - } - - /// - /// 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 Double3(double x) => new(x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int3(Double3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt3(Double3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Float3(Double3 xyz) => default; + this.x = x; + this.y = y; + this.z = z; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Double3(Double2 xy, double z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Double3(double x, Double2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// 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 Double3(double x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int3(Double3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt3(Double3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Float3(Double3 xyz) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs b/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs index b74498fc..5cf6e969 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs +++ b/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs @@ -10,1530 +10,1529 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] +public unsafe partial struct Double3 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] - public unsafe partial struct Double3 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3), sizeof(Double4)); + + [FieldOffset(0)] + private double x; + + [FieldOffset(8)] + private double y; + + [FieldOffset(16)] + private double z; + + /// + /// 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 double this[int i] => ref *(double*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref double 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 double Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref double Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Double2 XX => ref *(Double2*)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 Double2 XY => ref *(Double2*)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 Double2 XZ => ref *(Double2*)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 Double2 YX => ref *(Double2*)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 Double2 YY => ref *(Double2*)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 Double2 YZ => ref *(Double2*)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 Double2 ZX => ref *(Double2*)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 Double2 ZY => ref *(Double2*)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 Double2 ZZ => ref *(Double2*)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 Double3 XXX => ref *(Double3*)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 Double3 XXY => ref *(Double3*)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 Double3 XXZ => ref *(Double3*)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 Double3 XYX => ref *(Double3*)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 Double3 XYY => ref *(Double3*)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 Double3 XYZ => ref *(Double3*)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 Double3 XZX => ref *(Double3*)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 Double3 XZY => ref *(Double3*)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 Double3 XZZ => ref *(Double3*)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 Double3 YXX => ref *(Double3*)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 Double3 YXY => ref *(Double3*)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 Double3 YXZ => ref *(Double3*)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 Double3 YYX => ref *(Double3*)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 Double3 YYY => ref *(Double3*)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 Double3 YYZ => ref *(Double3*)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 Double3 YZX => ref *(Double3*)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 Double3 YZY => ref *(Double3*)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 Double3 YZZ => ref *(Double3*)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 Double3 ZXX => ref *(Double3*)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 Double3 ZXY => ref *(Double3*)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 Double3 ZXZ => ref *(Double3*)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 Double3 ZYX => ref *(Double3*)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 Double3 ZYY => ref *(Double3*)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 Double3 ZYZ => ref *(Double3*)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 Double3 ZZX => ref *(Double3*)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 Double3 ZZY => ref *(Double3*)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 Double3 ZZZ => ref *(Double3*)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 Double4 XXXX => ref *(Double4*)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 Double4 XXXY => ref *(Double4*)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 Double4 XXXZ => ref *(Double4*)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 Double4 XXYX => ref *(Double4*)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 Double4 XXYY => ref *(Double4*)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 Double4 XXYZ => ref *(Double4*)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 Double4 XXZX => ref *(Double4*)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 Double4 XXZY => ref *(Double4*)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 Double4 XXZZ => ref *(Double4*)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 Double4 XYXX => ref *(Double4*)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 Double4 XYXY => ref *(Double4*)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 Double4 XYXZ => ref *(Double4*)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 Double4 XYYX => ref *(Double4*)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 Double4 XYYY => ref *(Double4*)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 Double4 XYYZ => ref *(Double4*)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 Double4 XYZX => ref *(Double4*)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 Double4 XYZY => ref *(Double4*)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 Double4 XYZZ => ref *(Double4*)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 Double4 XZXX => ref *(Double4*)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 Double4 XZXY => ref *(Double4*)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 Double4 XZXZ => ref *(Double4*)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 Double4 XZYX => ref *(Double4*)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 Double4 XZYY => ref *(Double4*)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 Double4 XZYZ => ref *(Double4*)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 Double4 XZZX => ref *(Double4*)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 Double4 XZZY => ref *(Double4*)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 Double4 XZZZ => ref *(Double4*)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 Double4 YXXX => ref *(Double4*)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 Double4 YXXY => ref *(Double4*)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 Double4 YXXZ => ref *(Double4*)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 Double4 YXYX => ref *(Double4*)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 Double4 YXYY => ref *(Double4*)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 Double4 YXYZ => ref *(Double4*)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 Double4 YXZX => ref *(Double4*)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 Double4 YXZY => ref *(Double4*)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 Double4 YXZZ => ref *(Double4*)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 Double4 YYXX => ref *(Double4*)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 Double4 YYXY => ref *(Double4*)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 Double4 YYXZ => ref *(Double4*)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 Double4 YYYX => ref *(Double4*)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 Double4 YYYY => ref *(Double4*)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 Double4 YYYZ => ref *(Double4*)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 Double4 YYZX => ref *(Double4*)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 Double4 YYZY => ref *(Double4*)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 Double4 YYZZ => ref *(Double4*)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 Double4 YZXX => ref *(Double4*)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 Double4 YZXY => ref *(Double4*)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 Double4 YZXZ => ref *(Double4*)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 Double4 YZYX => ref *(Double4*)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 Double4 YZYY => ref *(Double4*)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 Double4 YZYZ => ref *(Double4*)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 Double4 YZZX => ref *(Double4*)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 Double4 YZZY => ref *(Double4*)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 Double4 YZZZ => ref *(Double4*)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 Double4 ZXXX => ref *(Double4*)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 Double4 ZXXY => ref *(Double4*)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 Double4 ZXXZ => ref *(Double4*)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 Double4 ZXYX => ref *(Double4*)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 Double4 ZXYY => ref *(Double4*)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 Double4 ZXYZ => ref *(Double4*)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 Double4 ZXZX => ref *(Double4*)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 Double4 ZXZY => ref *(Double4*)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 Double4 ZXZZ => ref *(Double4*)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 Double4 ZYXX => ref *(Double4*)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 Double4 ZYXY => ref *(Double4*)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 Double4 ZYXZ => ref *(Double4*)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 Double4 ZYYX => ref *(Double4*)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 Double4 ZYYY => ref *(Double4*)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 Double4 ZYYZ => ref *(Double4*)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 Double4 ZYZX => ref *(Double4*)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 Double4 ZYZY => ref *(Double4*)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 Double4 ZYZZ => ref *(Double4*)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 Double4 ZZXX => ref *(Double4*)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 Double4 ZZXY => ref *(Double4*)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 Double4 ZZXZ => ref *(Double4*)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 Double4 ZZYX => ref *(Double4*)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 Double4 ZZYY => ref *(Double4*)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 Double4 ZZYZ => ref *(Double4*)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 Double4 ZZZX => ref *(Double4*)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 Double4 ZZZY => ref *(Double4*)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 Double4 ZZZZ => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref double 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 double G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref double B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Double2 RR => ref *(Double2*)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 Double2 RG => ref *(Double2*)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 Double2 RB => ref *(Double2*)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 Double2 GR => ref *(Double2*)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 Double2 GG => ref *(Double2*)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 Double2 GB => ref *(Double2*)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 Double2 BR => ref *(Double2*)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 Double2 BG => ref *(Double2*)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 Double2 BB => ref *(Double2*)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 Double3 RRR => ref *(Double3*)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 Double3 RRG => ref *(Double3*)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 Double3 RRB => ref *(Double3*)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 Double3 RGR => ref *(Double3*)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 Double3 RGG => ref *(Double3*)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 Double3 RGB => ref *(Double3*)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 Double3 RBR => ref *(Double3*)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 Double3 RBG => ref *(Double3*)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 Double3 RBB => ref *(Double3*)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 Double3 GRR => ref *(Double3*)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 Double3 GRG => ref *(Double3*)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 Double3 GRB => ref *(Double3*)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 Double3 GGR => ref *(Double3*)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 Double3 GGG => ref *(Double3*)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 Double3 GGB => ref *(Double3*)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 Double3 GBR => ref *(Double3*)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 Double3 GBG => ref *(Double3*)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 Double3 GBB => ref *(Double3*)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 Double3 BRR => ref *(Double3*)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 Double3 BRG => ref *(Double3*)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 Double3 BRB => ref *(Double3*)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 Double3 BGR => ref *(Double3*)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 Double3 BGG => ref *(Double3*)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 Double3 BGB => ref *(Double3*)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 Double3 BBR => ref *(Double3*)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 Double3 BBG => ref *(Double3*)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 Double3 BBB => ref *(Double3*)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 Double4 RRRR => ref *(Double4*)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 Double4 RRRG => ref *(Double4*)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 Double4 RRRB => ref *(Double4*)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 Double4 RRGR => ref *(Double4*)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 Double4 RRGG => ref *(Double4*)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 Double4 RRGB => ref *(Double4*)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 Double4 RRBR => ref *(Double4*)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 Double4 RRBG => ref *(Double4*)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 Double4 RRBB => ref *(Double4*)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 Double4 RGRR => ref *(Double4*)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 Double4 RGRG => ref *(Double4*)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 Double4 RGRB => ref *(Double4*)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 Double4 RGGR => ref *(Double4*)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 Double4 RGGG => ref *(Double4*)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 Double4 RGGB => ref *(Double4*)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 Double4 RGBR => ref *(Double4*)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 Double4 RGBG => ref *(Double4*)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 Double4 RGBB => ref *(Double4*)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 Double4 RBRR => ref *(Double4*)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 Double4 RBRG => ref *(Double4*)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 Double4 RBRB => ref *(Double4*)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 Double4 RBGR => ref *(Double4*)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 Double4 RBGG => ref *(Double4*)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 Double4 RBGB => ref *(Double4*)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 Double4 RBBR => ref *(Double4*)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 Double4 RBBG => ref *(Double4*)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 Double4 RBBB => ref *(Double4*)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 Double4 GRRR => ref *(Double4*)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 Double4 GRRG => ref *(Double4*)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 Double4 GRRB => ref *(Double4*)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 Double4 GRGR => ref *(Double4*)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 Double4 GRGG => ref *(Double4*)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 Double4 GRGB => ref *(Double4*)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 Double4 GRBR => ref *(Double4*)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 Double4 GRBG => ref *(Double4*)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 Double4 GRBB => ref *(Double4*)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 Double4 GGRR => ref *(Double4*)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 Double4 GGRG => ref *(Double4*)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 Double4 GGRB => ref *(Double4*)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 Double4 GGGR => ref *(Double4*)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 Double4 GGGG => ref *(Double4*)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 Double4 GGGB => ref *(Double4*)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 Double4 GGBR => ref *(Double4*)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 Double4 GGBG => ref *(Double4*)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 Double4 GGBB => ref *(Double4*)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 Double4 GBRR => ref *(Double4*)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 Double4 GBRG => ref *(Double4*)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 Double4 GBRB => ref *(Double4*)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 Double4 GBGR => ref *(Double4*)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 Double4 GBGG => ref *(Double4*)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 Double4 GBGB => ref *(Double4*)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 Double4 GBBR => ref *(Double4*)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 Double4 GBBG => ref *(Double4*)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 Double4 GBBB => ref *(Double4*)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 Double4 BRRR => ref *(Double4*)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 Double4 BRRG => ref *(Double4*)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 Double4 BRRB => ref *(Double4*)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 Double4 BRGR => ref *(Double4*)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 Double4 BRGG => ref *(Double4*)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 Double4 BRGB => ref *(Double4*)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 Double4 BRBR => ref *(Double4*)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 Double4 BRBG => ref *(Double4*)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 Double4 BRBB => ref *(Double4*)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 Double4 BGRR => ref *(Double4*)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 Double4 BGRG => ref *(Double4*)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 Double4 BGRB => ref *(Double4*)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 Double4 BGGR => ref *(Double4*)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 Double4 BGGG => ref *(Double4*)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 Double4 BGGB => ref *(Double4*)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 Double4 BGBR => ref *(Double4*)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 Double4 BGBG => ref *(Double4*)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 Double4 BGBB => ref *(Double4*)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 Double4 BBRR => ref *(Double4*)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 Double4 BBRG => ref *(Double4*)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 Double4 BBRB => ref *(Double4*)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 Double4 BBGR => ref *(Double4*)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 Double4 BBGG => ref *(Double4*)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 Double4 BBGB => ref *(Double4*)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 Double4 BBBR => ref *(Double4*)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 Double4 BBBG => ref *(Double4*)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 Double4 BBBB => ref *(Double4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3), sizeof(Double4)); - - [FieldOffset(0)] - private double x; - - [FieldOffset(8)] - private double y; - - [FieldOffset(16)] - private double z; - - /// - /// 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 double this[int i] => ref *(double*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref double 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 double Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref double Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Double2 XX => ref *(Double2*)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 Double2 XY => ref *(Double2*)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 Double2 XZ => ref *(Double2*)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 Double2 YX => ref *(Double2*)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 Double2 YY => ref *(Double2*)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 Double2 YZ => ref *(Double2*)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 Double2 ZX => ref *(Double2*)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 Double2 ZY => ref *(Double2*)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 Double2 ZZ => ref *(Double2*)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 Double3 XXX => ref *(Double3*)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 Double3 XXY => ref *(Double3*)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 Double3 XXZ => ref *(Double3*)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 Double3 XYX => ref *(Double3*)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 Double3 XYY => ref *(Double3*)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 Double3 XYZ => ref *(Double3*)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 Double3 XZX => ref *(Double3*)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 Double3 XZY => ref *(Double3*)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 Double3 XZZ => ref *(Double3*)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 Double3 YXX => ref *(Double3*)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 Double3 YXY => ref *(Double3*)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 Double3 YXZ => ref *(Double3*)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 Double3 YYX => ref *(Double3*)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 Double3 YYY => ref *(Double3*)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 Double3 YYZ => ref *(Double3*)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 Double3 YZX => ref *(Double3*)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 Double3 YZY => ref *(Double3*)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 Double3 YZZ => ref *(Double3*)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 Double3 ZXX => ref *(Double3*)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 Double3 ZXY => ref *(Double3*)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 Double3 ZXZ => ref *(Double3*)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 Double3 ZYX => ref *(Double3*)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 Double3 ZYY => ref *(Double3*)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 Double3 ZYZ => ref *(Double3*)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 Double3 ZZX => ref *(Double3*)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 Double3 ZZY => ref *(Double3*)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 Double3 ZZZ => ref *(Double3*)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 Double4 XXXX => ref *(Double4*)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 Double4 XXXY => ref *(Double4*)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 Double4 XXXZ => ref *(Double4*)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 Double4 XXYX => ref *(Double4*)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 Double4 XXYY => ref *(Double4*)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 Double4 XXYZ => ref *(Double4*)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 Double4 XXZX => ref *(Double4*)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 Double4 XXZY => ref *(Double4*)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 Double4 XXZZ => ref *(Double4*)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 Double4 XYXX => ref *(Double4*)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 Double4 XYXY => ref *(Double4*)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 Double4 XYXZ => ref *(Double4*)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 Double4 XYYX => ref *(Double4*)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 Double4 XYYY => ref *(Double4*)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 Double4 XYYZ => ref *(Double4*)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 Double4 XYZX => ref *(Double4*)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 Double4 XYZY => ref *(Double4*)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 Double4 XYZZ => ref *(Double4*)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 Double4 XZXX => ref *(Double4*)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 Double4 XZXY => ref *(Double4*)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 Double4 XZXZ => ref *(Double4*)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 Double4 XZYX => ref *(Double4*)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 Double4 XZYY => ref *(Double4*)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 Double4 XZYZ => ref *(Double4*)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 Double4 XZZX => ref *(Double4*)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 Double4 XZZY => ref *(Double4*)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 Double4 XZZZ => ref *(Double4*)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 Double4 YXXX => ref *(Double4*)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 Double4 YXXY => ref *(Double4*)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 Double4 YXXZ => ref *(Double4*)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 Double4 YXYX => ref *(Double4*)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 Double4 YXYY => ref *(Double4*)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 Double4 YXYZ => ref *(Double4*)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 Double4 YXZX => ref *(Double4*)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 Double4 YXZY => ref *(Double4*)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 Double4 YXZZ => ref *(Double4*)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 Double4 YYXX => ref *(Double4*)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 Double4 YYXY => ref *(Double4*)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 Double4 YYXZ => ref *(Double4*)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 Double4 YYYX => ref *(Double4*)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 Double4 YYYY => ref *(Double4*)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 Double4 YYYZ => ref *(Double4*)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 Double4 YYZX => ref *(Double4*)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 Double4 YYZY => ref *(Double4*)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 Double4 YYZZ => ref *(Double4*)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 Double4 YZXX => ref *(Double4*)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 Double4 YZXY => ref *(Double4*)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 Double4 YZXZ => ref *(Double4*)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 Double4 YZYX => ref *(Double4*)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 Double4 YZYY => ref *(Double4*)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 Double4 YZYZ => ref *(Double4*)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 Double4 YZZX => ref *(Double4*)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 Double4 YZZY => ref *(Double4*)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 Double4 YZZZ => ref *(Double4*)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 Double4 ZXXX => ref *(Double4*)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 Double4 ZXXY => ref *(Double4*)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 Double4 ZXXZ => ref *(Double4*)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 Double4 ZXYX => ref *(Double4*)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 Double4 ZXYY => ref *(Double4*)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 Double4 ZXYZ => ref *(Double4*)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 Double4 ZXZX => ref *(Double4*)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 Double4 ZXZY => ref *(Double4*)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 Double4 ZXZZ => ref *(Double4*)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 Double4 ZYXX => ref *(Double4*)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 Double4 ZYXY => ref *(Double4*)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 Double4 ZYXZ => ref *(Double4*)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 Double4 ZYYX => ref *(Double4*)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 Double4 ZYYY => ref *(Double4*)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 Double4 ZYYZ => ref *(Double4*)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 Double4 ZYZX => ref *(Double4*)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 Double4 ZYZY => ref *(Double4*)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 Double4 ZYZZ => ref *(Double4*)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 Double4 ZZXX => ref *(Double4*)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 Double4 ZZXY => ref *(Double4*)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 Double4 ZZXZ => ref *(Double4*)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 Double4 ZZYX => ref *(Double4*)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 Double4 ZZYY => ref *(Double4*)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 Double4 ZZYZ => ref *(Double4*)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 Double4 ZZZX => ref *(Double4*)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 Double4 ZZZY => ref *(Double4*)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 Double4 ZZZZ => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref double 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 double G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref double B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Double2 RR => ref *(Double2*)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 Double2 RG => ref *(Double2*)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 Double2 RB => ref *(Double2*)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 Double2 GR => ref *(Double2*)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 Double2 GG => ref *(Double2*)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 Double2 GB => ref *(Double2*)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 Double2 BR => ref *(Double2*)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 Double2 BG => ref *(Double2*)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 Double2 BB => ref *(Double2*)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 Double3 RRR => ref *(Double3*)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 Double3 RRG => ref *(Double3*)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 Double3 RRB => ref *(Double3*)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 Double3 RGR => ref *(Double3*)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 Double3 RGG => ref *(Double3*)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 Double3 RGB => ref *(Double3*)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 Double3 RBR => ref *(Double3*)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 Double3 RBG => ref *(Double3*)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 Double3 RBB => ref *(Double3*)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 Double3 GRR => ref *(Double3*)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 Double3 GRG => ref *(Double3*)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 Double3 GRB => ref *(Double3*)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 Double3 GGR => ref *(Double3*)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 Double3 GGG => ref *(Double3*)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 Double3 GGB => ref *(Double3*)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 Double3 GBR => ref *(Double3*)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 Double3 GBG => ref *(Double3*)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 Double3 GBB => ref *(Double3*)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 Double3 BRR => ref *(Double3*)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 Double3 BRG => ref *(Double3*)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 Double3 BRB => ref *(Double3*)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 Double3 BGR => ref *(Double3*)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 Double3 BGG => ref *(Double3*)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 Double3 BGB => ref *(Double3*)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 Double3 BBR => ref *(Double3*)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 Double3 BBG => ref *(Double3*)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 Double3 BBB => ref *(Double3*)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 Double4 RRRR => ref *(Double4*)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 Double4 RRRG => ref *(Double4*)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 Double4 RRRB => ref *(Double4*)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 Double4 RRGR => ref *(Double4*)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 Double4 RRGG => ref *(Double4*)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 Double4 RRGB => ref *(Double4*)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 Double4 RRBR => ref *(Double4*)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 Double4 RRBG => ref *(Double4*)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 Double4 RRBB => ref *(Double4*)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 Double4 RGRR => ref *(Double4*)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 Double4 RGRG => ref *(Double4*)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 Double4 RGRB => ref *(Double4*)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 Double4 RGGR => ref *(Double4*)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 Double4 RGGG => ref *(Double4*)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 Double4 RGGB => ref *(Double4*)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 Double4 RGBR => ref *(Double4*)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 Double4 RGBG => ref *(Double4*)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 Double4 RGBB => ref *(Double4*)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 Double4 RBRR => ref *(Double4*)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 Double4 RBRG => ref *(Double4*)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 Double4 RBRB => ref *(Double4*)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 Double4 RBGR => ref *(Double4*)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 Double4 RBGG => ref *(Double4*)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 Double4 RBGB => ref *(Double4*)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 Double4 RBBR => ref *(Double4*)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 Double4 RBBG => ref *(Double4*)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 Double4 RBBB => ref *(Double4*)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 Double4 GRRR => ref *(Double4*)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 Double4 GRRG => ref *(Double4*)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 Double4 GRRB => ref *(Double4*)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 Double4 GRGR => ref *(Double4*)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 Double4 GRGG => ref *(Double4*)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 Double4 GRGB => ref *(Double4*)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 Double4 GRBR => ref *(Double4*)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 Double4 GRBG => ref *(Double4*)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 Double4 GRBB => ref *(Double4*)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 Double4 GGRR => ref *(Double4*)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 Double4 GGRG => ref *(Double4*)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 Double4 GGRB => ref *(Double4*)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 Double4 GGGR => ref *(Double4*)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 Double4 GGGG => ref *(Double4*)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 Double4 GGGB => ref *(Double4*)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 Double4 GGBR => ref *(Double4*)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 Double4 GGBG => ref *(Double4*)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 Double4 GGBB => ref *(Double4*)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 Double4 GBRR => ref *(Double4*)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 Double4 GBRG => ref *(Double4*)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 Double4 GBRB => ref *(Double4*)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 Double4 GBGR => ref *(Double4*)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 Double4 GBGG => ref *(Double4*)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 Double4 GBGB => ref *(Double4*)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 Double4 GBBR => ref *(Double4*)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 Double4 GBBG => ref *(Double4*)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 Double4 GBBB => ref *(Double4*)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 Double4 BRRR => ref *(Double4*)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 Double4 BRRG => ref *(Double4*)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 Double4 BRRB => ref *(Double4*)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 Double4 BRGR => ref *(Double4*)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 Double4 BRGG => ref *(Double4*)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 Double4 BRGB => ref *(Double4*)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 Double4 BRBR => ref *(Double4*)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 Double4 BRBG => ref *(Double4*)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 Double4 BRBB => ref *(Double4*)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 Double4 BGRR => ref *(Double4*)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 Double4 BGRG => ref *(Double4*)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 Double4 BGRB => ref *(Double4*)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 Double4 BGGR => ref *(Double4*)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 Double4 BGGG => ref *(Double4*)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 Double4 BGGB => ref *(Double4*)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 Double4 BGBR => ref *(Double4*)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 Double4 BGBG => ref *(Double4*)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 Double4 BGBB => ref *(Double4*)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 Double4 BBRR => ref *(Double4*)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 Double4 BBRG => ref *(Double4*)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 Double4 BBRB => ref *(Double4*)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 Double4 BBGR => ref *(Double4*)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 Double4 BBGG => ref *(Double4*)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 Double4 BBGB => ref *(Double4*)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 Double4 BBBR => ref *(Double4*)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 Double4 BBBG => ref *(Double4*)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 Double4 BBBB => ref *(Double4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double3 operator -(Double3 xyz) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double3 operator +(Double3 left, Double3 right) => default; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double3 operator /(Double3 left, Double3 right) => default; - - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double3 operator *(Double3 left, Double3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double3 operator -(Double3 left, Double3 right) => default; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double3 operator -(Double3 xyz) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double3 operator +(Double3 left, Double3 right) => default; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double3 operator /(Double3 left, Double3 right) => default; + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double3 operator *(Double3 left, Double3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double3 operator -(Double3 left, Double3 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.cs b/src/ComputeSharp/Core/Primitives/Double/Double4.cs index 371f3ada..b3432b0d 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double4.cs +++ b/src/ComputeSharp/Core/Primitives/Double/Double4.cs @@ -1,147 +1,146 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Double4 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Double4 + public static Double4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Double4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitW => new(0, 0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Double4(double x, double y, double z, double w) { - /// - /// Gets an value with all components set to 0. - /// - public static Double4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Double4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Double4 UnitW => new(0, 0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Double4(double x, double y, double z, double w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Double4(Double2 xy, double z, double w) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - this.w = w; - } - - /// - /// 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. - /// The value to assign to the third and fourth vector components. - public Double4(double x, double y, Double2 zw) - { - this.x = x; - this.y = y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third and fourth vector components. - public Double4(Double2 xy, Double2 zw) - { - this.x = xy.X; - this.y = xy.Y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first, second and third vector components. - /// The value to assign to the fourth vector component. - public Double4(Double3 xyz, double w) - { - this.x = xyz.X; - this.y = xyz.Y; - this.z = xyz.Z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second, third and fourth vector components. - public Double4(double x, Double3 yzw) - { - this.x = x; - this.y = yzw.X; - this.z = yzw.Y; - this.w = yzw.Z; - } - - /// - /// 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 Double4(double x) => new(x, x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int4(Double4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt4(Double4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Float4(Double4 xyzw) => default; + this.x = x; + this.y = y; + this.z = z; + this.w = w; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Double4(Double2 xy, double z, double w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// 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. + /// The value to assign to the third and fourth vector components. + public Double4(double x, double y, Double2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Double4(Double2 xy, Double2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Double4(Double3 xyz, double w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Double4(double x, Double3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// 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 Double4(double x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int4(Double4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt4(Double4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Float4(Double4 xyzw) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs b/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs index 3d5acbac..618707f8 100644 --- a/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs +++ b/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs @@ -10,4174 +10,4173 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] +public unsafe partial struct Double4 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] - public unsafe partial struct Double4 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4), sizeof(Double4)); + + [FieldOffset(0)] + private double x; + + [FieldOffset(8)] + private double y; + + [FieldOffset(16)] + private double z; + + [FieldOffset(24)] + private double w; + + /// + /// 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 double this[int i] => ref *(double*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref double 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 double Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref double Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the W component. + /// + public readonly ref double W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Double2 XX => ref *(Double2*)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 Double2 XY => ref *(Double2*)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 Double2 XZ => ref *(Double2*)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 Double2 XW => ref *(Double2*)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 Double2 YX => ref *(Double2*)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 Double2 YY => ref *(Double2*)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 Double2 YZ => ref *(Double2*)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 Double2 YW => ref *(Double2*)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 Double2 ZX => ref *(Double2*)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 Double2 ZY => ref *(Double2*)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 Double2 ZZ => ref *(Double2*)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 Double2 ZW => ref *(Double2*)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 Double2 WX => ref *(Double2*)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 Double2 WY => ref *(Double2*)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 Double2 WZ => ref *(Double2*)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 Double2 WW => ref *(Double2*)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 Double3 XXX => ref *(Double3*)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 Double3 XXY => ref *(Double3*)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 Double3 XXZ => ref *(Double3*)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 Double3 XXW => ref *(Double3*)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 Double3 XYX => ref *(Double3*)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 Double3 XYY => ref *(Double3*)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 Double3 XYZ => ref *(Double3*)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 Double3 XYW => ref *(Double3*)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 Double3 XZX => ref *(Double3*)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 Double3 XZY => ref *(Double3*)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 Double3 XZZ => ref *(Double3*)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 Double3 XZW => ref *(Double3*)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 Double3 XWX => ref *(Double3*)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 Double3 XWY => ref *(Double3*)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 Double3 XWZ => ref *(Double3*)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 Double3 XWW => ref *(Double3*)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 Double3 YXX => ref *(Double3*)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 Double3 YXY => ref *(Double3*)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 Double3 YXZ => ref *(Double3*)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 Double3 YXW => ref *(Double3*)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 Double3 YYX => ref *(Double3*)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 Double3 YYY => ref *(Double3*)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 Double3 YYZ => ref *(Double3*)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 Double3 YYW => ref *(Double3*)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 Double3 YZX => ref *(Double3*)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 Double3 YZY => ref *(Double3*)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 Double3 YZZ => ref *(Double3*)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 Double3 YZW => ref *(Double3*)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 Double3 YWX => ref *(Double3*)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 Double3 YWY => ref *(Double3*)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 Double3 YWZ => ref *(Double3*)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 Double3 YWW => ref *(Double3*)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 Double3 ZXX => ref *(Double3*)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 Double3 ZXY => ref *(Double3*)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 Double3 ZXZ => ref *(Double3*)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 Double3 ZXW => ref *(Double3*)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 Double3 ZYX => ref *(Double3*)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 Double3 ZYY => ref *(Double3*)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 Double3 ZYZ => ref *(Double3*)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 Double3 ZYW => ref *(Double3*)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 Double3 ZZX => ref *(Double3*)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 Double3 ZZY => ref *(Double3*)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 Double3 ZZZ => ref *(Double3*)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 Double3 ZZW => ref *(Double3*)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 Double3 ZWX => ref *(Double3*)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 Double3 ZWY => ref *(Double3*)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 Double3 ZWZ => ref *(Double3*)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 Double3 ZWW => ref *(Double3*)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 Double3 WXX => ref *(Double3*)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 Double3 WXY => ref *(Double3*)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 Double3 WXZ => ref *(Double3*)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 Double3 WXW => ref *(Double3*)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 Double3 WYX => ref *(Double3*)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 Double3 WYY => ref *(Double3*)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 Double3 WYZ => ref *(Double3*)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 Double3 WYW => ref *(Double3*)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 Double3 WZX => ref *(Double3*)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 Double3 WZY => ref *(Double3*)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 Double3 WZZ => ref *(Double3*)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 Double3 WZW => ref *(Double3*)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 Double3 WWX => ref *(Double3*)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 Double3 WWY => ref *(Double3*)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 Double3 WWZ => ref *(Double3*)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 Double3 WWW => ref *(Double3*)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 Double4 XXXX => ref *(Double4*)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 Double4 XXXY => ref *(Double4*)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 Double4 XXXZ => ref *(Double4*)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 Double4 XXXW => ref *(Double4*)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 Double4 XXYX => ref *(Double4*)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 Double4 XXYY => ref *(Double4*)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 Double4 XXYZ => ref *(Double4*)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 Double4 XXYW => ref *(Double4*)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 Double4 XXZX => ref *(Double4*)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 Double4 XXZY => ref *(Double4*)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 Double4 XXZZ => ref *(Double4*)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 Double4 XXZW => ref *(Double4*)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 Double4 XXWX => ref *(Double4*)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 Double4 XXWY => ref *(Double4*)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 Double4 XXWZ => ref *(Double4*)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 Double4 XXWW => ref *(Double4*)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 Double4 XYXX => ref *(Double4*)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 Double4 XYXY => ref *(Double4*)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 Double4 XYXZ => ref *(Double4*)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 Double4 XYXW => ref *(Double4*)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 Double4 XYYX => ref *(Double4*)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 Double4 XYYY => ref *(Double4*)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 Double4 XYYZ => ref *(Double4*)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 Double4 XYYW => ref *(Double4*)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 Double4 XYZX => ref *(Double4*)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 Double4 XYZY => ref *(Double4*)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 Double4 XYZZ => ref *(Double4*)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 Double4 XYZW => ref *(Double4*)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 Double4 XYWX => ref *(Double4*)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 Double4 XYWY => ref *(Double4*)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 Double4 XYWZ => ref *(Double4*)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 Double4 XYWW => ref *(Double4*)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 Double4 XZXX => ref *(Double4*)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 Double4 XZXY => ref *(Double4*)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 Double4 XZXZ => ref *(Double4*)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 Double4 XZXW => ref *(Double4*)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 Double4 XZYX => ref *(Double4*)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 Double4 XZYY => ref *(Double4*)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 Double4 XZYZ => ref *(Double4*)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 Double4 XZYW => ref *(Double4*)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 Double4 XZZX => ref *(Double4*)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 Double4 XZZY => ref *(Double4*)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 Double4 XZZZ => ref *(Double4*)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 Double4 XZZW => ref *(Double4*)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 Double4 XZWX => ref *(Double4*)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 Double4 XZWY => ref *(Double4*)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 Double4 XZWZ => ref *(Double4*)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 Double4 XZWW => ref *(Double4*)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 Double4 XWXX => ref *(Double4*)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 Double4 XWXY => ref *(Double4*)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 Double4 XWXZ => ref *(Double4*)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 Double4 XWXW => ref *(Double4*)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 Double4 XWYX => ref *(Double4*)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 Double4 XWYY => ref *(Double4*)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 Double4 XWYZ => ref *(Double4*)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 Double4 XWYW => ref *(Double4*)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 Double4 XWZX => ref *(Double4*)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 Double4 XWZY => ref *(Double4*)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 Double4 XWZZ => ref *(Double4*)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 Double4 XWZW => ref *(Double4*)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 Double4 XWWX => ref *(Double4*)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 Double4 XWWY => ref *(Double4*)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 Double4 XWWZ => ref *(Double4*)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 Double4 XWWW => ref *(Double4*)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 Double4 YXXX => ref *(Double4*)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 Double4 YXXY => ref *(Double4*)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 Double4 YXXZ => ref *(Double4*)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 Double4 YXXW => ref *(Double4*)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 Double4 YXYX => ref *(Double4*)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 Double4 YXYY => ref *(Double4*)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 Double4 YXYZ => ref *(Double4*)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 Double4 YXYW => ref *(Double4*)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 Double4 YXZX => ref *(Double4*)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 Double4 YXZY => ref *(Double4*)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 Double4 YXZZ => ref *(Double4*)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 Double4 YXZW => ref *(Double4*)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 Double4 YXWX => ref *(Double4*)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 Double4 YXWY => ref *(Double4*)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 Double4 YXWZ => ref *(Double4*)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 Double4 YXWW => ref *(Double4*)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 Double4 YYXX => ref *(Double4*)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 Double4 YYXY => ref *(Double4*)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 Double4 YYXZ => ref *(Double4*)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 Double4 YYXW => ref *(Double4*)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 Double4 YYYX => ref *(Double4*)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 Double4 YYYY => ref *(Double4*)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 Double4 YYYZ => ref *(Double4*)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 Double4 YYYW => ref *(Double4*)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 Double4 YYZX => ref *(Double4*)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 Double4 YYZY => ref *(Double4*)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 Double4 YYZZ => ref *(Double4*)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 Double4 YYZW => ref *(Double4*)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 Double4 YYWX => ref *(Double4*)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 Double4 YYWY => ref *(Double4*)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 Double4 YYWZ => ref *(Double4*)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 Double4 YYWW => ref *(Double4*)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 Double4 YZXX => ref *(Double4*)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 Double4 YZXY => ref *(Double4*)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 Double4 YZXZ => ref *(Double4*)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 Double4 YZXW => ref *(Double4*)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 Double4 YZYX => ref *(Double4*)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 Double4 YZYY => ref *(Double4*)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 Double4 YZYZ => ref *(Double4*)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 Double4 YZYW => ref *(Double4*)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 Double4 YZZX => ref *(Double4*)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 Double4 YZZY => ref *(Double4*)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 Double4 YZZZ => ref *(Double4*)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 Double4 YZZW => ref *(Double4*)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 Double4 YZWX => ref *(Double4*)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 Double4 YZWY => ref *(Double4*)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 Double4 YZWZ => ref *(Double4*)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 Double4 YZWW => ref *(Double4*)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 Double4 YWXX => ref *(Double4*)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 Double4 YWXY => ref *(Double4*)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 Double4 YWXZ => ref *(Double4*)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 Double4 YWXW => ref *(Double4*)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 Double4 YWYX => ref *(Double4*)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 Double4 YWYY => ref *(Double4*)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 Double4 YWYZ => ref *(Double4*)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 Double4 YWYW => ref *(Double4*)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 Double4 YWZX => ref *(Double4*)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 Double4 YWZY => ref *(Double4*)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 Double4 YWZZ => ref *(Double4*)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 Double4 YWZW => ref *(Double4*)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 Double4 YWWX => ref *(Double4*)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 Double4 YWWY => ref *(Double4*)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 Double4 YWWZ => ref *(Double4*)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 Double4 YWWW => ref *(Double4*)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 Double4 ZXXX => ref *(Double4*)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 Double4 ZXXY => ref *(Double4*)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 Double4 ZXXZ => ref *(Double4*)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 Double4 ZXXW => ref *(Double4*)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 Double4 ZXYX => ref *(Double4*)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 Double4 ZXYY => ref *(Double4*)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 Double4 ZXYZ => ref *(Double4*)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 Double4 ZXYW => ref *(Double4*)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 Double4 ZXZX => ref *(Double4*)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 Double4 ZXZY => ref *(Double4*)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 Double4 ZXZZ => ref *(Double4*)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 Double4 ZXZW => ref *(Double4*)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 Double4 ZXWX => ref *(Double4*)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 Double4 ZXWY => ref *(Double4*)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 Double4 ZXWZ => ref *(Double4*)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 Double4 ZXWW => ref *(Double4*)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 Double4 ZYXX => ref *(Double4*)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 Double4 ZYXY => ref *(Double4*)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 Double4 ZYXZ => ref *(Double4*)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 Double4 ZYXW => ref *(Double4*)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 Double4 ZYYX => ref *(Double4*)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 Double4 ZYYY => ref *(Double4*)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 Double4 ZYYZ => ref *(Double4*)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 Double4 ZYYW => ref *(Double4*)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 Double4 ZYZX => ref *(Double4*)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 Double4 ZYZY => ref *(Double4*)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 Double4 ZYZZ => ref *(Double4*)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 Double4 ZYZW => ref *(Double4*)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 Double4 ZYWX => ref *(Double4*)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 Double4 ZYWY => ref *(Double4*)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 Double4 ZYWZ => ref *(Double4*)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 Double4 ZYWW => ref *(Double4*)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 Double4 ZZXX => ref *(Double4*)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 Double4 ZZXY => ref *(Double4*)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 Double4 ZZXZ => ref *(Double4*)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 Double4 ZZXW => ref *(Double4*)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 Double4 ZZYX => ref *(Double4*)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 Double4 ZZYY => ref *(Double4*)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 Double4 ZZYZ => ref *(Double4*)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 Double4 ZZYW => ref *(Double4*)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 Double4 ZZZX => ref *(Double4*)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 Double4 ZZZY => ref *(Double4*)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 Double4 ZZZZ => ref *(Double4*)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 Double4 ZZZW => ref *(Double4*)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 Double4 ZZWX => ref *(Double4*)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 Double4 ZZWY => ref *(Double4*)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 Double4 ZZWZ => ref *(Double4*)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 Double4 ZZWW => ref *(Double4*)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 Double4 ZWXX => ref *(Double4*)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 Double4 ZWXY => ref *(Double4*)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 Double4 ZWXZ => ref *(Double4*)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 Double4 ZWXW => ref *(Double4*)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 Double4 ZWYX => ref *(Double4*)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 Double4 ZWYY => ref *(Double4*)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 Double4 ZWYZ => ref *(Double4*)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 Double4 ZWYW => ref *(Double4*)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 Double4 ZWZX => ref *(Double4*)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 Double4 ZWZY => ref *(Double4*)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 Double4 ZWZZ => ref *(Double4*)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 Double4 ZWZW => ref *(Double4*)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 Double4 ZWWX => ref *(Double4*)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 Double4 ZWWY => ref *(Double4*)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 Double4 ZWWZ => ref *(Double4*)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 Double4 ZWWW => ref *(Double4*)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 Double4 WXXX => ref *(Double4*)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 Double4 WXXY => ref *(Double4*)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 Double4 WXXZ => ref *(Double4*)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 Double4 WXXW => ref *(Double4*)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 Double4 WXYX => ref *(Double4*)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 Double4 WXYY => ref *(Double4*)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 Double4 WXYZ => ref *(Double4*)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 Double4 WXYW => ref *(Double4*)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 Double4 WXZX => ref *(Double4*)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 Double4 WXZY => ref *(Double4*)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 Double4 WXZZ => ref *(Double4*)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 Double4 WXZW => ref *(Double4*)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 Double4 WXWX => ref *(Double4*)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 Double4 WXWY => ref *(Double4*)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 Double4 WXWZ => ref *(Double4*)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 Double4 WXWW => ref *(Double4*)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 Double4 WYXX => ref *(Double4*)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 Double4 WYXY => ref *(Double4*)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 Double4 WYXZ => ref *(Double4*)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 Double4 WYXW => ref *(Double4*)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 Double4 WYYX => ref *(Double4*)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 Double4 WYYY => ref *(Double4*)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 Double4 WYYZ => ref *(Double4*)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 Double4 WYYW => ref *(Double4*)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 Double4 WYZX => ref *(Double4*)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 Double4 WYZY => ref *(Double4*)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 Double4 WYZZ => ref *(Double4*)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 Double4 WYZW => ref *(Double4*)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 Double4 WYWX => ref *(Double4*)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 Double4 WYWY => ref *(Double4*)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 Double4 WYWZ => ref *(Double4*)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 Double4 WYWW => ref *(Double4*)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 Double4 WZXX => ref *(Double4*)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 Double4 WZXY => ref *(Double4*)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 Double4 WZXZ => ref *(Double4*)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 Double4 WZXW => ref *(Double4*)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 Double4 WZYX => ref *(Double4*)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 Double4 WZYY => ref *(Double4*)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 Double4 WZYZ => ref *(Double4*)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 Double4 WZYW => ref *(Double4*)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 Double4 WZZX => ref *(Double4*)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 Double4 WZZY => ref *(Double4*)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 Double4 WZZZ => ref *(Double4*)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 Double4 WZZW => ref *(Double4*)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 Double4 WZWX => ref *(Double4*)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 Double4 WZWY => ref *(Double4*)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 Double4 WZWZ => ref *(Double4*)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 Double4 WZWW => ref *(Double4*)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 Double4 WWXX => ref *(Double4*)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 Double4 WWXY => ref *(Double4*)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 Double4 WWXZ => ref *(Double4*)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 Double4 WWXW => ref *(Double4*)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 Double4 WWYX => ref *(Double4*)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 Double4 WWYY => ref *(Double4*)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 Double4 WWYZ => ref *(Double4*)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 Double4 WWYW => ref *(Double4*)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 Double4 WWZX => ref *(Double4*)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 Double4 WWZY => ref *(Double4*)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 Double4 WWZZ => ref *(Double4*)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 Double4 WWZW => ref *(Double4*)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 Double4 WWWX => ref *(Double4*)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 Double4 WWWY => ref *(Double4*)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 Double4 WWWZ => ref *(Double4*)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 Double4 WWWW => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref double 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 double G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref double B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the A component. + /// + public readonly ref double A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Double2 RR => ref *(Double2*)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 Double2 RG => ref *(Double2*)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 Double2 RB => ref *(Double2*)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 Double2 RA => ref *(Double2*)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 Double2 GR => ref *(Double2*)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 Double2 GG => ref *(Double2*)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 Double2 GB => ref *(Double2*)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 Double2 GA => ref *(Double2*)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 Double2 BR => ref *(Double2*)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 Double2 BG => ref *(Double2*)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 Double2 BB => ref *(Double2*)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 Double2 BA => ref *(Double2*)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 Double2 AR => ref *(Double2*)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 Double2 AG => ref *(Double2*)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 Double2 AB => ref *(Double2*)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 Double2 AA => ref *(Double2*)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 Double3 RRR => ref *(Double3*)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 Double3 RRG => ref *(Double3*)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 Double3 RRB => ref *(Double3*)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 Double3 RRA => ref *(Double3*)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 Double3 RGR => ref *(Double3*)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 Double3 RGG => ref *(Double3*)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 Double3 RGB => ref *(Double3*)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 Double3 RGA => ref *(Double3*)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 Double3 RBR => ref *(Double3*)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 Double3 RBG => ref *(Double3*)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 Double3 RBB => ref *(Double3*)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 Double3 RBA => ref *(Double3*)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 Double3 RAR => ref *(Double3*)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 Double3 RAG => ref *(Double3*)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 Double3 RAB => ref *(Double3*)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 Double3 RAA => ref *(Double3*)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 Double3 GRR => ref *(Double3*)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 Double3 GRG => ref *(Double3*)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 Double3 GRB => ref *(Double3*)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 Double3 GRA => ref *(Double3*)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 Double3 GGR => ref *(Double3*)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 Double3 GGG => ref *(Double3*)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 Double3 GGB => ref *(Double3*)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 Double3 GGA => ref *(Double3*)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 Double3 GBR => ref *(Double3*)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 Double3 GBG => ref *(Double3*)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 Double3 GBB => ref *(Double3*)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 Double3 GBA => ref *(Double3*)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 Double3 GAR => ref *(Double3*)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 Double3 GAG => ref *(Double3*)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 Double3 GAB => ref *(Double3*)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 Double3 GAA => ref *(Double3*)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 Double3 BRR => ref *(Double3*)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 Double3 BRG => ref *(Double3*)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 Double3 BRB => ref *(Double3*)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 Double3 BRA => ref *(Double3*)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 Double3 BGR => ref *(Double3*)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 Double3 BGG => ref *(Double3*)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 Double3 BGB => ref *(Double3*)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 Double3 BGA => ref *(Double3*)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 Double3 BBR => ref *(Double3*)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 Double3 BBG => ref *(Double3*)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 Double3 BBB => ref *(Double3*)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 Double3 BBA => ref *(Double3*)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 Double3 BAR => ref *(Double3*)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 Double3 BAG => ref *(Double3*)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 Double3 BAB => ref *(Double3*)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 Double3 BAA => ref *(Double3*)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 Double3 ARR => ref *(Double3*)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 Double3 ARG => ref *(Double3*)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 Double3 ARB => ref *(Double3*)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 Double3 ARA => ref *(Double3*)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 Double3 AGR => ref *(Double3*)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 Double3 AGG => ref *(Double3*)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 Double3 AGB => ref *(Double3*)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 Double3 AGA => ref *(Double3*)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 Double3 ABR => ref *(Double3*)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 Double3 ABG => ref *(Double3*)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 Double3 ABB => ref *(Double3*)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 Double3 ABA => ref *(Double3*)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 Double3 AAR => ref *(Double3*)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 Double3 AAG => ref *(Double3*)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 Double3 AAB => ref *(Double3*)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 Double3 AAA => ref *(Double3*)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 Double4 RRRR => ref *(Double4*)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 Double4 RRRG => ref *(Double4*)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 Double4 RRRB => ref *(Double4*)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 Double4 RRRA => ref *(Double4*)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 Double4 RRGR => ref *(Double4*)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 Double4 RRGG => ref *(Double4*)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 Double4 RRGB => ref *(Double4*)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 Double4 RRGA => ref *(Double4*)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 Double4 RRBR => ref *(Double4*)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 Double4 RRBG => ref *(Double4*)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 Double4 RRBB => ref *(Double4*)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 Double4 RRBA => ref *(Double4*)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 Double4 RRAR => ref *(Double4*)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 Double4 RRAG => ref *(Double4*)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 Double4 RRAB => ref *(Double4*)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 Double4 RRAA => ref *(Double4*)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 Double4 RGRR => ref *(Double4*)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 Double4 RGRG => ref *(Double4*)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 Double4 RGRB => ref *(Double4*)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 Double4 RGRA => ref *(Double4*)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 Double4 RGGR => ref *(Double4*)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 Double4 RGGG => ref *(Double4*)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 Double4 RGGB => ref *(Double4*)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 Double4 RGGA => ref *(Double4*)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 Double4 RGBR => ref *(Double4*)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 Double4 RGBG => ref *(Double4*)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 Double4 RGBB => ref *(Double4*)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 Double4 RGBA => ref *(Double4*)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 Double4 RGAR => ref *(Double4*)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 Double4 RGAG => ref *(Double4*)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 Double4 RGAB => ref *(Double4*)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 Double4 RGAA => ref *(Double4*)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 Double4 RBRR => ref *(Double4*)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 Double4 RBRG => ref *(Double4*)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 Double4 RBRB => ref *(Double4*)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 Double4 RBRA => ref *(Double4*)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 Double4 RBGR => ref *(Double4*)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 Double4 RBGG => ref *(Double4*)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 Double4 RBGB => ref *(Double4*)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 Double4 RBGA => ref *(Double4*)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 Double4 RBBR => ref *(Double4*)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 Double4 RBBG => ref *(Double4*)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 Double4 RBBB => ref *(Double4*)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 Double4 RBBA => ref *(Double4*)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 Double4 RBAR => ref *(Double4*)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 Double4 RBAG => ref *(Double4*)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 Double4 RBAB => ref *(Double4*)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 Double4 RBAA => ref *(Double4*)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 Double4 RARR => ref *(Double4*)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 Double4 RARG => ref *(Double4*)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 Double4 RARB => ref *(Double4*)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 Double4 RARA => ref *(Double4*)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 Double4 RAGR => ref *(Double4*)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 Double4 RAGG => ref *(Double4*)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 Double4 RAGB => ref *(Double4*)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 Double4 RAGA => ref *(Double4*)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 Double4 RABR => ref *(Double4*)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 Double4 RABG => ref *(Double4*)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 Double4 RABB => ref *(Double4*)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 Double4 RABA => ref *(Double4*)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 Double4 RAAR => ref *(Double4*)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 Double4 RAAG => ref *(Double4*)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 Double4 RAAB => ref *(Double4*)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 Double4 RAAA => ref *(Double4*)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 Double4 GRRR => ref *(Double4*)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 Double4 GRRG => ref *(Double4*)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 Double4 GRRB => ref *(Double4*)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 Double4 GRRA => ref *(Double4*)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 Double4 GRGR => ref *(Double4*)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 Double4 GRGG => ref *(Double4*)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 Double4 GRGB => ref *(Double4*)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 Double4 GRGA => ref *(Double4*)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 Double4 GRBR => ref *(Double4*)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 Double4 GRBG => ref *(Double4*)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 Double4 GRBB => ref *(Double4*)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 Double4 GRBA => ref *(Double4*)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 Double4 GRAR => ref *(Double4*)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 Double4 GRAG => ref *(Double4*)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 Double4 GRAB => ref *(Double4*)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 Double4 GRAA => ref *(Double4*)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 Double4 GGRR => ref *(Double4*)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 Double4 GGRG => ref *(Double4*)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 Double4 GGRB => ref *(Double4*)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 Double4 GGRA => ref *(Double4*)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 Double4 GGGR => ref *(Double4*)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 Double4 GGGG => ref *(Double4*)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 Double4 GGGB => ref *(Double4*)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 Double4 GGGA => ref *(Double4*)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 Double4 GGBR => ref *(Double4*)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 Double4 GGBG => ref *(Double4*)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 Double4 GGBB => ref *(Double4*)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 Double4 GGBA => ref *(Double4*)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 Double4 GGAR => ref *(Double4*)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 Double4 GGAG => ref *(Double4*)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 Double4 GGAB => ref *(Double4*)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 Double4 GGAA => ref *(Double4*)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 Double4 GBRR => ref *(Double4*)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 Double4 GBRG => ref *(Double4*)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 Double4 GBRB => ref *(Double4*)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 Double4 GBRA => ref *(Double4*)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 Double4 GBGR => ref *(Double4*)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 Double4 GBGG => ref *(Double4*)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 Double4 GBGB => ref *(Double4*)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 Double4 GBGA => ref *(Double4*)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 Double4 GBBR => ref *(Double4*)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 Double4 GBBG => ref *(Double4*)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 Double4 GBBB => ref *(Double4*)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 Double4 GBBA => ref *(Double4*)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 Double4 GBAR => ref *(Double4*)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 Double4 GBAG => ref *(Double4*)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 Double4 GBAB => ref *(Double4*)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 Double4 GBAA => ref *(Double4*)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 Double4 GARR => ref *(Double4*)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 Double4 GARG => ref *(Double4*)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 Double4 GARB => ref *(Double4*)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 Double4 GARA => ref *(Double4*)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 Double4 GAGR => ref *(Double4*)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 Double4 GAGG => ref *(Double4*)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 Double4 GAGB => ref *(Double4*)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 Double4 GAGA => ref *(Double4*)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 Double4 GABR => ref *(Double4*)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 Double4 GABG => ref *(Double4*)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 Double4 GABB => ref *(Double4*)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 Double4 GABA => ref *(Double4*)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 Double4 GAAR => ref *(Double4*)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 Double4 GAAG => ref *(Double4*)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 Double4 GAAB => ref *(Double4*)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 Double4 GAAA => ref *(Double4*)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 Double4 BRRR => ref *(Double4*)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 Double4 BRRG => ref *(Double4*)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 Double4 BRRB => ref *(Double4*)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 Double4 BRRA => ref *(Double4*)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 Double4 BRGR => ref *(Double4*)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 Double4 BRGG => ref *(Double4*)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 Double4 BRGB => ref *(Double4*)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 Double4 BRGA => ref *(Double4*)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 Double4 BRBR => ref *(Double4*)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 Double4 BRBG => ref *(Double4*)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 Double4 BRBB => ref *(Double4*)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 Double4 BRBA => ref *(Double4*)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 Double4 BRAR => ref *(Double4*)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 Double4 BRAG => ref *(Double4*)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 Double4 BRAB => ref *(Double4*)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 Double4 BRAA => ref *(Double4*)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 Double4 BGRR => ref *(Double4*)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 Double4 BGRG => ref *(Double4*)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 Double4 BGRB => ref *(Double4*)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 Double4 BGRA => ref *(Double4*)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 Double4 BGGR => ref *(Double4*)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 Double4 BGGG => ref *(Double4*)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 Double4 BGGB => ref *(Double4*)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 Double4 BGGA => ref *(Double4*)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 Double4 BGBR => ref *(Double4*)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 Double4 BGBG => ref *(Double4*)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 Double4 BGBB => ref *(Double4*)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 Double4 BGBA => ref *(Double4*)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 Double4 BGAR => ref *(Double4*)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 Double4 BGAG => ref *(Double4*)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 Double4 BGAB => ref *(Double4*)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 Double4 BGAA => ref *(Double4*)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 Double4 BBRR => ref *(Double4*)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 Double4 BBRG => ref *(Double4*)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 Double4 BBRB => ref *(Double4*)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 Double4 BBRA => ref *(Double4*)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 Double4 BBGR => ref *(Double4*)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 Double4 BBGG => ref *(Double4*)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 Double4 BBGB => ref *(Double4*)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 Double4 BBGA => ref *(Double4*)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 Double4 BBBR => ref *(Double4*)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 Double4 BBBG => ref *(Double4*)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 Double4 BBBB => ref *(Double4*)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 Double4 BBBA => ref *(Double4*)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 Double4 BBAR => ref *(Double4*)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 Double4 BBAG => ref *(Double4*)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 Double4 BBAB => ref *(Double4*)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 Double4 BBAA => ref *(Double4*)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 Double4 BARR => ref *(Double4*)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 Double4 BARG => ref *(Double4*)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 Double4 BARB => ref *(Double4*)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 Double4 BARA => ref *(Double4*)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 Double4 BAGR => ref *(Double4*)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 Double4 BAGG => ref *(Double4*)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 Double4 BAGB => ref *(Double4*)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 Double4 BAGA => ref *(Double4*)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 Double4 BABR => ref *(Double4*)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 Double4 BABG => ref *(Double4*)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 Double4 BABB => ref *(Double4*)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 Double4 BABA => ref *(Double4*)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 Double4 BAAR => ref *(Double4*)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 Double4 BAAG => ref *(Double4*)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 Double4 BAAB => ref *(Double4*)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 Double4 BAAA => ref *(Double4*)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 Double4 ARRR => ref *(Double4*)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 Double4 ARRG => ref *(Double4*)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 Double4 ARRB => ref *(Double4*)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 Double4 ARRA => ref *(Double4*)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 Double4 ARGR => ref *(Double4*)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 Double4 ARGG => ref *(Double4*)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 Double4 ARGB => ref *(Double4*)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 Double4 ARGA => ref *(Double4*)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 Double4 ARBR => ref *(Double4*)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 Double4 ARBG => ref *(Double4*)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 Double4 ARBB => ref *(Double4*)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 Double4 ARBA => ref *(Double4*)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 Double4 ARAR => ref *(Double4*)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 Double4 ARAG => ref *(Double4*)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 Double4 ARAB => ref *(Double4*)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 Double4 ARAA => ref *(Double4*)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 Double4 AGRR => ref *(Double4*)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 Double4 AGRG => ref *(Double4*)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 Double4 AGRB => ref *(Double4*)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 Double4 AGRA => ref *(Double4*)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 Double4 AGGR => ref *(Double4*)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 Double4 AGGG => ref *(Double4*)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 Double4 AGGB => ref *(Double4*)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 Double4 AGGA => ref *(Double4*)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 Double4 AGBR => ref *(Double4*)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 Double4 AGBG => ref *(Double4*)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 Double4 AGBB => ref *(Double4*)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 Double4 AGBA => ref *(Double4*)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 Double4 AGAR => ref *(Double4*)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 Double4 AGAG => ref *(Double4*)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 Double4 AGAB => ref *(Double4*)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 Double4 AGAA => ref *(Double4*)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 Double4 ABRR => ref *(Double4*)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 Double4 ABRG => ref *(Double4*)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 Double4 ABRB => ref *(Double4*)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 Double4 ABRA => ref *(Double4*)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 Double4 ABGR => ref *(Double4*)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 Double4 ABGG => ref *(Double4*)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 Double4 ABGB => ref *(Double4*)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 Double4 ABGA => ref *(Double4*)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 Double4 ABBR => ref *(Double4*)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 Double4 ABBG => ref *(Double4*)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 Double4 ABBB => ref *(Double4*)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 Double4 ABBA => ref *(Double4*)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 Double4 ABAR => ref *(Double4*)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 Double4 ABAG => ref *(Double4*)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 Double4 ABAB => ref *(Double4*)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 Double4 ABAA => ref *(Double4*)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 Double4 AARR => ref *(Double4*)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 Double4 AARG => ref *(Double4*)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 Double4 AARB => ref *(Double4*)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 Double4 AARA => ref *(Double4*)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 Double4 AAGR => ref *(Double4*)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 Double4 AAGG => ref *(Double4*)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 Double4 AAGB => ref *(Double4*)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 Double4 AAGA => ref *(Double4*)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 Double4 AABR => ref *(Double4*)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 Double4 AABG => ref *(Double4*)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 Double4 AABB => ref *(Double4*)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 Double4 AABA => ref *(Double4*)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 Double4 AAAR => ref *(Double4*)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 Double4 AAAG => ref *(Double4*)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 Double4 AAAB => ref *(Double4*)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 Double4 AAAA => ref *(Double4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4), sizeof(Double4)); - - [FieldOffset(0)] - private double x; - - [FieldOffset(8)] - private double y; - - [FieldOffset(16)] - private double z; - - [FieldOffset(24)] - private double w; - - /// - /// 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 double this[int i] => ref *(double*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref double 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 double Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref double Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the W component. - /// - public readonly ref double W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Double2 XX => ref *(Double2*)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 Double2 XY => ref *(Double2*)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 Double2 XZ => ref *(Double2*)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 Double2 XW => ref *(Double2*)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 Double2 YX => ref *(Double2*)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 Double2 YY => ref *(Double2*)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 Double2 YZ => ref *(Double2*)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 Double2 YW => ref *(Double2*)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 Double2 ZX => ref *(Double2*)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 Double2 ZY => ref *(Double2*)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 Double2 ZZ => ref *(Double2*)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 Double2 ZW => ref *(Double2*)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 Double2 WX => ref *(Double2*)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 Double2 WY => ref *(Double2*)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 Double2 WZ => ref *(Double2*)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 Double2 WW => ref *(Double2*)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 Double3 XXX => ref *(Double3*)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 Double3 XXY => ref *(Double3*)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 Double3 XXZ => ref *(Double3*)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 Double3 XXW => ref *(Double3*)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 Double3 XYX => ref *(Double3*)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 Double3 XYY => ref *(Double3*)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 Double3 XYZ => ref *(Double3*)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 Double3 XYW => ref *(Double3*)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 Double3 XZX => ref *(Double3*)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 Double3 XZY => ref *(Double3*)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 Double3 XZZ => ref *(Double3*)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 Double3 XZW => ref *(Double3*)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 Double3 XWX => ref *(Double3*)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 Double3 XWY => ref *(Double3*)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 Double3 XWZ => ref *(Double3*)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 Double3 XWW => ref *(Double3*)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 Double3 YXX => ref *(Double3*)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 Double3 YXY => ref *(Double3*)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 Double3 YXZ => ref *(Double3*)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 Double3 YXW => ref *(Double3*)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 Double3 YYX => ref *(Double3*)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 Double3 YYY => ref *(Double3*)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 Double3 YYZ => ref *(Double3*)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 Double3 YYW => ref *(Double3*)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 Double3 YZX => ref *(Double3*)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 Double3 YZY => ref *(Double3*)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 Double3 YZZ => ref *(Double3*)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 Double3 YZW => ref *(Double3*)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 Double3 YWX => ref *(Double3*)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 Double3 YWY => ref *(Double3*)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 Double3 YWZ => ref *(Double3*)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 Double3 YWW => ref *(Double3*)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 Double3 ZXX => ref *(Double3*)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 Double3 ZXY => ref *(Double3*)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 Double3 ZXZ => ref *(Double3*)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 Double3 ZXW => ref *(Double3*)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 Double3 ZYX => ref *(Double3*)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 Double3 ZYY => ref *(Double3*)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 Double3 ZYZ => ref *(Double3*)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 Double3 ZYW => ref *(Double3*)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 Double3 ZZX => ref *(Double3*)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 Double3 ZZY => ref *(Double3*)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 Double3 ZZZ => ref *(Double3*)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 Double3 ZZW => ref *(Double3*)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 Double3 ZWX => ref *(Double3*)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 Double3 ZWY => ref *(Double3*)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 Double3 ZWZ => ref *(Double3*)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 Double3 ZWW => ref *(Double3*)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 Double3 WXX => ref *(Double3*)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 Double3 WXY => ref *(Double3*)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 Double3 WXZ => ref *(Double3*)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 Double3 WXW => ref *(Double3*)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 Double3 WYX => ref *(Double3*)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 Double3 WYY => ref *(Double3*)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 Double3 WYZ => ref *(Double3*)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 Double3 WYW => ref *(Double3*)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 Double3 WZX => ref *(Double3*)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 Double3 WZY => ref *(Double3*)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 Double3 WZZ => ref *(Double3*)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 Double3 WZW => ref *(Double3*)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 Double3 WWX => ref *(Double3*)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 Double3 WWY => ref *(Double3*)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 Double3 WWZ => ref *(Double3*)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 Double3 WWW => ref *(Double3*)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 Double4 XXXX => ref *(Double4*)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 Double4 XXXY => ref *(Double4*)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 Double4 XXXZ => ref *(Double4*)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 Double4 XXXW => ref *(Double4*)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 Double4 XXYX => ref *(Double4*)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 Double4 XXYY => ref *(Double4*)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 Double4 XXYZ => ref *(Double4*)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 Double4 XXYW => ref *(Double4*)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 Double4 XXZX => ref *(Double4*)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 Double4 XXZY => ref *(Double4*)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 Double4 XXZZ => ref *(Double4*)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 Double4 XXZW => ref *(Double4*)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 Double4 XXWX => ref *(Double4*)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 Double4 XXWY => ref *(Double4*)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 Double4 XXWZ => ref *(Double4*)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 Double4 XXWW => ref *(Double4*)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 Double4 XYXX => ref *(Double4*)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 Double4 XYXY => ref *(Double4*)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 Double4 XYXZ => ref *(Double4*)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 Double4 XYXW => ref *(Double4*)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 Double4 XYYX => ref *(Double4*)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 Double4 XYYY => ref *(Double4*)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 Double4 XYYZ => ref *(Double4*)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 Double4 XYYW => ref *(Double4*)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 Double4 XYZX => ref *(Double4*)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 Double4 XYZY => ref *(Double4*)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 Double4 XYZZ => ref *(Double4*)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 Double4 XYZW => ref *(Double4*)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 Double4 XYWX => ref *(Double4*)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 Double4 XYWY => ref *(Double4*)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 Double4 XYWZ => ref *(Double4*)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 Double4 XYWW => ref *(Double4*)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 Double4 XZXX => ref *(Double4*)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 Double4 XZXY => ref *(Double4*)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 Double4 XZXZ => ref *(Double4*)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 Double4 XZXW => ref *(Double4*)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 Double4 XZYX => ref *(Double4*)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 Double4 XZYY => ref *(Double4*)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 Double4 XZYZ => ref *(Double4*)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 Double4 XZYW => ref *(Double4*)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 Double4 XZZX => ref *(Double4*)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 Double4 XZZY => ref *(Double4*)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 Double4 XZZZ => ref *(Double4*)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 Double4 XZZW => ref *(Double4*)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 Double4 XZWX => ref *(Double4*)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 Double4 XZWY => ref *(Double4*)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 Double4 XZWZ => ref *(Double4*)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 Double4 XZWW => ref *(Double4*)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 Double4 XWXX => ref *(Double4*)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 Double4 XWXY => ref *(Double4*)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 Double4 XWXZ => ref *(Double4*)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 Double4 XWXW => ref *(Double4*)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 Double4 XWYX => ref *(Double4*)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 Double4 XWYY => ref *(Double4*)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 Double4 XWYZ => ref *(Double4*)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 Double4 XWYW => ref *(Double4*)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 Double4 XWZX => ref *(Double4*)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 Double4 XWZY => ref *(Double4*)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 Double4 XWZZ => ref *(Double4*)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 Double4 XWZW => ref *(Double4*)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 Double4 XWWX => ref *(Double4*)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 Double4 XWWY => ref *(Double4*)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 Double4 XWWZ => ref *(Double4*)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 Double4 XWWW => ref *(Double4*)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 Double4 YXXX => ref *(Double4*)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 Double4 YXXY => ref *(Double4*)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 Double4 YXXZ => ref *(Double4*)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 Double4 YXXW => ref *(Double4*)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 Double4 YXYX => ref *(Double4*)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 Double4 YXYY => ref *(Double4*)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 Double4 YXYZ => ref *(Double4*)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 Double4 YXYW => ref *(Double4*)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 Double4 YXZX => ref *(Double4*)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 Double4 YXZY => ref *(Double4*)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 Double4 YXZZ => ref *(Double4*)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 Double4 YXZW => ref *(Double4*)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 Double4 YXWX => ref *(Double4*)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 Double4 YXWY => ref *(Double4*)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 Double4 YXWZ => ref *(Double4*)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 Double4 YXWW => ref *(Double4*)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 Double4 YYXX => ref *(Double4*)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 Double4 YYXY => ref *(Double4*)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 Double4 YYXZ => ref *(Double4*)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 Double4 YYXW => ref *(Double4*)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 Double4 YYYX => ref *(Double4*)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 Double4 YYYY => ref *(Double4*)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 Double4 YYYZ => ref *(Double4*)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 Double4 YYYW => ref *(Double4*)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 Double4 YYZX => ref *(Double4*)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 Double4 YYZY => ref *(Double4*)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 Double4 YYZZ => ref *(Double4*)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 Double4 YYZW => ref *(Double4*)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 Double4 YYWX => ref *(Double4*)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 Double4 YYWY => ref *(Double4*)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 Double4 YYWZ => ref *(Double4*)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 Double4 YYWW => ref *(Double4*)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 Double4 YZXX => ref *(Double4*)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 Double4 YZXY => ref *(Double4*)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 Double4 YZXZ => ref *(Double4*)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 Double4 YZXW => ref *(Double4*)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 Double4 YZYX => ref *(Double4*)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 Double4 YZYY => ref *(Double4*)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 Double4 YZYZ => ref *(Double4*)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 Double4 YZYW => ref *(Double4*)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 Double4 YZZX => ref *(Double4*)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 Double4 YZZY => ref *(Double4*)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 Double4 YZZZ => ref *(Double4*)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 Double4 YZZW => ref *(Double4*)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 Double4 YZWX => ref *(Double4*)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 Double4 YZWY => ref *(Double4*)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 Double4 YZWZ => ref *(Double4*)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 Double4 YZWW => ref *(Double4*)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 Double4 YWXX => ref *(Double4*)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 Double4 YWXY => ref *(Double4*)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 Double4 YWXZ => ref *(Double4*)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 Double4 YWXW => ref *(Double4*)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 Double4 YWYX => ref *(Double4*)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 Double4 YWYY => ref *(Double4*)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 Double4 YWYZ => ref *(Double4*)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 Double4 YWYW => ref *(Double4*)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 Double4 YWZX => ref *(Double4*)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 Double4 YWZY => ref *(Double4*)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 Double4 YWZZ => ref *(Double4*)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 Double4 YWZW => ref *(Double4*)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 Double4 YWWX => ref *(Double4*)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 Double4 YWWY => ref *(Double4*)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 Double4 YWWZ => ref *(Double4*)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 Double4 YWWW => ref *(Double4*)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 Double4 ZXXX => ref *(Double4*)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 Double4 ZXXY => ref *(Double4*)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 Double4 ZXXZ => ref *(Double4*)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 Double4 ZXXW => ref *(Double4*)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 Double4 ZXYX => ref *(Double4*)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 Double4 ZXYY => ref *(Double4*)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 Double4 ZXYZ => ref *(Double4*)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 Double4 ZXYW => ref *(Double4*)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 Double4 ZXZX => ref *(Double4*)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 Double4 ZXZY => ref *(Double4*)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 Double4 ZXZZ => ref *(Double4*)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 Double4 ZXZW => ref *(Double4*)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 Double4 ZXWX => ref *(Double4*)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 Double4 ZXWY => ref *(Double4*)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 Double4 ZXWZ => ref *(Double4*)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 Double4 ZXWW => ref *(Double4*)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 Double4 ZYXX => ref *(Double4*)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 Double4 ZYXY => ref *(Double4*)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 Double4 ZYXZ => ref *(Double4*)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 Double4 ZYXW => ref *(Double4*)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 Double4 ZYYX => ref *(Double4*)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 Double4 ZYYY => ref *(Double4*)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 Double4 ZYYZ => ref *(Double4*)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 Double4 ZYYW => ref *(Double4*)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 Double4 ZYZX => ref *(Double4*)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 Double4 ZYZY => ref *(Double4*)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 Double4 ZYZZ => ref *(Double4*)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 Double4 ZYZW => ref *(Double4*)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 Double4 ZYWX => ref *(Double4*)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 Double4 ZYWY => ref *(Double4*)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 Double4 ZYWZ => ref *(Double4*)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 Double4 ZYWW => ref *(Double4*)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 Double4 ZZXX => ref *(Double4*)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 Double4 ZZXY => ref *(Double4*)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 Double4 ZZXZ => ref *(Double4*)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 Double4 ZZXW => ref *(Double4*)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 Double4 ZZYX => ref *(Double4*)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 Double4 ZZYY => ref *(Double4*)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 Double4 ZZYZ => ref *(Double4*)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 Double4 ZZYW => ref *(Double4*)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 Double4 ZZZX => ref *(Double4*)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 Double4 ZZZY => ref *(Double4*)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 Double4 ZZZZ => ref *(Double4*)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 Double4 ZZZW => ref *(Double4*)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 Double4 ZZWX => ref *(Double4*)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 Double4 ZZWY => ref *(Double4*)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 Double4 ZZWZ => ref *(Double4*)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 Double4 ZZWW => ref *(Double4*)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 Double4 ZWXX => ref *(Double4*)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 Double4 ZWXY => ref *(Double4*)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 Double4 ZWXZ => ref *(Double4*)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 Double4 ZWXW => ref *(Double4*)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 Double4 ZWYX => ref *(Double4*)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 Double4 ZWYY => ref *(Double4*)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 Double4 ZWYZ => ref *(Double4*)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 Double4 ZWYW => ref *(Double4*)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 Double4 ZWZX => ref *(Double4*)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 Double4 ZWZY => ref *(Double4*)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 Double4 ZWZZ => ref *(Double4*)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 Double4 ZWZW => ref *(Double4*)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 Double4 ZWWX => ref *(Double4*)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 Double4 ZWWY => ref *(Double4*)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 Double4 ZWWZ => ref *(Double4*)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 Double4 ZWWW => ref *(Double4*)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 Double4 WXXX => ref *(Double4*)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 Double4 WXXY => ref *(Double4*)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 Double4 WXXZ => ref *(Double4*)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 Double4 WXXW => ref *(Double4*)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 Double4 WXYX => ref *(Double4*)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 Double4 WXYY => ref *(Double4*)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 Double4 WXYZ => ref *(Double4*)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 Double4 WXYW => ref *(Double4*)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 Double4 WXZX => ref *(Double4*)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 Double4 WXZY => ref *(Double4*)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 Double4 WXZZ => ref *(Double4*)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 Double4 WXZW => ref *(Double4*)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 Double4 WXWX => ref *(Double4*)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 Double4 WXWY => ref *(Double4*)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 Double4 WXWZ => ref *(Double4*)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 Double4 WXWW => ref *(Double4*)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 Double4 WYXX => ref *(Double4*)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 Double4 WYXY => ref *(Double4*)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 Double4 WYXZ => ref *(Double4*)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 Double4 WYXW => ref *(Double4*)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 Double4 WYYX => ref *(Double4*)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 Double4 WYYY => ref *(Double4*)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 Double4 WYYZ => ref *(Double4*)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 Double4 WYYW => ref *(Double4*)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 Double4 WYZX => ref *(Double4*)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 Double4 WYZY => ref *(Double4*)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 Double4 WYZZ => ref *(Double4*)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 Double4 WYZW => ref *(Double4*)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 Double4 WYWX => ref *(Double4*)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 Double4 WYWY => ref *(Double4*)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 Double4 WYWZ => ref *(Double4*)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 Double4 WYWW => ref *(Double4*)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 Double4 WZXX => ref *(Double4*)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 Double4 WZXY => ref *(Double4*)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 Double4 WZXZ => ref *(Double4*)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 Double4 WZXW => ref *(Double4*)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 Double4 WZYX => ref *(Double4*)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 Double4 WZYY => ref *(Double4*)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 Double4 WZYZ => ref *(Double4*)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 Double4 WZYW => ref *(Double4*)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 Double4 WZZX => ref *(Double4*)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 Double4 WZZY => ref *(Double4*)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 Double4 WZZZ => ref *(Double4*)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 Double4 WZZW => ref *(Double4*)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 Double4 WZWX => ref *(Double4*)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 Double4 WZWY => ref *(Double4*)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 Double4 WZWZ => ref *(Double4*)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 Double4 WZWW => ref *(Double4*)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 Double4 WWXX => ref *(Double4*)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 Double4 WWXY => ref *(Double4*)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 Double4 WWXZ => ref *(Double4*)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 Double4 WWXW => ref *(Double4*)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 Double4 WWYX => ref *(Double4*)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 Double4 WWYY => ref *(Double4*)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 Double4 WWYZ => ref *(Double4*)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 Double4 WWYW => ref *(Double4*)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 Double4 WWZX => ref *(Double4*)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 Double4 WWZY => ref *(Double4*)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 Double4 WWZZ => ref *(Double4*)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 Double4 WWZW => ref *(Double4*)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 Double4 WWWX => ref *(Double4*)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 Double4 WWWY => ref *(Double4*)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 Double4 WWWZ => ref *(Double4*)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 Double4 WWWW => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref double 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 double G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref double B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the A component. - /// - public readonly ref double A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Double2 RR => ref *(Double2*)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 Double2 RG => ref *(Double2*)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 Double2 RB => ref *(Double2*)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 Double2 RA => ref *(Double2*)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 Double2 GR => ref *(Double2*)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 Double2 GG => ref *(Double2*)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 Double2 GB => ref *(Double2*)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 Double2 GA => ref *(Double2*)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 Double2 BR => ref *(Double2*)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 Double2 BG => ref *(Double2*)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 Double2 BB => ref *(Double2*)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 Double2 BA => ref *(Double2*)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 Double2 AR => ref *(Double2*)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 Double2 AG => ref *(Double2*)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 Double2 AB => ref *(Double2*)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 Double2 AA => ref *(Double2*)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 Double3 RRR => ref *(Double3*)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 Double3 RRG => ref *(Double3*)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 Double3 RRB => ref *(Double3*)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 Double3 RRA => ref *(Double3*)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 Double3 RGR => ref *(Double3*)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 Double3 RGG => ref *(Double3*)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 Double3 RGB => ref *(Double3*)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 Double3 RGA => ref *(Double3*)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 Double3 RBR => ref *(Double3*)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 Double3 RBG => ref *(Double3*)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 Double3 RBB => ref *(Double3*)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 Double3 RBA => ref *(Double3*)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 Double3 RAR => ref *(Double3*)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 Double3 RAG => ref *(Double3*)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 Double3 RAB => ref *(Double3*)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 Double3 RAA => ref *(Double3*)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 Double3 GRR => ref *(Double3*)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 Double3 GRG => ref *(Double3*)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 Double3 GRB => ref *(Double3*)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 Double3 GRA => ref *(Double3*)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 Double3 GGR => ref *(Double3*)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 Double3 GGG => ref *(Double3*)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 Double3 GGB => ref *(Double3*)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 Double3 GGA => ref *(Double3*)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 Double3 GBR => ref *(Double3*)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 Double3 GBG => ref *(Double3*)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 Double3 GBB => ref *(Double3*)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 Double3 GBA => ref *(Double3*)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 Double3 GAR => ref *(Double3*)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 Double3 GAG => ref *(Double3*)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 Double3 GAB => ref *(Double3*)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 Double3 GAA => ref *(Double3*)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 Double3 BRR => ref *(Double3*)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 Double3 BRG => ref *(Double3*)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 Double3 BRB => ref *(Double3*)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 Double3 BRA => ref *(Double3*)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 Double3 BGR => ref *(Double3*)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 Double3 BGG => ref *(Double3*)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 Double3 BGB => ref *(Double3*)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 Double3 BGA => ref *(Double3*)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 Double3 BBR => ref *(Double3*)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 Double3 BBG => ref *(Double3*)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 Double3 BBB => ref *(Double3*)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 Double3 BBA => ref *(Double3*)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 Double3 BAR => ref *(Double3*)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 Double3 BAG => ref *(Double3*)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 Double3 BAB => ref *(Double3*)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 Double3 BAA => ref *(Double3*)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 Double3 ARR => ref *(Double3*)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 Double3 ARG => ref *(Double3*)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 Double3 ARB => ref *(Double3*)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 Double3 ARA => ref *(Double3*)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 Double3 AGR => ref *(Double3*)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 Double3 AGG => ref *(Double3*)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 Double3 AGB => ref *(Double3*)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 Double3 AGA => ref *(Double3*)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 Double3 ABR => ref *(Double3*)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 Double3 ABG => ref *(Double3*)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 Double3 ABB => ref *(Double3*)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 Double3 ABA => ref *(Double3*)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 Double3 AAR => ref *(Double3*)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 Double3 AAG => ref *(Double3*)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 Double3 AAB => ref *(Double3*)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 Double3 AAA => ref *(Double3*)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 Double4 RRRR => ref *(Double4*)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 Double4 RRRG => ref *(Double4*)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 Double4 RRRB => ref *(Double4*)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 Double4 RRRA => ref *(Double4*)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 Double4 RRGR => ref *(Double4*)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 Double4 RRGG => ref *(Double4*)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 Double4 RRGB => ref *(Double4*)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 Double4 RRGA => ref *(Double4*)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 Double4 RRBR => ref *(Double4*)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 Double4 RRBG => ref *(Double4*)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 Double4 RRBB => ref *(Double4*)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 Double4 RRBA => ref *(Double4*)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 Double4 RRAR => ref *(Double4*)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 Double4 RRAG => ref *(Double4*)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 Double4 RRAB => ref *(Double4*)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 Double4 RRAA => ref *(Double4*)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 Double4 RGRR => ref *(Double4*)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 Double4 RGRG => ref *(Double4*)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 Double4 RGRB => ref *(Double4*)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 Double4 RGRA => ref *(Double4*)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 Double4 RGGR => ref *(Double4*)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 Double4 RGGG => ref *(Double4*)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 Double4 RGGB => ref *(Double4*)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 Double4 RGGA => ref *(Double4*)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 Double4 RGBR => ref *(Double4*)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 Double4 RGBG => ref *(Double4*)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 Double4 RGBB => ref *(Double4*)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 Double4 RGBA => ref *(Double4*)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 Double4 RGAR => ref *(Double4*)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 Double4 RGAG => ref *(Double4*)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 Double4 RGAB => ref *(Double4*)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 Double4 RGAA => ref *(Double4*)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 Double4 RBRR => ref *(Double4*)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 Double4 RBRG => ref *(Double4*)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 Double4 RBRB => ref *(Double4*)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 Double4 RBRA => ref *(Double4*)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 Double4 RBGR => ref *(Double4*)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 Double4 RBGG => ref *(Double4*)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 Double4 RBGB => ref *(Double4*)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 Double4 RBGA => ref *(Double4*)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 Double4 RBBR => ref *(Double4*)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 Double4 RBBG => ref *(Double4*)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 Double4 RBBB => ref *(Double4*)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 Double4 RBBA => ref *(Double4*)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 Double4 RBAR => ref *(Double4*)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 Double4 RBAG => ref *(Double4*)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 Double4 RBAB => ref *(Double4*)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 Double4 RBAA => ref *(Double4*)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 Double4 RARR => ref *(Double4*)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 Double4 RARG => ref *(Double4*)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 Double4 RARB => ref *(Double4*)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 Double4 RARA => ref *(Double4*)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 Double4 RAGR => ref *(Double4*)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 Double4 RAGG => ref *(Double4*)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 Double4 RAGB => ref *(Double4*)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 Double4 RAGA => ref *(Double4*)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 Double4 RABR => ref *(Double4*)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 Double4 RABG => ref *(Double4*)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 Double4 RABB => ref *(Double4*)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 Double4 RABA => ref *(Double4*)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 Double4 RAAR => ref *(Double4*)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 Double4 RAAG => ref *(Double4*)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 Double4 RAAB => ref *(Double4*)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 Double4 RAAA => ref *(Double4*)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 Double4 GRRR => ref *(Double4*)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 Double4 GRRG => ref *(Double4*)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 Double4 GRRB => ref *(Double4*)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 Double4 GRRA => ref *(Double4*)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 Double4 GRGR => ref *(Double4*)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 Double4 GRGG => ref *(Double4*)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 Double4 GRGB => ref *(Double4*)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 Double4 GRGA => ref *(Double4*)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 Double4 GRBR => ref *(Double4*)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 Double4 GRBG => ref *(Double4*)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 Double4 GRBB => ref *(Double4*)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 Double4 GRBA => ref *(Double4*)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 Double4 GRAR => ref *(Double4*)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 Double4 GRAG => ref *(Double4*)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 Double4 GRAB => ref *(Double4*)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 Double4 GRAA => ref *(Double4*)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 Double4 GGRR => ref *(Double4*)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 Double4 GGRG => ref *(Double4*)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 Double4 GGRB => ref *(Double4*)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 Double4 GGRA => ref *(Double4*)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 Double4 GGGR => ref *(Double4*)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 Double4 GGGG => ref *(Double4*)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 Double4 GGGB => ref *(Double4*)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 Double4 GGGA => ref *(Double4*)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 Double4 GGBR => ref *(Double4*)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 Double4 GGBG => ref *(Double4*)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 Double4 GGBB => ref *(Double4*)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 Double4 GGBA => ref *(Double4*)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 Double4 GGAR => ref *(Double4*)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 Double4 GGAG => ref *(Double4*)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 Double4 GGAB => ref *(Double4*)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 Double4 GGAA => ref *(Double4*)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 Double4 GBRR => ref *(Double4*)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 Double4 GBRG => ref *(Double4*)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 Double4 GBRB => ref *(Double4*)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 Double4 GBRA => ref *(Double4*)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 Double4 GBGR => ref *(Double4*)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 Double4 GBGG => ref *(Double4*)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 Double4 GBGB => ref *(Double4*)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 Double4 GBGA => ref *(Double4*)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 Double4 GBBR => ref *(Double4*)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 Double4 GBBG => ref *(Double4*)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 Double4 GBBB => ref *(Double4*)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 Double4 GBBA => ref *(Double4*)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 Double4 GBAR => ref *(Double4*)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 Double4 GBAG => ref *(Double4*)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 Double4 GBAB => ref *(Double4*)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 Double4 GBAA => ref *(Double4*)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 Double4 GARR => ref *(Double4*)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 Double4 GARG => ref *(Double4*)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 Double4 GARB => ref *(Double4*)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 Double4 GARA => ref *(Double4*)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 Double4 GAGR => ref *(Double4*)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 Double4 GAGG => ref *(Double4*)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 Double4 GAGB => ref *(Double4*)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 Double4 GAGA => ref *(Double4*)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 Double4 GABR => ref *(Double4*)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 Double4 GABG => ref *(Double4*)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 Double4 GABB => ref *(Double4*)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 Double4 GABA => ref *(Double4*)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 Double4 GAAR => ref *(Double4*)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 Double4 GAAG => ref *(Double4*)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 Double4 GAAB => ref *(Double4*)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 Double4 GAAA => ref *(Double4*)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 Double4 BRRR => ref *(Double4*)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 Double4 BRRG => ref *(Double4*)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 Double4 BRRB => ref *(Double4*)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 Double4 BRRA => ref *(Double4*)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 Double4 BRGR => ref *(Double4*)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 Double4 BRGG => ref *(Double4*)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 Double4 BRGB => ref *(Double4*)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 Double4 BRGA => ref *(Double4*)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 Double4 BRBR => ref *(Double4*)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 Double4 BRBG => ref *(Double4*)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 Double4 BRBB => ref *(Double4*)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 Double4 BRBA => ref *(Double4*)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 Double4 BRAR => ref *(Double4*)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 Double4 BRAG => ref *(Double4*)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 Double4 BRAB => ref *(Double4*)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 Double4 BRAA => ref *(Double4*)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 Double4 BGRR => ref *(Double4*)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 Double4 BGRG => ref *(Double4*)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 Double4 BGRB => ref *(Double4*)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 Double4 BGRA => ref *(Double4*)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 Double4 BGGR => ref *(Double4*)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 Double4 BGGG => ref *(Double4*)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 Double4 BGGB => ref *(Double4*)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 Double4 BGGA => ref *(Double4*)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 Double4 BGBR => ref *(Double4*)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 Double4 BGBG => ref *(Double4*)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 Double4 BGBB => ref *(Double4*)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 Double4 BGBA => ref *(Double4*)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 Double4 BGAR => ref *(Double4*)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 Double4 BGAG => ref *(Double4*)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 Double4 BGAB => ref *(Double4*)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 Double4 BGAA => ref *(Double4*)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 Double4 BBRR => ref *(Double4*)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 Double4 BBRG => ref *(Double4*)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 Double4 BBRB => ref *(Double4*)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 Double4 BBRA => ref *(Double4*)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 Double4 BBGR => ref *(Double4*)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 Double4 BBGG => ref *(Double4*)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 Double4 BBGB => ref *(Double4*)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 Double4 BBGA => ref *(Double4*)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 Double4 BBBR => ref *(Double4*)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 Double4 BBBG => ref *(Double4*)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 Double4 BBBB => ref *(Double4*)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 Double4 BBBA => ref *(Double4*)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 Double4 BBAR => ref *(Double4*)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 Double4 BBAG => ref *(Double4*)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 Double4 BBAB => ref *(Double4*)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 Double4 BBAA => ref *(Double4*)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 Double4 BARR => ref *(Double4*)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 Double4 BARG => ref *(Double4*)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 Double4 BARB => ref *(Double4*)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 Double4 BARA => ref *(Double4*)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 Double4 BAGR => ref *(Double4*)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 Double4 BAGG => ref *(Double4*)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 Double4 BAGB => ref *(Double4*)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 Double4 BAGA => ref *(Double4*)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 Double4 BABR => ref *(Double4*)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 Double4 BABG => ref *(Double4*)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 Double4 BABB => ref *(Double4*)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 Double4 BABA => ref *(Double4*)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 Double4 BAAR => ref *(Double4*)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 Double4 BAAG => ref *(Double4*)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 Double4 BAAB => ref *(Double4*)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 Double4 BAAA => ref *(Double4*)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 Double4 ARRR => ref *(Double4*)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 Double4 ARRG => ref *(Double4*)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 Double4 ARRB => ref *(Double4*)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 Double4 ARRA => ref *(Double4*)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 Double4 ARGR => ref *(Double4*)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 Double4 ARGG => ref *(Double4*)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 Double4 ARGB => ref *(Double4*)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 Double4 ARGA => ref *(Double4*)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 Double4 ARBR => ref *(Double4*)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 Double4 ARBG => ref *(Double4*)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 Double4 ARBB => ref *(Double4*)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 Double4 ARBA => ref *(Double4*)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 Double4 ARAR => ref *(Double4*)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 Double4 ARAG => ref *(Double4*)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 Double4 ARAB => ref *(Double4*)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 Double4 ARAA => ref *(Double4*)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 Double4 AGRR => ref *(Double4*)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 Double4 AGRG => ref *(Double4*)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 Double4 AGRB => ref *(Double4*)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 Double4 AGRA => ref *(Double4*)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 Double4 AGGR => ref *(Double4*)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 Double4 AGGG => ref *(Double4*)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 Double4 AGGB => ref *(Double4*)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 Double4 AGGA => ref *(Double4*)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 Double4 AGBR => ref *(Double4*)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 Double4 AGBG => ref *(Double4*)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 Double4 AGBB => ref *(Double4*)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 Double4 AGBA => ref *(Double4*)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 Double4 AGAR => ref *(Double4*)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 Double4 AGAG => ref *(Double4*)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 Double4 AGAB => ref *(Double4*)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 Double4 AGAA => ref *(Double4*)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 Double4 ABRR => ref *(Double4*)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 Double4 ABRG => ref *(Double4*)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 Double4 ABRB => ref *(Double4*)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 Double4 ABRA => ref *(Double4*)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 Double4 ABGR => ref *(Double4*)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 Double4 ABGG => ref *(Double4*)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 Double4 ABGB => ref *(Double4*)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 Double4 ABGA => ref *(Double4*)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 Double4 ABBR => ref *(Double4*)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 Double4 ABBG => ref *(Double4*)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 Double4 ABBB => ref *(Double4*)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 Double4 ABBA => ref *(Double4*)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 Double4 ABAR => ref *(Double4*)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 Double4 ABAG => ref *(Double4*)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 Double4 ABAB => ref *(Double4*)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 Double4 ABAA => ref *(Double4*)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 Double4 AARR => ref *(Double4*)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 Double4 AARG => ref *(Double4*)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 Double4 AARB => ref *(Double4*)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 Double4 AARA => ref *(Double4*)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 Double4 AAGR => ref *(Double4*)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 Double4 AAGG => ref *(Double4*)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 Double4 AAGB => ref *(Double4*)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 Double4 AAGA => ref *(Double4*)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 Double4 AABR => ref *(Double4*)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 Double4 AABG => ref *(Double4*)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 Double4 AABB => ref *(Double4*)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 Double4 AABA => ref *(Double4*)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 Double4 AAAR => ref *(Double4*)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 Double4 AAAG => ref *(Double4*)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 Double4 AAAB => ref *(Double4*)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 Double4 AAAA => ref *(Double4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.w.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double4 operator -(Double4 xyzw) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double4 operator +(Double4 left, Double4 right) => default; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double4 operator /(Double4 left, Double4 right) => default; - - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double4 operator *(Double4 left, Double4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double4 operator -(Double4 left, Double4 right) => default; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.w.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double4 operator -(Double4 xyzw) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double4 operator +(Double4 left, Double4 right) => default; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double4 operator /(Double4 left, Double4 right) => default; + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double4 operator *(Double4 left, Double4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double4 operator -(Double4 left, Double4 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs b/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs index 137ca790..fdb8f020 100644 --- a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs @@ -5,2944 +5,2943 @@ using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers; using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #endif -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] +public unsafe partial struct Double1x1 { - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] - public unsafe partial struct Double1x1 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x1), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Double1x1(double m11) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x1), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - public Double1x1(double m11) - { - this.m11 = m11; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 double this[int row] => ref *(double*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// 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 Double1x1(double x) - { - Double1x1 matrix; - - matrix.m11 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double1x1 operator -(Double1x1 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double1x1 operator +(Double1x1 left, Double1x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double1x1 operator /(Double1x1 left, Double1x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double1x1 operator *(Double1x1 left, Double1x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double1x1 operator -(Double1x1 left, Double1x1 right) => default; + this.m11 = m11; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] - public unsafe partial struct Double1x2 + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 double this[int row] => ref *(double*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// 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 Double1x1(double x) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x2), sizeof(Double4)); + Double1x1 matrix; - [FieldOffset(0)] - private double m11; + matrix.m11 = x; - [FieldOffset(8)] - private double m12; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - public Double1x2(double m11, double m12) - { - this.m11 = m11; - this.m12 = m12; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// 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 Double1x2(double x) - { - Double1x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double1x2 operator -(Double1x2 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double1x2 operator +(Double1x2 left, Double1x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double1x2 operator /(Double1x2 left, Double1x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double1x2 operator *(Double1x2 left, Double1x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double1x2 operator -(Double1x2 left, Double1x2 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Double1x2(Double2 vector) => *(Double1x2*)&vector; + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] - public unsafe partial struct Double1x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double1x1 operator -(Double1x1 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double1x1 operator +(Double1x1 left, Double1x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double1x1 operator /(Double1x1 left, Double1x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double1x1 operator *(Double1x1 left, Double1x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double1x1 operator -(Double1x1 left, Double1x1 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] +public unsafe partial struct Double1x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x2), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Double1x2(double m11, double m12) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x3), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - public Double1x3(double m11, double m12, double m13) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// 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 Double1x2(double x) + { + Double1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double1x2 operator -(Double1x2 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double1x2 operator +(Double1x2 left, Double1x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double1x2 operator /(Double1x2 left, Double1x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double1x2 operator *(Double1x2 left, Double1x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double1x2 operator -(Double1x2 left, Double1x2 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double1x2(Double2 vector) => *(Double1x2*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] +public unsafe partial struct Double1x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x3), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Double1x3(double m11, double m12, double m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// 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 Double1x3(double x) - { - Double1x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double1x3 operator -(Double1x3 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double1x3 operator +(Double1x3 left, Double1x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double1x3 operator /(Double1x3 left, Double1x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double1x3 operator *(Double1x3 left, Double1x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double1x3 operator -(Double1x3 left, Double1x3 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Double1x3(Double3 vector) => *(Double1x3*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// 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 Double1x3(double x) + { + Double1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] - public unsafe partial struct Double1x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double1x3 operator -(Double1x3 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double1x3 operator +(Double1x3 left, Double1x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double1x3 operator /(Double1x3 left, Double1x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double1x3 operator *(Double1x3 left, Double1x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double1x3 operator -(Double1x3 left, Double1x3 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double1x3(Double3 vector) => *(Double1x3*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] +public unsafe partial struct Double1x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x4), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Double1x4(double m11, double m12, double m13, double m14) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double1x4), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m14; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - public Double1x4(double m11, double m12, double m13, double m14) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// 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 Double1x4(double x) - { - Double1x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double1x4 operator -(Double1x4 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double1x4 operator +(Double1x4 left, Double1x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double1x4 operator /(Double1x4 left, Double1x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double1x4 operator *(Double1x4 left, Double1x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double1x4 operator -(Double1x4 left, Double1x4 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Double1x4(Double4 vector) => *(Double1x4*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// 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 Double1x4(double x) + { + Double1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] - public unsafe partial struct Double2x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double1x4 operator -(Double1x4 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double1x4 operator +(Double1x4 left, Double1x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double1x4 operator /(Double1x4 left, Double1x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double1x4 operator *(Double1x4 left, Double1x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double1x4 operator -(Double1x4 left, Double1x4 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double1x4(Double4 vector) => *(Double1x4*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] +public unsafe partial struct Double2x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x1), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Double2x1(double m11, double m21) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x1), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m21; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - public Double2x1(double m11, double m21) - { - this.m11 = m11; - this.m21 = m21; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 double this[int row] => ref *(double*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 double this[int row] => ref *(double*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// 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 Double2x1(double x) - { - Double2x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double2x1 operator -(Double2x1 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double2x1 operator +(Double2x1 left, Double2x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double2x1 operator /(Double2x1 left, Double2x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double2x1 operator *(Double2x1 left, Double2x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double2x1 operator -(Double2x1 left, Double2x1 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Double2(Double2x1 matrix) => *(Double2*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// 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 Double2x1(double x) + { + Double2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double2x1 operator -(Double2x1 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double2x1 operator +(Double2x1 left, Double2x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double2x1 operator /(Double2x1 left, Double2x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double2x1 operator *(Double2x1 left, Double2x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double2x1 operator -(Double2x1 left, Double2x1 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double2(Double2x1 matrix) => *(Double2*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] +public unsafe partial struct Double2x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x2), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m21; + + [FieldOffset(24)] + private double m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Double2x2(double m11, double m12, double m21, double m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] - public unsafe partial struct Double2x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Double2x2(Double2 row1, Double2 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x2), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m21; - - [FieldOffset(24)] - private double m22; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - public Double2x2(double m11, double m12, double m21, double m22) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Double2x2(Double2 row1, Double2 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// 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 Double2x2(double x) - { - Double2x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double2x2 operator -(Double2x2 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double2x2 operator +(Double2x2 left, Double2x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double2x2 operator /(Double2x2 left, Double2x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double2x2 operator *(Double2x2 left, Double2x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double2x2 operator -(Double2x2 left, Double2x2 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// 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 Double2x2(double x) + { + Double2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double2x2 operator -(Double2x2 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double2x2 operator +(Double2x2 left, Double2x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double2x2 operator /(Double2x2 left, Double2x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double2x2 operator *(Double2x2 left, Double2x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double2x2 operator -(Double2x2 left, Double2x2 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)] +public unsafe partial struct Double2x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x3), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m21; + + [FieldOffset(32)] + private double m22; + + [FieldOffset(40)] + private double m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Double2x3(double m11, double m12, double m13, double m21, double m22, double m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)] - public unsafe partial struct Double2x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Double2x3(Double3 row1, Double3 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x3), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m21; - - [FieldOffset(32)] - private double m22; - - [FieldOffset(40)] - private double m23; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - public Double2x3(double m11, double m12, double m13, double m21, double m22, double m23) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Double2x3(Double3 row1, Double3 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// 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 Double2x3(double x) - { - Double2x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double2x3 operator -(Double2x3 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double2x3 operator +(Double2x3 left, Double2x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double2x3 operator /(Double2x3 left, Double2x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double2x3 operator *(Double2x3 left, Double2x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double2x3 operator -(Double2x3 left, Double2x3 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// 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 Double2x3(double x) + { + Double2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double2x3 operator -(Double2x3 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double2x3 operator +(Double2x3 left, Double2x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double2x3 operator /(Double2x3 left, Double2x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double2x3 operator *(Double2x3 left, Double2x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double2x3 operator -(Double2x3 left, Double2x3 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)] +public unsafe partial struct Double2x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x4), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + [FieldOffset(32)] + private double m21; + + [FieldOffset(40)] + private double m22; + + [FieldOffset(48)] + private double m23; + + [FieldOffset(56)] + private double m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Double2x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; } - /// - [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)] - public unsafe partial struct Double2x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Double2x4(Double4 row1, Double4 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2x4), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m14; - - [FieldOffset(32)] - private double m21; - - [FieldOffset(40)] - private double m22; - - [FieldOffset(48)] - private double m23; - - [FieldOffset(56)] - private double m24; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - public Double2x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Double2x4(Double4 row1, Double4 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref double M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// 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 Double2x4(double x) - { - Double2x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double2x4 operator -(Double2x4 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double2x4 operator +(Double2x4 left, Double2x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double2x4 operator /(Double2x4 left, Double2x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double2x4 operator *(Double2x4 left, Double2x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double2x4 operator -(Double2x4 left, Double2x4 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref double M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// 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 Double2x4(double x) + { + Double2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] - public unsafe partial struct Double3x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double2x4 operator -(Double2x4 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double2x4 operator +(Double2x4 left, Double2x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double2x4 operator /(Double2x4 left, Double2x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double2x4 operator *(Double2x4 left, Double2x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double2x4 operator -(Double2x4 left, Double2x4 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] +public unsafe partial struct Double3x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x1), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m21; + + [FieldOffset(16)] + private double m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Double3x1(double m11, double m21, double m31) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x1), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m21; - - [FieldOffset(16)] - private double m31; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - public Double3x1(double m11, double m21, double m31) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 double this[int row] => ref *(double*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 double this[int row] => ref *(double*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// 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 Double3x1(double x) - { - Double3x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double3x1 operator -(Double3x1 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double3x1 operator +(Double3x1 left, Double3x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double3x1 operator /(Double3x1 left, Double3x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double3x1 operator *(Double3x1 left, Double3x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double3x1 operator -(Double3x1 left, Double3x1 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Double3(Double3x1 matrix) => *(Double3*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// 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 Double3x1(double x) + { + Double3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double3x1 operator -(Double3x1 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double3x1 operator +(Double3x1 left, Double3x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double3x1 operator /(Double3x1 left, Double3x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double3x1 operator *(Double3x1 left, Double3x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double3x1 operator -(Double3x1 left, Double3x1 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double3(Double3x1 matrix) => *(Double3*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)] +public unsafe partial struct Double3x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x2), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m21; + + [FieldOffset(24)] + private double m22; + + [FieldOffset(32)] + private double m31; + + [FieldOffset(40)] + private double m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Double3x2(double m11, double m12, double m21, double m22, double m31, double m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)] - public unsafe partial struct Double3x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Double3x2(Double2 row1, Double2 row2, Double2 row3) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x2), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m21; - - [FieldOffset(24)] - private double m22; - - [FieldOffset(32)] - private double m31; - - [FieldOffset(40)] - private double m32; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - public Double3x2(double m11, double m12, double m21, double m22, double m31, double m32) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Double3x2(Double2 row1, Double2 row2, Double2 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// 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 Double3x2(double x) - { - Double3x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double3x2 operator -(Double3x2 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double3x2 operator +(Double3x2 left, Double3x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double3x2 operator /(Double3x2 left, Double3x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double3x2 operator *(Double3x2 left, Double3x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double3x2 operator -(Double3x2 left, Double3x2 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// 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 Double3x2(double x) + { + Double3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 72, Pack = 8)] - public unsafe partial struct Double3x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double3x2 operator -(Double3x2 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double3x2 operator +(Double3x2 left, Double3x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double3x2 operator /(Double3x2 left, Double3x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double3x2 operator *(Double3x2 left, Double3x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double3x2 operator -(Double3x2 left, Double3x2 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 72, Pack = 8)] +public unsafe partial struct Double3x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x3), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m21; + + [FieldOffset(32)] + private double m22; + + [FieldOffset(40)] + private double m23; + + [FieldOffset(48)] + private double m31; + + [FieldOffset(56)] + private double m32; + + [FieldOffset(64)] + private double m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Double3x3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x3), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m21; - - [FieldOffset(32)] - private double m22; - - [FieldOffset(40)] - private double m23; - - [FieldOffset(48)] - private double m31; - - [FieldOffset(56)] - private double m32; - - [FieldOffset(64)] - private double m33; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - public Double3x3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Double3x3(Double3 row1, Double3 row2, Double3 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Double3x3(Double3 row1, Double3 row2, Double3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// 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 Double3x3(double x) - { - Double3x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double3x3 operator -(Double3x3 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double3x3 operator +(Double3x3 left, Double3x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double3x3 operator /(Double3x3 left, Double3x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double3x3 operator *(Double3x3 left, Double3x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double3x3 operator -(Double3x3 left, Double3x3 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// 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 Double3x3(double x) + { + Double3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)] - public unsafe partial struct Double3x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double3x3 operator -(Double3x3 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double3x3 operator +(Double3x3 left, Double3x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double3x3 operator /(Double3x3 left, Double3x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double3x3 operator *(Double3x3 left, Double3x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double3x3 operator -(Double3x3 left, Double3x3 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)] +public unsafe partial struct Double3x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x4), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + [FieldOffset(32)] + private double m21; + + [FieldOffset(40)] + private double m22; + + [FieldOffset(48)] + private double m23; + + [FieldOffset(56)] + private double m24; + + [FieldOffset(64)] + private double m31; + + [FieldOffset(72)] + private double m32; + + [FieldOffset(80)] + private double m33; + + [FieldOffset(88)] + private double m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Double3x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3x4), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m14; - - [FieldOffset(32)] - private double m21; - - [FieldOffset(40)] - private double m22; - - [FieldOffset(48)] - private double m23; - - [FieldOffset(56)] - private double m24; - - [FieldOffset(64)] - private double m31; - - [FieldOffset(72)] - private double m32; - - [FieldOffset(80)] - private double m33; - - [FieldOffset(88)] - private double m34; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - public Double3x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Double3x4(Double4 row1, Double4 row2, Double4 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Double3x4(Double4 row1, Double4 row2, Double4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref double M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref double M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// 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 Double3x4(double x) - { - Double3x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double3x4 operator -(Double3x4 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double3x4 operator +(Double3x4 left, Double3x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double3x4 operator /(Double3x4 left, Double3x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double3x4 operator *(Double3x4 left, Double3x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double3x4 operator -(Double3x4 left, Double3x4 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref double M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref double M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// 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 Double3x4(double x) + { + Double3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] - public unsafe partial struct Double4x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double3x4 operator -(Double3x4 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double3x4 operator +(Double3x4 left, Double3x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double3x4 operator /(Double3x4 left, Double3x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double3x4 operator *(Double3x4 left, Double3x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double3x4 operator -(Double3x4 left, Double3x4 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] +public unsafe partial struct Double4x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x1), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m21; + + [FieldOffset(16)] + private double m31; + + [FieldOffset(24)] + private double m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Double4x1(double m11, double m21, double m31, double m41) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x1), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m21; - - [FieldOffset(16)] - private double m31; - - [FieldOffset(24)] - private double m41; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [4, 1]. - public Double4x1(double m11, double m21, double m31, double m41) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - this.m41 = m41; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 double this[int row] => ref *(double*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 double this[int row] => ref *(double*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// 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 Double4x1(double x) - { - Double4x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - matrix.m41 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double4x1 operator -(Double4x1 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double4x1 operator +(Double4x1 left, Double4x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double4x1 operator /(Double4x1 left, Double4x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double4x1 operator *(Double4x1 left, Double4x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double4x1 operator -(Double4x1 left, Double4x1 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Double4(Double4x1 matrix) => *(Double4*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// 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 Double4x1(double x) + { + Double4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double4x1 operator -(Double4x1 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double4x1 operator +(Double4x1 left, Double4x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double4x1 operator /(Double4x1 left, Double4x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double4x1 operator *(Double4x1 left, Double4x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double4x1 operator -(Double4x1 left, Double4x1 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double4(Double4x1 matrix) => *(Double4*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)] +public unsafe partial struct Double4x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x2), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m21; + + [FieldOffset(24)] + private double m22; + + [FieldOffset(32)] + private double m31; + + [FieldOffset(40)] + private double m32; + + [FieldOffset(48)] + private double m41; + + [FieldOffset(56)] + private double m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Double4x2(double m11, double m12, double m21, double m22, double m31, double m32, double m41, double m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; } - /// - [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)] - public unsafe partial struct Double4x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Double4x2(Double2 row1, Double2 row2, Double2 row3, Double2 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x2), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m21; - - [FieldOffset(24)] - private double m22; - - [FieldOffset(32)] - private double m31; - - [FieldOffset(40)] - private double m32; - - [FieldOffset(48)] - private double m41; - - [FieldOffset(56)] - private double m42; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - public Double4x2(double m11, double m12, double m21, double m22, double m31, double m32, double m41, double m42) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - this.m41 = m41; - this.m42 = m42; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Double4x2(Double2 row1, Double2 row2, Double2 row3, Double2 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m41 = row4.X; - this.m42 = row4.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double2 this[int row] => ref *(Double2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref double M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// 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 Double4x2(double x) - { - Double4x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m41 = x; - matrix.m42 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double4x2 operator -(Double4x2 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double4x2 operator +(Double4x2 left, Double4x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double4x2 operator /(Double4x2 left, Double4x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double4x2 operator *(Double4x2 left, Double4x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double4x2 operator -(Double4x2 left, Double4x2 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref double M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// 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 Double4x2(double x) + { + Double4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double4x2 operator -(Double4x2 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double4x2 operator +(Double4x2 left, Double4x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double4x2 operator /(Double4x2 left, Double4x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double4x2 operator *(Double4x2 left, Double4x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double4x2 operator -(Double4x2 left, Double4x2 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)] +public unsafe partial struct Double4x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x3), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m21; + + [FieldOffset(32)] + private double m22; + + [FieldOffset(40)] + private double m23; + + [FieldOffset(48)] + private double m31; + + [FieldOffset(56)] + private double m32; + + [FieldOffset(64)] + private double m33; + + [FieldOffset(72)] + private double m41; + + [FieldOffset(80)] + private double m42; + + [FieldOffset(88)] + private double m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Double4x3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33, double m41, double m42, double m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; } - /// - [StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)] - public unsafe partial struct Double4x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Double4x3(Double3 row1, Double3 row2, Double3 row3, Double3 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x3), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m21; - - [FieldOffset(32)] - private double m22; - - [FieldOffset(40)] - private double m23; - - [FieldOffset(48)] - private double m31; - - [FieldOffset(56)] - private double m32; - - [FieldOffset(64)] - private double m33; - - [FieldOffset(72)] - private double m41; - - [FieldOffset(80)] - private double m42; - - [FieldOffset(88)] - private double m43; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - public Double4x3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33, double m41, double m42, double m43) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Double4x3(Double3 row1, Double3 row2, Double3 row3, Double3 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double3 this[int row] => ref *(Double3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref double M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref double M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// 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 Double4x3(double x) - { - Double4x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double4x3 operator -(Double4x3 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double4x3 operator +(Double4x3 left, Double4x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double4x3 operator /(Double4x3 left, Double4x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double4x3 operator *(Double4x3 left, Double4x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double4x3 operator -(Double4x3 left, Double4x3 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref double M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref double M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// 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 Double4x3(double x) + { + Double4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double4x3 operator -(Double4x3 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double4x3 operator +(Double4x3 left, Double4x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double4x3 operator /(Double4x3 left, Double4x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double4x3 operator *(Double4x3 left, Double4x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double4x3 operator -(Double4x3 left, Double4x3 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 128, Pack = 8)] +public unsafe partial struct Double4x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x4), sizeof(Double4)); + + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + [FieldOffset(32)] + private double m21; + + [FieldOffset(40)] + private double m22; + + [FieldOffset(48)] + private double m23; + + [FieldOffset(56)] + private double m24; + + [FieldOffset(64)] + private double m31; + + [FieldOffset(72)] + private double m32; + + [FieldOffset(80)] + private double m33; + + [FieldOffset(88)] + private double m34; + + [FieldOffset(96)] + private double m41; + + [FieldOffset(104)] + private double m42; + + [FieldOffset(112)] + private double m43; + + [FieldOffset(120)] + private double m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Double4x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; } - /// - [StructLayout(LayoutKind.Explicit, Size = 128, Pack = 8)] - public unsafe partial struct Double4x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Double4x4(Double4 row1, Double4 row2, Double4 row3, Double4 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double4x4), sizeof(Double4)); - - [FieldOffset(0)] - private double m11; - - [FieldOffset(8)] - private double m12; - - [FieldOffset(16)] - private double m13; - - [FieldOffset(24)] - private double m14; - - [FieldOffset(32)] - private double m21; - - [FieldOffset(40)] - private double m22; - - [FieldOffset(48)] - private double m23; - - [FieldOffset(56)] - private double m24; - - [FieldOffset(64)] - private double m31; - - [FieldOffset(72)] - private double m32; - - [FieldOffset(80)] - private double m33; - - [FieldOffset(88)] - private double m34; - - [FieldOffset(96)] - private double m41; - - [FieldOffset(104)] - private double m42; - - [FieldOffset(112)] - private double m43; - - [FieldOffset(120)] - private double m44; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - /// The value to assign to the component at position [4, 4]. - public Double4x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - this.m44 = m44; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Double4x4(Double4 row1, Double4 row2, Double4 row3, Double4 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - this.m44 = row4.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Double4 this[int row] => ref *(Double4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref double M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref double M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref double M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref double M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 4]. - /// - public readonly ref double M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); - - /// - /// 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 Double4x4(double x) - { - Double4x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - matrix.m44 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 Double4x4 operator -(Double4x4 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 Double4x4 operator +(Double4x4 left, Double4x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 Double4x4 operator /(Double4x4 left, Double4x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 Double4x4 operator *(Double4x4 left, Double4x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 Double4x4 operator -(Double4x4 left, Double4x4 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Double4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref double M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref double M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref double M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref double M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref double M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref double M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref double M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref double M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref double M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref double M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref double M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref double M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref double M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref double M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref double M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public readonly ref double M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); + + /// + /// 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 Double4x4(double x) + { + Double4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 Double4x4 operator -(Double4x4 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 Double4x4 operator +(Double4x4 left, Double4x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 Double4x4 operator /(Double4x4 left, Double4x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 Double4x4 operator *(Double4x4 left, Double4x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 Double4x4 operator -(Double4x4 left, Double4x4 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.cs b/src/ComputeSharp/Core/Primitives/Float/Float2.cs index 5360d172..9ab871bf 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float2.cs +++ b/src/ComputeSharp/Core/Primitives/Float/Float2.cs @@ -1,80 +1,79 @@ using System.Numerics; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Float2 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Float2 + public static Float2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Float2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float2 UnitY => new(0, 1); + + /// + /// 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 Float2(float x, float y) { - /// - /// Gets an value with all components set to 0. - /// - public static Float2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Float2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float2 UnitY => new(0, 1); - - /// - /// 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 Float2(float x, float y) - { - this.x = x; - this.y = y; - } - - /// - /// 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 Float2(float x) => new(x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static unsafe implicit operator Vector2(Float2 xy) => *(Vector2*)&xy; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static unsafe implicit operator Float2(Vector2 xy) => *(Float2*)&xy; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double2(Float2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int2(Float2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt2(Float2 xy) => default; + this.x = x; + this.y = y; } + + /// + /// 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 Float2(float x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Vector2(Float2 xy) => *(Vector2*)&xy; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Float2(Vector2 xy) => *(Float2*)&xy; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double2(Float2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int2(Float2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt2(Float2 xy) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs b/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs index 7eec5117..db950822 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs +++ b/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs @@ -10,446 +10,445 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Float2 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Float2 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2), sizeof(Float4)); + + [FieldOffset(0)] + private float x; + + [FieldOffset(4)] + private float 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 float this[int i] => ref *(float*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref float 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 float 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 Float2 XX => ref *(Float2*)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 Float2 XY => ref *(Float2*)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 Float2 YX => ref *(Float2*)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 Float2 YY => ref *(Float2*)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 Float3 XXX => ref *(Float3*)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 Float3 XXY => ref *(Float3*)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 Float3 XYX => ref *(Float3*)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 Float3 XYY => ref *(Float3*)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 Float3 YXX => ref *(Float3*)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 Float3 YXY => ref *(Float3*)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 Float3 YYX => ref *(Float3*)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 Float3 YYY => ref *(Float3*)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 Float4 XXXX => ref *(Float4*)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 Float4 XXXY => ref *(Float4*)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 Float4 XXYX => ref *(Float4*)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 Float4 XXYY => ref *(Float4*)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 Float4 XYXX => ref *(Float4*)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 Float4 XYXY => ref *(Float4*)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 Float4 XYYX => ref *(Float4*)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 Float4 XYYY => ref *(Float4*)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 Float4 YXXX => ref *(Float4*)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 Float4 YXXY => ref *(Float4*)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 Float4 YXYX => ref *(Float4*)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 Float4 YXYY => ref *(Float4*)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 Float4 YYXX => ref *(Float4*)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 Float4 YYXY => ref *(Float4*)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 Float4 YYYX => ref *(Float4*)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 Float4 YYYY => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref float 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 float 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 Float2 RR => ref *(Float2*)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 Float2 RG => ref *(Float2*)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 Float2 GR => ref *(Float2*)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 Float2 GG => ref *(Float2*)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 Float3 RRR => ref *(Float3*)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 Float3 RRG => ref *(Float3*)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 Float3 RGR => ref *(Float3*)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 Float3 RGG => ref *(Float3*)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 Float3 GRR => ref *(Float3*)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 Float3 GRG => ref *(Float3*)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 Float3 GGR => ref *(Float3*)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 Float3 GGG => ref *(Float3*)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 Float4 RRRR => ref *(Float4*)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 Float4 RRRG => ref *(Float4*)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 Float4 RRGR => ref *(Float4*)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 Float4 RRGG => ref *(Float4*)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 Float4 RGRR => ref *(Float4*)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 Float4 RGRG => ref *(Float4*)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 Float4 RGGR => ref *(Float4*)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 Float4 RGGG => ref *(Float4*)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 Float4 GRRR => ref *(Float4*)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 Float4 GRRG => ref *(Float4*)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 Float4 GRGR => ref *(Float4*)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 Float4 GRGG => ref *(Float4*)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 Float4 GGRR => ref *(Float4*)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 Float4 GGRG => ref *(Float4*)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 Float4 GGGR => ref *(Float4*)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 Float4 GGGG => ref *(Float4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2), sizeof(Float4)); - - [FieldOffset(0)] - private float x; - - [FieldOffset(4)] - private float 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 float this[int i] => ref *(float*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref float 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 float 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 Float2 XX => ref *(Float2*)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 Float2 XY => ref *(Float2*)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 Float2 YX => ref *(Float2*)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 Float2 YY => ref *(Float2*)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 Float3 XXX => ref *(Float3*)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 Float3 XXY => ref *(Float3*)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 Float3 XYX => ref *(Float3*)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 Float3 XYY => ref *(Float3*)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 Float3 YXX => ref *(Float3*)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 Float3 YXY => ref *(Float3*)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 Float3 YYX => ref *(Float3*)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 Float3 YYY => ref *(Float3*)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 Float4 XXXX => ref *(Float4*)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 Float4 XXXY => ref *(Float4*)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 Float4 XXYX => ref *(Float4*)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 Float4 XXYY => ref *(Float4*)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 Float4 XYXX => ref *(Float4*)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 Float4 XYXY => ref *(Float4*)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 Float4 XYYX => ref *(Float4*)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 Float4 XYYY => ref *(Float4*)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 Float4 YXXX => ref *(Float4*)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 Float4 YXXY => ref *(Float4*)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 Float4 YXYX => ref *(Float4*)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 Float4 YXYY => ref *(Float4*)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 Float4 YYXX => ref *(Float4*)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 Float4 YYXY => ref *(Float4*)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 Float4 YYYX => ref *(Float4*)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 Float4 YYYY => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref float 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 float 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 Float2 RR => ref *(Float2*)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 Float2 RG => ref *(Float2*)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 Float2 GR => ref *(Float2*)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 Float2 GG => ref *(Float2*)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 Float3 RRR => ref *(Float3*)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 Float3 RRG => ref *(Float3*)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 Float3 RGR => ref *(Float3*)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 Float3 RGG => ref *(Float3*)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 Float3 GRR => ref *(Float3*)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 Float3 GRG => ref *(Float3*)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 Float3 GGR => ref *(Float3*)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 Float3 GGG => ref *(Float3*)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 Float4 RRRR => ref *(Float4*)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 Float4 RRRG => ref *(Float4*)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 Float4 RRGR => ref *(Float4*)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 Float4 RRGG => ref *(Float4*)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 Float4 RGRR => ref *(Float4*)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 Float4 RGRG => ref *(Float4*)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 Float4 RGGR => ref *(Float4*)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 Float4 RGGG => ref *(Float4*)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 Float4 GRRR => ref *(Float4*)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 Float4 GRRG => ref *(Float4*)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 Float4 GRGR => ref *(Float4*)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 Float4 GRGG => ref *(Float4*)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 Float4 GGRR => ref *(Float4*)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 Float4 GGRG => ref *(Float4*)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 Float4 GGGR => ref *(Float4*)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 Float4 GGGG => ref *(Float4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 xy) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 xy) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.cs b/src/ComputeSharp/Core/Primitives/Float/Float3.cs index 15af02b1..09afd529 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float3.cs +++ b/src/ComputeSharp/Core/Primitives/Float/Float3.cs @@ -1,111 +1,110 @@ using System.Numerics; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Float3 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Float3 + public static Float3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Float3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float3 UnitZ => new(0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + public Float3(float x, float y, float z) { - /// - /// Gets an value with all components set to 0. - /// - public static Float3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Float3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float3 UnitZ => new(0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - public Float3(float x, float y, float z) - { - this.x = x; - this.y = y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - public Float3(Float2 xy, float z) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second and thirt vector components. - public Float3(float x, Float2 yz) - { - this.x = x; - this.y = yz.X; - this.z = yz.Y; - } - - /// - /// 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 Float3(float x) => new(x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static unsafe implicit operator Vector3(Float3 xyz) => *(Vector3*)&xyz; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static unsafe implicit operator Float3(Vector3 xyz) => *(Float3*)&xyz; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double3(Float3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int3(Float3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt3(Float3 xyz) => default; + this.x = x; + this.y = y; + this.z = z; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Float3(Float2 xy, float z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Float3(float x, Float2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// 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 Float3(float x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Vector3(Float3 xyz) => *(Vector3*)&xyz; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Float3(Vector3 xyz) => *(Float3*)&xyz; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double3(Float3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int3(Float3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt3(Float3 xyz) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs b/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs index e3ce0105..4ee708b3 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs +++ b/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs @@ -10,1530 +10,1529 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Float3 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Float3 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3), sizeof(Float4)); + + [FieldOffset(0)] + private float x; + + [FieldOffset(4)] + private float y; + + [FieldOffset(8)] + private float z; + + /// + /// 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 float this[int i] => ref *(float*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref float 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 float Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref float Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Float2 XX => ref *(Float2*)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 Float2 XY => ref *(Float2*)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 Float2 XZ => ref *(Float2*)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 Float2 YX => ref *(Float2*)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 Float2 YY => ref *(Float2*)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 Float2 YZ => ref *(Float2*)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 Float2 ZX => ref *(Float2*)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 Float2 ZY => ref *(Float2*)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 Float2 ZZ => ref *(Float2*)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 Float3 XXX => ref *(Float3*)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 Float3 XXY => ref *(Float3*)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 Float3 XXZ => ref *(Float3*)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 Float3 XYX => ref *(Float3*)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 Float3 XYY => ref *(Float3*)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 Float3 XYZ => ref *(Float3*)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 Float3 XZX => ref *(Float3*)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 Float3 XZY => ref *(Float3*)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 Float3 XZZ => ref *(Float3*)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 Float3 YXX => ref *(Float3*)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 Float3 YXY => ref *(Float3*)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 Float3 YXZ => ref *(Float3*)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 Float3 YYX => ref *(Float3*)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 Float3 YYY => ref *(Float3*)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 Float3 YYZ => ref *(Float3*)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 Float3 YZX => ref *(Float3*)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 Float3 YZY => ref *(Float3*)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 Float3 YZZ => ref *(Float3*)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 Float3 ZXX => ref *(Float3*)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 Float3 ZXY => ref *(Float3*)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 Float3 ZXZ => ref *(Float3*)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 Float3 ZYX => ref *(Float3*)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 Float3 ZYY => ref *(Float3*)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 Float3 ZYZ => ref *(Float3*)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 Float3 ZZX => ref *(Float3*)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 Float3 ZZY => ref *(Float3*)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 Float3 ZZZ => ref *(Float3*)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 Float4 XXXX => ref *(Float4*)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 Float4 XXXY => ref *(Float4*)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 Float4 XXXZ => ref *(Float4*)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 Float4 XXYX => ref *(Float4*)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 Float4 XXYY => ref *(Float4*)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 Float4 XXYZ => ref *(Float4*)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 Float4 XXZX => ref *(Float4*)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 Float4 XXZY => ref *(Float4*)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 Float4 XXZZ => ref *(Float4*)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 Float4 XYXX => ref *(Float4*)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 Float4 XYXY => ref *(Float4*)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 Float4 XYXZ => ref *(Float4*)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 Float4 XYYX => ref *(Float4*)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 Float4 XYYY => ref *(Float4*)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 Float4 XYYZ => ref *(Float4*)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 Float4 XYZX => ref *(Float4*)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 Float4 XYZY => ref *(Float4*)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 Float4 XYZZ => ref *(Float4*)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 Float4 XZXX => ref *(Float4*)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 Float4 XZXY => ref *(Float4*)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 Float4 XZXZ => ref *(Float4*)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 Float4 XZYX => ref *(Float4*)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 Float4 XZYY => ref *(Float4*)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 Float4 XZYZ => ref *(Float4*)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 Float4 XZZX => ref *(Float4*)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 Float4 XZZY => ref *(Float4*)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 Float4 XZZZ => ref *(Float4*)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 Float4 YXXX => ref *(Float4*)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 Float4 YXXY => ref *(Float4*)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 Float4 YXXZ => ref *(Float4*)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 Float4 YXYX => ref *(Float4*)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 Float4 YXYY => ref *(Float4*)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 Float4 YXYZ => ref *(Float4*)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 Float4 YXZX => ref *(Float4*)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 Float4 YXZY => ref *(Float4*)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 Float4 YXZZ => ref *(Float4*)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 Float4 YYXX => ref *(Float4*)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 Float4 YYXY => ref *(Float4*)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 Float4 YYXZ => ref *(Float4*)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 Float4 YYYX => ref *(Float4*)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 Float4 YYYY => ref *(Float4*)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 Float4 YYYZ => ref *(Float4*)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 Float4 YYZX => ref *(Float4*)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 Float4 YYZY => ref *(Float4*)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 Float4 YYZZ => ref *(Float4*)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 Float4 YZXX => ref *(Float4*)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 Float4 YZXY => ref *(Float4*)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 Float4 YZXZ => ref *(Float4*)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 Float4 YZYX => ref *(Float4*)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 Float4 YZYY => ref *(Float4*)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 Float4 YZYZ => ref *(Float4*)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 Float4 YZZX => ref *(Float4*)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 Float4 YZZY => ref *(Float4*)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 Float4 YZZZ => ref *(Float4*)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 Float4 ZXXX => ref *(Float4*)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 Float4 ZXXY => ref *(Float4*)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 Float4 ZXXZ => ref *(Float4*)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 Float4 ZXYX => ref *(Float4*)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 Float4 ZXYY => ref *(Float4*)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 Float4 ZXYZ => ref *(Float4*)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 Float4 ZXZX => ref *(Float4*)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 Float4 ZXZY => ref *(Float4*)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 Float4 ZXZZ => ref *(Float4*)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 Float4 ZYXX => ref *(Float4*)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 Float4 ZYXY => ref *(Float4*)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 Float4 ZYXZ => ref *(Float4*)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 Float4 ZYYX => ref *(Float4*)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 Float4 ZYYY => ref *(Float4*)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 Float4 ZYYZ => ref *(Float4*)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 Float4 ZYZX => ref *(Float4*)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 Float4 ZYZY => ref *(Float4*)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 Float4 ZYZZ => ref *(Float4*)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 Float4 ZZXX => ref *(Float4*)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 Float4 ZZXY => ref *(Float4*)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 Float4 ZZXZ => ref *(Float4*)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 Float4 ZZYX => ref *(Float4*)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 Float4 ZZYY => ref *(Float4*)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 Float4 ZZYZ => ref *(Float4*)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 Float4 ZZZX => ref *(Float4*)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 Float4 ZZZY => ref *(Float4*)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 Float4 ZZZZ => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref float 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 float G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref float B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Float2 RR => ref *(Float2*)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 Float2 RG => ref *(Float2*)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 Float2 RB => ref *(Float2*)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 Float2 GR => ref *(Float2*)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 Float2 GG => ref *(Float2*)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 Float2 GB => ref *(Float2*)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 Float2 BR => ref *(Float2*)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 Float2 BG => ref *(Float2*)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 Float2 BB => ref *(Float2*)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 Float3 RRR => ref *(Float3*)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 Float3 RRG => ref *(Float3*)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 Float3 RRB => ref *(Float3*)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 Float3 RGR => ref *(Float3*)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 Float3 RGG => ref *(Float3*)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 Float3 RGB => ref *(Float3*)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 Float3 RBR => ref *(Float3*)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 Float3 RBG => ref *(Float3*)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 Float3 RBB => ref *(Float3*)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 Float3 GRR => ref *(Float3*)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 Float3 GRG => ref *(Float3*)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 Float3 GRB => ref *(Float3*)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 Float3 GGR => ref *(Float3*)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 Float3 GGG => ref *(Float3*)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 Float3 GGB => ref *(Float3*)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 Float3 GBR => ref *(Float3*)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 Float3 GBG => ref *(Float3*)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 Float3 GBB => ref *(Float3*)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 Float3 BRR => ref *(Float3*)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 Float3 BRG => ref *(Float3*)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 Float3 BRB => ref *(Float3*)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 Float3 BGR => ref *(Float3*)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 Float3 BGG => ref *(Float3*)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 Float3 BGB => ref *(Float3*)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 Float3 BBR => ref *(Float3*)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 Float3 BBG => ref *(Float3*)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 Float3 BBB => ref *(Float3*)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 Float4 RRRR => ref *(Float4*)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 Float4 RRRG => ref *(Float4*)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 Float4 RRRB => ref *(Float4*)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 Float4 RRGR => ref *(Float4*)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 Float4 RRGG => ref *(Float4*)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 Float4 RRGB => ref *(Float4*)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 Float4 RRBR => ref *(Float4*)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 Float4 RRBG => ref *(Float4*)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 Float4 RRBB => ref *(Float4*)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 Float4 RGRR => ref *(Float4*)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 Float4 RGRG => ref *(Float4*)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 Float4 RGRB => ref *(Float4*)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 Float4 RGGR => ref *(Float4*)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 Float4 RGGG => ref *(Float4*)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 Float4 RGGB => ref *(Float4*)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 Float4 RGBR => ref *(Float4*)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 Float4 RGBG => ref *(Float4*)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 Float4 RGBB => ref *(Float4*)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 Float4 RBRR => ref *(Float4*)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 Float4 RBRG => ref *(Float4*)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 Float4 RBRB => ref *(Float4*)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 Float4 RBGR => ref *(Float4*)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 Float4 RBGG => ref *(Float4*)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 Float4 RBGB => ref *(Float4*)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 Float4 RBBR => ref *(Float4*)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 Float4 RBBG => ref *(Float4*)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 Float4 RBBB => ref *(Float4*)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 Float4 GRRR => ref *(Float4*)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 Float4 GRRG => ref *(Float4*)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 Float4 GRRB => ref *(Float4*)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 Float4 GRGR => ref *(Float4*)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 Float4 GRGG => ref *(Float4*)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 Float4 GRGB => ref *(Float4*)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 Float4 GRBR => ref *(Float4*)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 Float4 GRBG => ref *(Float4*)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 Float4 GRBB => ref *(Float4*)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 Float4 GGRR => ref *(Float4*)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 Float4 GGRG => ref *(Float4*)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 Float4 GGRB => ref *(Float4*)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 Float4 GGGR => ref *(Float4*)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 Float4 GGGG => ref *(Float4*)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 Float4 GGGB => ref *(Float4*)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 Float4 GGBR => ref *(Float4*)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 Float4 GGBG => ref *(Float4*)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 Float4 GGBB => ref *(Float4*)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 Float4 GBRR => ref *(Float4*)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 Float4 GBRG => ref *(Float4*)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 Float4 GBRB => ref *(Float4*)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 Float4 GBGR => ref *(Float4*)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 Float4 GBGG => ref *(Float4*)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 Float4 GBGB => ref *(Float4*)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 Float4 GBBR => ref *(Float4*)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 Float4 GBBG => ref *(Float4*)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 Float4 GBBB => ref *(Float4*)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 Float4 BRRR => ref *(Float4*)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 Float4 BRRG => ref *(Float4*)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 Float4 BRRB => ref *(Float4*)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 Float4 BRGR => ref *(Float4*)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 Float4 BRGG => ref *(Float4*)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 Float4 BRGB => ref *(Float4*)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 Float4 BRBR => ref *(Float4*)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 Float4 BRBG => ref *(Float4*)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 Float4 BRBB => ref *(Float4*)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 Float4 BGRR => ref *(Float4*)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 Float4 BGRG => ref *(Float4*)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 Float4 BGRB => ref *(Float4*)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 Float4 BGGR => ref *(Float4*)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 Float4 BGGG => ref *(Float4*)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 Float4 BGGB => ref *(Float4*)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 Float4 BGBR => ref *(Float4*)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 Float4 BGBG => ref *(Float4*)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 Float4 BGBB => ref *(Float4*)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 Float4 BBRR => ref *(Float4*)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 Float4 BBRG => ref *(Float4*)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 Float4 BBRB => ref *(Float4*)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 Float4 BBGR => ref *(Float4*)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 Float4 BBGG => ref *(Float4*)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 Float4 BBGB => ref *(Float4*)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 Float4 BBBR => ref *(Float4*)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 Float4 BBBG => ref *(Float4*)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 Float4 BBBB => ref *(Float4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3), sizeof(Float4)); - - [FieldOffset(0)] - private float x; - - [FieldOffset(4)] - private float y; - - [FieldOffset(8)] - private float z; - - /// - /// 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 float this[int i] => ref *(float*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref float 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 float Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref float Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Float2 XX => ref *(Float2*)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 Float2 XY => ref *(Float2*)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 Float2 XZ => ref *(Float2*)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 Float2 YX => ref *(Float2*)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 Float2 YY => ref *(Float2*)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 Float2 YZ => ref *(Float2*)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 Float2 ZX => ref *(Float2*)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 Float2 ZY => ref *(Float2*)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 Float2 ZZ => ref *(Float2*)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 Float3 XXX => ref *(Float3*)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 Float3 XXY => ref *(Float3*)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 Float3 XXZ => ref *(Float3*)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 Float3 XYX => ref *(Float3*)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 Float3 XYY => ref *(Float3*)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 Float3 XYZ => ref *(Float3*)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 Float3 XZX => ref *(Float3*)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 Float3 XZY => ref *(Float3*)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 Float3 XZZ => ref *(Float3*)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 Float3 YXX => ref *(Float3*)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 Float3 YXY => ref *(Float3*)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 Float3 YXZ => ref *(Float3*)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 Float3 YYX => ref *(Float3*)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 Float3 YYY => ref *(Float3*)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 Float3 YYZ => ref *(Float3*)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 Float3 YZX => ref *(Float3*)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 Float3 YZY => ref *(Float3*)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 Float3 YZZ => ref *(Float3*)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 Float3 ZXX => ref *(Float3*)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 Float3 ZXY => ref *(Float3*)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 Float3 ZXZ => ref *(Float3*)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 Float3 ZYX => ref *(Float3*)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 Float3 ZYY => ref *(Float3*)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 Float3 ZYZ => ref *(Float3*)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 Float3 ZZX => ref *(Float3*)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 Float3 ZZY => ref *(Float3*)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 Float3 ZZZ => ref *(Float3*)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 Float4 XXXX => ref *(Float4*)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 Float4 XXXY => ref *(Float4*)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 Float4 XXXZ => ref *(Float4*)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 Float4 XXYX => ref *(Float4*)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 Float4 XXYY => ref *(Float4*)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 Float4 XXYZ => ref *(Float4*)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 Float4 XXZX => ref *(Float4*)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 Float4 XXZY => ref *(Float4*)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 Float4 XXZZ => ref *(Float4*)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 Float4 XYXX => ref *(Float4*)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 Float4 XYXY => ref *(Float4*)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 Float4 XYXZ => ref *(Float4*)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 Float4 XYYX => ref *(Float4*)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 Float4 XYYY => ref *(Float4*)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 Float4 XYYZ => ref *(Float4*)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 Float4 XYZX => ref *(Float4*)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 Float4 XYZY => ref *(Float4*)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 Float4 XYZZ => ref *(Float4*)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 Float4 XZXX => ref *(Float4*)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 Float4 XZXY => ref *(Float4*)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 Float4 XZXZ => ref *(Float4*)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 Float4 XZYX => ref *(Float4*)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 Float4 XZYY => ref *(Float4*)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 Float4 XZYZ => ref *(Float4*)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 Float4 XZZX => ref *(Float4*)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 Float4 XZZY => ref *(Float4*)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 Float4 XZZZ => ref *(Float4*)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 Float4 YXXX => ref *(Float4*)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 Float4 YXXY => ref *(Float4*)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 Float4 YXXZ => ref *(Float4*)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 Float4 YXYX => ref *(Float4*)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 Float4 YXYY => ref *(Float4*)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 Float4 YXYZ => ref *(Float4*)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 Float4 YXZX => ref *(Float4*)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 Float4 YXZY => ref *(Float4*)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 Float4 YXZZ => ref *(Float4*)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 Float4 YYXX => ref *(Float4*)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 Float4 YYXY => ref *(Float4*)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 Float4 YYXZ => ref *(Float4*)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 Float4 YYYX => ref *(Float4*)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 Float4 YYYY => ref *(Float4*)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 Float4 YYYZ => ref *(Float4*)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 Float4 YYZX => ref *(Float4*)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 Float4 YYZY => ref *(Float4*)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 Float4 YYZZ => ref *(Float4*)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 Float4 YZXX => ref *(Float4*)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 Float4 YZXY => ref *(Float4*)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 Float4 YZXZ => ref *(Float4*)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 Float4 YZYX => ref *(Float4*)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 Float4 YZYY => ref *(Float4*)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 Float4 YZYZ => ref *(Float4*)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 Float4 YZZX => ref *(Float4*)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 Float4 YZZY => ref *(Float4*)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 Float4 YZZZ => ref *(Float4*)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 Float4 ZXXX => ref *(Float4*)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 Float4 ZXXY => ref *(Float4*)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 Float4 ZXXZ => ref *(Float4*)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 Float4 ZXYX => ref *(Float4*)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 Float4 ZXYY => ref *(Float4*)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 Float4 ZXYZ => ref *(Float4*)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 Float4 ZXZX => ref *(Float4*)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 Float4 ZXZY => ref *(Float4*)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 Float4 ZXZZ => ref *(Float4*)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 Float4 ZYXX => ref *(Float4*)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 Float4 ZYXY => ref *(Float4*)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 Float4 ZYXZ => ref *(Float4*)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 Float4 ZYYX => ref *(Float4*)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 Float4 ZYYY => ref *(Float4*)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 Float4 ZYYZ => ref *(Float4*)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 Float4 ZYZX => ref *(Float4*)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 Float4 ZYZY => ref *(Float4*)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 Float4 ZYZZ => ref *(Float4*)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 Float4 ZZXX => ref *(Float4*)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 Float4 ZZXY => ref *(Float4*)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 Float4 ZZXZ => ref *(Float4*)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 Float4 ZZYX => ref *(Float4*)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 Float4 ZZYY => ref *(Float4*)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 Float4 ZZYZ => ref *(Float4*)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 Float4 ZZZX => ref *(Float4*)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 Float4 ZZZY => ref *(Float4*)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 Float4 ZZZZ => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref float 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 float G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref float B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 Float2 RR => ref *(Float2*)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 Float2 RG => ref *(Float2*)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 Float2 RB => ref *(Float2*)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 Float2 GR => ref *(Float2*)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 Float2 GG => ref *(Float2*)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 Float2 GB => ref *(Float2*)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 Float2 BR => ref *(Float2*)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 Float2 BG => ref *(Float2*)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 Float2 BB => ref *(Float2*)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 Float3 RRR => ref *(Float3*)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 Float3 RRG => ref *(Float3*)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 Float3 RRB => ref *(Float3*)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 Float3 RGR => ref *(Float3*)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 Float3 RGG => ref *(Float3*)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 Float3 RGB => ref *(Float3*)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 Float3 RBR => ref *(Float3*)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 Float3 RBG => ref *(Float3*)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 Float3 RBB => ref *(Float3*)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 Float3 GRR => ref *(Float3*)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 Float3 GRG => ref *(Float3*)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 Float3 GRB => ref *(Float3*)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 Float3 GGR => ref *(Float3*)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 Float3 GGG => ref *(Float3*)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 Float3 GGB => ref *(Float3*)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 Float3 GBR => ref *(Float3*)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 Float3 GBG => ref *(Float3*)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 Float3 GBB => ref *(Float3*)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 Float3 BRR => ref *(Float3*)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 Float3 BRG => ref *(Float3*)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 Float3 BRB => ref *(Float3*)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 Float3 BGR => ref *(Float3*)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 Float3 BGG => ref *(Float3*)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 Float3 BGB => ref *(Float3*)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 Float3 BBR => ref *(Float3*)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 Float3 BBG => ref *(Float3*)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 Float3 BBB => ref *(Float3*)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 Float4 RRRR => ref *(Float4*)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 Float4 RRRG => ref *(Float4*)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 Float4 RRRB => ref *(Float4*)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 Float4 RRGR => ref *(Float4*)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 Float4 RRGG => ref *(Float4*)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 Float4 RRGB => ref *(Float4*)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 Float4 RRBR => ref *(Float4*)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 Float4 RRBG => ref *(Float4*)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 Float4 RRBB => ref *(Float4*)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 Float4 RGRR => ref *(Float4*)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 Float4 RGRG => ref *(Float4*)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 Float4 RGRB => ref *(Float4*)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 Float4 RGGR => ref *(Float4*)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 Float4 RGGG => ref *(Float4*)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 Float4 RGGB => ref *(Float4*)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 Float4 RGBR => ref *(Float4*)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 Float4 RGBG => ref *(Float4*)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 Float4 RGBB => ref *(Float4*)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 Float4 RBRR => ref *(Float4*)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 Float4 RBRG => ref *(Float4*)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 Float4 RBRB => ref *(Float4*)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 Float4 RBGR => ref *(Float4*)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 Float4 RBGG => ref *(Float4*)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 Float4 RBGB => ref *(Float4*)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 Float4 RBBR => ref *(Float4*)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 Float4 RBBG => ref *(Float4*)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 Float4 RBBB => ref *(Float4*)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 Float4 GRRR => ref *(Float4*)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 Float4 GRRG => ref *(Float4*)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 Float4 GRRB => ref *(Float4*)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 Float4 GRGR => ref *(Float4*)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 Float4 GRGG => ref *(Float4*)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 Float4 GRGB => ref *(Float4*)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 Float4 GRBR => ref *(Float4*)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 Float4 GRBG => ref *(Float4*)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 Float4 GRBB => ref *(Float4*)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 Float4 GGRR => ref *(Float4*)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 Float4 GGRG => ref *(Float4*)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 Float4 GGRB => ref *(Float4*)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 Float4 GGGR => ref *(Float4*)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 Float4 GGGG => ref *(Float4*)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 Float4 GGGB => ref *(Float4*)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 Float4 GGBR => ref *(Float4*)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 Float4 GGBG => ref *(Float4*)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 Float4 GGBB => ref *(Float4*)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 Float4 GBRR => ref *(Float4*)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 Float4 GBRG => ref *(Float4*)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 Float4 GBRB => ref *(Float4*)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 Float4 GBGR => ref *(Float4*)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 Float4 GBGG => ref *(Float4*)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 Float4 GBGB => ref *(Float4*)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 Float4 GBBR => ref *(Float4*)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 Float4 GBBG => ref *(Float4*)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 Float4 GBBB => ref *(Float4*)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 Float4 BRRR => ref *(Float4*)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 Float4 BRRG => ref *(Float4*)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 Float4 BRRB => ref *(Float4*)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 Float4 BRGR => ref *(Float4*)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 Float4 BRGG => ref *(Float4*)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 Float4 BRGB => ref *(Float4*)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 Float4 BRBR => ref *(Float4*)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 Float4 BRBG => ref *(Float4*)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 Float4 BRBB => ref *(Float4*)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 Float4 BGRR => ref *(Float4*)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 Float4 BGRG => ref *(Float4*)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 Float4 BGRB => ref *(Float4*)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 Float4 BGGR => ref *(Float4*)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 Float4 BGGG => ref *(Float4*)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 Float4 BGGB => ref *(Float4*)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 Float4 BGBR => ref *(Float4*)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 Float4 BGBG => ref *(Float4*)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 Float4 BGBB => ref *(Float4*)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 Float4 BBRR => ref *(Float4*)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 Float4 BBRG => ref *(Float4*)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 Float4 BBRB => ref *(Float4*)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 Float4 BBGR => ref *(Float4*)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 Float4 BBGG => ref *(Float4*)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 Float4 BBGB => ref *(Float4*)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 Float4 BBBR => ref *(Float4*)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 Float4 BBBG => ref *(Float4*)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 Float4 BBBB => ref *(Float4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 xyz) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 xyz) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.cs b/src/ComputeSharp/Core/Primitives/Float/Float4.cs index 65476089..a31b90ec 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float4.cs +++ b/src/ComputeSharp/Core/Primitives/Float/Float4.cs @@ -1,161 +1,160 @@ using System.Numerics; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Float4 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Float4 + public static Float4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Float4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitW => new(0, 0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Float4(float x, float y, float z, float w) { - /// - /// Gets an value with all components set to 0. - /// - public static Float4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Float4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Float4 UnitW => new(0, 0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Float4(float x, float y, float z, float w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Float4(Float2 xy, float z, float w) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - this.w = w; - } - - /// - /// 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. - /// The value to assign to the third and fourth vector components. - public Float4(float x, float y, Float2 zw) - { - this.x = x; - this.y = y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third and fourth vector components. - public Float4(Float2 xy, Float2 zw) - { - this.x = xy.X; - this.y = xy.Y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first, second and third vector components. - /// The value to assign to the fourth vector component. - public Float4(Float3 xyz, float w) - { - this.x = xyz.X; - this.y = xyz.Y; - this.z = xyz.Z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second, third and fourth vector components. - public Float4(float x, Float3 yzw) - { - this.x = x; - this.y = yzw.X; - this.z = yzw.Y; - this.w = yzw.Z; - } - - /// - /// 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 Float4(float x) => new(x, x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static unsafe implicit operator Vector4(Float4 xyzw) => *(Vector4*)&xyzw; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static unsafe implicit operator Float4(Vector4 xyzw) => *(Float4*)&xyzw; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double4(Float4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int4(Float4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt4(Float4 xyzw) => default; + this.x = x; + this.y = y; + this.z = z; + this.w = w; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Float4(Float2 xy, float z, float w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// 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. + /// The value to assign to the third and fourth vector components. + public Float4(float x, float y, Float2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Float4(Float2 xy, Float2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Float4(Float3 xyz, float w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Float4(float x, Float3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// 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 Float4(float x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Vector4(Float4 xyzw) => *(Vector4*)&xyzw; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Float4(Vector4 xyzw) => *(Float4*)&xyzw; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double4(Float4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int4(Float4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt4(Float4 xyzw) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs b/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs index a6a59cef..f3cf4c17 100644 --- a/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs +++ b/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs @@ -10,4174 +10,4173 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Float4 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Float4 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4), sizeof(Float4)); + + [FieldOffset(0)] + private float x; + + [FieldOffset(4)] + private float y; + + [FieldOffset(8)] + private float z; + + [FieldOffset(12)] + private float w; + + /// + /// 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 float this[int i] => ref *(float*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref float 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 float Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref float Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the W component. + /// + public readonly ref float W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Float2 XX => ref *(Float2*)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 Float2 XY => ref *(Float2*)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 Float2 XZ => ref *(Float2*)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 Float2 XW => ref *(Float2*)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 Float2 YX => ref *(Float2*)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 Float2 YY => ref *(Float2*)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 Float2 YZ => ref *(Float2*)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 Float2 YW => ref *(Float2*)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 Float2 ZX => ref *(Float2*)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 Float2 ZY => ref *(Float2*)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 Float2 ZZ => ref *(Float2*)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 Float2 ZW => ref *(Float2*)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 Float2 WX => ref *(Float2*)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 Float2 WY => ref *(Float2*)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 Float2 WZ => ref *(Float2*)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 Float2 WW => ref *(Float2*)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 Float3 XXX => ref *(Float3*)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 Float3 XXY => ref *(Float3*)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 Float3 XXZ => ref *(Float3*)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 Float3 XXW => ref *(Float3*)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 Float3 XYX => ref *(Float3*)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 Float3 XYY => ref *(Float3*)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 Float3 XYZ => ref *(Float3*)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 Float3 XYW => ref *(Float3*)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 Float3 XZX => ref *(Float3*)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 Float3 XZY => ref *(Float3*)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 Float3 XZZ => ref *(Float3*)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 Float3 XZW => ref *(Float3*)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 Float3 XWX => ref *(Float3*)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 Float3 XWY => ref *(Float3*)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 Float3 XWZ => ref *(Float3*)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 Float3 XWW => ref *(Float3*)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 Float3 YXX => ref *(Float3*)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 Float3 YXY => ref *(Float3*)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 Float3 YXZ => ref *(Float3*)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 Float3 YXW => ref *(Float3*)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 Float3 YYX => ref *(Float3*)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 Float3 YYY => ref *(Float3*)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 Float3 YYZ => ref *(Float3*)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 Float3 YYW => ref *(Float3*)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 Float3 YZX => ref *(Float3*)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 Float3 YZY => ref *(Float3*)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 Float3 YZZ => ref *(Float3*)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 Float3 YZW => ref *(Float3*)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 Float3 YWX => ref *(Float3*)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 Float3 YWY => ref *(Float3*)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 Float3 YWZ => ref *(Float3*)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 Float3 YWW => ref *(Float3*)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 Float3 ZXX => ref *(Float3*)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 Float3 ZXY => ref *(Float3*)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 Float3 ZXZ => ref *(Float3*)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 Float3 ZXW => ref *(Float3*)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 Float3 ZYX => ref *(Float3*)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 Float3 ZYY => ref *(Float3*)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 Float3 ZYZ => ref *(Float3*)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 Float3 ZYW => ref *(Float3*)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 Float3 ZZX => ref *(Float3*)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 Float3 ZZY => ref *(Float3*)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 Float3 ZZZ => ref *(Float3*)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 Float3 ZZW => ref *(Float3*)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 Float3 ZWX => ref *(Float3*)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 Float3 ZWY => ref *(Float3*)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 Float3 ZWZ => ref *(Float3*)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 Float3 ZWW => ref *(Float3*)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 Float3 WXX => ref *(Float3*)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 Float3 WXY => ref *(Float3*)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 Float3 WXZ => ref *(Float3*)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 Float3 WXW => ref *(Float3*)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 Float3 WYX => ref *(Float3*)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 Float3 WYY => ref *(Float3*)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 Float3 WYZ => ref *(Float3*)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 Float3 WYW => ref *(Float3*)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 Float3 WZX => ref *(Float3*)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 Float3 WZY => ref *(Float3*)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 Float3 WZZ => ref *(Float3*)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 Float3 WZW => ref *(Float3*)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 Float3 WWX => ref *(Float3*)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 Float3 WWY => ref *(Float3*)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 Float3 WWZ => ref *(Float3*)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 Float3 WWW => ref *(Float3*)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 Float4 XXXX => ref *(Float4*)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 Float4 XXXY => ref *(Float4*)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 Float4 XXXZ => ref *(Float4*)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 Float4 XXXW => ref *(Float4*)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 Float4 XXYX => ref *(Float4*)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 Float4 XXYY => ref *(Float4*)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 Float4 XXYZ => ref *(Float4*)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 Float4 XXYW => ref *(Float4*)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 Float4 XXZX => ref *(Float4*)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 Float4 XXZY => ref *(Float4*)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 Float4 XXZZ => ref *(Float4*)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 Float4 XXZW => ref *(Float4*)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 Float4 XXWX => ref *(Float4*)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 Float4 XXWY => ref *(Float4*)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 Float4 XXWZ => ref *(Float4*)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 Float4 XXWW => ref *(Float4*)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 Float4 XYXX => ref *(Float4*)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 Float4 XYXY => ref *(Float4*)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 Float4 XYXZ => ref *(Float4*)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 Float4 XYXW => ref *(Float4*)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 Float4 XYYX => ref *(Float4*)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 Float4 XYYY => ref *(Float4*)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 Float4 XYYZ => ref *(Float4*)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 Float4 XYYW => ref *(Float4*)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 Float4 XYZX => ref *(Float4*)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 Float4 XYZY => ref *(Float4*)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 Float4 XYZZ => ref *(Float4*)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 Float4 XYZW => ref *(Float4*)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 Float4 XYWX => ref *(Float4*)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 Float4 XYWY => ref *(Float4*)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 Float4 XYWZ => ref *(Float4*)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 Float4 XYWW => ref *(Float4*)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 Float4 XZXX => ref *(Float4*)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 Float4 XZXY => ref *(Float4*)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 Float4 XZXZ => ref *(Float4*)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 Float4 XZXW => ref *(Float4*)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 Float4 XZYX => ref *(Float4*)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 Float4 XZYY => ref *(Float4*)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 Float4 XZYZ => ref *(Float4*)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 Float4 XZYW => ref *(Float4*)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 Float4 XZZX => ref *(Float4*)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 Float4 XZZY => ref *(Float4*)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 Float4 XZZZ => ref *(Float4*)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 Float4 XZZW => ref *(Float4*)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 Float4 XZWX => ref *(Float4*)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 Float4 XZWY => ref *(Float4*)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 Float4 XZWZ => ref *(Float4*)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 Float4 XZWW => ref *(Float4*)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 Float4 XWXX => ref *(Float4*)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 Float4 XWXY => ref *(Float4*)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 Float4 XWXZ => ref *(Float4*)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 Float4 XWXW => ref *(Float4*)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 Float4 XWYX => ref *(Float4*)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 Float4 XWYY => ref *(Float4*)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 Float4 XWYZ => ref *(Float4*)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 Float4 XWYW => ref *(Float4*)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 Float4 XWZX => ref *(Float4*)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 Float4 XWZY => ref *(Float4*)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 Float4 XWZZ => ref *(Float4*)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 Float4 XWZW => ref *(Float4*)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 Float4 XWWX => ref *(Float4*)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 Float4 XWWY => ref *(Float4*)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 Float4 XWWZ => ref *(Float4*)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 Float4 XWWW => ref *(Float4*)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 Float4 YXXX => ref *(Float4*)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 Float4 YXXY => ref *(Float4*)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 Float4 YXXZ => ref *(Float4*)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 Float4 YXXW => ref *(Float4*)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 Float4 YXYX => ref *(Float4*)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 Float4 YXYY => ref *(Float4*)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 Float4 YXYZ => ref *(Float4*)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 Float4 YXYW => ref *(Float4*)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 Float4 YXZX => ref *(Float4*)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 Float4 YXZY => ref *(Float4*)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 Float4 YXZZ => ref *(Float4*)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 Float4 YXZW => ref *(Float4*)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 Float4 YXWX => ref *(Float4*)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 Float4 YXWY => ref *(Float4*)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 Float4 YXWZ => ref *(Float4*)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 Float4 YXWW => ref *(Float4*)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 Float4 YYXX => ref *(Float4*)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 Float4 YYXY => ref *(Float4*)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 Float4 YYXZ => ref *(Float4*)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 Float4 YYXW => ref *(Float4*)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 Float4 YYYX => ref *(Float4*)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 Float4 YYYY => ref *(Float4*)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 Float4 YYYZ => ref *(Float4*)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 Float4 YYYW => ref *(Float4*)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 Float4 YYZX => ref *(Float4*)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 Float4 YYZY => ref *(Float4*)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 Float4 YYZZ => ref *(Float4*)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 Float4 YYZW => ref *(Float4*)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 Float4 YYWX => ref *(Float4*)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 Float4 YYWY => ref *(Float4*)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 Float4 YYWZ => ref *(Float4*)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 Float4 YYWW => ref *(Float4*)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 Float4 YZXX => ref *(Float4*)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 Float4 YZXY => ref *(Float4*)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 Float4 YZXZ => ref *(Float4*)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 Float4 YZXW => ref *(Float4*)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 Float4 YZYX => ref *(Float4*)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 Float4 YZYY => ref *(Float4*)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 Float4 YZYZ => ref *(Float4*)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 Float4 YZYW => ref *(Float4*)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 Float4 YZZX => ref *(Float4*)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 Float4 YZZY => ref *(Float4*)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 Float4 YZZZ => ref *(Float4*)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 Float4 YZZW => ref *(Float4*)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 Float4 YZWX => ref *(Float4*)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 Float4 YZWY => ref *(Float4*)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 Float4 YZWZ => ref *(Float4*)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 Float4 YZWW => ref *(Float4*)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 Float4 YWXX => ref *(Float4*)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 Float4 YWXY => ref *(Float4*)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 Float4 YWXZ => ref *(Float4*)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 Float4 YWXW => ref *(Float4*)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 Float4 YWYX => ref *(Float4*)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 Float4 YWYY => ref *(Float4*)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 Float4 YWYZ => ref *(Float4*)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 Float4 YWYW => ref *(Float4*)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 Float4 YWZX => ref *(Float4*)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 Float4 YWZY => ref *(Float4*)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 Float4 YWZZ => ref *(Float4*)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 Float4 YWZW => ref *(Float4*)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 Float4 YWWX => ref *(Float4*)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 Float4 YWWY => ref *(Float4*)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 Float4 YWWZ => ref *(Float4*)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 Float4 YWWW => ref *(Float4*)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 Float4 ZXXX => ref *(Float4*)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 Float4 ZXXY => ref *(Float4*)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 Float4 ZXXZ => ref *(Float4*)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 Float4 ZXXW => ref *(Float4*)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 Float4 ZXYX => ref *(Float4*)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 Float4 ZXYY => ref *(Float4*)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 Float4 ZXYZ => ref *(Float4*)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 Float4 ZXYW => ref *(Float4*)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 Float4 ZXZX => ref *(Float4*)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 Float4 ZXZY => ref *(Float4*)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 Float4 ZXZZ => ref *(Float4*)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 Float4 ZXZW => ref *(Float4*)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 Float4 ZXWX => ref *(Float4*)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 Float4 ZXWY => ref *(Float4*)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 Float4 ZXWZ => ref *(Float4*)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 Float4 ZXWW => ref *(Float4*)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 Float4 ZYXX => ref *(Float4*)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 Float4 ZYXY => ref *(Float4*)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 Float4 ZYXZ => ref *(Float4*)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 Float4 ZYXW => ref *(Float4*)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 Float4 ZYYX => ref *(Float4*)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 Float4 ZYYY => ref *(Float4*)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 Float4 ZYYZ => ref *(Float4*)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 Float4 ZYYW => ref *(Float4*)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 Float4 ZYZX => ref *(Float4*)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 Float4 ZYZY => ref *(Float4*)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 Float4 ZYZZ => ref *(Float4*)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 Float4 ZYZW => ref *(Float4*)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 Float4 ZYWX => ref *(Float4*)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 Float4 ZYWY => ref *(Float4*)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 Float4 ZYWZ => ref *(Float4*)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 Float4 ZYWW => ref *(Float4*)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 Float4 ZZXX => ref *(Float4*)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 Float4 ZZXY => ref *(Float4*)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 Float4 ZZXZ => ref *(Float4*)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 Float4 ZZXW => ref *(Float4*)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 Float4 ZZYX => ref *(Float4*)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 Float4 ZZYY => ref *(Float4*)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 Float4 ZZYZ => ref *(Float4*)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 Float4 ZZYW => ref *(Float4*)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 Float4 ZZZX => ref *(Float4*)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 Float4 ZZZY => ref *(Float4*)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 Float4 ZZZZ => ref *(Float4*)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 Float4 ZZZW => ref *(Float4*)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 Float4 ZZWX => ref *(Float4*)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 Float4 ZZWY => ref *(Float4*)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 Float4 ZZWZ => ref *(Float4*)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 Float4 ZZWW => ref *(Float4*)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 Float4 ZWXX => ref *(Float4*)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 Float4 ZWXY => ref *(Float4*)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 Float4 ZWXZ => ref *(Float4*)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 Float4 ZWXW => ref *(Float4*)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 Float4 ZWYX => ref *(Float4*)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 Float4 ZWYY => ref *(Float4*)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 Float4 ZWYZ => ref *(Float4*)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 Float4 ZWYW => ref *(Float4*)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 Float4 ZWZX => ref *(Float4*)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 Float4 ZWZY => ref *(Float4*)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 Float4 ZWZZ => ref *(Float4*)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 Float4 ZWZW => ref *(Float4*)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 Float4 ZWWX => ref *(Float4*)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 Float4 ZWWY => ref *(Float4*)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 Float4 ZWWZ => ref *(Float4*)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 Float4 ZWWW => ref *(Float4*)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 Float4 WXXX => ref *(Float4*)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 Float4 WXXY => ref *(Float4*)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 Float4 WXXZ => ref *(Float4*)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 Float4 WXXW => ref *(Float4*)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 Float4 WXYX => ref *(Float4*)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 Float4 WXYY => ref *(Float4*)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 Float4 WXYZ => ref *(Float4*)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 Float4 WXYW => ref *(Float4*)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 Float4 WXZX => ref *(Float4*)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 Float4 WXZY => ref *(Float4*)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 Float4 WXZZ => ref *(Float4*)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 Float4 WXZW => ref *(Float4*)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 Float4 WXWX => ref *(Float4*)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 Float4 WXWY => ref *(Float4*)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 Float4 WXWZ => ref *(Float4*)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 Float4 WXWW => ref *(Float4*)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 Float4 WYXX => ref *(Float4*)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 Float4 WYXY => ref *(Float4*)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 Float4 WYXZ => ref *(Float4*)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 Float4 WYXW => ref *(Float4*)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 Float4 WYYX => ref *(Float4*)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 Float4 WYYY => ref *(Float4*)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 Float4 WYYZ => ref *(Float4*)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 Float4 WYYW => ref *(Float4*)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 Float4 WYZX => ref *(Float4*)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 Float4 WYZY => ref *(Float4*)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 Float4 WYZZ => ref *(Float4*)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 Float4 WYZW => ref *(Float4*)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 Float4 WYWX => ref *(Float4*)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 Float4 WYWY => ref *(Float4*)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 Float4 WYWZ => ref *(Float4*)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 Float4 WYWW => ref *(Float4*)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 Float4 WZXX => ref *(Float4*)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 Float4 WZXY => ref *(Float4*)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 Float4 WZXZ => ref *(Float4*)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 Float4 WZXW => ref *(Float4*)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 Float4 WZYX => ref *(Float4*)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 Float4 WZYY => ref *(Float4*)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 Float4 WZYZ => ref *(Float4*)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 Float4 WZYW => ref *(Float4*)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 Float4 WZZX => ref *(Float4*)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 Float4 WZZY => ref *(Float4*)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 Float4 WZZZ => ref *(Float4*)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 Float4 WZZW => ref *(Float4*)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 Float4 WZWX => ref *(Float4*)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 Float4 WZWY => ref *(Float4*)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 Float4 WZWZ => ref *(Float4*)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 Float4 WZWW => ref *(Float4*)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 Float4 WWXX => ref *(Float4*)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 Float4 WWXY => ref *(Float4*)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 Float4 WWXZ => ref *(Float4*)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 Float4 WWXW => ref *(Float4*)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 Float4 WWYX => ref *(Float4*)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 Float4 WWYY => ref *(Float4*)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 Float4 WWYZ => ref *(Float4*)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 Float4 WWYW => ref *(Float4*)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 Float4 WWZX => ref *(Float4*)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 Float4 WWZY => ref *(Float4*)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 Float4 WWZZ => ref *(Float4*)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 Float4 WWZW => ref *(Float4*)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 Float4 WWWX => ref *(Float4*)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 Float4 WWWY => ref *(Float4*)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 Float4 WWWZ => ref *(Float4*)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 Float4 WWWW => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref float 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 float G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref float B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the A component. + /// + public readonly ref float A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Float2 RR => ref *(Float2*)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 Float2 RG => ref *(Float2*)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 Float2 RB => ref *(Float2*)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 Float2 RA => ref *(Float2*)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 Float2 GR => ref *(Float2*)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 Float2 GG => ref *(Float2*)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 Float2 GB => ref *(Float2*)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 Float2 GA => ref *(Float2*)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 Float2 BR => ref *(Float2*)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 Float2 BG => ref *(Float2*)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 Float2 BB => ref *(Float2*)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 Float2 BA => ref *(Float2*)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 Float2 AR => ref *(Float2*)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 Float2 AG => ref *(Float2*)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 Float2 AB => ref *(Float2*)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 Float2 AA => ref *(Float2*)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 Float3 RRR => ref *(Float3*)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 Float3 RRG => ref *(Float3*)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 Float3 RRB => ref *(Float3*)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 Float3 RRA => ref *(Float3*)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 Float3 RGR => ref *(Float3*)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 Float3 RGG => ref *(Float3*)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 Float3 RGB => ref *(Float3*)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 Float3 RGA => ref *(Float3*)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 Float3 RBR => ref *(Float3*)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 Float3 RBG => ref *(Float3*)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 Float3 RBB => ref *(Float3*)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 Float3 RBA => ref *(Float3*)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 Float3 RAR => ref *(Float3*)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 Float3 RAG => ref *(Float3*)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 Float3 RAB => ref *(Float3*)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 Float3 RAA => ref *(Float3*)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 Float3 GRR => ref *(Float3*)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 Float3 GRG => ref *(Float3*)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 Float3 GRB => ref *(Float3*)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 Float3 GRA => ref *(Float3*)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 Float3 GGR => ref *(Float3*)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 Float3 GGG => ref *(Float3*)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 Float3 GGB => ref *(Float3*)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 Float3 GGA => ref *(Float3*)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 Float3 GBR => ref *(Float3*)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 Float3 GBG => ref *(Float3*)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 Float3 GBB => ref *(Float3*)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 Float3 GBA => ref *(Float3*)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 Float3 GAR => ref *(Float3*)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 Float3 GAG => ref *(Float3*)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 Float3 GAB => ref *(Float3*)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 Float3 GAA => ref *(Float3*)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 Float3 BRR => ref *(Float3*)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 Float3 BRG => ref *(Float3*)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 Float3 BRB => ref *(Float3*)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 Float3 BRA => ref *(Float3*)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 Float3 BGR => ref *(Float3*)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 Float3 BGG => ref *(Float3*)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 Float3 BGB => ref *(Float3*)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 Float3 BGA => ref *(Float3*)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 Float3 BBR => ref *(Float3*)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 Float3 BBG => ref *(Float3*)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 Float3 BBB => ref *(Float3*)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 Float3 BBA => ref *(Float3*)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 Float3 BAR => ref *(Float3*)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 Float3 BAG => ref *(Float3*)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 Float3 BAB => ref *(Float3*)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 Float3 BAA => ref *(Float3*)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 Float3 ARR => ref *(Float3*)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 Float3 ARG => ref *(Float3*)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 Float3 ARB => ref *(Float3*)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 Float3 ARA => ref *(Float3*)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 Float3 AGR => ref *(Float3*)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 Float3 AGG => ref *(Float3*)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 Float3 AGB => ref *(Float3*)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 Float3 AGA => ref *(Float3*)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 Float3 ABR => ref *(Float3*)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 Float3 ABG => ref *(Float3*)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 Float3 ABB => ref *(Float3*)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 Float3 ABA => ref *(Float3*)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 Float3 AAR => ref *(Float3*)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 Float3 AAG => ref *(Float3*)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 Float3 AAB => ref *(Float3*)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 Float3 AAA => ref *(Float3*)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 Float4 RRRR => ref *(Float4*)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 Float4 RRRG => ref *(Float4*)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 Float4 RRRB => ref *(Float4*)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 Float4 RRRA => ref *(Float4*)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 Float4 RRGR => ref *(Float4*)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 Float4 RRGG => ref *(Float4*)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 Float4 RRGB => ref *(Float4*)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 Float4 RRGA => ref *(Float4*)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 Float4 RRBR => ref *(Float4*)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 Float4 RRBG => ref *(Float4*)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 Float4 RRBB => ref *(Float4*)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 Float4 RRBA => ref *(Float4*)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 Float4 RRAR => ref *(Float4*)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 Float4 RRAG => ref *(Float4*)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 Float4 RRAB => ref *(Float4*)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 Float4 RRAA => ref *(Float4*)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 Float4 RGRR => ref *(Float4*)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 Float4 RGRG => ref *(Float4*)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 Float4 RGRB => ref *(Float4*)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 Float4 RGRA => ref *(Float4*)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 Float4 RGGR => ref *(Float4*)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 Float4 RGGG => ref *(Float4*)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 Float4 RGGB => ref *(Float4*)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 Float4 RGGA => ref *(Float4*)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 Float4 RGBR => ref *(Float4*)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 Float4 RGBG => ref *(Float4*)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 Float4 RGBB => ref *(Float4*)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 Float4 RGBA => ref *(Float4*)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 Float4 RGAR => ref *(Float4*)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 Float4 RGAG => ref *(Float4*)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 Float4 RGAB => ref *(Float4*)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 Float4 RGAA => ref *(Float4*)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 Float4 RBRR => ref *(Float4*)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 Float4 RBRG => ref *(Float4*)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 Float4 RBRB => ref *(Float4*)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 Float4 RBRA => ref *(Float4*)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 Float4 RBGR => ref *(Float4*)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 Float4 RBGG => ref *(Float4*)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 Float4 RBGB => ref *(Float4*)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 Float4 RBGA => ref *(Float4*)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 Float4 RBBR => ref *(Float4*)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 Float4 RBBG => ref *(Float4*)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 Float4 RBBB => ref *(Float4*)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 Float4 RBBA => ref *(Float4*)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 Float4 RBAR => ref *(Float4*)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 Float4 RBAG => ref *(Float4*)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 Float4 RBAB => ref *(Float4*)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 Float4 RBAA => ref *(Float4*)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 Float4 RARR => ref *(Float4*)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 Float4 RARG => ref *(Float4*)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 Float4 RARB => ref *(Float4*)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 Float4 RARA => ref *(Float4*)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 Float4 RAGR => ref *(Float4*)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 Float4 RAGG => ref *(Float4*)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 Float4 RAGB => ref *(Float4*)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 Float4 RAGA => ref *(Float4*)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 Float4 RABR => ref *(Float4*)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 Float4 RABG => ref *(Float4*)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 Float4 RABB => ref *(Float4*)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 Float4 RABA => ref *(Float4*)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 Float4 RAAR => ref *(Float4*)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 Float4 RAAG => ref *(Float4*)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 Float4 RAAB => ref *(Float4*)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 Float4 RAAA => ref *(Float4*)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 Float4 GRRR => ref *(Float4*)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 Float4 GRRG => ref *(Float4*)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 Float4 GRRB => ref *(Float4*)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 Float4 GRRA => ref *(Float4*)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 Float4 GRGR => ref *(Float4*)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 Float4 GRGG => ref *(Float4*)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 Float4 GRGB => ref *(Float4*)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 Float4 GRGA => ref *(Float4*)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 Float4 GRBR => ref *(Float4*)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 Float4 GRBG => ref *(Float4*)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 Float4 GRBB => ref *(Float4*)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 Float4 GRBA => ref *(Float4*)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 Float4 GRAR => ref *(Float4*)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 Float4 GRAG => ref *(Float4*)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 Float4 GRAB => ref *(Float4*)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 Float4 GRAA => ref *(Float4*)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 Float4 GGRR => ref *(Float4*)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 Float4 GGRG => ref *(Float4*)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 Float4 GGRB => ref *(Float4*)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 Float4 GGRA => ref *(Float4*)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 Float4 GGGR => ref *(Float4*)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 Float4 GGGG => ref *(Float4*)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 Float4 GGGB => ref *(Float4*)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 Float4 GGGA => ref *(Float4*)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 Float4 GGBR => ref *(Float4*)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 Float4 GGBG => ref *(Float4*)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 Float4 GGBB => ref *(Float4*)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 Float4 GGBA => ref *(Float4*)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 Float4 GGAR => ref *(Float4*)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 Float4 GGAG => ref *(Float4*)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 Float4 GGAB => ref *(Float4*)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 Float4 GGAA => ref *(Float4*)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 Float4 GBRR => ref *(Float4*)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 Float4 GBRG => ref *(Float4*)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 Float4 GBRB => ref *(Float4*)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 Float4 GBRA => ref *(Float4*)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 Float4 GBGR => ref *(Float4*)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 Float4 GBGG => ref *(Float4*)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 Float4 GBGB => ref *(Float4*)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 Float4 GBGA => ref *(Float4*)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 Float4 GBBR => ref *(Float4*)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 Float4 GBBG => ref *(Float4*)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 Float4 GBBB => ref *(Float4*)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 Float4 GBBA => ref *(Float4*)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 Float4 GBAR => ref *(Float4*)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 Float4 GBAG => ref *(Float4*)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 Float4 GBAB => ref *(Float4*)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 Float4 GBAA => ref *(Float4*)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 Float4 GARR => ref *(Float4*)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 Float4 GARG => ref *(Float4*)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 Float4 GARB => ref *(Float4*)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 Float4 GARA => ref *(Float4*)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 Float4 GAGR => ref *(Float4*)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 Float4 GAGG => ref *(Float4*)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 Float4 GAGB => ref *(Float4*)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 Float4 GAGA => ref *(Float4*)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 Float4 GABR => ref *(Float4*)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 Float4 GABG => ref *(Float4*)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 Float4 GABB => ref *(Float4*)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 Float4 GABA => ref *(Float4*)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 Float4 GAAR => ref *(Float4*)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 Float4 GAAG => ref *(Float4*)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 Float4 GAAB => ref *(Float4*)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 Float4 GAAA => ref *(Float4*)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 Float4 BRRR => ref *(Float4*)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 Float4 BRRG => ref *(Float4*)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 Float4 BRRB => ref *(Float4*)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 Float4 BRRA => ref *(Float4*)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 Float4 BRGR => ref *(Float4*)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 Float4 BRGG => ref *(Float4*)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 Float4 BRGB => ref *(Float4*)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 Float4 BRGA => ref *(Float4*)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 Float4 BRBR => ref *(Float4*)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 Float4 BRBG => ref *(Float4*)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 Float4 BRBB => ref *(Float4*)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 Float4 BRBA => ref *(Float4*)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 Float4 BRAR => ref *(Float4*)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 Float4 BRAG => ref *(Float4*)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 Float4 BRAB => ref *(Float4*)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 Float4 BRAA => ref *(Float4*)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 Float4 BGRR => ref *(Float4*)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 Float4 BGRG => ref *(Float4*)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 Float4 BGRB => ref *(Float4*)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 Float4 BGRA => ref *(Float4*)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 Float4 BGGR => ref *(Float4*)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 Float4 BGGG => ref *(Float4*)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 Float4 BGGB => ref *(Float4*)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 Float4 BGGA => ref *(Float4*)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 Float4 BGBR => ref *(Float4*)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 Float4 BGBG => ref *(Float4*)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 Float4 BGBB => ref *(Float4*)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 Float4 BGBA => ref *(Float4*)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 Float4 BGAR => ref *(Float4*)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 Float4 BGAG => ref *(Float4*)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 Float4 BGAB => ref *(Float4*)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 Float4 BGAA => ref *(Float4*)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 Float4 BBRR => ref *(Float4*)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 Float4 BBRG => ref *(Float4*)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 Float4 BBRB => ref *(Float4*)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 Float4 BBRA => ref *(Float4*)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 Float4 BBGR => ref *(Float4*)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 Float4 BBGG => ref *(Float4*)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 Float4 BBGB => ref *(Float4*)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 Float4 BBGA => ref *(Float4*)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 Float4 BBBR => ref *(Float4*)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 Float4 BBBG => ref *(Float4*)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 Float4 BBBB => ref *(Float4*)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 Float4 BBBA => ref *(Float4*)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 Float4 BBAR => ref *(Float4*)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 Float4 BBAG => ref *(Float4*)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 Float4 BBAB => ref *(Float4*)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 Float4 BBAA => ref *(Float4*)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 Float4 BARR => ref *(Float4*)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 Float4 BARG => ref *(Float4*)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 Float4 BARB => ref *(Float4*)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 Float4 BARA => ref *(Float4*)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 Float4 BAGR => ref *(Float4*)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 Float4 BAGG => ref *(Float4*)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 Float4 BAGB => ref *(Float4*)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 Float4 BAGA => ref *(Float4*)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 Float4 BABR => ref *(Float4*)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 Float4 BABG => ref *(Float4*)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 Float4 BABB => ref *(Float4*)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 Float4 BABA => ref *(Float4*)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 Float4 BAAR => ref *(Float4*)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 Float4 BAAG => ref *(Float4*)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 Float4 BAAB => ref *(Float4*)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 Float4 BAAA => ref *(Float4*)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 Float4 ARRR => ref *(Float4*)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 Float4 ARRG => ref *(Float4*)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 Float4 ARRB => ref *(Float4*)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 Float4 ARRA => ref *(Float4*)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 Float4 ARGR => ref *(Float4*)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 Float4 ARGG => ref *(Float4*)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 Float4 ARGB => ref *(Float4*)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 Float4 ARGA => ref *(Float4*)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 Float4 ARBR => ref *(Float4*)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 Float4 ARBG => ref *(Float4*)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 Float4 ARBB => ref *(Float4*)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 Float4 ARBA => ref *(Float4*)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 Float4 ARAR => ref *(Float4*)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 Float4 ARAG => ref *(Float4*)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 Float4 ARAB => ref *(Float4*)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 Float4 ARAA => ref *(Float4*)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 Float4 AGRR => ref *(Float4*)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 Float4 AGRG => ref *(Float4*)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 Float4 AGRB => ref *(Float4*)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 Float4 AGRA => ref *(Float4*)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 Float4 AGGR => ref *(Float4*)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 Float4 AGGG => ref *(Float4*)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 Float4 AGGB => ref *(Float4*)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 Float4 AGGA => ref *(Float4*)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 Float4 AGBR => ref *(Float4*)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 Float4 AGBG => ref *(Float4*)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 Float4 AGBB => ref *(Float4*)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 Float4 AGBA => ref *(Float4*)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 Float4 AGAR => ref *(Float4*)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 Float4 AGAG => ref *(Float4*)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 Float4 AGAB => ref *(Float4*)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 Float4 AGAA => ref *(Float4*)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 Float4 ABRR => ref *(Float4*)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 Float4 ABRG => ref *(Float4*)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 Float4 ABRB => ref *(Float4*)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 Float4 ABRA => ref *(Float4*)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 Float4 ABGR => ref *(Float4*)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 Float4 ABGG => ref *(Float4*)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 Float4 ABGB => ref *(Float4*)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 Float4 ABGA => ref *(Float4*)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 Float4 ABBR => ref *(Float4*)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 Float4 ABBG => ref *(Float4*)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 Float4 ABBB => ref *(Float4*)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 Float4 ABBA => ref *(Float4*)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 Float4 ABAR => ref *(Float4*)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 Float4 ABAG => ref *(Float4*)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 Float4 ABAB => ref *(Float4*)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 Float4 ABAA => ref *(Float4*)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 Float4 AARR => ref *(Float4*)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 Float4 AARG => ref *(Float4*)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 Float4 AARB => ref *(Float4*)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 Float4 AARA => ref *(Float4*)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 Float4 AAGR => ref *(Float4*)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 Float4 AAGG => ref *(Float4*)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 Float4 AAGB => ref *(Float4*)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 Float4 AAGA => ref *(Float4*)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 Float4 AABR => ref *(Float4*)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 Float4 AABG => ref *(Float4*)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 Float4 AABB => ref *(Float4*)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 Float4 AABA => ref *(Float4*)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 Float4 AAAR => ref *(Float4*)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 Float4 AAAG => ref *(Float4*)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 Float4 AAAB => ref *(Float4*)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 Float4 AAAA => ref *(Float4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4), sizeof(Float4)); - - [FieldOffset(0)] - private float x; - - [FieldOffset(4)] - private float y; - - [FieldOffset(8)] - private float z; - - [FieldOffset(12)] - private float w; - - /// - /// 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 float this[int i] => ref *(float*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref float 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 float Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref float Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the W component. - /// - public readonly ref float W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Float2 XX => ref *(Float2*)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 Float2 XY => ref *(Float2*)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 Float2 XZ => ref *(Float2*)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 Float2 XW => ref *(Float2*)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 Float2 YX => ref *(Float2*)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 Float2 YY => ref *(Float2*)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 Float2 YZ => ref *(Float2*)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 Float2 YW => ref *(Float2*)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 Float2 ZX => ref *(Float2*)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 Float2 ZY => ref *(Float2*)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 Float2 ZZ => ref *(Float2*)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 Float2 ZW => ref *(Float2*)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 Float2 WX => ref *(Float2*)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 Float2 WY => ref *(Float2*)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 Float2 WZ => ref *(Float2*)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 Float2 WW => ref *(Float2*)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 Float3 XXX => ref *(Float3*)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 Float3 XXY => ref *(Float3*)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 Float3 XXZ => ref *(Float3*)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 Float3 XXW => ref *(Float3*)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 Float3 XYX => ref *(Float3*)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 Float3 XYY => ref *(Float3*)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 Float3 XYZ => ref *(Float3*)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 Float3 XYW => ref *(Float3*)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 Float3 XZX => ref *(Float3*)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 Float3 XZY => ref *(Float3*)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 Float3 XZZ => ref *(Float3*)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 Float3 XZW => ref *(Float3*)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 Float3 XWX => ref *(Float3*)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 Float3 XWY => ref *(Float3*)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 Float3 XWZ => ref *(Float3*)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 Float3 XWW => ref *(Float3*)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 Float3 YXX => ref *(Float3*)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 Float3 YXY => ref *(Float3*)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 Float3 YXZ => ref *(Float3*)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 Float3 YXW => ref *(Float3*)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 Float3 YYX => ref *(Float3*)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 Float3 YYY => ref *(Float3*)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 Float3 YYZ => ref *(Float3*)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 Float3 YYW => ref *(Float3*)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 Float3 YZX => ref *(Float3*)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 Float3 YZY => ref *(Float3*)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 Float3 YZZ => ref *(Float3*)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 Float3 YZW => ref *(Float3*)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 Float3 YWX => ref *(Float3*)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 Float3 YWY => ref *(Float3*)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 Float3 YWZ => ref *(Float3*)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 Float3 YWW => ref *(Float3*)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 Float3 ZXX => ref *(Float3*)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 Float3 ZXY => ref *(Float3*)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 Float3 ZXZ => ref *(Float3*)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 Float3 ZXW => ref *(Float3*)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 Float3 ZYX => ref *(Float3*)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 Float3 ZYY => ref *(Float3*)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 Float3 ZYZ => ref *(Float3*)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 Float3 ZYW => ref *(Float3*)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 Float3 ZZX => ref *(Float3*)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 Float3 ZZY => ref *(Float3*)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 Float3 ZZZ => ref *(Float3*)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 Float3 ZZW => ref *(Float3*)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 Float3 ZWX => ref *(Float3*)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 Float3 ZWY => ref *(Float3*)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 Float3 ZWZ => ref *(Float3*)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 Float3 ZWW => ref *(Float3*)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 Float3 WXX => ref *(Float3*)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 Float3 WXY => ref *(Float3*)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 Float3 WXZ => ref *(Float3*)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 Float3 WXW => ref *(Float3*)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 Float3 WYX => ref *(Float3*)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 Float3 WYY => ref *(Float3*)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 Float3 WYZ => ref *(Float3*)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 Float3 WYW => ref *(Float3*)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 Float3 WZX => ref *(Float3*)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 Float3 WZY => ref *(Float3*)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 Float3 WZZ => ref *(Float3*)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 Float3 WZW => ref *(Float3*)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 Float3 WWX => ref *(Float3*)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 Float3 WWY => ref *(Float3*)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 Float3 WWZ => ref *(Float3*)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 Float3 WWW => ref *(Float3*)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 Float4 XXXX => ref *(Float4*)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 Float4 XXXY => ref *(Float4*)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 Float4 XXXZ => ref *(Float4*)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 Float4 XXXW => ref *(Float4*)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 Float4 XXYX => ref *(Float4*)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 Float4 XXYY => ref *(Float4*)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 Float4 XXYZ => ref *(Float4*)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 Float4 XXYW => ref *(Float4*)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 Float4 XXZX => ref *(Float4*)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 Float4 XXZY => ref *(Float4*)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 Float4 XXZZ => ref *(Float4*)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 Float4 XXZW => ref *(Float4*)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 Float4 XXWX => ref *(Float4*)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 Float4 XXWY => ref *(Float4*)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 Float4 XXWZ => ref *(Float4*)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 Float4 XXWW => ref *(Float4*)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 Float4 XYXX => ref *(Float4*)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 Float4 XYXY => ref *(Float4*)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 Float4 XYXZ => ref *(Float4*)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 Float4 XYXW => ref *(Float4*)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 Float4 XYYX => ref *(Float4*)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 Float4 XYYY => ref *(Float4*)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 Float4 XYYZ => ref *(Float4*)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 Float4 XYYW => ref *(Float4*)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 Float4 XYZX => ref *(Float4*)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 Float4 XYZY => ref *(Float4*)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 Float4 XYZZ => ref *(Float4*)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 Float4 XYZW => ref *(Float4*)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 Float4 XYWX => ref *(Float4*)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 Float4 XYWY => ref *(Float4*)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 Float4 XYWZ => ref *(Float4*)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 Float4 XYWW => ref *(Float4*)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 Float4 XZXX => ref *(Float4*)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 Float4 XZXY => ref *(Float4*)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 Float4 XZXZ => ref *(Float4*)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 Float4 XZXW => ref *(Float4*)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 Float4 XZYX => ref *(Float4*)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 Float4 XZYY => ref *(Float4*)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 Float4 XZYZ => ref *(Float4*)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 Float4 XZYW => ref *(Float4*)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 Float4 XZZX => ref *(Float4*)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 Float4 XZZY => ref *(Float4*)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 Float4 XZZZ => ref *(Float4*)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 Float4 XZZW => ref *(Float4*)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 Float4 XZWX => ref *(Float4*)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 Float4 XZWY => ref *(Float4*)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 Float4 XZWZ => ref *(Float4*)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 Float4 XZWW => ref *(Float4*)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 Float4 XWXX => ref *(Float4*)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 Float4 XWXY => ref *(Float4*)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 Float4 XWXZ => ref *(Float4*)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 Float4 XWXW => ref *(Float4*)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 Float4 XWYX => ref *(Float4*)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 Float4 XWYY => ref *(Float4*)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 Float4 XWYZ => ref *(Float4*)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 Float4 XWYW => ref *(Float4*)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 Float4 XWZX => ref *(Float4*)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 Float4 XWZY => ref *(Float4*)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 Float4 XWZZ => ref *(Float4*)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 Float4 XWZW => ref *(Float4*)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 Float4 XWWX => ref *(Float4*)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 Float4 XWWY => ref *(Float4*)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 Float4 XWWZ => ref *(Float4*)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 Float4 XWWW => ref *(Float4*)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 Float4 YXXX => ref *(Float4*)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 Float4 YXXY => ref *(Float4*)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 Float4 YXXZ => ref *(Float4*)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 Float4 YXXW => ref *(Float4*)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 Float4 YXYX => ref *(Float4*)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 Float4 YXYY => ref *(Float4*)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 Float4 YXYZ => ref *(Float4*)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 Float4 YXYW => ref *(Float4*)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 Float4 YXZX => ref *(Float4*)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 Float4 YXZY => ref *(Float4*)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 Float4 YXZZ => ref *(Float4*)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 Float4 YXZW => ref *(Float4*)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 Float4 YXWX => ref *(Float4*)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 Float4 YXWY => ref *(Float4*)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 Float4 YXWZ => ref *(Float4*)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 Float4 YXWW => ref *(Float4*)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 Float4 YYXX => ref *(Float4*)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 Float4 YYXY => ref *(Float4*)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 Float4 YYXZ => ref *(Float4*)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 Float4 YYXW => ref *(Float4*)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 Float4 YYYX => ref *(Float4*)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 Float4 YYYY => ref *(Float4*)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 Float4 YYYZ => ref *(Float4*)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 Float4 YYYW => ref *(Float4*)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 Float4 YYZX => ref *(Float4*)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 Float4 YYZY => ref *(Float4*)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 Float4 YYZZ => ref *(Float4*)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 Float4 YYZW => ref *(Float4*)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 Float4 YYWX => ref *(Float4*)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 Float4 YYWY => ref *(Float4*)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 Float4 YYWZ => ref *(Float4*)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 Float4 YYWW => ref *(Float4*)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 Float4 YZXX => ref *(Float4*)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 Float4 YZXY => ref *(Float4*)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 Float4 YZXZ => ref *(Float4*)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 Float4 YZXW => ref *(Float4*)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 Float4 YZYX => ref *(Float4*)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 Float4 YZYY => ref *(Float4*)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 Float4 YZYZ => ref *(Float4*)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 Float4 YZYW => ref *(Float4*)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 Float4 YZZX => ref *(Float4*)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 Float4 YZZY => ref *(Float4*)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 Float4 YZZZ => ref *(Float4*)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 Float4 YZZW => ref *(Float4*)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 Float4 YZWX => ref *(Float4*)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 Float4 YZWY => ref *(Float4*)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 Float4 YZWZ => ref *(Float4*)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 Float4 YZWW => ref *(Float4*)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 Float4 YWXX => ref *(Float4*)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 Float4 YWXY => ref *(Float4*)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 Float4 YWXZ => ref *(Float4*)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 Float4 YWXW => ref *(Float4*)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 Float4 YWYX => ref *(Float4*)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 Float4 YWYY => ref *(Float4*)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 Float4 YWYZ => ref *(Float4*)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 Float4 YWYW => ref *(Float4*)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 Float4 YWZX => ref *(Float4*)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 Float4 YWZY => ref *(Float4*)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 Float4 YWZZ => ref *(Float4*)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 Float4 YWZW => ref *(Float4*)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 Float4 YWWX => ref *(Float4*)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 Float4 YWWY => ref *(Float4*)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 Float4 YWWZ => ref *(Float4*)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 Float4 YWWW => ref *(Float4*)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 Float4 ZXXX => ref *(Float4*)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 Float4 ZXXY => ref *(Float4*)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 Float4 ZXXZ => ref *(Float4*)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 Float4 ZXXW => ref *(Float4*)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 Float4 ZXYX => ref *(Float4*)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 Float4 ZXYY => ref *(Float4*)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 Float4 ZXYZ => ref *(Float4*)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 Float4 ZXYW => ref *(Float4*)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 Float4 ZXZX => ref *(Float4*)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 Float4 ZXZY => ref *(Float4*)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 Float4 ZXZZ => ref *(Float4*)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 Float4 ZXZW => ref *(Float4*)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 Float4 ZXWX => ref *(Float4*)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 Float4 ZXWY => ref *(Float4*)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 Float4 ZXWZ => ref *(Float4*)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 Float4 ZXWW => ref *(Float4*)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 Float4 ZYXX => ref *(Float4*)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 Float4 ZYXY => ref *(Float4*)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 Float4 ZYXZ => ref *(Float4*)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 Float4 ZYXW => ref *(Float4*)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 Float4 ZYYX => ref *(Float4*)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 Float4 ZYYY => ref *(Float4*)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 Float4 ZYYZ => ref *(Float4*)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 Float4 ZYYW => ref *(Float4*)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 Float4 ZYZX => ref *(Float4*)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 Float4 ZYZY => ref *(Float4*)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 Float4 ZYZZ => ref *(Float4*)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 Float4 ZYZW => ref *(Float4*)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 Float4 ZYWX => ref *(Float4*)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 Float4 ZYWY => ref *(Float4*)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 Float4 ZYWZ => ref *(Float4*)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 Float4 ZYWW => ref *(Float4*)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 Float4 ZZXX => ref *(Float4*)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 Float4 ZZXY => ref *(Float4*)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 Float4 ZZXZ => ref *(Float4*)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 Float4 ZZXW => ref *(Float4*)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 Float4 ZZYX => ref *(Float4*)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 Float4 ZZYY => ref *(Float4*)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 Float4 ZZYZ => ref *(Float4*)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 Float4 ZZYW => ref *(Float4*)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 Float4 ZZZX => ref *(Float4*)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 Float4 ZZZY => ref *(Float4*)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 Float4 ZZZZ => ref *(Float4*)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 Float4 ZZZW => ref *(Float4*)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 Float4 ZZWX => ref *(Float4*)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 Float4 ZZWY => ref *(Float4*)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 Float4 ZZWZ => ref *(Float4*)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 Float4 ZZWW => ref *(Float4*)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 Float4 ZWXX => ref *(Float4*)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 Float4 ZWXY => ref *(Float4*)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 Float4 ZWXZ => ref *(Float4*)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 Float4 ZWXW => ref *(Float4*)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 Float4 ZWYX => ref *(Float4*)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 Float4 ZWYY => ref *(Float4*)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 Float4 ZWYZ => ref *(Float4*)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 Float4 ZWYW => ref *(Float4*)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 Float4 ZWZX => ref *(Float4*)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 Float4 ZWZY => ref *(Float4*)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 Float4 ZWZZ => ref *(Float4*)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 Float4 ZWZW => ref *(Float4*)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 Float4 ZWWX => ref *(Float4*)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 Float4 ZWWY => ref *(Float4*)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 Float4 ZWWZ => ref *(Float4*)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 Float4 ZWWW => ref *(Float4*)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 Float4 WXXX => ref *(Float4*)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 Float4 WXXY => ref *(Float4*)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 Float4 WXXZ => ref *(Float4*)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 Float4 WXXW => ref *(Float4*)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 Float4 WXYX => ref *(Float4*)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 Float4 WXYY => ref *(Float4*)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 Float4 WXYZ => ref *(Float4*)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 Float4 WXYW => ref *(Float4*)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 Float4 WXZX => ref *(Float4*)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 Float4 WXZY => ref *(Float4*)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 Float4 WXZZ => ref *(Float4*)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 Float4 WXZW => ref *(Float4*)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 Float4 WXWX => ref *(Float4*)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 Float4 WXWY => ref *(Float4*)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 Float4 WXWZ => ref *(Float4*)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 Float4 WXWW => ref *(Float4*)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 Float4 WYXX => ref *(Float4*)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 Float4 WYXY => ref *(Float4*)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 Float4 WYXZ => ref *(Float4*)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 Float4 WYXW => ref *(Float4*)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 Float4 WYYX => ref *(Float4*)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 Float4 WYYY => ref *(Float4*)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 Float4 WYYZ => ref *(Float4*)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 Float4 WYYW => ref *(Float4*)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 Float4 WYZX => ref *(Float4*)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 Float4 WYZY => ref *(Float4*)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 Float4 WYZZ => ref *(Float4*)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 Float4 WYZW => ref *(Float4*)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 Float4 WYWX => ref *(Float4*)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 Float4 WYWY => ref *(Float4*)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 Float4 WYWZ => ref *(Float4*)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 Float4 WYWW => ref *(Float4*)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 Float4 WZXX => ref *(Float4*)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 Float4 WZXY => ref *(Float4*)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 Float4 WZXZ => ref *(Float4*)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 Float4 WZXW => ref *(Float4*)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 Float4 WZYX => ref *(Float4*)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 Float4 WZYY => ref *(Float4*)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 Float4 WZYZ => ref *(Float4*)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 Float4 WZYW => ref *(Float4*)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 Float4 WZZX => ref *(Float4*)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 Float4 WZZY => ref *(Float4*)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 Float4 WZZZ => ref *(Float4*)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 Float4 WZZW => ref *(Float4*)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 Float4 WZWX => ref *(Float4*)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 Float4 WZWY => ref *(Float4*)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 Float4 WZWZ => ref *(Float4*)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 Float4 WZWW => ref *(Float4*)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 Float4 WWXX => ref *(Float4*)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 Float4 WWXY => ref *(Float4*)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 Float4 WWXZ => ref *(Float4*)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 Float4 WWXW => ref *(Float4*)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 Float4 WWYX => ref *(Float4*)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 Float4 WWYY => ref *(Float4*)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 Float4 WWYZ => ref *(Float4*)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 Float4 WWYW => ref *(Float4*)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 Float4 WWZX => ref *(Float4*)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 Float4 WWZY => ref *(Float4*)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 Float4 WWZZ => ref *(Float4*)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 Float4 WWZW => ref *(Float4*)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 Float4 WWWX => ref *(Float4*)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 Float4 WWWY => ref *(Float4*)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 Float4 WWWZ => ref *(Float4*)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 Float4 WWWW => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref float 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 float G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref float B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the A component. - /// - public readonly ref float A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 Float2 RR => ref *(Float2*)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 Float2 RG => ref *(Float2*)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 Float2 RB => ref *(Float2*)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 Float2 RA => ref *(Float2*)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 Float2 GR => ref *(Float2*)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 Float2 GG => ref *(Float2*)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 Float2 GB => ref *(Float2*)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 Float2 GA => ref *(Float2*)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 Float2 BR => ref *(Float2*)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 Float2 BG => ref *(Float2*)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 Float2 BB => ref *(Float2*)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 Float2 BA => ref *(Float2*)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 Float2 AR => ref *(Float2*)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 Float2 AG => ref *(Float2*)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 Float2 AB => ref *(Float2*)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 Float2 AA => ref *(Float2*)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 Float3 RRR => ref *(Float3*)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 Float3 RRG => ref *(Float3*)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 Float3 RRB => ref *(Float3*)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 Float3 RRA => ref *(Float3*)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 Float3 RGR => ref *(Float3*)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 Float3 RGG => ref *(Float3*)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 Float3 RGB => ref *(Float3*)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 Float3 RGA => ref *(Float3*)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 Float3 RBR => ref *(Float3*)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 Float3 RBG => ref *(Float3*)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 Float3 RBB => ref *(Float3*)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 Float3 RBA => ref *(Float3*)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 Float3 RAR => ref *(Float3*)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 Float3 RAG => ref *(Float3*)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 Float3 RAB => ref *(Float3*)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 Float3 RAA => ref *(Float3*)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 Float3 GRR => ref *(Float3*)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 Float3 GRG => ref *(Float3*)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 Float3 GRB => ref *(Float3*)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 Float3 GRA => ref *(Float3*)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 Float3 GGR => ref *(Float3*)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 Float3 GGG => ref *(Float3*)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 Float3 GGB => ref *(Float3*)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 Float3 GGA => ref *(Float3*)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 Float3 GBR => ref *(Float3*)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 Float3 GBG => ref *(Float3*)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 Float3 GBB => ref *(Float3*)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 Float3 GBA => ref *(Float3*)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 Float3 GAR => ref *(Float3*)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 Float3 GAG => ref *(Float3*)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 Float3 GAB => ref *(Float3*)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 Float3 GAA => ref *(Float3*)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 Float3 BRR => ref *(Float3*)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 Float3 BRG => ref *(Float3*)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 Float3 BRB => ref *(Float3*)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 Float3 BRA => ref *(Float3*)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 Float3 BGR => ref *(Float3*)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 Float3 BGG => ref *(Float3*)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 Float3 BGB => ref *(Float3*)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 Float3 BGA => ref *(Float3*)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 Float3 BBR => ref *(Float3*)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 Float3 BBG => ref *(Float3*)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 Float3 BBB => ref *(Float3*)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 Float3 BBA => ref *(Float3*)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 Float3 BAR => ref *(Float3*)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 Float3 BAG => ref *(Float3*)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 Float3 BAB => ref *(Float3*)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 Float3 BAA => ref *(Float3*)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 Float3 ARR => ref *(Float3*)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 Float3 ARG => ref *(Float3*)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 Float3 ARB => ref *(Float3*)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 Float3 ARA => ref *(Float3*)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 Float3 AGR => ref *(Float3*)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 Float3 AGG => ref *(Float3*)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 Float3 AGB => ref *(Float3*)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 Float3 AGA => ref *(Float3*)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 Float3 ABR => ref *(Float3*)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 Float3 ABG => ref *(Float3*)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 Float3 ABB => ref *(Float3*)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 Float3 ABA => ref *(Float3*)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 Float3 AAR => ref *(Float3*)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 Float3 AAG => ref *(Float3*)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 Float3 AAB => ref *(Float3*)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 Float3 AAA => ref *(Float3*)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 Float4 RRRR => ref *(Float4*)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 Float4 RRRG => ref *(Float4*)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 Float4 RRRB => ref *(Float4*)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 Float4 RRRA => ref *(Float4*)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 Float4 RRGR => ref *(Float4*)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 Float4 RRGG => ref *(Float4*)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 Float4 RRGB => ref *(Float4*)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 Float4 RRGA => ref *(Float4*)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 Float4 RRBR => ref *(Float4*)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 Float4 RRBG => ref *(Float4*)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 Float4 RRBB => ref *(Float4*)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 Float4 RRBA => ref *(Float4*)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 Float4 RRAR => ref *(Float4*)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 Float4 RRAG => ref *(Float4*)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 Float4 RRAB => ref *(Float4*)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 Float4 RRAA => ref *(Float4*)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 Float4 RGRR => ref *(Float4*)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 Float4 RGRG => ref *(Float4*)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 Float4 RGRB => ref *(Float4*)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 Float4 RGRA => ref *(Float4*)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 Float4 RGGR => ref *(Float4*)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 Float4 RGGG => ref *(Float4*)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 Float4 RGGB => ref *(Float4*)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 Float4 RGGA => ref *(Float4*)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 Float4 RGBR => ref *(Float4*)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 Float4 RGBG => ref *(Float4*)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 Float4 RGBB => ref *(Float4*)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 Float4 RGBA => ref *(Float4*)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 Float4 RGAR => ref *(Float4*)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 Float4 RGAG => ref *(Float4*)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 Float4 RGAB => ref *(Float4*)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 Float4 RGAA => ref *(Float4*)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 Float4 RBRR => ref *(Float4*)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 Float4 RBRG => ref *(Float4*)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 Float4 RBRB => ref *(Float4*)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 Float4 RBRA => ref *(Float4*)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 Float4 RBGR => ref *(Float4*)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 Float4 RBGG => ref *(Float4*)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 Float4 RBGB => ref *(Float4*)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 Float4 RBGA => ref *(Float4*)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 Float4 RBBR => ref *(Float4*)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 Float4 RBBG => ref *(Float4*)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 Float4 RBBB => ref *(Float4*)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 Float4 RBBA => ref *(Float4*)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 Float4 RBAR => ref *(Float4*)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 Float4 RBAG => ref *(Float4*)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 Float4 RBAB => ref *(Float4*)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 Float4 RBAA => ref *(Float4*)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 Float4 RARR => ref *(Float4*)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 Float4 RARG => ref *(Float4*)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 Float4 RARB => ref *(Float4*)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 Float4 RARA => ref *(Float4*)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 Float4 RAGR => ref *(Float4*)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 Float4 RAGG => ref *(Float4*)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 Float4 RAGB => ref *(Float4*)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 Float4 RAGA => ref *(Float4*)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 Float4 RABR => ref *(Float4*)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 Float4 RABG => ref *(Float4*)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 Float4 RABB => ref *(Float4*)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 Float4 RABA => ref *(Float4*)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 Float4 RAAR => ref *(Float4*)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 Float4 RAAG => ref *(Float4*)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 Float4 RAAB => ref *(Float4*)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 Float4 RAAA => ref *(Float4*)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 Float4 GRRR => ref *(Float4*)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 Float4 GRRG => ref *(Float4*)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 Float4 GRRB => ref *(Float4*)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 Float4 GRRA => ref *(Float4*)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 Float4 GRGR => ref *(Float4*)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 Float4 GRGG => ref *(Float4*)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 Float4 GRGB => ref *(Float4*)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 Float4 GRGA => ref *(Float4*)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 Float4 GRBR => ref *(Float4*)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 Float4 GRBG => ref *(Float4*)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 Float4 GRBB => ref *(Float4*)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 Float4 GRBA => ref *(Float4*)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 Float4 GRAR => ref *(Float4*)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 Float4 GRAG => ref *(Float4*)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 Float4 GRAB => ref *(Float4*)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 Float4 GRAA => ref *(Float4*)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 Float4 GGRR => ref *(Float4*)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 Float4 GGRG => ref *(Float4*)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 Float4 GGRB => ref *(Float4*)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 Float4 GGRA => ref *(Float4*)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 Float4 GGGR => ref *(Float4*)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 Float4 GGGG => ref *(Float4*)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 Float4 GGGB => ref *(Float4*)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 Float4 GGGA => ref *(Float4*)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 Float4 GGBR => ref *(Float4*)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 Float4 GGBG => ref *(Float4*)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 Float4 GGBB => ref *(Float4*)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 Float4 GGBA => ref *(Float4*)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 Float4 GGAR => ref *(Float4*)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 Float4 GGAG => ref *(Float4*)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 Float4 GGAB => ref *(Float4*)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 Float4 GGAA => ref *(Float4*)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 Float4 GBRR => ref *(Float4*)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 Float4 GBRG => ref *(Float4*)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 Float4 GBRB => ref *(Float4*)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 Float4 GBRA => ref *(Float4*)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 Float4 GBGR => ref *(Float4*)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 Float4 GBGG => ref *(Float4*)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 Float4 GBGB => ref *(Float4*)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 Float4 GBGA => ref *(Float4*)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 Float4 GBBR => ref *(Float4*)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 Float4 GBBG => ref *(Float4*)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 Float4 GBBB => ref *(Float4*)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 Float4 GBBA => ref *(Float4*)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 Float4 GBAR => ref *(Float4*)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 Float4 GBAG => ref *(Float4*)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 Float4 GBAB => ref *(Float4*)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 Float4 GBAA => ref *(Float4*)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 Float4 GARR => ref *(Float4*)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 Float4 GARG => ref *(Float4*)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 Float4 GARB => ref *(Float4*)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 Float4 GARA => ref *(Float4*)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 Float4 GAGR => ref *(Float4*)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 Float4 GAGG => ref *(Float4*)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 Float4 GAGB => ref *(Float4*)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 Float4 GAGA => ref *(Float4*)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 Float4 GABR => ref *(Float4*)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 Float4 GABG => ref *(Float4*)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 Float4 GABB => ref *(Float4*)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 Float4 GABA => ref *(Float4*)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 Float4 GAAR => ref *(Float4*)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 Float4 GAAG => ref *(Float4*)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 Float4 GAAB => ref *(Float4*)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 Float4 GAAA => ref *(Float4*)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 Float4 BRRR => ref *(Float4*)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 Float4 BRRG => ref *(Float4*)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 Float4 BRRB => ref *(Float4*)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 Float4 BRRA => ref *(Float4*)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 Float4 BRGR => ref *(Float4*)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 Float4 BRGG => ref *(Float4*)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 Float4 BRGB => ref *(Float4*)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 Float4 BRGA => ref *(Float4*)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 Float4 BRBR => ref *(Float4*)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 Float4 BRBG => ref *(Float4*)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 Float4 BRBB => ref *(Float4*)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 Float4 BRBA => ref *(Float4*)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 Float4 BRAR => ref *(Float4*)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 Float4 BRAG => ref *(Float4*)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 Float4 BRAB => ref *(Float4*)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 Float4 BRAA => ref *(Float4*)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 Float4 BGRR => ref *(Float4*)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 Float4 BGRG => ref *(Float4*)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 Float4 BGRB => ref *(Float4*)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 Float4 BGRA => ref *(Float4*)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 Float4 BGGR => ref *(Float4*)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 Float4 BGGG => ref *(Float4*)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 Float4 BGGB => ref *(Float4*)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 Float4 BGGA => ref *(Float4*)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 Float4 BGBR => ref *(Float4*)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 Float4 BGBG => ref *(Float4*)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 Float4 BGBB => ref *(Float4*)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 Float4 BGBA => ref *(Float4*)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 Float4 BGAR => ref *(Float4*)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 Float4 BGAG => ref *(Float4*)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 Float4 BGAB => ref *(Float4*)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 Float4 BGAA => ref *(Float4*)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 Float4 BBRR => ref *(Float4*)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 Float4 BBRG => ref *(Float4*)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 Float4 BBRB => ref *(Float4*)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 Float4 BBRA => ref *(Float4*)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 Float4 BBGR => ref *(Float4*)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 Float4 BBGG => ref *(Float4*)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 Float4 BBGB => ref *(Float4*)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 Float4 BBGA => ref *(Float4*)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 Float4 BBBR => ref *(Float4*)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 Float4 BBBG => ref *(Float4*)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 Float4 BBBB => ref *(Float4*)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 Float4 BBBA => ref *(Float4*)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 Float4 BBAR => ref *(Float4*)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 Float4 BBAG => ref *(Float4*)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 Float4 BBAB => ref *(Float4*)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 Float4 BBAA => ref *(Float4*)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 Float4 BARR => ref *(Float4*)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 Float4 BARG => ref *(Float4*)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 Float4 BARB => ref *(Float4*)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 Float4 BARA => ref *(Float4*)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 Float4 BAGR => ref *(Float4*)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 Float4 BAGG => ref *(Float4*)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 Float4 BAGB => ref *(Float4*)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 Float4 BAGA => ref *(Float4*)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 Float4 BABR => ref *(Float4*)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 Float4 BABG => ref *(Float4*)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 Float4 BABB => ref *(Float4*)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 Float4 BABA => ref *(Float4*)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 Float4 BAAR => ref *(Float4*)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 Float4 BAAG => ref *(Float4*)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 Float4 BAAB => ref *(Float4*)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 Float4 BAAA => ref *(Float4*)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 Float4 ARRR => ref *(Float4*)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 Float4 ARRG => ref *(Float4*)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 Float4 ARRB => ref *(Float4*)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 Float4 ARRA => ref *(Float4*)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 Float4 ARGR => ref *(Float4*)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 Float4 ARGG => ref *(Float4*)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 Float4 ARGB => ref *(Float4*)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 Float4 ARGA => ref *(Float4*)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 Float4 ARBR => ref *(Float4*)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 Float4 ARBG => ref *(Float4*)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 Float4 ARBB => ref *(Float4*)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 Float4 ARBA => ref *(Float4*)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 Float4 ARAR => ref *(Float4*)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 Float4 ARAG => ref *(Float4*)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 Float4 ARAB => ref *(Float4*)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 Float4 ARAA => ref *(Float4*)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 Float4 AGRR => ref *(Float4*)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 Float4 AGRG => ref *(Float4*)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 Float4 AGRB => ref *(Float4*)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 Float4 AGRA => ref *(Float4*)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 Float4 AGGR => ref *(Float4*)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 Float4 AGGG => ref *(Float4*)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 Float4 AGGB => ref *(Float4*)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 Float4 AGGA => ref *(Float4*)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 Float4 AGBR => ref *(Float4*)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 Float4 AGBG => ref *(Float4*)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 Float4 AGBB => ref *(Float4*)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 Float4 AGBA => ref *(Float4*)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 Float4 AGAR => ref *(Float4*)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 Float4 AGAG => ref *(Float4*)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 Float4 AGAB => ref *(Float4*)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 Float4 AGAA => ref *(Float4*)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 Float4 ABRR => ref *(Float4*)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 Float4 ABRG => ref *(Float4*)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 Float4 ABRB => ref *(Float4*)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 Float4 ABRA => ref *(Float4*)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 Float4 ABGR => ref *(Float4*)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 Float4 ABGG => ref *(Float4*)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 Float4 ABGB => ref *(Float4*)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 Float4 ABGA => ref *(Float4*)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 Float4 ABBR => ref *(Float4*)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 Float4 ABBG => ref *(Float4*)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 Float4 ABBB => ref *(Float4*)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 Float4 ABBA => ref *(Float4*)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 Float4 ABAR => ref *(Float4*)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 Float4 ABAG => ref *(Float4*)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 Float4 ABAB => ref *(Float4*)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 Float4 ABAA => ref *(Float4*)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 Float4 AARR => ref *(Float4*)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 Float4 AARG => ref *(Float4*)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 Float4 AARB => ref *(Float4*)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 Float4 AARA => ref *(Float4*)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 Float4 AAGR => ref *(Float4*)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 Float4 AAGG => ref *(Float4*)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 Float4 AAGB => ref *(Float4*)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 Float4 AAGA => ref *(Float4*)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 Float4 AABR => ref *(Float4*)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 Float4 AABG => ref *(Float4*)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 Float4 AABB => ref *(Float4*)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 Float4 AABA => ref *(Float4*)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 Float4 AAAR => ref *(Float4*)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 Float4 AAAG => ref *(Float4*)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 Float4 AAAB => ref *(Float4*)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 Float4 AAAA => ref *(Float4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.w.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 xyzw) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.w.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 xyzw) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs b/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs index 3b03b72b..bd06d1dc 100644 --- a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs @@ -5,2944 +5,2943 @@ using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers; using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #endif -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] +public unsafe partial struct Float1x1 { - /// - [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] - public unsafe partial struct Float1x1 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x1), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Float1x1(float m11) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x1), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - public Float1x1(float m11) - { - this.m11 = m11; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 float this[int row] => ref *(float*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// 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 Float1x1(float x) - { - Float1x1 matrix; - - matrix.m11 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + this.m11 = m11; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Float1x2 + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 float this[int row] => ref *(float*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// 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 Float1x1(float x) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x2), sizeof(Float4)); + Float1x1 matrix; - [FieldOffset(0)] - private float m11; + matrix.m11 = x; - [FieldOffset(4)] - private float m12; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - public Float1x2(float m11, float m12) - { - this.m11 = m11; - this.m12 = m12; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// 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 Float1x2(float x) - { - Float1x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Float1x2(Float2 vector) => *(Float1x2*)&vector; + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Float1x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Float1x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x2), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Float1x2(float m11, float m12) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x3), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - public Float1x3(float m11, float m12, float m13) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// 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 Float1x2(float x) + { + Float1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float1x2(Float2 vector) => *(Float1x2*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Float1x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x3), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Float1x3(float m11, float m12, float m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// 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 Float1x3(float x) - { - Float1x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Float1x3(Float3 vector) => *(Float1x3*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// 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 Float1x3(float x) + { + Float1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Float1x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float1x3(Float3 vector) => *(Float1x3*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Float1x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x4), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Float1x4(float m11, float m12, float m13, float m14) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float1x4), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m14; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - public Float1x4(float m11, float m12, float m13, float m14) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// 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 Float1x4(float x) - { - Float1x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Float1x4(Float4 vector) => *(Float1x4*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// 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 Float1x4(float x) + { + Float1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Float2x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float1x4(Float4 vector) => *(Float1x4*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Float2x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x1), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Float2x1(float m11, float m21) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x1), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m21; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - public Float2x1(float m11, float m21) - { - this.m11 = m11; - this.m21 = m21; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 float this[int row] => ref *(float*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 float this[int row] => ref *(float*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// 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 Float2x1(float x) - { - Float2x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Float2(Float2x1 matrix) => *(Float2*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// 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 Float2x1(float x) + { + Float2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float2(Float2x1 matrix) => *(Float2*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Float2x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x2), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m21; + + [FieldOffset(12)] + private float m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Float2x2(float m11, float m12, float m21, float m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Float2x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Float2x2(Float2 row1, Float2 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x2), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m21; - - [FieldOffset(12)] - private float m22; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - public Float2x2(float m11, float m12, float m21, float m22) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Float2x2(Float2 row1, Float2 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// 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 Float2x2(float x) - { - Float2x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// 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 Float2x2(float x) + { + Float2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct Float2x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x3), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m21; + + [FieldOffset(16)] + private float m22; + + [FieldOffset(20)] + private float m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Float2x3(float m11, float m12, float m13, float m21, float m22, float m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct Float2x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Float2x3(Float3 row1, Float3 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x3), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m21; - - [FieldOffset(16)] - private float m22; - - [FieldOffset(20)] - private float m23; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - public Float2x3(float m11, float m12, float m13, float m21, float m22, float m23) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Float2x3(Float3 row1, Float3 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// 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 Float2x3(float x) - { - Float2x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// 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 Float2x3(float x) + { + Float2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct Float2x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x4), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + [FieldOffset(16)] + private float m21; + + [FieldOffset(20)] + private float m22; + + [FieldOffset(24)] + private float m23; + + [FieldOffset(28)] + private float m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Float2x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct Float2x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Float2x4(Float4 row1, Float4 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2x4), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m14; - - [FieldOffset(16)] - private float m21; - - [FieldOffset(20)] - private float m22; - - [FieldOffset(24)] - private float m23; - - [FieldOffset(28)] - private float m24; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - public Float2x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Float2x4(Float4 row1, Float4 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref float M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// 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 Float2x4(float x) - { - Float2x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref float M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// 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 Float2x4(float x) + { + Float2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Float3x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Float3x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x1), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m21; + + [FieldOffset(8)] + private float m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Float3x1(float m11, float m21, float m31) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x1), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m21; - - [FieldOffset(8)] - private float m31; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - public Float3x1(float m11, float m21, float m31) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 float this[int row] => ref *(float*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 float this[int row] => ref *(float*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// 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 Float3x1(float x) - { - Float3x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Float3(Float3x1 matrix) => *(Float3*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// 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 Float3x1(float x) + { + Float3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float3(Float3x1 matrix) => *(Float3*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct Float3x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x2), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m21; + + [FieldOffset(12)] + private float m22; + + [FieldOffset(16)] + private float m31; + + [FieldOffset(20)] + private float m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Float3x2(float m11, float m12, float m21, float m22, float m31, float m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct Float3x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Float3x2(Float2 row1, Float2 row2, Float2 row3) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x2), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m21; - - [FieldOffset(12)] - private float m22; - - [FieldOffset(16)] - private float m31; - - [FieldOffset(20)] - private float m32; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - public Float3x2(float m11, float m12, float m21, float m22, float m31, float m32) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Float3x2(Float2 row1, Float2 row2, Float2 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// 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 Float3x2(float x) - { - Float3x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// 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 Float3x2(float x) + { + Float3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] - public unsafe partial struct Float3x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] +public unsafe partial struct Float3x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x3), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m21; + + [FieldOffset(16)] + private float m22; + + [FieldOffset(20)] + private float m23; + + [FieldOffset(24)] + private float m31; + + [FieldOffset(28)] + private float m32; + + [FieldOffset(32)] + private float m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Float3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x3), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m21; - - [FieldOffset(16)] - private float m22; - - [FieldOffset(20)] - private float m23; - - [FieldOffset(24)] - private float m31; - - [FieldOffset(28)] - private float m32; - - [FieldOffset(32)] - private float m33; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - public Float3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Float3x3(Float3 row1, Float3 row2, Float3 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Float3x3(Float3 row1, Float3 row2, Float3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// 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 Float3x3(float x) - { - Float3x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// 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 Float3x3(float x) + { + Float3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct Float3x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct Float3x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x4), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + [FieldOffset(16)] + private float m21; + + [FieldOffset(20)] + private float m22; + + [FieldOffset(24)] + private float m23; + + [FieldOffset(28)] + private float m24; + + [FieldOffset(32)] + private float m31; + + [FieldOffset(36)] + private float m32; + + [FieldOffset(40)] + private float m33; + + [FieldOffset(44)] + private float m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Float3x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3x4), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m14; - - [FieldOffset(16)] - private float m21; - - [FieldOffset(20)] - private float m22; - - [FieldOffset(24)] - private float m23; - - [FieldOffset(28)] - private float m24; - - [FieldOffset(32)] - private float m31; - - [FieldOffset(36)] - private float m32; - - [FieldOffset(40)] - private float m33; - - [FieldOffset(44)] - private float m34; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - public Float3x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Float3x4(Float4 row1, Float4 row2, Float4 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Float3x4(Float4 row1, Float4 row2, Float4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref float M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref float M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// 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 Float3x4(float x) - { - Float3x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref float M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref float M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// 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 Float3x4(float x) + { + Float3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Float4x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Float4x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x1), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m21; + + [FieldOffset(8)] + private float m31; + + [FieldOffset(12)] + private float m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Float4x1(float m11, float m21, float m31, float m41) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x1), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m21; - - [FieldOffset(8)] - private float m31; - - [FieldOffset(12)] - private float m41; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [4, 1]. - public Float4x1(float m11, float m21, float m31, float m41) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - this.m41 = m41; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 float this[int row] => ref *(float*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 float this[int row] => ref *(float*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// 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 Float4x1(float x) - { - Float4x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - matrix.m41 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Float4(Float4x1 matrix) => *(Float4*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// 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 Float4x1(float x) + { + Float4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float4(Float4x1 matrix) => *(Float4*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct Float4x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x2), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m21; + + [FieldOffset(12)] + private float m22; + + [FieldOffset(16)] + private float m31; + + [FieldOffset(20)] + private float m32; + + [FieldOffset(24)] + private float m41; + + [FieldOffset(28)] + private float m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Float4x2(float m11, float m12, float m21, float m22, float m31, float m32, float m41, float m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct Float4x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Float4x2(Float2 row1, Float2 row2, Float2 row3, Float2 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x2), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m21; - - [FieldOffset(12)] - private float m22; - - [FieldOffset(16)] - private float m31; - - [FieldOffset(20)] - private float m32; - - [FieldOffset(24)] - private float m41; - - [FieldOffset(28)] - private float m42; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - public Float4x2(float m11, float m12, float m21, float m22, float m31, float m32, float m41, float m42) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - this.m41 = m41; - this.m42 = m42; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Float4x2(Float2 row1, Float2 row2, Float2 row3, Float2 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m41 = row4.X; - this.m42 = row4.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float2 this[int row] => ref *(Float2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref float M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// 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 Float4x2(float x) - { - Float4x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m41 = x; - matrix.m42 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref float M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// 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 Float4x2(float x) + { + Float4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct Float4x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x3), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m21; + + [FieldOffset(16)] + private float m22; + + [FieldOffset(20)] + private float m23; + + [FieldOffset(24)] + private float m31; + + [FieldOffset(28)] + private float m32; + + [FieldOffset(32)] + private float m33; + + [FieldOffset(36)] + private float m41; + + [FieldOffset(40)] + private float m42; + + [FieldOffset(44)] + private float m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Float4x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33, float m41, float m42, float m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct Float4x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Float4x3(Float3 row1, Float3 row2, Float3 row3, Float3 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x3), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m21; - - [FieldOffset(16)] - private float m22; - - [FieldOffset(20)] - private float m23; - - [FieldOffset(24)] - private float m31; - - [FieldOffset(28)] - private float m32; - - [FieldOffset(32)] - private float m33; - - [FieldOffset(36)] - private float m41; - - [FieldOffset(40)] - private float m42; - - [FieldOffset(44)] - private float m43; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - public Float4x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33, float m41, float m42, float m43) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Float4x3(Float3 row1, Float3 row2, Float3 row3, Float3 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float3 this[int row] => ref *(Float3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref float M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref float M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// 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 Float4x3(float x) - { - Float4x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref float M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref float M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// 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 Float4x3(float x) + { + Float4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] +public unsafe partial struct Float4x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x4), sizeof(Float4)); + + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + [FieldOffset(16)] + private float m21; + + [FieldOffset(20)] + private float m22; + + [FieldOffset(24)] + private float m23; + + [FieldOffset(28)] + private float m24; + + [FieldOffset(32)] + private float m31; + + [FieldOffset(36)] + private float m32; + + [FieldOffset(40)] + private float m33; + + [FieldOffset(44)] + private float m34; + + [FieldOffset(48)] + private float m41; + + [FieldOffset(52)] + private float m42; + + [FieldOffset(56)] + private float m43; + + [FieldOffset(60)] + private float m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Float4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; } - /// - [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] - public unsafe partial struct Float4x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Float4x4(Float4 row1, Float4 row2, Float4 row3, Float4 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float4x4), sizeof(Float4)); - - [FieldOffset(0)] - private float m11; - - [FieldOffset(4)] - private float m12; - - [FieldOffset(8)] - private float m13; - - [FieldOffset(12)] - private float m14; - - [FieldOffset(16)] - private float m21; - - [FieldOffset(20)] - private float m22; - - [FieldOffset(24)] - private float m23; - - [FieldOffset(28)] - private float m24; - - [FieldOffset(32)] - private float m31; - - [FieldOffset(36)] - private float m32; - - [FieldOffset(40)] - private float m33; - - [FieldOffset(44)] - private float m34; - - [FieldOffset(48)] - private float m41; - - [FieldOffset(52)] - private float m42; - - [FieldOffset(56)] - private float m43; - - [FieldOffset(60)] - private float m44; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - /// The value to assign to the component at position [4, 4]. - public Float4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - this.m44 = m44; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Float4x4(Float4 row1, Float4 row2, Float4 row3, Float4 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - this.m44 = row4.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Float4 this[int row] => ref *(Float4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref float M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref float M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref float M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref float M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 4]. - /// - public readonly ref float M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); - - /// - /// 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 Float4x4(float x) - { - Float4x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - matrix.m44 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Float4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref float M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref float M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref float M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref float M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref float M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref float M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref float M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref float M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref float M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref float M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref float M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref float M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref float M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref float M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref float M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public readonly ref float M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); + + /// + /// 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 Float4x4(float x) + { + Float4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.cs b/src/ComputeSharp/Core/Primitives/Int/Int2.cs index a65bd6d9..71a5865c 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int2.cs +++ b/src/ComputeSharp/Core/Primitives/Int/Int2.cs @@ -1,66 +1,65 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Int2 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Int2 + public static Int2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Int2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int2 UnitY => new(0, 1); + + /// + /// 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 Int2(int x, int y) { - /// - /// Gets an value with all components set to 0. - /// - public static Int2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Int2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int2 UnitY => new(0, 1); - - /// - /// 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 Int2(int x, int y) - { - this.x = x; - this.y = y; - } - - /// - /// 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 Int2(int x) => new(x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt2(Int2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Float2(Int2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double2(Int2 xy) => default; + this.x = x; + this.y = y; } + + /// + /// 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 Int2(int x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt2(Int2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Float2(Int2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double2(Int2 xy) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs index 94b21a98..f26cfd11 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs +++ b/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs @@ -10,446 +10,445 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Int2 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Int2 : IFormattable + /// + /// 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 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; + + /// + public override readonly string ToString() { - /// - /// 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 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; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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. - /// 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. - /// 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. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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. + /// 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. + /// 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. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.cs b/src/ComputeSharp/Core/Primitives/Int/Int3.cs index 25839169..e4335439 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int3.cs +++ b/src/ComputeSharp/Core/Primitives/Int/Int3.cs @@ -1,97 +1,96 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Int3 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Int3 + public static Int3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Int3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int3 UnitZ => new(0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + public Int3(int x, int y, int z) { - /// - /// Gets an value with all components set to 0. - /// - public static Int3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Int3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int3 UnitZ => new(0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - public Int3(int x, int y, int z) - { - this.x = x; - this.y = y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - public Int3(Int2 xy, int z) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second and thirt vector components. - public Int3(int x, Int2 yz) - { - this.x = x; - this.y = yz.X; - this.z = yz.Y; - } - - /// - /// 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 Int3(int x) => new(x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt3(Int3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Float3(Int3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double3(Int3 xyz) => default; + this.x = x; + this.y = y; + this.z = z; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Int3(Int2 xy, int z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Int3(int x, Int2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// 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 Int3(int x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt3(Int3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Float3(Int3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double3(Int3 xyz) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs index c1f7e5bc..db4f6b55 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs +++ b/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs @@ -10,1530 +10,1529 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Int3 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Int3 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3), sizeof(Int4)); + + [FieldOffset(0)] + private int x; + + [FieldOffset(4)] + private int y; + + [FieldOffset(8)] + private int z; + + /// + /// 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 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 reference to the value representing the Z component. + /// + public readonly ref int Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 XZ => 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 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 YZ => 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 ZX => 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 ZY => 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 ZZ => 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 XXZ => 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 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 Int3 XYZ => 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 XZX => ref *(Int3*)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 Int3 XZY => 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 XZZ => 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 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 Int3 YXZ => 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 Int3 YYZ => ref *(Int3*)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 Int3 YZX => 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 YZY => 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 YZZ => 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 ZXX => ref *(Int3*)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 Int3 ZXY => 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 ZXZ => ref *(Int3*)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 Int3 ZYX => 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 ZYY => 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 ZYZ => 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 ZZX => 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 ZZY => 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 ZZZ => 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 XXXZ => 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 XXYZ => 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 XXZX => 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 XXZY => 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 XXZZ => 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 XYXZ => 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 XYYZ => 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 XYZX => 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 XYZY => 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 XYZZ => 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 XZXX => 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 XZXY => 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 XZXZ => 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 XZYX => 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 XZYY => 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 XZYZ => 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 XZZX => 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 XZZY => 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 XZZZ => 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 YXXZ => 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 YXYZ => 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 YXZX => 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 YXZY => 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 YXZZ => 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 YYXZ => 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 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 YYYZ => 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 YYZX => 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 YYZY => 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 YYZZ => 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 YZXX => 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 YZXY => 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 YZXZ => 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 YZYX => 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 YZYY => 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 YZYZ => 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 YZZX => 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 YZZY => 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 YZZZ => 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 ZXXX => 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 ZXXY => 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 ZXXZ => 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 ZXYX => 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 ZXYY => 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 ZXYZ => 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 ZXZX => 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 ZXZY => 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 ZXZZ => 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 ZYXX => 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 ZYXY => 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 ZYXZ => 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 ZYYX => 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 ZYYY => 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 ZYYZ => 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 ZYZX => 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 ZYZY => 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 ZYZZ => 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 ZZXX => 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 ZZXY => 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 ZZXZ => 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 ZZYX => 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 ZZYY => 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 ZZYZ => 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 ZZZX => 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 ZZZY => 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 ZZZZ => 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 reference to the value representing the B component. + /// + public readonly ref int B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 RB => 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 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 GB => 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 BR => 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 BG => 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 BB => 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 RRB => 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 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 Int3 RGB => 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 RBR => ref *(Int3*)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 Int3 RBG => 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 RBB => 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 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 Int3 GRB => 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 Int3 GGB => ref *(Int3*)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 Int3 GBR => 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 GBG => 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 GBB => 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 BRR => ref *(Int3*)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 Int3 BRG => 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 BRB => ref *(Int3*)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 Int3 BGR => 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 BGG => 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 BGB => 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 BBR => 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 BBG => 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 BBB => 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 RRRB => 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 RRGB => 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 RRBR => 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 RRBG => 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 RRBB => 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 RGRB => 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 RGGB => 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 RGBR => 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 RGBG => 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 RGBB => 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 RBRR => 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 RBRG => 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 RBRB => 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 RBGR => 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 RBGG => 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 RBGB => 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 RBBR => 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 RBBG => 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 RBBB => 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 GRRB => 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 GRGB => 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 GRBR => 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 GRBG => 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 GRBB => 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 GGRB => 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; + + /// + /// 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 GGGB => 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 GGBR => 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 GGBG => 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 GGBB => 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 GBRR => 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 GBRG => 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 GBRB => 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 GBGR => 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 GBGG => 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 GBGB => 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 GBBR => 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 GBBG => 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 GBBB => 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 BRRR => 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 BRRG => 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 BRRB => 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 BRGR => 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 BRGG => 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 BRGB => 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 BRBR => 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 BRBG => 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 BRBB => 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 BGRR => 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 BGRG => 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 BGRB => 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 BGGR => 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 BGGG => 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 BGGB => 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 BGBR => 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 BGBG => 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 BGBB => 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 BBRR => 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 BBRG => 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 BBRB => 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 BBGR => 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 BBGG => 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 BBGB => 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 BBBR => 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 BBBG => 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 BBBB => ref *(Int4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3), sizeof(Int4)); - - [FieldOffset(0)] - private int x; - - [FieldOffset(4)] - private int y; - - [FieldOffset(8)] - private int z; - - /// - /// 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 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 reference to the value representing the Z component. - /// - public readonly ref int Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 XZ => 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 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 YZ => 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 ZX => 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 ZY => 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 ZZ => 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 XXZ => 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 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 Int3 XYZ => 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 XZX => ref *(Int3*)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 Int3 XZY => 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 XZZ => 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 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 Int3 YXZ => 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 Int3 YYZ => ref *(Int3*)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 Int3 YZX => 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 YZY => 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 YZZ => 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 ZXX => ref *(Int3*)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 Int3 ZXY => 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 ZXZ => ref *(Int3*)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 Int3 ZYX => 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 ZYY => 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 ZYZ => 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 ZZX => 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 ZZY => 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 ZZZ => 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 XXXZ => 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 XXYZ => 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 XXZX => 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 XXZY => 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 XXZZ => 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 XYXZ => 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 XYYZ => 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 XYZX => 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 XYZY => 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 XYZZ => 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 XZXX => 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 XZXY => 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 XZXZ => 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 XZYX => 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 XZYY => 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 XZYZ => 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 XZZX => 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 XZZY => 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 XZZZ => 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 YXXZ => 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 YXYZ => 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 YXZX => 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 YXZY => 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 YXZZ => 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 YYXZ => 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 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 YYYZ => 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 YYZX => 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 YYZY => 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 YYZZ => 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 YZXX => 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 YZXY => 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 YZXZ => 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 YZYX => 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 YZYY => 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 YZYZ => 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 YZZX => 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 YZZY => 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 YZZZ => 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 ZXXX => 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 ZXXY => 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 ZXXZ => 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 ZXYX => 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 ZXYY => 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 ZXYZ => 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 ZXZX => 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 ZXZY => 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 ZXZZ => 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 ZYXX => 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 ZYXY => 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 ZYXZ => 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 ZYYX => 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 ZYYY => 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 ZYYZ => 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 ZYZX => 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 ZYZY => 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 ZYZZ => 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 ZZXX => 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 ZZXY => 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 ZZXZ => 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 ZZYX => 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 ZZYY => 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 ZZYZ => 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 ZZZX => 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 ZZZY => 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 ZZZZ => 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 reference to the value representing the B component. - /// - public readonly ref int B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 RB => 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 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 GB => 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 BR => 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 BG => 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 BB => 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 RRB => 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 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 Int3 RGB => 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 RBR => ref *(Int3*)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 Int3 RBG => 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 RBB => 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 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 Int3 GRB => 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 Int3 GGB => ref *(Int3*)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 Int3 GBR => 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 GBG => 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 GBB => 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 BRR => ref *(Int3*)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 Int3 BRG => 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 BRB => ref *(Int3*)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 Int3 BGR => 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 BGG => 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 BGB => 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 BBR => 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 BBG => 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 BBB => 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 RRRB => 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 RRGB => 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 RRBR => 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 RRBG => 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 RRBB => 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 RGRB => 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 RGGB => 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 RGBR => 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 RGBG => 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 RGBB => 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 RBRR => 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 RBRG => 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 RBRB => 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 RBGR => 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 RBGG => 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 RBGB => 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 RBBR => 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 RBBG => 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 RBBB => 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 GRRB => 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 GRGB => 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 GRBR => 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 GRBG => 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 GRBB => 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 GGRB => 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; - - /// - /// 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 GGGB => 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 GGBR => 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 GGBG => 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 GGBB => 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 GBRR => 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 GBRG => 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 GBRB => 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 GBGR => 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 GBGG => 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 GBGB => 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 GBBR => 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 GBBG => 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 GBBB => 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 BRRR => 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 BRRG => 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 BRRB => 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 BRGR => 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 BRGG => 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 BRGB => 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 BRBR => 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 BRBG => 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 BRBB => 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 BGRR => 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 BGRG => 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 BGRB => 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 BGGR => 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 BGGG => 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 BGGB => 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 BGBR => 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 BGBG => 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 BGBB => 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 BBRR => 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 BBRG => 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 BBRB => 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 BBGR => 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 BBGG => 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 BBGB => 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 BBBR => 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 BBBG => 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 BBBB => ref *(Int4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 xyz) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 xyz) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.cs b/src/ComputeSharp/Core/Primitives/Int/Int4.cs index ad3712fd..0c4b2cc7 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int4.cs +++ b/src/ComputeSharp/Core/Primitives/Int/Int4.cs @@ -1,147 +1,146 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct Int4 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct Int4 + public static Int4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Int4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitW => new(0, 0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Int4(int x, int y, int z, int w) { - /// - /// Gets an value with all components set to 0. - /// - public static Int4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static Int4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static Int4 UnitW => new(0, 0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Int4(int x, int y, int z, int w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public Int4(Int2 xy, int z, int w) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - this.w = w; - } - - /// - /// 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. - /// The value to assign to the third and fourth vector components. - public Int4(int x, int y, Int2 zw) - { - this.x = x; - this.y = y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third and fourth vector components. - public Int4(Int2 xy, Int2 zw) - { - this.x = xy.X; - this.y = xy.Y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first, second and third vector components. - /// The value to assign to the fourth vector component. - public Int4(Int3 xyz, int w) - { - this.x = xyz.X; - this.y = xyz.Y; - this.z = xyz.Z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second, third and fourth vector components. - public Int4(int x, Int3 yzw) - { - this.x = x; - this.y = yzw.X; - this.z = yzw.Y; - this.w = yzw.Z; - } - - /// - /// 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 Int4(int x) => new(x, x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator UInt4(Int4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Float4(Int4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double4(Int4 xyzw) => default; + this.x = x; + this.y = y; + this.z = z; + this.w = w; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Int4(Int2 xy, int z, int w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// 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. + /// The value to assign to the third and fourth vector components. + public Int4(int x, int y, Int2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Int4(Int2 xy, Int2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Int4(Int3 xyz, int w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Int4(int x, Int3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// 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 Int4(int x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator UInt4(Int4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Float4(Int4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double4(Int4 xyzw) => default; } diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs index 0a18d1b4..d48d6a99 100644 --- a/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs +++ b/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs @@ -10,4174 +10,4173 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Int4 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Int4 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4), sizeof(Int4)); + + [FieldOffset(0)] + private int x; + + [FieldOffset(4)] + private int y; + + [FieldOffset(8)] + private int z; + + [FieldOffset(12)] + private int w; + + /// + /// 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 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 reference to the value representing the Z component. + /// + public readonly ref int Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the W component. + /// + public readonly ref int W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 XZ => 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 XW => 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 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 YZ => 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 YW => 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 ZX => 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 ZY => 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 ZZ => 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 ZW => 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 WX => 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 WY => 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 WZ => 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 WW => 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 XXZ => 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 XXW => 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 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 Int3 XYZ => ref *(Int3*)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 Int3 XYW => 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 XZX => ref *(Int3*)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 Int3 XZY => 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 XZZ => ref *(Int3*)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 Int3 XZW => 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 XWX => ref *(Int3*)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 Int3 XWY => ref *(Int3*)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 Int3 XWZ => 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 XWW => 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 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 Int3 YXZ => ref *(Int3*)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 Int3 YXW => 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 Int3 YYZ => 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 YYW => ref *(Int3*)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 Int3 YZX => 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 YZY => 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 YZZ => ref *(Int3*)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 Int3 YZW => ref *(Int3*)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 Int3 YWX => 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 YWY => ref *(Int3*)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 Int3 YWZ => 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 YWW => 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 ZXX => ref *(Int3*)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 Int3 ZXY => 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 ZXZ => ref *(Int3*)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 Int3 ZXW => ref *(Int3*)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 Int3 ZYX => 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 ZYY => 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 ZYZ => ref *(Int3*)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 Int3 ZYW => 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 ZZX => 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 ZZY => 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 ZZZ => 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 ZZW => ref *(Int3*)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 Int3 ZWX => ref *(Int3*)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 Int3 ZWY => 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 ZWZ => 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 ZWW => 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 WXX => ref *(Int3*)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 Int3 WXY => ref *(Int3*)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 Int3 WXZ => 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 WXW => ref *(Int3*)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 Int3 WYX => 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 WYY => ref *(Int3*)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 Int3 WYZ => 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 WYW => ref *(Int3*)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 Int3 WZX => ref *(Int3*)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 Int3 WZY => 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 WZZ => 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 WZW => 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 WWX => 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 WWY => 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 WWZ => 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 WWW => 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 XXXZ => 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 XXXW => 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 XXYZ => 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 XXYW => 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 XXZX => 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 XXZY => 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 XXZZ => 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 XXZW => 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 XXWX => 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 XXWY => 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 XXWZ => 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 XXWW => 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 XYXZ => 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 XYXW => 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 XYYZ => 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 XYYW => 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 XYZX => 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 XYZY => 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 XYZZ => ref *(Int4*)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 Int4 XYZW => 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 XYWX => 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 XYWY => ref *(Int4*)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 Int4 XYWZ => 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 XYWW => 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 XZXX => 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 XZXY => 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 XZXZ => 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 XZXW => 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 XZYX => 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 XZYY => 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 XZYZ => ref *(Int4*)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 Int4 XZYW => 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 XZZX => 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 XZZY => 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 XZZZ => 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 XZZW => 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 XZWX => ref *(Int4*)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 Int4 XZWY => 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 XZWZ => 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 XZWW => 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 XWXX => 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 XWXY => 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 XWXZ => 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 XWXW => 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 XWYX => 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 XWYY => ref *(Int4*)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 Int4 XWYZ => 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 XWYW => 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 XWZX => ref *(Int4*)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 Int4 XWZY => 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 XWZZ => 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 XWZW => 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 XWWX => 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 XWWY => 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 XWWZ => 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 XWWW => 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 YXXZ => 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 YXXW => 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 YXYZ => 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 YXYW => 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 YXZX => 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 YXZY => 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 YXZZ => ref *(Int4*)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 Int4 YXZW => 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 YXWX => 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 YXWY => ref *(Int4*)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 Int4 YXWZ => 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 YXWW => 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 YYXZ => 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 YYXW => 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 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 YYYZ => 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 YYYW => 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 YYZX => 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 YYZY => 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 YYZZ => 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 YYZW => 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 YYWX => 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 YYWY => 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 YYWZ => 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 YYWW => 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 YZXX => 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 YZXY => 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 YZXZ => ref *(Int4*)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 Int4 YZXW => 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 YZYX => 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 YZYY => 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 YZYZ => 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 YZYW => 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 YZZX => 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 YZZY => 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 YZZZ => 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 YZZW => ref *(Int4*)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 Int4 YZWX => 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 YZWY => 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 YZWZ => 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 YZWW => 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 YWXX => 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 YWXY => ref *(Int4*)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 Int4 YWXZ => 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 YWXW => 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 YWYX => 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 YWYY => 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 YWYZ => 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 YWYW => ref *(Int4*)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 Int4 YWZX => 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 YWZY => 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 YWZZ => 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 YWZW => 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 YWWX => 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 YWWY => 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 YWWZ => 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 YWWW => 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 ZXXX => 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 ZXXY => 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 ZXXZ => 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 ZXXW => 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 ZXYX => 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 ZXYY => 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 ZXYZ => ref *(Int4*)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 Int4 ZXYW => 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 ZXZX => 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 ZXZY => 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 ZXZZ => 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 ZXZW => 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 ZXWX => ref *(Int4*)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 Int4 ZXWY => 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 ZXWZ => 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 ZXWW => 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 ZYXX => 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 ZYXY => 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 ZYXZ => ref *(Int4*)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 Int4 ZYXW => 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 ZYYX => 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 ZYYY => 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 ZYYZ => 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 ZYYW => 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 ZYZX => 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 ZYZY => 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 ZYZZ => 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 ZYZW => ref *(Int4*)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 Int4 ZYWX => 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 ZYWY => 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 ZYWZ => 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 ZYWW => 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 ZZXX => 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 ZZXY => 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 ZZXZ => 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 ZZXW => 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 ZZYX => 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 ZZYY => 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 ZZYZ => 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 ZZYW => 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 ZZZX => 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 ZZZY => 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 ZZZZ => 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 ZZZW => 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 ZZWX => 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 ZZWY => 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 ZZWZ => 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 ZZWW => 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 ZWXX => ref *(Int4*)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 Int4 ZWXY => 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 ZWXZ => 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 ZWXW => ref *(Int4*)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 Int4 ZWYX => 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 ZWYY => 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 ZWYZ => 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 ZWYW => 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 ZWZX => 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 ZWZY => 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 ZWZZ => 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 ZWZW => 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 ZWWX => 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 ZWWY => 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 ZWWZ => 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 ZWWW => 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 WXXX => 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 WXXY => 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 WXXZ => 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 WXXW => 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 WXYX => 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 WXYY => ref *(Int4*)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 Int4 WXYZ => 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 WXYW => 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 WXZX => ref *(Int4*)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 Int4 WXZY => 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 WXZZ => 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 WXZW => 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 WXWX => 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 WXWY => 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 WXWZ => 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 WXWW => 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 WYXX => 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 WYXY => ref *(Int4*)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 Int4 WYXZ => 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 WYXW => 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 WYYX => 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 WYYY => 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 WYYZ => 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 WYYW => ref *(Int4*)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 Int4 WYZX => 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 WYZY => 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 WYZZ => 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 WYZW => 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 WYWX => 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 WYWY => 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 WYWZ => 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 WYWW => 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 WZXX => ref *(Int4*)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 Int4 WZXY => 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 WZXZ => 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 WZXW => ref *(Int4*)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 Int4 WZYX => 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 WZYY => 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 WZYZ => 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 WZYW => 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 WZZX => 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 WZZY => 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 WZZZ => 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 WZZW => 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 WZWX => 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 WZWY => 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 WZWZ => 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 WZWW => 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 WWXX => 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 WWXY => 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 WWXZ => 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 WWXW => 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 WWYX => 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 WWYY => 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 WWYZ => 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 WWYW => 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 WWZX => 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 WWZY => 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 WWZZ => 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 WWZW => 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 WWWX => 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 WWWY => 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 WWWZ => 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 WWWW => 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 reference to the value representing the B component. + /// + public readonly ref int B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the A component. + /// + public readonly ref int A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 RB => 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 RA => 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 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 GB => 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 GA => 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 BR => 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 BG => 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 BB => 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 BA => 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 AR => 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 AG => 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 AB => 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 AA => 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 RRB => 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 RRA => 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 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 Int3 RGB => ref *(Int3*)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 Int3 RGA => 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 RBR => ref *(Int3*)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 Int3 RBG => 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 RBB => ref *(Int3*)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 Int3 RBA => 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 RAR => ref *(Int3*)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 Int3 RAG => ref *(Int3*)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 Int3 RAB => 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 RAA => 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 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 Int3 GRB => ref *(Int3*)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 Int3 GRA => 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 Int3 GGB => 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 GGA => ref *(Int3*)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 Int3 GBR => 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 GBG => 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 GBB => ref *(Int3*)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 Int3 GBA => ref *(Int3*)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 Int3 GAR => 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 GAG => ref *(Int3*)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 Int3 GAB => 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 GAA => 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 BRR => ref *(Int3*)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 Int3 BRG => 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 BRB => ref *(Int3*)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 Int3 BRA => ref *(Int3*)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 Int3 BGR => 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 BGG => 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 BGB => ref *(Int3*)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 Int3 BGA => 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 BBR => 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 BBG => 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 BBB => 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 BBA => ref *(Int3*)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 Int3 BAR => ref *(Int3*)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 Int3 BAG => 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 BAB => 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 BAA => 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 ARR => ref *(Int3*)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 Int3 ARG => ref *(Int3*)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 Int3 ARB => 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 ARA => ref *(Int3*)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 Int3 AGR => 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 AGG => ref *(Int3*)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 Int3 AGB => 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 AGA => ref *(Int3*)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 Int3 ABR => ref *(Int3*)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 Int3 ABG => 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 ABB => 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 ABA => 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 AAR => 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 AAG => 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 AAB => 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 AAA => 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 RRRB => 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 RRRA => 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 RRGB => 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 RRGA => 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 RRBR => 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 RRBG => 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 RRBB => 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 RRBA => 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 RRAR => 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 RRAG => 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 RRAB => 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 RRAA => 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 RGRB => 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 RGRA => 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 RGGB => 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 RGGA => 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 RGBR => 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 RGBG => 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 RGBB => ref *(Int4*)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 Int4 RGBA => 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 RGAR => 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 RGAG => ref *(Int4*)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 Int4 RGAB => 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 RGAA => 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 RBRR => 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 RBRG => 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 RBRB => 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 RBRA => 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 RBGR => 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 RBGG => 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 RBGB => ref *(Int4*)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 Int4 RBGA => 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 RBBR => 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 RBBG => 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 RBBB => 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 RBBA => 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 RBAR => ref *(Int4*)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 Int4 RBAG => 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 RBAB => 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 RBAA => 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 RARR => 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 RARG => 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 RARB => 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 RARA => 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 RAGR => 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 RAGG => ref *(Int4*)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 Int4 RAGB => 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 RAGA => 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 RABR => ref *(Int4*)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 Int4 RABG => 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 RABB => 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 RABA => 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 RAAR => 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 RAAG => 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 RAAB => 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 RAAA => 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 GRRB => 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 GRRA => 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 GRGB => 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 GRGA => 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 GRBR => 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 GRBG => 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 GRBB => ref *(Int4*)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 Int4 GRBA => 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 GRAR => 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 GRAG => ref *(Int4*)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 Int4 GRAB => 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 GRAA => 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 GGRB => 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 GGRA => 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; + + /// + /// 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 GGGB => 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 GGGA => 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 GGBR => 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 GGBG => 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 GGBB => 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 GGBA => 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 GGAR => 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 GGAG => 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 GGAB => 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 GGAA => 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 GBRR => 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 GBRG => 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 GBRB => ref *(Int4*)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 Int4 GBRA => 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 GBGR => 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 GBGG => 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 GBGB => 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 GBGA => 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 GBBR => 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 GBBG => 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 GBBB => 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 GBBA => ref *(Int4*)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 Int4 GBAR => 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 GBAG => 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 GBAB => 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 GBAA => 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 GARR => 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 GARG => ref *(Int4*)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 Int4 GARB => 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 GARA => 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 GAGR => 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 GAGG => 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 GAGB => 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 GAGA => ref *(Int4*)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 Int4 GABR => 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 GABG => 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 GABB => 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 GABA => 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 GAAR => 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 GAAG => 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 GAAB => 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 GAAA => 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 BRRR => 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 BRRG => 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 BRRB => 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 BRRA => 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 BRGR => 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 BRGG => 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 BRGB => ref *(Int4*)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 Int4 BRGA => 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 BRBR => 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 BRBG => 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 BRBB => 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 BRBA => 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 BRAR => ref *(Int4*)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 Int4 BRAG => 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 BRAB => 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 BRAA => 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 BGRR => 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 BGRG => 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 BGRB => ref *(Int4*)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 Int4 BGRA => 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 BGGR => 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 BGGG => 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 BGGB => 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 BGGA => 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 BGBR => 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 BGBG => 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 BGBB => 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 BGBA => ref *(Int4*)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 Int4 BGAR => 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 BGAG => 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 BGAB => 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 BGAA => 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 BBRR => 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 BBRG => 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 BBRB => 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 BBRA => 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 BBGR => 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 BBGG => 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 BBGB => 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 BBGA => 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 BBBR => 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 BBBG => 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 BBBB => 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 BBBA => 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 BBAR => 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 BBAG => 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 BBAB => 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 BBAA => 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 BARR => ref *(Int4*)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 Int4 BARG => 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 BARB => 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 BARA => ref *(Int4*)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 Int4 BAGR => 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 BAGG => 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 BAGB => 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 BAGA => 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 BABR => 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 BABG => 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 BABB => 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 BABA => 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 BAAR => 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 BAAG => 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 BAAB => 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 BAAA => 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 ARRR => 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 ARRG => 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 ARRB => 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 ARRA => 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 ARGR => 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 ARGG => ref *(Int4*)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 Int4 ARGB => 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 ARGA => 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 ARBR => ref *(Int4*)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 Int4 ARBG => 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 ARBB => 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 ARBA => 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 ARAR => 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 ARAG => 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 ARAB => 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 ARAA => 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 AGRR => 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 AGRG => ref *(Int4*)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 Int4 AGRB => 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 AGRA => 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 AGGR => 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 AGGG => 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 AGGB => 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 AGGA => ref *(Int4*)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 Int4 AGBR => 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 AGBG => 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 AGBB => 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 AGBA => 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 AGAR => 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 AGAG => 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 AGAB => 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 AGAA => 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 ABRR => ref *(Int4*)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 Int4 ABRG => 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 ABRB => 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 ABRA => ref *(Int4*)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 Int4 ABGR => 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 ABGG => 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 ABGB => 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 ABGA => 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 ABBR => 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 ABBG => 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 ABBB => 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 ABBA => 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 ABAR => 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 ABAG => 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 ABAB => 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 ABAA => 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 AARR => 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 AARG => 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 AARB => 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 AARA => 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 AAGR => 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 AAGG => 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 AAGB => 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 AAGA => 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 AABR => 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 AABG => 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 AABB => 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 AABA => 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 AAAR => 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 AAAG => 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 AAAB => 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 AAAA => ref *(Int4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4), sizeof(Int4)); - - [FieldOffset(0)] - private int x; - - [FieldOffset(4)] - private int y; - - [FieldOffset(8)] - private int z; - - [FieldOffset(12)] - private int w; - - /// - /// 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 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 reference to the value representing the Z component. - /// - public readonly ref int Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the W component. - /// - public readonly ref int W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 XZ => 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 XW => 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 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 YZ => 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 YW => 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 ZX => 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 ZY => 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 ZZ => 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 ZW => 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 WX => 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 WY => 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 WZ => 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 WW => 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 XXZ => 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 XXW => 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 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 Int3 XYZ => ref *(Int3*)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 Int3 XYW => 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 XZX => ref *(Int3*)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 Int3 XZY => 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 XZZ => ref *(Int3*)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 Int3 XZW => 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 XWX => ref *(Int3*)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 Int3 XWY => ref *(Int3*)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 Int3 XWZ => 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 XWW => 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 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 Int3 YXZ => ref *(Int3*)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 Int3 YXW => 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 Int3 YYZ => 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 YYW => ref *(Int3*)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 Int3 YZX => 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 YZY => 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 YZZ => ref *(Int3*)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 Int3 YZW => ref *(Int3*)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 Int3 YWX => 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 YWY => ref *(Int3*)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 Int3 YWZ => 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 YWW => 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 ZXX => ref *(Int3*)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 Int3 ZXY => 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 ZXZ => ref *(Int3*)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 Int3 ZXW => ref *(Int3*)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 Int3 ZYX => 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 ZYY => 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 ZYZ => ref *(Int3*)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 Int3 ZYW => 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 ZZX => 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 ZZY => 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 ZZZ => 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 ZZW => ref *(Int3*)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 Int3 ZWX => ref *(Int3*)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 Int3 ZWY => 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 ZWZ => 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 ZWW => 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 WXX => ref *(Int3*)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 Int3 WXY => ref *(Int3*)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 Int3 WXZ => 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 WXW => ref *(Int3*)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 Int3 WYX => 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 WYY => ref *(Int3*)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 Int3 WYZ => 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 WYW => ref *(Int3*)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 Int3 WZX => ref *(Int3*)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 Int3 WZY => 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 WZZ => 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 WZW => 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 WWX => 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 WWY => 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 WWZ => 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 WWW => 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 XXXZ => 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 XXXW => 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 XXYZ => 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 XXYW => 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 XXZX => 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 XXZY => 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 XXZZ => 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 XXZW => 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 XXWX => 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 XXWY => 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 XXWZ => 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 XXWW => 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 XYXZ => 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 XYXW => 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 XYYZ => 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 XYYW => 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 XYZX => 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 XYZY => 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 XYZZ => ref *(Int4*)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 Int4 XYZW => 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 XYWX => 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 XYWY => ref *(Int4*)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 Int4 XYWZ => 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 XYWW => 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 XZXX => 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 XZXY => 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 XZXZ => 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 XZXW => 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 XZYX => 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 XZYY => 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 XZYZ => ref *(Int4*)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 Int4 XZYW => 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 XZZX => 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 XZZY => 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 XZZZ => 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 XZZW => 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 XZWX => ref *(Int4*)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 Int4 XZWY => 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 XZWZ => 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 XZWW => 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 XWXX => 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 XWXY => 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 XWXZ => 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 XWXW => 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 XWYX => 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 XWYY => ref *(Int4*)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 Int4 XWYZ => 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 XWYW => 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 XWZX => ref *(Int4*)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 Int4 XWZY => 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 XWZZ => 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 XWZW => 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 XWWX => 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 XWWY => 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 XWWZ => 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 XWWW => 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 YXXZ => 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 YXXW => 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 YXYZ => 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 YXYW => 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 YXZX => 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 YXZY => 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 YXZZ => ref *(Int4*)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 Int4 YXZW => 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 YXWX => 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 YXWY => ref *(Int4*)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 Int4 YXWZ => 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 YXWW => 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 YYXZ => 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 YYXW => 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 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 YYYZ => 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 YYYW => 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 YYZX => 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 YYZY => 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 YYZZ => 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 YYZW => 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 YYWX => 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 YYWY => 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 YYWZ => 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 YYWW => 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 YZXX => 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 YZXY => 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 YZXZ => ref *(Int4*)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 Int4 YZXW => 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 YZYX => 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 YZYY => 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 YZYZ => 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 YZYW => 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 YZZX => 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 YZZY => 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 YZZZ => 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 YZZW => ref *(Int4*)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 Int4 YZWX => 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 YZWY => 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 YZWZ => 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 YZWW => 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 YWXX => 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 YWXY => ref *(Int4*)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 Int4 YWXZ => 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 YWXW => 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 YWYX => 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 YWYY => 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 YWYZ => 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 YWYW => ref *(Int4*)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 Int4 YWZX => 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 YWZY => 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 YWZZ => 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 YWZW => 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 YWWX => 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 YWWY => 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 YWWZ => 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 YWWW => 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 ZXXX => 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 ZXXY => 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 ZXXZ => 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 ZXXW => 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 ZXYX => 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 ZXYY => 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 ZXYZ => ref *(Int4*)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 Int4 ZXYW => 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 ZXZX => 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 ZXZY => 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 ZXZZ => 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 ZXZW => 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 ZXWX => ref *(Int4*)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 Int4 ZXWY => 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 ZXWZ => 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 ZXWW => 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 ZYXX => 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 ZYXY => 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 ZYXZ => ref *(Int4*)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 Int4 ZYXW => 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 ZYYX => 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 ZYYY => 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 ZYYZ => 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 ZYYW => 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 ZYZX => 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 ZYZY => 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 ZYZZ => 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 ZYZW => ref *(Int4*)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 Int4 ZYWX => 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 ZYWY => 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 ZYWZ => 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 ZYWW => 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 ZZXX => 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 ZZXY => 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 ZZXZ => 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 ZZXW => 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 ZZYX => 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 ZZYY => 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 ZZYZ => 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 ZZYW => 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 ZZZX => 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 ZZZY => 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 ZZZZ => 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 ZZZW => 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 ZZWX => 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 ZZWY => 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 ZZWZ => 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 ZZWW => 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 ZWXX => ref *(Int4*)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 Int4 ZWXY => 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 ZWXZ => 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 ZWXW => ref *(Int4*)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 Int4 ZWYX => 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 ZWYY => 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 ZWYZ => 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 ZWYW => 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 ZWZX => 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 ZWZY => 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 ZWZZ => 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 ZWZW => 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 ZWWX => 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 ZWWY => 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 ZWWZ => 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 ZWWW => 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 WXXX => 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 WXXY => 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 WXXZ => 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 WXXW => 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 WXYX => 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 WXYY => ref *(Int4*)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 Int4 WXYZ => 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 WXYW => 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 WXZX => ref *(Int4*)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 Int4 WXZY => 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 WXZZ => 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 WXZW => 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 WXWX => 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 WXWY => 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 WXWZ => 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 WXWW => 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 WYXX => 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 WYXY => ref *(Int4*)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 Int4 WYXZ => 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 WYXW => 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 WYYX => 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 WYYY => 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 WYYZ => 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 WYYW => ref *(Int4*)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 Int4 WYZX => 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 WYZY => 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 WYZZ => 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 WYZW => 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 WYWX => 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 WYWY => 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 WYWZ => 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 WYWW => 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 WZXX => ref *(Int4*)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 Int4 WZXY => 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 WZXZ => 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 WZXW => ref *(Int4*)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 Int4 WZYX => 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 WZYY => 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 WZYZ => 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 WZYW => 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 WZZX => 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 WZZY => 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 WZZZ => 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 WZZW => 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 WZWX => 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 WZWY => 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 WZWZ => 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 WZWW => 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 WWXX => 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 WWXY => 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 WWXZ => 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 WWXW => 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 WWYX => 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 WWYY => 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 WWYZ => 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 WWYW => 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 WWZX => 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 WWZY => 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 WWZZ => 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 WWZW => 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 WWWX => 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 WWWY => 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 WWWZ => 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 WWWW => 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 reference to the value representing the B component. - /// - public readonly ref int B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the A component. - /// - public readonly ref int A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 RB => 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 RA => 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 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 GB => 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 GA => 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 BR => 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 BG => 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 BB => 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 BA => 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 AR => 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 AG => 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 AB => 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 AA => 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 RRB => 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 RRA => 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 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 Int3 RGB => ref *(Int3*)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 Int3 RGA => 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 RBR => ref *(Int3*)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 Int3 RBG => 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 RBB => ref *(Int3*)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 Int3 RBA => 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 RAR => ref *(Int3*)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 Int3 RAG => ref *(Int3*)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 Int3 RAB => 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 RAA => 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 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 Int3 GRB => ref *(Int3*)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 Int3 GRA => 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 Int3 GGB => 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 GGA => ref *(Int3*)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 Int3 GBR => 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 GBG => 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 GBB => ref *(Int3*)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 Int3 GBA => ref *(Int3*)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 Int3 GAR => 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 GAG => ref *(Int3*)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 Int3 GAB => 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 GAA => 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 BRR => ref *(Int3*)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 Int3 BRG => 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 BRB => ref *(Int3*)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 Int3 BRA => ref *(Int3*)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 Int3 BGR => 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 BGG => 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 BGB => ref *(Int3*)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 Int3 BGA => 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 BBR => 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 BBG => 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 BBB => 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 BBA => ref *(Int3*)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 Int3 BAR => ref *(Int3*)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 Int3 BAG => 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 BAB => 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 BAA => 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 ARR => ref *(Int3*)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 Int3 ARG => ref *(Int3*)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 Int3 ARB => 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 ARA => ref *(Int3*)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 Int3 AGR => 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 AGG => ref *(Int3*)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 Int3 AGB => 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 AGA => ref *(Int3*)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 Int3 ABR => ref *(Int3*)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 Int3 ABG => 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 ABB => 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 ABA => 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 AAR => 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 AAG => 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 AAB => 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 AAA => 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 RRRB => 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 RRRA => 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 RRGB => 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 RRGA => 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 RRBR => 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 RRBG => 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 RRBB => 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 RRBA => 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 RRAR => 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 RRAG => 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 RRAB => 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 RRAA => 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 RGRB => 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 RGRA => 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 RGGB => 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 RGGA => 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 RGBR => 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 RGBG => 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 RGBB => ref *(Int4*)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 Int4 RGBA => 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 RGAR => 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 RGAG => ref *(Int4*)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 Int4 RGAB => 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 RGAA => 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 RBRR => 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 RBRG => 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 RBRB => 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 RBRA => 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 RBGR => 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 RBGG => 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 RBGB => ref *(Int4*)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 Int4 RBGA => 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 RBBR => 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 RBBG => 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 RBBB => 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 RBBA => 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 RBAR => ref *(Int4*)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 Int4 RBAG => 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 RBAB => 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 RBAA => 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 RARR => 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 RARG => 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 RARB => 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 RARA => 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 RAGR => 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 RAGG => ref *(Int4*)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 Int4 RAGB => 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 RAGA => 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 RABR => ref *(Int4*)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 Int4 RABG => 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 RABB => 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 RABA => 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 RAAR => 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 RAAG => 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 RAAB => 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 RAAA => 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 GRRB => 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 GRRA => 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 GRGB => 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 GRGA => 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 GRBR => 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 GRBG => 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 GRBB => ref *(Int4*)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 Int4 GRBA => 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 GRAR => 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 GRAG => ref *(Int4*)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 Int4 GRAB => 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 GRAA => 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 GGRB => 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 GGRA => 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; - - /// - /// 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 GGGB => 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 GGGA => 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 GGBR => 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 GGBG => 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 GGBB => 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 GGBA => 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 GGAR => 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 GGAG => 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 GGAB => 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 GGAA => 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 GBRR => 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 GBRG => 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 GBRB => ref *(Int4*)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 Int4 GBRA => 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 GBGR => 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 GBGG => 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 GBGB => 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 GBGA => 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 GBBR => 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 GBBG => 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 GBBB => 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 GBBA => ref *(Int4*)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 Int4 GBAR => 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 GBAG => 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 GBAB => 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 GBAA => 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 GARR => 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 GARG => ref *(Int4*)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 Int4 GARB => 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 GARA => 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 GAGR => 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 GAGG => 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 GAGB => 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 GAGA => ref *(Int4*)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 Int4 GABR => 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 GABG => 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 GABB => 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 GABA => 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 GAAR => 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 GAAG => 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 GAAB => 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 GAAA => 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 BRRR => 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 BRRG => 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 BRRB => 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 BRRA => 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 BRGR => 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 BRGG => 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 BRGB => ref *(Int4*)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 Int4 BRGA => 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 BRBR => 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 BRBG => 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 BRBB => 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 BRBA => 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 BRAR => ref *(Int4*)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 Int4 BRAG => 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 BRAB => 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 BRAA => 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 BGRR => 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 BGRG => 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 BGRB => ref *(Int4*)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 Int4 BGRA => 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 BGGR => 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 BGGG => 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 BGGB => 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 BGGA => 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 BGBR => 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 BGBG => 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 BGBB => 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 BGBA => ref *(Int4*)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 Int4 BGAR => 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 BGAG => 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 BGAB => 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 BGAA => 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 BBRR => 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 BBRG => 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 BBRB => 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 BBRA => 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 BBGR => 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 BBGG => 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 BBGB => 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 BBGA => 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 BBBR => 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 BBBG => 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 BBBB => 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 BBBA => 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 BBAR => 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 BBAG => 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 BBAB => 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 BBAA => 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 BARR => ref *(Int4*)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 Int4 BARG => 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 BARB => 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 BARA => ref *(Int4*)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 Int4 BAGR => 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 BAGG => 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 BAGB => 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 BAGA => 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 BABR => 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 BABG => 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 BABB => 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 BABA => 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 BAAR => 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 BAAG => 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 BAAB => 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 BAAA => 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 ARRR => 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 ARRG => 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 ARRB => 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 ARRA => 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 ARGR => 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 ARGG => ref *(Int4*)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 Int4 ARGB => 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 ARGA => 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 ARBR => ref *(Int4*)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 Int4 ARBG => 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 ARBB => 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 ARBA => 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 ARAR => 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 ARAG => 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 ARAB => 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 ARAA => 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 AGRR => 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 AGRG => ref *(Int4*)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 Int4 AGRB => 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 AGRA => 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 AGGR => 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 AGGG => 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 AGGB => 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 AGGA => ref *(Int4*)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 Int4 AGBR => 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 AGBG => 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 AGBB => 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 AGBA => 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 AGAR => 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 AGAG => 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 AGAB => 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 AGAA => 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 ABRR => ref *(Int4*)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 Int4 ABRG => 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 ABRB => 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 ABRA => ref *(Int4*)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 Int4 ABGR => 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 ABGG => 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 ABGB => 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 ABGA => 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 ABBR => 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 ABBG => 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 ABBB => 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 ABBA => 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 ABAR => 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 ABAG => 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 ABAB => 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 ABAA => 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 AARR => 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 AARG => 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 AARB => 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 AARA => 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 AAGR => 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 AAGG => 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 AAGB => 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 AAGA => 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 AABR => 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 AABG => 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 AABB => 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 AABA => 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 AAAR => 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 AAAG => 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 AAAB => 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 AAAA => ref *(Int4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.w.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 xyzw) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.w.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 xyzw) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs b/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs index 3b765b73..578d17f6 100644 --- a/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs @@ -5,2944 +5,2943 @@ using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers; using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #endif -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] +public unsafe partial struct Int1x1 { - /// - [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] - public unsafe partial struct Int1x1 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x1), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Int1x1(int m11) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x1), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - public Int1x1(int m11) - { - this.m11 = m11; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 row] => ref *(int*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// 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 Int1x1(int x) - { - Int1x1 matrix; - - matrix.m11 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + this.m11 = m11; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Int1x2 + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 row] => ref *(int*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// 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 Int1x1(int x) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x2), sizeof(Int4)); + Int1x1 matrix; - [FieldOffset(0)] - private int m11; + matrix.m11 = x; - [FieldOffset(4)] - private int m12; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - public Int1x2(int m11, int m12) - { - this.m11 = m11; - this.m12 = m12; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// 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 Int1x2(int x) - { - Int1x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Int1x2(Int2 vector) => *(Int1x2*)&vector; + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Int1x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Int1x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x2), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Int1x2(int m11, int m12) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x3), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - public Int1x3(int m11, int m12, int m13) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// 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 Int1x2(int x) + { + Int1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int1x2(Int2 vector) => *(Int1x2*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Int1x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x3), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Int1x3(int m11, int m12, int m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// 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 Int1x3(int x) - { - Int1x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Int1x3(Int3 vector) => *(Int1x3*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// 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 Int1x3(int x) + { + Int1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Int1x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int1x3(Int3 vector) => *(Int1x3*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Int1x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x4), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Int1x4(int m11, int m12, int m13, int m14) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int1x4), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m14; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - public Int1x4(int m11, int m12, int m13, int m14) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// 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 Int1x4(int x) - { - Int1x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Int1x4(Int4 vector) => *(Int1x4*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// 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 Int1x4(int x) + { + Int1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct Int2x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int1x4(Int4 vector) => *(Int1x4*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct Int2x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x1), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Int2x1(int m11, int m21) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x1), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m21; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - public Int2x1(int m11, int m21) - { - this.m11 = m11; - this.m21 = m21; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 row] => ref *(int*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 row] => ref *(int*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// 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 Int2x1(int x) - { - Int2x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Int2(Int2x1 matrix) => *(Int2*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// 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 Int2x1(int x) + { + Int2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int2(Int2x1 matrix) => *(Int2*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Int2x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x2), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m21; + + [FieldOffset(12)] + private int m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Int2x2(int m11, int m12, int m21, int m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Int2x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Int2x2(Int2 row1, Int2 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x2), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m21; - - [FieldOffset(12)] - private int m22; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - public Int2x2(int m11, int m12, int m21, int m22) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Int2x2(Int2 row1, Int2 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// 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 Int2x2(int x) - { - Int2x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// 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 Int2x2(int x) + { + Int2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct Int2x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x3), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m21; + + [FieldOffset(16)] + private int m22; + + [FieldOffset(20)] + private int m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Int2x3(int m11, int m12, int m13, int m21, int m22, int m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct Int2x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Int2x3(Int3 row1, Int3 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x3), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m21; - - [FieldOffset(16)] - private int m22; - - [FieldOffset(20)] - private int m23; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - public Int2x3(int m11, int m12, int m13, int m21, int m22, int m23) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Int2x3(Int3 row1, Int3 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// 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 Int2x3(int x) - { - Int2x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// 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 Int2x3(int x) + { + Int2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct Int2x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x4), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + [FieldOffset(16)] + private int m21; + + [FieldOffset(20)] + private int m22; + + [FieldOffset(24)] + private int m23; + + [FieldOffset(28)] + private int m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Int2x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct Int2x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Int2x4(Int4 row1, Int4 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2x4), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m14; - - [FieldOffset(16)] - private int m21; - - [FieldOffset(20)] - private int m22; - - [FieldOffset(24)] - private int m23; - - [FieldOffset(28)] - private int m24; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - public Int2x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public Int2x4(Int4 row1, Int4 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref int M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// 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 Int2x4(int x) - { - Int2x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref int M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// 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 Int2x4(int x) + { + Int2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct Int3x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct Int3x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x1), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m21; + + [FieldOffset(8)] + private int m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Int3x1(int m11, int m21, int m31) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x1), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m21; - - [FieldOffset(8)] - private int m31; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - public Int3x1(int m11, int m21, int m31) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 row] => ref *(int*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 row] => ref *(int*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// 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 Int3x1(int x) - { - Int3x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Int3(Int3x1 matrix) => *(Int3*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// 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 Int3x1(int x) + { + Int3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int3(Int3x1 matrix) => *(Int3*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct Int3x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x2), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m21; + + [FieldOffset(12)] + private int m22; + + [FieldOffset(16)] + private int m31; + + [FieldOffset(20)] + private int m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Int3x2(int m11, int m12, int m21, int m22, int m31, int m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct Int3x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Int3x2(Int2 row1, Int2 row2, Int2 row3) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x2), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m21; - - [FieldOffset(12)] - private int m22; - - [FieldOffset(16)] - private int m31; - - [FieldOffset(20)] - private int m32; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - public Int3x2(int m11, int m12, int m21, int m22, int m31, int m32) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Int3x2(Int2 row1, Int2 row2, Int2 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// 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 Int3x2(int x) - { - Int3x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// 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 Int3x2(int x) + { + Int3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] - public unsafe partial struct Int3x3 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] +public unsafe partial struct Int3x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x3), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m21; + + [FieldOffset(16)] + private int m22; + + [FieldOffset(20)] + private int m23; + + [FieldOffset(24)] + private int m31; + + [FieldOffset(28)] + private int m32; + + [FieldOffset(32)] + private int m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Int3x3(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x3), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m21; - - [FieldOffset(16)] - private int m22; - - [FieldOffset(20)] - private int m23; - - [FieldOffset(24)] - private int m31; - - [FieldOffset(28)] - private int m32; - - [FieldOffset(32)] - private int m33; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - public Int3x3(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Int3x3(Int3 row1, Int3 row2, Int3 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Int3x3(Int3 row1, Int3 row2, Int3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// 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 Int3x3(int x) - { - Int3x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// 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 Int3x3(int x) + { + Int3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct Int3x4 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct Int3x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x4), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + [FieldOffset(16)] + private int m21; + + [FieldOffset(20)] + private int m22; + + [FieldOffset(24)] + private int m23; + + [FieldOffset(28)] + private int m24; + + [FieldOffset(32)] + private int m31; + + [FieldOffset(36)] + private int m32; + + [FieldOffset(40)] + private int m33; + + [FieldOffset(44)] + private int m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Int3x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24, int m31, int m32, int m33, int m34) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3x4), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m14; - - [FieldOffset(16)] - private int m21; - - [FieldOffset(20)] - private int m22; - - [FieldOffset(24)] - private int m23; - - [FieldOffset(28)] - private int m24; - - [FieldOffset(32)] - private int m31; - - [FieldOffset(36)] - private int m32; - - [FieldOffset(40)] - private int m33; - - [FieldOffset(44)] - private int m34; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - public Int3x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24, int m31, int m32, int m33, int m34) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public Int3x4(Int4 row1, Int4 row2, Int4 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Int3x4(Int4 row1, Int4 row2, Int4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref int M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref int M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// 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 Int3x4(int x) - { - Int3x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref int M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref int M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// 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 Int3x4(int x) + { + Int3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct Int4x1 + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct Int4x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x1), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m21; + + [FieldOffset(8)] + private int m31; + + [FieldOffset(12)] + private int m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Int4x1(int m11, int m21, int m31, int m41) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x1), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m21; - - [FieldOffset(8)] - private int m31; - - [FieldOffset(12)] - private int m41; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [4, 1]. - public Int4x1(int m11, int m21, int m31, int m41) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - this.m41 = m41; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 row] => ref *(int*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 row] => ref *(int*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// 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 Int4x1(int x) - { - Int4x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - matrix.m41 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator Int4(Int4x1 matrix) => *(Int4*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// 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 Int4x1(int x) + { + Int4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int4(Int4x1 matrix) => *(Int4*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct Int4x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x2), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m21; + + [FieldOffset(12)] + private int m22; + + [FieldOffset(16)] + private int m31; + + [FieldOffset(20)] + private int m32; + + [FieldOffset(24)] + private int m41; + + [FieldOffset(28)] + private int m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Int4x2(int m11, int m12, int m21, int m22, int m31, int m32, int m41, int m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct Int4x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Int4x2(Int2 row1, Int2 row2, Int2 row3, Int2 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x2), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m21; - - [FieldOffset(12)] - private int m22; - - [FieldOffset(16)] - private int m31; - - [FieldOffset(20)] - private int m32; - - [FieldOffset(24)] - private int m41; - - [FieldOffset(28)] - private int m42; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - public Int4x2(int m11, int m12, int m21, int m22, int m31, int m32, int m41, int m42) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - this.m41 = m41; - this.m42 = m42; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Int4x2(Int2 row1, Int2 row2, Int2 row3, Int2 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m41 = row4.X; - this.m42 = row4.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int2 this[int row] => ref *(Int2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref int M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// 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 Int4x2(int x) - { - Int4x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m41 = x; - matrix.m42 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref int M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// 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 Int4x2(int x) + { + Int4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct Int4x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x3), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m21; + + [FieldOffset(16)] + private int m22; + + [FieldOffset(20)] + private int m23; + + [FieldOffset(24)] + private int m31; + + [FieldOffset(28)] + private int m32; + + [FieldOffset(32)] + private int m33; + + [FieldOffset(36)] + private int m41; + + [FieldOffset(40)] + private int m42; + + [FieldOffset(44)] + private int m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Int4x3(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33, int m41, int m42, int m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct Int4x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Int4x3(Int3 row1, Int3 row2, Int3 row3, Int3 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x3), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m21; - - [FieldOffset(16)] - private int m22; - - [FieldOffset(20)] - private int m23; - - [FieldOffset(24)] - private int m31; - - [FieldOffset(28)] - private int m32; - - [FieldOffset(32)] - private int m33; - - [FieldOffset(36)] - private int m41; - - [FieldOffset(40)] - private int m42; - - [FieldOffset(44)] - private int m43; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - public Int4x3(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33, int m41, int m42, int m43) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Int4x3(Int3 row1, Int3 row2, Int3 row3, Int3 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int3 this[int row] => ref *(Int3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref int M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref int M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// 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 Int4x3(int x) - { - Int4x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref int M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref int M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// 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 Int4x3(int x) + { + Int4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] +public unsafe partial struct Int4x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x4), sizeof(Int4)); + + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + [FieldOffset(16)] + private int m21; + + [FieldOffset(20)] + private int m22; + + [FieldOffset(24)] + private int m23; + + [FieldOffset(28)] + private int m24; + + [FieldOffset(32)] + private int m31; + + [FieldOffset(36)] + private int m32; + + [FieldOffset(40)] + private int m33; + + [FieldOffset(44)] + private int m34; + + [FieldOffset(48)] + private int m41; + + [FieldOffset(52)] + private int m42; + + [FieldOffset(56)] + private int m43; + + [FieldOffset(60)] + private int m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Int4x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24, int m31, int m32, int m33, int m34, int m41, int m42, int m43, int m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; } - /// - [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] - public unsafe partial struct Int4x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Int4x4(Int4 row1, Int4 row2, Int4 row3, Int4 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int4x4), sizeof(Int4)); - - [FieldOffset(0)] - private int m11; - - [FieldOffset(4)] - private int m12; - - [FieldOffset(8)] - private int m13; - - [FieldOffset(12)] - private int m14; - - [FieldOffset(16)] - private int m21; - - [FieldOffset(20)] - private int m22; - - [FieldOffset(24)] - private int m23; - - [FieldOffset(28)] - private int m24; - - [FieldOffset(32)] - private int m31; - - [FieldOffset(36)] - private int m32; - - [FieldOffset(40)] - private int m33; - - [FieldOffset(44)] - private int m34; - - [FieldOffset(48)] - private int m41; - - [FieldOffset(52)] - private int m42; - - [FieldOffset(56)] - private int m43; - - [FieldOffset(60)] - private int m44; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - /// The value to assign to the component at position [4, 4]. - public Int4x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24, int m31, int m32, int m33, int m34, int m41, int m42, int m43, int m44) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - this.m44 = m44; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public Int4x4(Int4 row1, Int4 row2, Int4 row3, Int4 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - this.m44 = row4.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 Int4 this[int row] => ref *(Int4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref int M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref int M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref int M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref int M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 4]. - /// - public readonly ref int M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); - - /// - /// 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 Int4x4(int x) - { - Int4x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - matrix.m44 = x; - - return matrix; - } - - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 matrix) => default; - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(Int4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref int M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref int M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref int M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref int M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref int M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref int M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref int M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref int M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref int M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref int M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref int M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref int M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref int M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref int M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref int M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public readonly ref int M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); + + /// + /// 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 Int4x4(int x) + { + Int4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; } + + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 matrix) => default; + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; } diff --git a/src/ComputeSharp/Core/Primitives/MatrixIndex.cs b/src/ComputeSharp/Core/Primitives/MatrixIndex.cs index 5b330472..d5044d3c 100644 --- a/src/ComputeSharp/Core/Primitives/MatrixIndex.cs +++ b/src/ComputeSharp/Core/Primitives/MatrixIndex.cs @@ -1,97 +1,96 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A type indicating a base-1 index into a matrix type. This can be used to extract references to swizzled vectors within a given matrix value. +/// For more info, see . +/// This type is meant to be used within a directive to simplify the code: +/// +/// +/// using static ComputeSharp.MatrixIndex; +/// Float2x2 matrix = 0; +/// Float2 row = matrix[M11, M12]; +/// +/// +/// +public enum MatrixIndex { /// - /// A type indicating a base-1 index into a matrix type. This can be used to extract references to swizzled vectors within a given matrix value. - /// For more info, see . - /// This type is meant to be used within a directive to simplify the code: - /// - /// - /// using static ComputeSharp.MatrixIndex; - /// Float2x2 matrix = 0; - /// Float2 row = matrix[M11, M12]; - /// - /// + /// The first item in the first row. /// - public enum MatrixIndex - { - /// - /// The first item in the first row. - /// - M11, + M11, - /// - /// The second item in the first row. - /// - M12, + /// + /// The second item in the first row. + /// + M12, - /// - /// The third item in the first row. - /// - M13, + /// + /// The third item in the first row. + /// + M13, - /// - /// The fourth item in the first row. - /// - M14, + /// + /// The fourth item in the first row. + /// + M14, - /// - /// The first item in the second row. - /// - M21, + /// + /// The first item in the second row. + /// + M21, - /// - /// The second item in the second row. - /// - M22, + /// + /// The second item in the second row. + /// + M22, - /// - /// The third item in the second row. - /// - M23, + /// + /// The third item in the second row. + /// + M23, - /// - /// The fourth item in the second row. - /// - M24, + /// + /// The fourth item in the second row. + /// + M24, - /// - /// The first item in the third row. - /// - M31, + /// + /// The first item in the third row. + /// + M31, - /// - /// The second item in the third row. - /// - M32, + /// + /// The second item in the third row. + /// + M32, - /// - /// The third item in the third row. - /// - M33, + /// + /// The third item in the third row. + /// + M33, - /// - /// The fourth item in the third row. - /// - M34, + /// + /// The fourth item in the third row. + /// + M34, - /// - /// The first item in the fourth row. - /// - M41, + /// + /// The first item in the fourth row. + /// + M41, - /// - /// The second item in the fourth row. - /// - M42, + /// + /// The second item in the fourth row. + /// + M42, - /// - /// The third item in the fourth row. - /// - M43, + /// + /// The third item in the fourth row. + /// + M43, - /// - /// The fourth item in the fourth row. - /// - M44 - } + /// + /// The fourth item in the fourth row. + /// + M44 } diff --git a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude index 389057a4..e2821f7d 100644 --- a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude @@ -17,8 +17,8 @@ using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers; using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #endif -namespace ComputeSharp -{ +namespace ComputeSharp; + <# for (int rows = 1; rows <= 4; rows++) for (int columns = 1; columns <= 4; columns++) @@ -27,9 +27,6 @@ namespace ComputeSharp GenerateMatrixProperties(typeName, rows, columns, elementSize); } -#> -} -<# } // Generates all vector access properties for a specified type @@ -40,18 +37,17 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen string rowTypeName = columns > 1 ? $"{typeName}{columns}" : elementTypeName; List fieldNames = new List(); #> - /// - [StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * rows * columns)#>, Pack = <#=elementSize#>)] - public unsafe partial struct <#=fullTypeName#> - { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<#=fullTypeName#>), sizeof(<#=typeName#>4)); +/// +[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * rows * columns)#>, Pack = <#=elementSize#>)] +public unsafe partial struct <#=fullTypeName#> +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<#=fullTypeName#>), sizeof(<#=typeName#>4)); <# WriteLine(""); PushIndent(" "); - PushIndent(" "); // Generate the private fields for (int i = 1; i <= rows; i++) @@ -124,65 +120,63 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen } PopIndent(); - PopIndent(); #> - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 <#=rowTypeName#> this[int row] => ref *(<#=rowTypeName#>*)UndefinedData; + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 <#=rowTypeName#> this[int row] => ref *(<#=rowTypeName#>*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 <#=typeName#>2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(<#=typeName#>2*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 <#=typeName#>2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(<#=typeName#>2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 <#=typeName#>3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(<#=typeName#>3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 <#=typeName#>3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(<#=typeName#>3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 <#=typeName#>4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(<#=typeName#>4*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 <#=typeName#>4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(<#=typeName#>4*)UndefinedData; <# for (int i = 1; i <= rows; i++) for (int j = 1; j <= columns; j++) { WriteLine(""); #> - /// - /// Gets a reference to the value representing the component at position [<#=i#>, <#=j#>]. - /// - public readonly ref <#=elementTypeName#> M<#=i#><#=j#> => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m<#=i#><#=j#>), 1)); + /// + /// Gets a reference to the value representing the component at position [<#=i#>, <#=j#>]. + /// + public readonly ref <#=elementTypeName#> M<#=i#><#=j#> => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m<#=i#><#=j#>), 1)); <# } WriteLine(""); #> - /// - /// 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 <#=fullTypeName#>(<#=elementTypeName#> x) + /// + /// 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 <#=fullTypeName#>(<#=elementTypeName#> x) <# // Complete the conversion operator above PushIndent(" "); - PushIndent(" "); WriteLine("{"); PushIndent(" "); WriteLine($"{fullTypeName} matrix;"); @@ -200,7 +194,6 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen PopIndent(); WriteLine("}"); PopIndent(); - PopIndent(); // Generate the negation operator if (typeName != "UInt") @@ -209,12 +202,12 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen string operatorName = typeName == "Bool" ? "!" : "-"; #> - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 <#=operatorName#>(<#=fullTypeName#> matrix) => default; + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 <#=operatorName#>(<#=fullTypeName#> matrix) => default; <# } @@ -223,37 +216,37 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen { WriteLine(""); #> - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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; + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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; - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; <# } @@ -262,11 +255,11 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen { WriteLine(""); #> - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator <#=fullTypeName#>(<#=typeName#><#=columns#> vector) => *(<#=fullTypeName#>*)&vector; + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator <#=fullTypeName#>(<#=typeName#><#=columns#> vector) => *(<#=fullTypeName#>*)&vector; <# } @@ -274,15 +267,15 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen { WriteLine(""); #> - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator <#=typeName#><#=rows#>(<#=fullTypeName#> matrix) => *(<#=typeName#><#=rows#>*)&matrix; + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator <#=typeName#><#=rows#>(<#=fullTypeName#> matrix) => *(<#=typeName#><#=rows#>*)&matrix; <# } #> - } +} <# } #> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs index b9aa527c..fc92f7e7 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs @@ -1,66 +1,65 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct UInt2 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct UInt2 + public static UInt2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static UInt2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt2 UnitY => new(0, 1); + + /// + /// 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 UInt2(uint x, uint y) { - /// - /// Gets an value with all components set to 0. - /// - public static UInt2 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static UInt2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt2 UnitX => new(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt2 UnitY => new(0, 1); - - /// - /// 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 UInt2(uint x, uint y) - { - this.x = x; - this.y = y; - } - - /// - /// 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 UInt2(uint x) => new(x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int2(UInt2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Float2(UInt2 xy) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double2(UInt2 xy) => default; + this.x = x; + this.y = y; } + + /// + /// 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 UInt2(uint x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int2(UInt2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Float2(UInt2 xy) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double2(UInt2 xy) => default; } diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs index f37795b5..82f576c2 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs @@ -10,439 +10,438 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct UInt2 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct UInt2 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2), sizeof(UInt4)); + + [FieldOffset(0)] + private uint x; + + [FieldOffset(4)] + private uint 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 uint this[int i] => ref *(uint*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref uint 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 uint 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 UInt2 XX => ref *(UInt2*)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 UInt2 XY => ref *(UInt2*)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 UInt2 YX => ref *(UInt2*)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 UInt2 YY => ref *(UInt2*)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 UInt3 XXX => ref *(UInt3*)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 UInt3 XXY => ref *(UInt3*)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 UInt3 XYX => ref *(UInt3*)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 UInt3 XYY => ref *(UInt3*)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 UInt3 YXX => ref *(UInt3*)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 UInt3 YXY => ref *(UInt3*)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 UInt3 YYX => ref *(UInt3*)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 UInt3 YYY => ref *(UInt3*)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 UInt4 XXXX => ref *(UInt4*)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 UInt4 XXXY => ref *(UInt4*)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 UInt4 XXYX => ref *(UInt4*)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 UInt4 XXYY => ref *(UInt4*)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 UInt4 XYXX => ref *(UInt4*)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 UInt4 XYXY => ref *(UInt4*)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 UInt4 XYYX => ref *(UInt4*)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 UInt4 XYYY => ref *(UInt4*)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 UInt4 YXXX => ref *(UInt4*)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 UInt4 YXXY => ref *(UInt4*)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 UInt4 YXYX => ref *(UInt4*)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 UInt4 YXYY => ref *(UInt4*)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 UInt4 YYXX => ref *(UInt4*)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 UInt4 YYXY => ref *(UInt4*)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 UInt4 YYYX => ref *(UInt4*)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 UInt4 YYYY => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref uint 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 uint 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 UInt2 RR => ref *(UInt2*)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 UInt2 RG => ref *(UInt2*)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 UInt2 GR => ref *(UInt2*)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 UInt2 GG => ref *(UInt2*)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 UInt3 RRR => ref *(UInt3*)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 UInt3 RRG => ref *(UInt3*)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 UInt3 RGR => ref *(UInt3*)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 UInt3 RGG => ref *(UInt3*)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 UInt3 GRR => ref *(UInt3*)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 UInt3 GRG => ref *(UInt3*)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 UInt3 GGR => ref *(UInt3*)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 UInt3 GGG => ref *(UInt3*)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 UInt4 RRRR => ref *(UInt4*)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 UInt4 RRRG => ref *(UInt4*)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 UInt4 RRGR => ref *(UInt4*)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 UInt4 RRGG => ref *(UInt4*)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 UInt4 RGRR => ref *(UInt4*)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 UInt4 RGRG => ref *(UInt4*)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 UInt4 RGGR => ref *(UInt4*)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 UInt4 RGGG => ref *(UInt4*)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 UInt4 GRRR => ref *(UInt4*)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 UInt4 GRRG => ref *(UInt4*)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 UInt4 GRGR => ref *(UInt4*)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 UInt4 GRGG => ref *(UInt4*)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 UInt4 GGRR => ref *(UInt4*)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 UInt4 GGRG => ref *(UInt4*)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 UInt4 GGGR => ref *(UInt4*)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 UInt4 GGGG => ref *(UInt4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2), sizeof(UInt4)); - - [FieldOffset(0)] - private uint x; - - [FieldOffset(4)] - private uint 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 uint this[int i] => ref *(uint*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref uint 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 uint 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 UInt2 XX => ref *(UInt2*)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 UInt2 XY => ref *(UInt2*)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 UInt2 YX => ref *(UInt2*)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 UInt2 YY => ref *(UInt2*)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 UInt3 XXX => ref *(UInt3*)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 UInt3 XXY => ref *(UInt3*)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 UInt3 XYX => ref *(UInt3*)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 UInt3 XYY => ref *(UInt3*)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 UInt3 YXX => ref *(UInt3*)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 UInt3 YXY => ref *(UInt3*)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 UInt3 YYX => ref *(UInt3*)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 UInt3 YYY => ref *(UInt3*)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 UInt4 XXXX => ref *(UInt4*)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 UInt4 XXXY => ref *(UInt4*)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 UInt4 XXYX => ref *(UInt4*)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 UInt4 XXYY => ref *(UInt4*)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 UInt4 XYXX => ref *(UInt4*)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 UInt4 XYXY => ref *(UInt4*)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 UInt4 XYYX => ref *(UInt4*)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 UInt4 XYYY => ref *(UInt4*)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 UInt4 YXXX => ref *(UInt4*)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 UInt4 YXXY => ref *(UInt4*)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 UInt4 YXYX => ref *(UInt4*)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 UInt4 YXYY => ref *(UInt4*)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 UInt4 YYXX => ref *(UInt4*)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 UInt4 YYXY => ref *(UInt4*)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 UInt4 YYYX => ref *(UInt4*)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 UInt4 YYYY => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref uint 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 uint 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 UInt2 RR => ref *(UInt2*)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 UInt2 RG => ref *(UInt2*)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 UInt2 GR => ref *(UInt2*)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 UInt2 GG => ref *(UInt2*)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 UInt3 RRR => ref *(UInt3*)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 UInt3 RRG => ref *(UInt3*)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 UInt3 RGR => ref *(UInt3*)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 UInt3 RGG => ref *(UInt3*)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 UInt3 GRR => ref *(UInt3*)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 UInt3 GRG => ref *(UInt3*)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 UInt3 GGR => ref *(UInt3*)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 UInt3 GGG => ref *(UInt3*)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 UInt4 RRRR => ref *(UInt4*)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 UInt4 RRRG => ref *(UInt4*)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 UInt4 RRGR => ref *(UInt4*)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 UInt4 RRGG => ref *(UInt4*)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 UInt4 RGRR => ref *(UInt4*)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 UInt4 RGRG => ref *(UInt4*)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 UInt4 RGGR => ref *(UInt4*)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 UInt4 RGGG => ref *(UInt4*)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 UInt4 GRRR => ref *(UInt4*)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 UInt4 GRRG => ref *(UInt4*)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 UInt4 GRGR => ref *(UInt4*)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 UInt4 GRGG => ref *(UInt4*)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 UInt4 GGRR => ref *(UInt4*)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 UInt4 GGRG => ref *(UInt4*)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 UInt4 GGGR => ref *(UInt4*)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 UInt4 GGGG => ref *(UInt4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt2 operator +(UInt2 left, UInt2 right) => default; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt2 operator /(UInt2 left, UInt2 right) => default; - - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt2 operator *(UInt2 left, UInt2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt2 operator -(UInt2 left, UInt2 right) => default; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt2 operator +(UInt2 left, UInt2 right) => default; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt2 operator /(UInt2 left, UInt2 right) => default; + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt2 operator *(UInt2 left, UInt2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt2 operator -(UInt2 left, UInt2 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs index 0fec29a5..87312c51 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs @@ -1,97 +1,96 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct UInt3 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct UInt3 + public static UInt3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static UInt3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitZ => new(0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + public UInt3(uint x, uint y, uint z) { - /// - /// Gets an value with all components set to 0. - /// - public static UInt3 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static UInt3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt3 UnitX => new(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt3 UnitY => new(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt3 UnitZ => new(0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - public UInt3(uint x, uint y, uint z) - { - this.x = x; - this.y = y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - public UInt3(UInt2 xy, uint z) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second and thirt vector components. - public UInt3(uint x, UInt2 yz) - { - this.x = x; - this.y = yz.X; - this.z = yz.Y; - } - - /// - /// 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 UInt3(uint x) => new(x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int3(UInt3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Float3(UInt3 xyz) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double3(UInt3 xyz) => default; + this.x = x; + this.y = y; + this.z = z; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public UInt3(UInt2 xy, uint z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public UInt3(uint x, UInt2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// 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 UInt3(uint x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int3(UInt3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Float3(UInt3 xyz) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double3(UInt3 xyz) => default; } diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs index 353523dd..d2fab955 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs @@ -10,1523 +10,1522 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct UInt3 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct UInt3 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3), sizeof(UInt4)); + + [FieldOffset(0)] + private uint x; + + [FieldOffset(4)] + private uint y; + + [FieldOffset(8)] + private uint z; + + /// + /// 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 uint this[int i] => ref *(uint*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref uint 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 uint Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref uint Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 UInt2 XX => ref *(UInt2*)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 UInt2 XY => ref *(UInt2*)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 UInt2 XZ => ref *(UInt2*)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 UInt2 YX => ref *(UInt2*)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 UInt2 YY => ref *(UInt2*)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 UInt2 YZ => ref *(UInt2*)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 UInt2 ZX => ref *(UInt2*)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 UInt2 ZY => ref *(UInt2*)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 UInt2 ZZ => ref *(UInt2*)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 UInt3 XXX => ref *(UInt3*)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 UInt3 XXY => ref *(UInt3*)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 UInt3 XXZ => ref *(UInt3*)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 UInt3 XYX => ref *(UInt3*)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 UInt3 XYY => ref *(UInt3*)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 UInt3 XYZ => ref *(UInt3*)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 UInt3 XZX => ref *(UInt3*)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 UInt3 XZY => ref *(UInt3*)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 UInt3 XZZ => ref *(UInt3*)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 UInt3 YXX => ref *(UInt3*)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 UInt3 YXY => ref *(UInt3*)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 UInt3 YXZ => ref *(UInt3*)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 UInt3 YYX => ref *(UInt3*)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 UInt3 YYY => ref *(UInt3*)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 UInt3 YYZ => ref *(UInt3*)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 UInt3 YZX => ref *(UInt3*)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 UInt3 YZY => ref *(UInt3*)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 UInt3 YZZ => ref *(UInt3*)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 UInt3 ZXX => ref *(UInt3*)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 UInt3 ZXY => ref *(UInt3*)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 UInt3 ZXZ => ref *(UInt3*)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 UInt3 ZYX => ref *(UInt3*)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 UInt3 ZYY => ref *(UInt3*)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 UInt3 ZYZ => ref *(UInt3*)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 UInt3 ZZX => ref *(UInt3*)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 UInt3 ZZY => ref *(UInt3*)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 UInt3 ZZZ => ref *(UInt3*)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 UInt4 XXXX => ref *(UInt4*)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 UInt4 XXXY => ref *(UInt4*)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 UInt4 XXXZ => ref *(UInt4*)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 UInt4 XXYX => ref *(UInt4*)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 UInt4 XXYY => ref *(UInt4*)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 UInt4 XXYZ => ref *(UInt4*)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 UInt4 XXZX => ref *(UInt4*)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 UInt4 XXZY => ref *(UInt4*)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 UInt4 XXZZ => ref *(UInt4*)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 UInt4 XYXX => ref *(UInt4*)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 UInt4 XYXY => ref *(UInt4*)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 UInt4 XYXZ => ref *(UInt4*)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 UInt4 XYYX => ref *(UInt4*)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 UInt4 XYYY => ref *(UInt4*)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 UInt4 XYYZ => ref *(UInt4*)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 UInt4 XYZX => ref *(UInt4*)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 UInt4 XYZY => ref *(UInt4*)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 UInt4 XYZZ => ref *(UInt4*)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 UInt4 XZXX => ref *(UInt4*)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 UInt4 XZXY => ref *(UInt4*)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 UInt4 XZXZ => ref *(UInt4*)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 UInt4 XZYX => ref *(UInt4*)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 UInt4 XZYY => ref *(UInt4*)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 UInt4 XZYZ => ref *(UInt4*)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 UInt4 XZZX => ref *(UInt4*)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 UInt4 XZZY => ref *(UInt4*)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 UInt4 XZZZ => ref *(UInt4*)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 UInt4 YXXX => ref *(UInt4*)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 UInt4 YXXY => ref *(UInt4*)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 UInt4 YXXZ => ref *(UInt4*)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 UInt4 YXYX => ref *(UInt4*)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 UInt4 YXYY => ref *(UInt4*)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 UInt4 YXYZ => ref *(UInt4*)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 UInt4 YXZX => ref *(UInt4*)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 UInt4 YXZY => ref *(UInt4*)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 UInt4 YXZZ => ref *(UInt4*)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 UInt4 YYXX => ref *(UInt4*)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 UInt4 YYXY => ref *(UInt4*)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 UInt4 YYXZ => ref *(UInt4*)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 UInt4 YYYX => ref *(UInt4*)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 UInt4 YYYY => ref *(UInt4*)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 UInt4 YYYZ => ref *(UInt4*)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 UInt4 YYZX => ref *(UInt4*)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 UInt4 YYZY => ref *(UInt4*)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 UInt4 YYZZ => ref *(UInt4*)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 UInt4 YZXX => ref *(UInt4*)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 UInt4 YZXY => ref *(UInt4*)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 UInt4 YZXZ => ref *(UInt4*)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 UInt4 YZYX => ref *(UInt4*)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 UInt4 YZYY => ref *(UInt4*)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 UInt4 YZYZ => ref *(UInt4*)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 UInt4 YZZX => ref *(UInt4*)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 UInt4 YZZY => ref *(UInt4*)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 UInt4 YZZZ => ref *(UInt4*)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 UInt4 ZXXX => ref *(UInt4*)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 UInt4 ZXXY => ref *(UInt4*)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 UInt4 ZXXZ => ref *(UInt4*)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 UInt4 ZXYX => ref *(UInt4*)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 UInt4 ZXYY => ref *(UInt4*)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 UInt4 ZXYZ => ref *(UInt4*)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 UInt4 ZXZX => ref *(UInt4*)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 UInt4 ZXZY => ref *(UInt4*)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 UInt4 ZXZZ => ref *(UInt4*)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 UInt4 ZYXX => ref *(UInt4*)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 UInt4 ZYXY => ref *(UInt4*)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 UInt4 ZYXZ => ref *(UInt4*)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 UInt4 ZYYX => ref *(UInt4*)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 UInt4 ZYYY => ref *(UInt4*)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 UInt4 ZYYZ => ref *(UInt4*)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 UInt4 ZYZX => ref *(UInt4*)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 UInt4 ZYZY => ref *(UInt4*)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 UInt4 ZYZZ => ref *(UInt4*)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 UInt4 ZZXX => ref *(UInt4*)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 UInt4 ZZXY => ref *(UInt4*)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 UInt4 ZZXZ => ref *(UInt4*)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 UInt4 ZZYX => ref *(UInt4*)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 UInt4 ZZYY => ref *(UInt4*)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 UInt4 ZZYZ => ref *(UInt4*)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 UInt4 ZZZX => ref *(UInt4*)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 UInt4 ZZZY => ref *(UInt4*)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 UInt4 ZZZZ => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref uint 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 uint G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref uint B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 UInt2 RR => ref *(UInt2*)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 UInt2 RG => ref *(UInt2*)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 UInt2 RB => ref *(UInt2*)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 UInt2 GR => ref *(UInt2*)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 UInt2 GG => ref *(UInt2*)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 UInt2 GB => ref *(UInt2*)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 UInt2 BR => ref *(UInt2*)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 UInt2 BG => ref *(UInt2*)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 UInt2 BB => ref *(UInt2*)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 UInt3 RRR => ref *(UInt3*)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 UInt3 RRG => ref *(UInt3*)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 UInt3 RRB => ref *(UInt3*)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 UInt3 RGR => ref *(UInt3*)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 UInt3 RGG => ref *(UInt3*)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 UInt3 RGB => ref *(UInt3*)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 UInt3 RBR => ref *(UInt3*)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 UInt3 RBG => ref *(UInt3*)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 UInt3 RBB => ref *(UInt3*)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 UInt3 GRR => ref *(UInt3*)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 UInt3 GRG => ref *(UInt3*)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 UInt3 GRB => ref *(UInt3*)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 UInt3 GGR => ref *(UInt3*)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 UInt3 GGG => ref *(UInt3*)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 UInt3 GGB => ref *(UInt3*)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 UInt3 GBR => ref *(UInt3*)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 UInt3 GBG => ref *(UInt3*)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 UInt3 GBB => ref *(UInt3*)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 UInt3 BRR => ref *(UInt3*)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 UInt3 BRG => ref *(UInt3*)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 UInt3 BRB => ref *(UInt3*)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 UInt3 BGR => ref *(UInt3*)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 UInt3 BGG => ref *(UInt3*)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 UInt3 BGB => ref *(UInt3*)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 UInt3 BBR => ref *(UInt3*)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 UInt3 BBG => ref *(UInt3*)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 UInt3 BBB => ref *(UInt3*)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 UInt4 RRRR => ref *(UInt4*)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 UInt4 RRRG => ref *(UInt4*)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 UInt4 RRRB => ref *(UInt4*)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 UInt4 RRGR => ref *(UInt4*)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 UInt4 RRGG => ref *(UInt4*)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 UInt4 RRGB => ref *(UInt4*)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 UInt4 RRBR => ref *(UInt4*)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 UInt4 RRBG => ref *(UInt4*)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 UInt4 RRBB => ref *(UInt4*)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 UInt4 RGRR => ref *(UInt4*)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 UInt4 RGRG => ref *(UInt4*)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 UInt4 RGRB => ref *(UInt4*)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 UInt4 RGGR => ref *(UInt4*)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 UInt4 RGGG => ref *(UInt4*)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 UInt4 RGGB => ref *(UInt4*)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 UInt4 RGBR => ref *(UInt4*)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 UInt4 RGBG => ref *(UInt4*)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 UInt4 RGBB => ref *(UInt4*)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 UInt4 RBRR => ref *(UInt4*)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 UInt4 RBRG => ref *(UInt4*)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 UInt4 RBRB => ref *(UInt4*)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 UInt4 RBGR => ref *(UInt4*)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 UInt4 RBGG => ref *(UInt4*)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 UInt4 RBGB => ref *(UInt4*)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 UInt4 RBBR => ref *(UInt4*)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 UInt4 RBBG => ref *(UInt4*)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 UInt4 RBBB => ref *(UInt4*)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 UInt4 GRRR => ref *(UInt4*)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 UInt4 GRRG => ref *(UInt4*)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 UInt4 GRRB => ref *(UInt4*)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 UInt4 GRGR => ref *(UInt4*)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 UInt4 GRGG => ref *(UInt4*)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 UInt4 GRGB => ref *(UInt4*)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 UInt4 GRBR => ref *(UInt4*)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 UInt4 GRBG => ref *(UInt4*)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 UInt4 GRBB => ref *(UInt4*)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 UInt4 GGRR => ref *(UInt4*)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 UInt4 GGRG => ref *(UInt4*)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 UInt4 GGRB => ref *(UInt4*)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 UInt4 GGGR => ref *(UInt4*)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 UInt4 GGGG => ref *(UInt4*)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 UInt4 GGGB => ref *(UInt4*)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 UInt4 GGBR => ref *(UInt4*)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 UInt4 GGBG => ref *(UInt4*)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 UInt4 GGBB => ref *(UInt4*)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 UInt4 GBRR => ref *(UInt4*)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 UInt4 GBRG => ref *(UInt4*)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 UInt4 GBRB => ref *(UInt4*)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 UInt4 GBGR => ref *(UInt4*)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 UInt4 GBGG => ref *(UInt4*)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 UInt4 GBGB => ref *(UInt4*)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 UInt4 GBBR => ref *(UInt4*)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 UInt4 GBBG => ref *(UInt4*)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 UInt4 GBBB => ref *(UInt4*)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 UInt4 BRRR => ref *(UInt4*)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 UInt4 BRRG => ref *(UInt4*)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 UInt4 BRRB => ref *(UInt4*)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 UInt4 BRGR => ref *(UInt4*)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 UInt4 BRGG => ref *(UInt4*)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 UInt4 BRGB => ref *(UInt4*)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 UInt4 BRBR => ref *(UInt4*)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 UInt4 BRBG => ref *(UInt4*)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 UInt4 BRBB => ref *(UInt4*)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 UInt4 BGRR => ref *(UInt4*)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 UInt4 BGRG => ref *(UInt4*)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 UInt4 BGRB => ref *(UInt4*)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 UInt4 BGGR => ref *(UInt4*)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 UInt4 BGGG => ref *(UInt4*)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 UInt4 BGGB => ref *(UInt4*)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 UInt4 BGBR => ref *(UInt4*)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 UInt4 BGBG => ref *(UInt4*)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 UInt4 BGBB => ref *(UInt4*)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 UInt4 BBRR => ref *(UInt4*)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 UInt4 BBRG => ref *(UInt4*)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 UInt4 BBRB => ref *(UInt4*)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 UInt4 BBGR => ref *(UInt4*)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 UInt4 BBGG => ref *(UInt4*)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 UInt4 BBGB => ref *(UInt4*)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 UInt4 BBBR => ref *(UInt4*)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 UInt4 BBBG => ref *(UInt4*)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 UInt4 BBBB => ref *(UInt4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3), sizeof(UInt4)); - - [FieldOffset(0)] - private uint x; - - [FieldOffset(4)] - private uint y; - - [FieldOffset(8)] - private uint z; - - /// - /// 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 uint this[int i] => ref *(uint*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref uint 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 uint Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref uint Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 UInt2 XX => ref *(UInt2*)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 UInt2 XY => ref *(UInt2*)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 UInt2 XZ => ref *(UInt2*)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 UInt2 YX => ref *(UInt2*)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 UInt2 YY => ref *(UInt2*)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 UInt2 YZ => ref *(UInt2*)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 UInt2 ZX => ref *(UInt2*)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 UInt2 ZY => ref *(UInt2*)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 UInt2 ZZ => ref *(UInt2*)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 UInt3 XXX => ref *(UInt3*)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 UInt3 XXY => ref *(UInt3*)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 UInt3 XXZ => ref *(UInt3*)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 UInt3 XYX => ref *(UInt3*)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 UInt3 XYY => ref *(UInt3*)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 UInt3 XYZ => ref *(UInt3*)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 UInt3 XZX => ref *(UInt3*)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 UInt3 XZY => ref *(UInt3*)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 UInt3 XZZ => ref *(UInt3*)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 UInt3 YXX => ref *(UInt3*)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 UInt3 YXY => ref *(UInt3*)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 UInt3 YXZ => ref *(UInt3*)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 UInt3 YYX => ref *(UInt3*)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 UInt3 YYY => ref *(UInt3*)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 UInt3 YYZ => ref *(UInt3*)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 UInt3 YZX => ref *(UInt3*)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 UInt3 YZY => ref *(UInt3*)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 UInt3 YZZ => ref *(UInt3*)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 UInt3 ZXX => ref *(UInt3*)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 UInt3 ZXY => ref *(UInt3*)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 UInt3 ZXZ => ref *(UInt3*)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 UInt3 ZYX => ref *(UInt3*)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 UInt3 ZYY => ref *(UInt3*)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 UInt3 ZYZ => ref *(UInt3*)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 UInt3 ZZX => ref *(UInt3*)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 UInt3 ZZY => ref *(UInt3*)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 UInt3 ZZZ => ref *(UInt3*)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 UInt4 XXXX => ref *(UInt4*)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 UInt4 XXXY => ref *(UInt4*)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 UInt4 XXXZ => ref *(UInt4*)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 UInt4 XXYX => ref *(UInt4*)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 UInt4 XXYY => ref *(UInt4*)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 UInt4 XXYZ => ref *(UInt4*)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 UInt4 XXZX => ref *(UInt4*)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 UInt4 XXZY => ref *(UInt4*)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 UInt4 XXZZ => ref *(UInt4*)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 UInt4 XYXX => ref *(UInt4*)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 UInt4 XYXY => ref *(UInt4*)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 UInt4 XYXZ => ref *(UInt4*)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 UInt4 XYYX => ref *(UInt4*)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 UInt4 XYYY => ref *(UInt4*)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 UInt4 XYYZ => ref *(UInt4*)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 UInt4 XYZX => ref *(UInt4*)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 UInt4 XYZY => ref *(UInt4*)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 UInt4 XYZZ => ref *(UInt4*)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 UInt4 XZXX => ref *(UInt4*)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 UInt4 XZXY => ref *(UInt4*)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 UInt4 XZXZ => ref *(UInt4*)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 UInt4 XZYX => ref *(UInt4*)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 UInt4 XZYY => ref *(UInt4*)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 UInt4 XZYZ => ref *(UInt4*)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 UInt4 XZZX => ref *(UInt4*)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 UInt4 XZZY => ref *(UInt4*)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 UInt4 XZZZ => ref *(UInt4*)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 UInt4 YXXX => ref *(UInt4*)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 UInt4 YXXY => ref *(UInt4*)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 UInt4 YXXZ => ref *(UInt4*)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 UInt4 YXYX => ref *(UInt4*)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 UInt4 YXYY => ref *(UInt4*)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 UInt4 YXYZ => ref *(UInt4*)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 UInt4 YXZX => ref *(UInt4*)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 UInt4 YXZY => ref *(UInt4*)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 UInt4 YXZZ => ref *(UInt4*)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 UInt4 YYXX => ref *(UInt4*)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 UInt4 YYXY => ref *(UInt4*)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 UInt4 YYXZ => ref *(UInt4*)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 UInt4 YYYX => ref *(UInt4*)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 UInt4 YYYY => ref *(UInt4*)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 UInt4 YYYZ => ref *(UInt4*)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 UInt4 YYZX => ref *(UInt4*)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 UInt4 YYZY => ref *(UInt4*)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 UInt4 YYZZ => ref *(UInt4*)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 UInt4 YZXX => ref *(UInt4*)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 UInt4 YZXY => ref *(UInt4*)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 UInt4 YZXZ => ref *(UInt4*)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 UInt4 YZYX => ref *(UInt4*)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 UInt4 YZYY => ref *(UInt4*)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 UInt4 YZYZ => ref *(UInt4*)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 UInt4 YZZX => ref *(UInt4*)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 UInt4 YZZY => ref *(UInt4*)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 UInt4 YZZZ => ref *(UInt4*)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 UInt4 ZXXX => ref *(UInt4*)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 UInt4 ZXXY => ref *(UInt4*)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 UInt4 ZXXZ => ref *(UInt4*)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 UInt4 ZXYX => ref *(UInt4*)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 UInt4 ZXYY => ref *(UInt4*)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 UInt4 ZXYZ => ref *(UInt4*)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 UInt4 ZXZX => ref *(UInt4*)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 UInt4 ZXZY => ref *(UInt4*)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 UInt4 ZXZZ => ref *(UInt4*)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 UInt4 ZYXX => ref *(UInt4*)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 UInt4 ZYXY => ref *(UInt4*)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 UInt4 ZYXZ => ref *(UInt4*)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 UInt4 ZYYX => ref *(UInt4*)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 UInt4 ZYYY => ref *(UInt4*)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 UInt4 ZYYZ => ref *(UInt4*)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 UInt4 ZYZX => ref *(UInt4*)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 UInt4 ZYZY => ref *(UInt4*)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 UInt4 ZYZZ => ref *(UInt4*)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 UInt4 ZZXX => ref *(UInt4*)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 UInt4 ZZXY => ref *(UInt4*)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 UInt4 ZZXZ => ref *(UInt4*)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 UInt4 ZZYX => ref *(UInt4*)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 UInt4 ZZYY => ref *(UInt4*)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 UInt4 ZZYZ => ref *(UInt4*)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 UInt4 ZZZX => ref *(UInt4*)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 UInt4 ZZZY => ref *(UInt4*)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 UInt4 ZZZZ => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref uint 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 uint G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref uint B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 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 UInt2 RR => ref *(UInt2*)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 UInt2 RG => ref *(UInt2*)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 UInt2 RB => ref *(UInt2*)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 UInt2 GR => ref *(UInt2*)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 UInt2 GG => ref *(UInt2*)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 UInt2 GB => ref *(UInt2*)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 UInt2 BR => ref *(UInt2*)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 UInt2 BG => ref *(UInt2*)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 UInt2 BB => ref *(UInt2*)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 UInt3 RRR => ref *(UInt3*)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 UInt3 RRG => ref *(UInt3*)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 UInt3 RRB => ref *(UInt3*)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 UInt3 RGR => ref *(UInt3*)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 UInt3 RGG => ref *(UInt3*)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 UInt3 RGB => ref *(UInt3*)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 UInt3 RBR => ref *(UInt3*)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 UInt3 RBG => ref *(UInt3*)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 UInt3 RBB => ref *(UInt3*)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 UInt3 GRR => ref *(UInt3*)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 UInt3 GRG => ref *(UInt3*)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 UInt3 GRB => ref *(UInt3*)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 UInt3 GGR => ref *(UInt3*)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 UInt3 GGG => ref *(UInt3*)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 UInt3 GGB => ref *(UInt3*)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 UInt3 GBR => ref *(UInt3*)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 UInt3 GBG => ref *(UInt3*)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 UInt3 GBB => ref *(UInt3*)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 UInt3 BRR => ref *(UInt3*)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 UInt3 BRG => ref *(UInt3*)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 UInt3 BRB => ref *(UInt3*)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 UInt3 BGR => ref *(UInt3*)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 UInt3 BGG => ref *(UInt3*)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 UInt3 BGB => ref *(UInt3*)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 UInt3 BBR => ref *(UInt3*)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 UInt3 BBG => ref *(UInt3*)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 UInt3 BBB => ref *(UInt3*)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 UInt4 RRRR => ref *(UInt4*)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 UInt4 RRRG => ref *(UInt4*)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 UInt4 RRRB => ref *(UInt4*)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 UInt4 RRGR => ref *(UInt4*)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 UInt4 RRGG => ref *(UInt4*)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 UInt4 RRGB => ref *(UInt4*)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 UInt4 RRBR => ref *(UInt4*)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 UInt4 RRBG => ref *(UInt4*)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 UInt4 RRBB => ref *(UInt4*)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 UInt4 RGRR => ref *(UInt4*)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 UInt4 RGRG => ref *(UInt4*)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 UInt4 RGRB => ref *(UInt4*)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 UInt4 RGGR => ref *(UInt4*)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 UInt4 RGGG => ref *(UInt4*)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 UInt4 RGGB => ref *(UInt4*)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 UInt4 RGBR => ref *(UInt4*)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 UInt4 RGBG => ref *(UInt4*)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 UInt4 RGBB => ref *(UInt4*)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 UInt4 RBRR => ref *(UInt4*)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 UInt4 RBRG => ref *(UInt4*)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 UInt4 RBRB => ref *(UInt4*)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 UInt4 RBGR => ref *(UInt4*)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 UInt4 RBGG => ref *(UInt4*)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 UInt4 RBGB => ref *(UInt4*)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 UInt4 RBBR => ref *(UInt4*)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 UInt4 RBBG => ref *(UInt4*)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 UInt4 RBBB => ref *(UInt4*)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 UInt4 GRRR => ref *(UInt4*)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 UInt4 GRRG => ref *(UInt4*)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 UInt4 GRRB => ref *(UInt4*)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 UInt4 GRGR => ref *(UInt4*)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 UInt4 GRGG => ref *(UInt4*)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 UInt4 GRGB => ref *(UInt4*)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 UInt4 GRBR => ref *(UInt4*)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 UInt4 GRBG => ref *(UInt4*)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 UInt4 GRBB => ref *(UInt4*)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 UInt4 GGRR => ref *(UInt4*)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 UInt4 GGRG => ref *(UInt4*)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 UInt4 GGRB => ref *(UInt4*)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 UInt4 GGGR => ref *(UInt4*)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 UInt4 GGGG => ref *(UInt4*)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 UInt4 GGGB => ref *(UInt4*)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 UInt4 GGBR => ref *(UInt4*)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 UInt4 GGBG => ref *(UInt4*)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 UInt4 GGBB => ref *(UInt4*)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 UInt4 GBRR => ref *(UInt4*)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 UInt4 GBRG => ref *(UInt4*)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 UInt4 GBRB => ref *(UInt4*)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 UInt4 GBGR => ref *(UInt4*)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 UInt4 GBGG => ref *(UInt4*)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 UInt4 GBGB => ref *(UInt4*)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 UInt4 GBBR => ref *(UInt4*)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 UInt4 GBBG => ref *(UInt4*)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 UInt4 GBBB => ref *(UInt4*)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 UInt4 BRRR => ref *(UInt4*)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 UInt4 BRRG => ref *(UInt4*)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 UInt4 BRRB => ref *(UInt4*)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 UInt4 BRGR => ref *(UInt4*)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 UInt4 BRGG => ref *(UInt4*)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 UInt4 BRGB => ref *(UInt4*)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 UInt4 BRBR => ref *(UInt4*)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 UInt4 BRBG => ref *(UInt4*)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 UInt4 BRBB => ref *(UInt4*)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 UInt4 BGRR => ref *(UInt4*)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 UInt4 BGRG => ref *(UInt4*)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 UInt4 BGRB => ref *(UInt4*)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 UInt4 BGGR => ref *(UInt4*)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 UInt4 BGGG => ref *(UInt4*)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 UInt4 BGGB => ref *(UInt4*)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 UInt4 BGBR => ref *(UInt4*)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 UInt4 BGBG => ref *(UInt4*)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 UInt4 BGBB => ref *(UInt4*)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 UInt4 BBRR => ref *(UInt4*)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 UInt4 BBRG => ref *(UInt4*)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 UInt4 BBRB => ref *(UInt4*)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 UInt4 BBGR => ref *(UInt4*)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 UInt4 BBGG => ref *(UInt4*)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 UInt4 BBGB => ref *(UInt4*)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 UInt4 BBBR => ref *(UInt4*)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 UInt4 BBBG => ref *(UInt4*)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 UInt4 BBBB => ref *(UInt4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt3 operator +(UInt3 left, UInt3 right) => default; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt3 operator /(UInt3 left, UInt3 right) => default; - - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt3 operator *(UInt3 left, UInt3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt3 operator -(UInt3 left, UInt3 right) => default; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt3 operator +(UInt3 left, UInt3 right) => default; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt3 operator /(UInt3 left, UInt3 right) => default; + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt3 operator *(UInt3 left, UInt3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt3 operator -(UInt3 left, UInt3 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs index 6b76e874..3e316b8a 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs @@ -1,147 +1,146 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that maps the HLSL type. +/// +public partial struct UInt4 { /// - /// A that maps the HLSL type. + /// Gets an value with all components set to 0. /// - public partial struct UInt4 + public static UInt4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static UInt4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitW => new(0, 0, 0, 1); + + /// + /// 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. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public UInt4(uint x, uint y, uint z, uint w) { - /// - /// Gets an value with all components set to 0. - /// - public static UInt4 Zero => 0; - - /// - /// Gets an value with all components set to 1. - /// - public static UInt4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitX => new(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitY => new(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitZ => new(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0. - /// - public static UInt4 UnitW => new(0, 0, 0, 1); - - /// - /// 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. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public UInt4(uint x, uint y, uint z, uint w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third vector component. - /// The value to assign to the fourth vector component. - public UInt4(UInt2 xy, uint z, uint w) - { - this.x = xy.X; - this.y = xy.Y; - this.z = z; - this.w = w; - } - - /// - /// 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. - /// The value to assign to the third and fourth vector components. - public UInt4(uint x, uint y, UInt2 zw) - { - this.x = x; - this.y = y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first and second vector components. - /// The value to assign to the third and fourth vector components. - public UInt4(UInt2 xy, UInt2 zw) - { - this.x = xy.X; - this.y = xy.Y; - this.z = zw.X; - this.w = zw.Y; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first, second and third vector components. - /// The value to assign to the fourth vector component. - public UInt4(UInt3 xyz, uint w) - { - this.x = xyz.X; - this.y = xyz.Y; - this.z = xyz.Z; - this.w = w; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the first vector component. - /// The value to assign to the second, third and fourth vector components. - public UInt4(uint x, UInt3 yzw) - { - this.x = x; - this.y = yzw.X; - this.z = yzw.Y; - this.w = yzw.Z; - } - - /// - /// 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 UInt4(uint x) => new(x, x, x, x); - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 explicit operator Int4(UInt4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Float4(UInt4 xyzw) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - /// 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 implicit operator Double4(UInt4 xyzw) => default; + this.x = x; + this.y = y; + this.z = z; + this.w = w; } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public UInt4(UInt2 xy, uint z, uint w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// 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. + /// The value to assign to the third and fourth vector components. + public UInt4(uint x, uint y, UInt2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public UInt4(UInt2 xy, UInt2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public UInt4(UInt3 xyz, uint w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public UInt4(uint x, UInt3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// 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 UInt4(uint x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 explicit operator Int4(UInt4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Float4(UInt4 xyzw) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + /// 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 implicit operator Double4(UInt4 xyzw) => default; } diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs index 269cf7ec..cf6735af 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs @@ -10,4167 +10,4166 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct UInt4 : IFormattable { - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct UInt4 : IFormattable + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4), sizeof(UInt4)); + + [FieldOffset(0)] + private uint x; + + [FieldOffset(4)] + private uint y; + + [FieldOffset(8)] + private uint z; + + [FieldOffset(12)] + private uint w; + + /// + /// 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 uint this[int i] => ref *(uint*)UndefinedData; + + /// + /// Gets a reference to the value representing the X component. + /// + public readonly ref uint 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 uint Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the Z component. + /// + public readonly ref uint Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the W component. + /// + public readonly ref uint W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 UInt2 XX => ref *(UInt2*)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 UInt2 XY => ref *(UInt2*)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 UInt2 XZ => ref *(UInt2*)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 UInt2 XW => ref *(UInt2*)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 UInt2 YX => ref *(UInt2*)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 UInt2 YY => ref *(UInt2*)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 UInt2 YZ => ref *(UInt2*)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 UInt2 YW => ref *(UInt2*)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 UInt2 ZX => ref *(UInt2*)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 UInt2 ZY => ref *(UInt2*)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 UInt2 ZZ => ref *(UInt2*)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 UInt2 ZW => ref *(UInt2*)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 UInt2 WX => ref *(UInt2*)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 UInt2 WY => ref *(UInt2*)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 UInt2 WZ => ref *(UInt2*)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 UInt2 WW => ref *(UInt2*)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 UInt3 XXX => ref *(UInt3*)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 UInt3 XXY => ref *(UInt3*)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 UInt3 XXZ => ref *(UInt3*)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 UInt3 XXW => ref *(UInt3*)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 UInt3 XYX => ref *(UInt3*)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 UInt3 XYY => ref *(UInt3*)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 UInt3 XYZ => ref *(UInt3*)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 UInt3 XYW => ref *(UInt3*)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 UInt3 XZX => ref *(UInt3*)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 UInt3 XZY => ref *(UInt3*)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 UInt3 XZZ => ref *(UInt3*)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 UInt3 XZW => ref *(UInt3*)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 UInt3 XWX => ref *(UInt3*)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 UInt3 XWY => ref *(UInt3*)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 UInt3 XWZ => ref *(UInt3*)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 UInt3 XWW => ref *(UInt3*)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 UInt3 YXX => ref *(UInt3*)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 UInt3 YXY => ref *(UInt3*)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 UInt3 YXZ => ref *(UInt3*)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 UInt3 YXW => ref *(UInt3*)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 UInt3 YYX => ref *(UInt3*)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 UInt3 YYY => ref *(UInt3*)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 UInt3 YYZ => ref *(UInt3*)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 UInt3 YYW => ref *(UInt3*)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 UInt3 YZX => ref *(UInt3*)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 UInt3 YZY => ref *(UInt3*)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 UInt3 YZZ => ref *(UInt3*)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 UInt3 YZW => ref *(UInt3*)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 UInt3 YWX => ref *(UInt3*)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 UInt3 YWY => ref *(UInt3*)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 UInt3 YWZ => ref *(UInt3*)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 UInt3 YWW => ref *(UInt3*)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 UInt3 ZXX => ref *(UInt3*)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 UInt3 ZXY => ref *(UInt3*)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 UInt3 ZXZ => ref *(UInt3*)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 UInt3 ZXW => ref *(UInt3*)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 UInt3 ZYX => ref *(UInt3*)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 UInt3 ZYY => ref *(UInt3*)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 UInt3 ZYZ => ref *(UInt3*)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 UInt3 ZYW => ref *(UInt3*)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 UInt3 ZZX => ref *(UInt3*)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 UInt3 ZZY => ref *(UInt3*)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 UInt3 ZZZ => ref *(UInt3*)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 UInt3 ZZW => ref *(UInt3*)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 UInt3 ZWX => ref *(UInt3*)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 UInt3 ZWY => ref *(UInt3*)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 UInt3 ZWZ => ref *(UInt3*)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 UInt3 ZWW => ref *(UInt3*)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 UInt3 WXX => ref *(UInt3*)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 UInt3 WXY => ref *(UInt3*)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 UInt3 WXZ => ref *(UInt3*)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 UInt3 WXW => ref *(UInt3*)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 UInt3 WYX => ref *(UInt3*)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 UInt3 WYY => ref *(UInt3*)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 UInt3 WYZ => ref *(UInt3*)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 UInt3 WYW => ref *(UInt3*)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 UInt3 WZX => ref *(UInt3*)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 UInt3 WZY => ref *(UInt3*)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 UInt3 WZZ => ref *(UInt3*)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 UInt3 WZW => ref *(UInt3*)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 UInt3 WWX => ref *(UInt3*)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 UInt3 WWY => ref *(UInt3*)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 UInt3 WWZ => ref *(UInt3*)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 UInt3 WWW => ref *(UInt3*)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 UInt4 XXXX => ref *(UInt4*)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 UInt4 XXXY => ref *(UInt4*)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 UInt4 XXXZ => ref *(UInt4*)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 UInt4 XXXW => ref *(UInt4*)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 UInt4 XXYX => ref *(UInt4*)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 UInt4 XXYY => ref *(UInt4*)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 UInt4 XXYZ => ref *(UInt4*)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 UInt4 XXYW => ref *(UInt4*)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 UInt4 XXZX => ref *(UInt4*)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 UInt4 XXZY => ref *(UInt4*)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 UInt4 XXZZ => ref *(UInt4*)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 UInt4 XXZW => ref *(UInt4*)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 UInt4 XXWX => ref *(UInt4*)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 UInt4 XXWY => ref *(UInt4*)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 UInt4 XXWZ => ref *(UInt4*)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 UInt4 XXWW => ref *(UInt4*)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 UInt4 XYXX => ref *(UInt4*)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 UInt4 XYXY => ref *(UInt4*)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 UInt4 XYXZ => ref *(UInt4*)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 UInt4 XYXW => ref *(UInt4*)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 UInt4 XYYX => ref *(UInt4*)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 UInt4 XYYY => ref *(UInt4*)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 UInt4 XYYZ => ref *(UInt4*)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 UInt4 XYYW => ref *(UInt4*)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 UInt4 XYZX => ref *(UInt4*)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 UInt4 XYZY => ref *(UInt4*)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 UInt4 XYZZ => ref *(UInt4*)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 UInt4 XYZW => ref *(UInt4*)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 UInt4 XYWX => ref *(UInt4*)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 UInt4 XYWY => ref *(UInt4*)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 UInt4 XYWZ => ref *(UInt4*)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 UInt4 XYWW => ref *(UInt4*)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 UInt4 XZXX => ref *(UInt4*)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 UInt4 XZXY => ref *(UInt4*)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 UInt4 XZXZ => ref *(UInt4*)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 UInt4 XZXW => ref *(UInt4*)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 UInt4 XZYX => ref *(UInt4*)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 UInt4 XZYY => ref *(UInt4*)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 UInt4 XZYZ => ref *(UInt4*)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 UInt4 XZYW => ref *(UInt4*)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 UInt4 XZZX => ref *(UInt4*)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 UInt4 XZZY => ref *(UInt4*)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 UInt4 XZZZ => ref *(UInt4*)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 UInt4 XZZW => ref *(UInt4*)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 UInt4 XZWX => ref *(UInt4*)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 UInt4 XZWY => ref *(UInt4*)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 UInt4 XZWZ => ref *(UInt4*)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 UInt4 XZWW => ref *(UInt4*)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 UInt4 XWXX => ref *(UInt4*)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 UInt4 XWXY => ref *(UInt4*)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 UInt4 XWXZ => ref *(UInt4*)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 UInt4 XWXW => ref *(UInt4*)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 UInt4 XWYX => ref *(UInt4*)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 UInt4 XWYY => ref *(UInt4*)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 UInt4 XWYZ => ref *(UInt4*)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 UInt4 XWYW => ref *(UInt4*)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 UInt4 XWZX => ref *(UInt4*)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 UInt4 XWZY => ref *(UInt4*)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 UInt4 XWZZ => ref *(UInt4*)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 UInt4 XWZW => ref *(UInt4*)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 UInt4 XWWX => ref *(UInt4*)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 UInt4 XWWY => ref *(UInt4*)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 UInt4 XWWZ => ref *(UInt4*)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 UInt4 XWWW => ref *(UInt4*)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 UInt4 YXXX => ref *(UInt4*)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 UInt4 YXXY => ref *(UInt4*)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 UInt4 YXXZ => ref *(UInt4*)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 UInt4 YXXW => ref *(UInt4*)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 UInt4 YXYX => ref *(UInt4*)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 UInt4 YXYY => ref *(UInt4*)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 UInt4 YXYZ => ref *(UInt4*)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 UInt4 YXYW => ref *(UInt4*)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 UInt4 YXZX => ref *(UInt4*)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 UInt4 YXZY => ref *(UInt4*)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 UInt4 YXZZ => ref *(UInt4*)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 UInt4 YXZW => ref *(UInt4*)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 UInt4 YXWX => ref *(UInt4*)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 UInt4 YXWY => ref *(UInt4*)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 UInt4 YXWZ => ref *(UInt4*)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 UInt4 YXWW => ref *(UInt4*)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 UInt4 YYXX => ref *(UInt4*)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 UInt4 YYXY => ref *(UInt4*)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 UInt4 YYXZ => ref *(UInt4*)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 UInt4 YYXW => ref *(UInt4*)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 UInt4 YYYX => ref *(UInt4*)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 UInt4 YYYY => ref *(UInt4*)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 UInt4 YYYZ => ref *(UInt4*)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 UInt4 YYYW => ref *(UInt4*)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 UInt4 YYZX => ref *(UInt4*)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 UInt4 YYZY => ref *(UInt4*)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 UInt4 YYZZ => ref *(UInt4*)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 UInt4 YYZW => ref *(UInt4*)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 UInt4 YYWX => ref *(UInt4*)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 UInt4 YYWY => ref *(UInt4*)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 UInt4 YYWZ => ref *(UInt4*)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 UInt4 YYWW => ref *(UInt4*)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 UInt4 YZXX => ref *(UInt4*)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 UInt4 YZXY => ref *(UInt4*)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 UInt4 YZXZ => ref *(UInt4*)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 UInt4 YZXW => ref *(UInt4*)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 UInt4 YZYX => ref *(UInt4*)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 UInt4 YZYY => ref *(UInt4*)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 UInt4 YZYZ => ref *(UInt4*)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 UInt4 YZYW => ref *(UInt4*)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 UInt4 YZZX => ref *(UInt4*)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 UInt4 YZZY => ref *(UInt4*)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 UInt4 YZZZ => ref *(UInt4*)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 UInt4 YZZW => ref *(UInt4*)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 UInt4 YZWX => ref *(UInt4*)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 UInt4 YZWY => ref *(UInt4*)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 UInt4 YZWZ => ref *(UInt4*)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 UInt4 YZWW => ref *(UInt4*)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 UInt4 YWXX => ref *(UInt4*)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 UInt4 YWXY => ref *(UInt4*)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 UInt4 YWXZ => ref *(UInt4*)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 UInt4 YWXW => ref *(UInt4*)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 UInt4 YWYX => ref *(UInt4*)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 UInt4 YWYY => ref *(UInt4*)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 UInt4 YWYZ => ref *(UInt4*)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 UInt4 YWYW => ref *(UInt4*)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 UInt4 YWZX => ref *(UInt4*)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 UInt4 YWZY => ref *(UInt4*)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 UInt4 YWZZ => ref *(UInt4*)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 UInt4 YWZW => ref *(UInt4*)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 UInt4 YWWX => ref *(UInt4*)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 UInt4 YWWY => ref *(UInt4*)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 UInt4 YWWZ => ref *(UInt4*)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 UInt4 YWWW => ref *(UInt4*)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 UInt4 ZXXX => ref *(UInt4*)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 UInt4 ZXXY => ref *(UInt4*)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 UInt4 ZXXZ => ref *(UInt4*)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 UInt4 ZXXW => ref *(UInt4*)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 UInt4 ZXYX => ref *(UInt4*)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 UInt4 ZXYY => ref *(UInt4*)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 UInt4 ZXYZ => ref *(UInt4*)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 UInt4 ZXYW => ref *(UInt4*)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 UInt4 ZXZX => ref *(UInt4*)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 UInt4 ZXZY => ref *(UInt4*)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 UInt4 ZXZZ => ref *(UInt4*)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 UInt4 ZXZW => ref *(UInt4*)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 UInt4 ZXWX => ref *(UInt4*)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 UInt4 ZXWY => ref *(UInt4*)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 UInt4 ZXWZ => ref *(UInt4*)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 UInt4 ZXWW => ref *(UInt4*)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 UInt4 ZYXX => ref *(UInt4*)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 UInt4 ZYXY => ref *(UInt4*)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 UInt4 ZYXZ => ref *(UInt4*)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 UInt4 ZYXW => ref *(UInt4*)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 UInt4 ZYYX => ref *(UInt4*)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 UInt4 ZYYY => ref *(UInt4*)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 UInt4 ZYYZ => ref *(UInt4*)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 UInt4 ZYYW => ref *(UInt4*)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 UInt4 ZYZX => ref *(UInt4*)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 UInt4 ZYZY => ref *(UInt4*)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 UInt4 ZYZZ => ref *(UInt4*)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 UInt4 ZYZW => ref *(UInt4*)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 UInt4 ZYWX => ref *(UInt4*)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 UInt4 ZYWY => ref *(UInt4*)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 UInt4 ZYWZ => ref *(UInt4*)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 UInt4 ZYWW => ref *(UInt4*)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 UInt4 ZZXX => ref *(UInt4*)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 UInt4 ZZXY => ref *(UInt4*)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 UInt4 ZZXZ => ref *(UInt4*)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 UInt4 ZZXW => ref *(UInt4*)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 UInt4 ZZYX => ref *(UInt4*)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 UInt4 ZZYY => ref *(UInt4*)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 UInt4 ZZYZ => ref *(UInt4*)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 UInt4 ZZYW => ref *(UInt4*)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 UInt4 ZZZX => ref *(UInt4*)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 UInt4 ZZZY => ref *(UInt4*)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 UInt4 ZZZZ => ref *(UInt4*)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 UInt4 ZZZW => ref *(UInt4*)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 UInt4 ZZWX => ref *(UInt4*)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 UInt4 ZZWY => ref *(UInt4*)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 UInt4 ZZWZ => ref *(UInt4*)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 UInt4 ZZWW => ref *(UInt4*)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 UInt4 ZWXX => ref *(UInt4*)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 UInt4 ZWXY => ref *(UInt4*)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 UInt4 ZWXZ => ref *(UInt4*)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 UInt4 ZWXW => ref *(UInt4*)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 UInt4 ZWYX => ref *(UInt4*)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 UInt4 ZWYY => ref *(UInt4*)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 UInt4 ZWYZ => ref *(UInt4*)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 UInt4 ZWYW => ref *(UInt4*)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 UInt4 ZWZX => ref *(UInt4*)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 UInt4 ZWZY => ref *(UInt4*)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 UInt4 ZWZZ => ref *(UInt4*)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 UInt4 ZWZW => ref *(UInt4*)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 UInt4 ZWWX => ref *(UInt4*)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 UInt4 ZWWY => ref *(UInt4*)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 UInt4 ZWWZ => ref *(UInt4*)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 UInt4 ZWWW => ref *(UInt4*)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 UInt4 WXXX => ref *(UInt4*)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 UInt4 WXXY => ref *(UInt4*)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 UInt4 WXXZ => ref *(UInt4*)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 UInt4 WXXW => ref *(UInt4*)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 UInt4 WXYX => ref *(UInt4*)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 UInt4 WXYY => ref *(UInt4*)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 UInt4 WXYZ => ref *(UInt4*)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 UInt4 WXYW => ref *(UInt4*)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 UInt4 WXZX => ref *(UInt4*)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 UInt4 WXZY => ref *(UInt4*)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 UInt4 WXZZ => ref *(UInt4*)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 UInt4 WXZW => ref *(UInt4*)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 UInt4 WXWX => ref *(UInt4*)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 UInt4 WXWY => ref *(UInt4*)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 UInt4 WXWZ => ref *(UInt4*)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 UInt4 WXWW => ref *(UInt4*)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 UInt4 WYXX => ref *(UInt4*)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 UInt4 WYXY => ref *(UInt4*)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 UInt4 WYXZ => ref *(UInt4*)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 UInt4 WYXW => ref *(UInt4*)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 UInt4 WYYX => ref *(UInt4*)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 UInt4 WYYY => ref *(UInt4*)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 UInt4 WYYZ => ref *(UInt4*)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 UInt4 WYYW => ref *(UInt4*)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 UInt4 WYZX => ref *(UInt4*)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 UInt4 WYZY => ref *(UInt4*)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 UInt4 WYZZ => ref *(UInt4*)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 UInt4 WYZW => ref *(UInt4*)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 UInt4 WYWX => ref *(UInt4*)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 UInt4 WYWY => ref *(UInt4*)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 UInt4 WYWZ => ref *(UInt4*)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 UInt4 WYWW => ref *(UInt4*)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 UInt4 WZXX => ref *(UInt4*)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 UInt4 WZXY => ref *(UInt4*)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 UInt4 WZXZ => ref *(UInt4*)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 UInt4 WZXW => ref *(UInt4*)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 UInt4 WZYX => ref *(UInt4*)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 UInt4 WZYY => ref *(UInt4*)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 UInt4 WZYZ => ref *(UInt4*)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 UInt4 WZYW => ref *(UInt4*)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 UInt4 WZZX => ref *(UInt4*)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 UInt4 WZZY => ref *(UInt4*)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 UInt4 WZZZ => ref *(UInt4*)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 UInt4 WZZW => ref *(UInt4*)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 UInt4 WZWX => ref *(UInt4*)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 UInt4 WZWY => ref *(UInt4*)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 UInt4 WZWZ => ref *(UInt4*)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 UInt4 WZWW => ref *(UInt4*)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 UInt4 WWXX => ref *(UInt4*)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 UInt4 WWXY => ref *(UInt4*)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 UInt4 WWXZ => ref *(UInt4*)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 UInt4 WWXW => ref *(UInt4*)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 UInt4 WWYX => ref *(UInt4*)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 UInt4 WWYY => ref *(UInt4*)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 UInt4 WWYZ => ref *(UInt4*)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 UInt4 WWYW => ref *(UInt4*)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 UInt4 WWZX => ref *(UInt4*)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 UInt4 WWZY => ref *(UInt4*)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 UInt4 WWZZ => ref *(UInt4*)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 UInt4 WWZW => ref *(UInt4*)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 UInt4 WWWX => ref *(UInt4*)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 UInt4 WWWY => ref *(UInt4*)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 UInt4 WWWZ => ref *(UInt4*)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 UInt4 WWWW => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the R component. + /// + public readonly ref uint 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 uint G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); + + /// + /// Gets a reference to the value representing the B component. + /// + public readonly ref uint B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); + + /// + /// Gets a reference to the value representing the A component. + /// + public readonly ref uint A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 UInt2 RR => ref *(UInt2*)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 UInt2 RG => ref *(UInt2*)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 UInt2 RB => ref *(UInt2*)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 UInt2 RA => ref *(UInt2*)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 UInt2 GR => ref *(UInt2*)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 UInt2 GG => ref *(UInt2*)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 UInt2 GB => ref *(UInt2*)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 UInt2 GA => ref *(UInt2*)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 UInt2 BR => ref *(UInt2*)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 UInt2 BG => ref *(UInt2*)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 UInt2 BB => ref *(UInt2*)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 UInt2 BA => ref *(UInt2*)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 UInt2 AR => ref *(UInt2*)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 UInt2 AG => ref *(UInt2*)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 UInt2 AB => ref *(UInt2*)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 UInt2 AA => ref *(UInt2*)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 UInt3 RRR => ref *(UInt3*)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 UInt3 RRG => ref *(UInt3*)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 UInt3 RRB => ref *(UInt3*)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 UInt3 RRA => ref *(UInt3*)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 UInt3 RGR => ref *(UInt3*)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 UInt3 RGG => ref *(UInt3*)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 UInt3 RGB => ref *(UInt3*)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 UInt3 RGA => ref *(UInt3*)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 UInt3 RBR => ref *(UInt3*)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 UInt3 RBG => ref *(UInt3*)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 UInt3 RBB => ref *(UInt3*)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 UInt3 RBA => ref *(UInt3*)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 UInt3 RAR => ref *(UInt3*)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 UInt3 RAG => ref *(UInt3*)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 UInt3 RAB => ref *(UInt3*)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 UInt3 RAA => ref *(UInt3*)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 UInt3 GRR => ref *(UInt3*)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 UInt3 GRG => ref *(UInt3*)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 UInt3 GRB => ref *(UInt3*)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 UInt3 GRA => ref *(UInt3*)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 UInt3 GGR => ref *(UInt3*)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 UInt3 GGG => ref *(UInt3*)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 UInt3 GGB => ref *(UInt3*)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 UInt3 GGA => ref *(UInt3*)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 UInt3 GBR => ref *(UInt3*)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 UInt3 GBG => ref *(UInt3*)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 UInt3 GBB => ref *(UInt3*)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 UInt3 GBA => ref *(UInt3*)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 UInt3 GAR => ref *(UInt3*)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 UInt3 GAG => ref *(UInt3*)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 UInt3 GAB => ref *(UInt3*)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 UInt3 GAA => ref *(UInt3*)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 UInt3 BRR => ref *(UInt3*)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 UInt3 BRG => ref *(UInt3*)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 UInt3 BRB => ref *(UInt3*)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 UInt3 BRA => ref *(UInt3*)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 UInt3 BGR => ref *(UInt3*)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 UInt3 BGG => ref *(UInt3*)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 UInt3 BGB => ref *(UInt3*)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 UInt3 BGA => ref *(UInt3*)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 UInt3 BBR => ref *(UInt3*)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 UInt3 BBG => ref *(UInt3*)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 UInt3 BBB => ref *(UInt3*)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 UInt3 BBA => ref *(UInt3*)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 UInt3 BAR => ref *(UInt3*)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 UInt3 BAG => ref *(UInt3*)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 UInt3 BAB => ref *(UInt3*)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 UInt3 BAA => ref *(UInt3*)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 UInt3 ARR => ref *(UInt3*)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 UInt3 ARG => ref *(UInt3*)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 UInt3 ARB => ref *(UInt3*)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 UInt3 ARA => ref *(UInt3*)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 UInt3 AGR => ref *(UInt3*)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 UInt3 AGG => ref *(UInt3*)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 UInt3 AGB => ref *(UInt3*)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 UInt3 AGA => ref *(UInt3*)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 UInt3 ABR => ref *(UInt3*)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 UInt3 ABG => ref *(UInt3*)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 UInt3 ABB => ref *(UInt3*)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 UInt3 ABA => ref *(UInt3*)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 UInt3 AAR => ref *(UInt3*)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 UInt3 AAG => ref *(UInt3*)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 UInt3 AAB => ref *(UInt3*)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 UInt3 AAA => ref *(UInt3*)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 UInt4 RRRR => ref *(UInt4*)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 UInt4 RRRG => ref *(UInt4*)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 UInt4 RRRB => ref *(UInt4*)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 UInt4 RRRA => ref *(UInt4*)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 UInt4 RRGR => ref *(UInt4*)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 UInt4 RRGG => ref *(UInt4*)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 UInt4 RRGB => ref *(UInt4*)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 UInt4 RRGA => ref *(UInt4*)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 UInt4 RRBR => ref *(UInt4*)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 UInt4 RRBG => ref *(UInt4*)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 UInt4 RRBB => ref *(UInt4*)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 UInt4 RRBA => ref *(UInt4*)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 UInt4 RRAR => ref *(UInt4*)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 UInt4 RRAG => ref *(UInt4*)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 UInt4 RRAB => ref *(UInt4*)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 UInt4 RRAA => ref *(UInt4*)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 UInt4 RGRR => ref *(UInt4*)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 UInt4 RGRG => ref *(UInt4*)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 UInt4 RGRB => ref *(UInt4*)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 UInt4 RGRA => ref *(UInt4*)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 UInt4 RGGR => ref *(UInt4*)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 UInt4 RGGG => ref *(UInt4*)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 UInt4 RGGB => ref *(UInt4*)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 UInt4 RGGA => ref *(UInt4*)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 UInt4 RGBR => ref *(UInt4*)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 UInt4 RGBG => ref *(UInt4*)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 UInt4 RGBB => ref *(UInt4*)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 UInt4 RGBA => ref *(UInt4*)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 UInt4 RGAR => ref *(UInt4*)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 UInt4 RGAG => ref *(UInt4*)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 UInt4 RGAB => ref *(UInt4*)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 UInt4 RGAA => ref *(UInt4*)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 UInt4 RBRR => ref *(UInt4*)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 UInt4 RBRG => ref *(UInt4*)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 UInt4 RBRB => ref *(UInt4*)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 UInt4 RBRA => ref *(UInt4*)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 UInt4 RBGR => ref *(UInt4*)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 UInt4 RBGG => ref *(UInt4*)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 UInt4 RBGB => ref *(UInt4*)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 UInt4 RBGA => ref *(UInt4*)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 UInt4 RBBR => ref *(UInt4*)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 UInt4 RBBG => ref *(UInt4*)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 UInt4 RBBB => ref *(UInt4*)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 UInt4 RBBA => ref *(UInt4*)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 UInt4 RBAR => ref *(UInt4*)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 UInt4 RBAG => ref *(UInt4*)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 UInt4 RBAB => ref *(UInt4*)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 UInt4 RBAA => ref *(UInt4*)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 UInt4 RARR => ref *(UInt4*)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 UInt4 RARG => ref *(UInt4*)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 UInt4 RARB => ref *(UInt4*)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 UInt4 RARA => ref *(UInt4*)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 UInt4 RAGR => ref *(UInt4*)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 UInt4 RAGG => ref *(UInt4*)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 UInt4 RAGB => ref *(UInt4*)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 UInt4 RAGA => ref *(UInt4*)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 UInt4 RABR => ref *(UInt4*)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 UInt4 RABG => ref *(UInt4*)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 UInt4 RABB => ref *(UInt4*)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 UInt4 RABA => ref *(UInt4*)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 UInt4 RAAR => ref *(UInt4*)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 UInt4 RAAG => ref *(UInt4*)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 UInt4 RAAB => ref *(UInt4*)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 UInt4 RAAA => ref *(UInt4*)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 UInt4 GRRR => ref *(UInt4*)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 UInt4 GRRG => ref *(UInt4*)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 UInt4 GRRB => ref *(UInt4*)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 UInt4 GRRA => ref *(UInt4*)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 UInt4 GRGR => ref *(UInt4*)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 UInt4 GRGG => ref *(UInt4*)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 UInt4 GRGB => ref *(UInt4*)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 UInt4 GRGA => ref *(UInt4*)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 UInt4 GRBR => ref *(UInt4*)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 UInt4 GRBG => ref *(UInt4*)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 UInt4 GRBB => ref *(UInt4*)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 UInt4 GRBA => ref *(UInt4*)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 UInt4 GRAR => ref *(UInt4*)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 UInt4 GRAG => ref *(UInt4*)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 UInt4 GRAB => ref *(UInt4*)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 UInt4 GRAA => ref *(UInt4*)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 UInt4 GGRR => ref *(UInt4*)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 UInt4 GGRG => ref *(UInt4*)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 UInt4 GGRB => ref *(UInt4*)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 UInt4 GGRA => ref *(UInt4*)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 UInt4 GGGR => ref *(UInt4*)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 UInt4 GGGG => ref *(UInt4*)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 UInt4 GGGB => ref *(UInt4*)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 UInt4 GGGA => ref *(UInt4*)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 UInt4 GGBR => ref *(UInt4*)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 UInt4 GGBG => ref *(UInt4*)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 UInt4 GGBB => ref *(UInt4*)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 UInt4 GGBA => ref *(UInt4*)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 UInt4 GGAR => ref *(UInt4*)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 UInt4 GGAG => ref *(UInt4*)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 UInt4 GGAB => ref *(UInt4*)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 UInt4 GGAA => ref *(UInt4*)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 UInt4 GBRR => ref *(UInt4*)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 UInt4 GBRG => ref *(UInt4*)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 UInt4 GBRB => ref *(UInt4*)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 UInt4 GBRA => ref *(UInt4*)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 UInt4 GBGR => ref *(UInt4*)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 UInt4 GBGG => ref *(UInt4*)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 UInt4 GBGB => ref *(UInt4*)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 UInt4 GBGA => ref *(UInt4*)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 UInt4 GBBR => ref *(UInt4*)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 UInt4 GBBG => ref *(UInt4*)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 UInt4 GBBB => ref *(UInt4*)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 UInt4 GBBA => ref *(UInt4*)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 UInt4 GBAR => ref *(UInt4*)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 UInt4 GBAG => ref *(UInt4*)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 UInt4 GBAB => ref *(UInt4*)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 UInt4 GBAA => ref *(UInt4*)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 UInt4 GARR => ref *(UInt4*)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 UInt4 GARG => ref *(UInt4*)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 UInt4 GARB => ref *(UInt4*)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 UInt4 GARA => ref *(UInt4*)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 UInt4 GAGR => ref *(UInt4*)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 UInt4 GAGG => ref *(UInt4*)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 UInt4 GAGB => ref *(UInt4*)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 UInt4 GAGA => ref *(UInt4*)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 UInt4 GABR => ref *(UInt4*)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 UInt4 GABG => ref *(UInt4*)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 UInt4 GABB => ref *(UInt4*)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 UInt4 GABA => ref *(UInt4*)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 UInt4 GAAR => ref *(UInt4*)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 UInt4 GAAG => ref *(UInt4*)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 UInt4 GAAB => ref *(UInt4*)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 UInt4 GAAA => ref *(UInt4*)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 UInt4 BRRR => ref *(UInt4*)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 UInt4 BRRG => ref *(UInt4*)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 UInt4 BRRB => ref *(UInt4*)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 UInt4 BRRA => ref *(UInt4*)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 UInt4 BRGR => ref *(UInt4*)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 UInt4 BRGG => ref *(UInt4*)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 UInt4 BRGB => ref *(UInt4*)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 UInt4 BRGA => ref *(UInt4*)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 UInt4 BRBR => ref *(UInt4*)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 UInt4 BRBG => ref *(UInt4*)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 UInt4 BRBB => ref *(UInt4*)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 UInt4 BRBA => ref *(UInt4*)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 UInt4 BRAR => ref *(UInt4*)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 UInt4 BRAG => ref *(UInt4*)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 UInt4 BRAB => ref *(UInt4*)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 UInt4 BRAA => ref *(UInt4*)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 UInt4 BGRR => ref *(UInt4*)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 UInt4 BGRG => ref *(UInt4*)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 UInt4 BGRB => ref *(UInt4*)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 UInt4 BGRA => ref *(UInt4*)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 UInt4 BGGR => ref *(UInt4*)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 UInt4 BGGG => ref *(UInt4*)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 UInt4 BGGB => ref *(UInt4*)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 UInt4 BGGA => ref *(UInt4*)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 UInt4 BGBR => ref *(UInt4*)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 UInt4 BGBG => ref *(UInt4*)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 UInt4 BGBB => ref *(UInt4*)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 UInt4 BGBA => ref *(UInt4*)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 UInt4 BGAR => ref *(UInt4*)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 UInt4 BGAG => ref *(UInt4*)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 UInt4 BGAB => ref *(UInt4*)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 UInt4 BGAA => ref *(UInt4*)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 UInt4 BBRR => ref *(UInt4*)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 UInt4 BBRG => ref *(UInt4*)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 UInt4 BBRB => ref *(UInt4*)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 UInt4 BBRA => ref *(UInt4*)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 UInt4 BBGR => ref *(UInt4*)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 UInt4 BBGG => ref *(UInt4*)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 UInt4 BBGB => ref *(UInt4*)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 UInt4 BBGA => ref *(UInt4*)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 UInt4 BBBR => ref *(UInt4*)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 UInt4 BBBG => ref *(UInt4*)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 UInt4 BBBB => ref *(UInt4*)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 UInt4 BBBA => ref *(UInt4*)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 UInt4 BBAR => ref *(UInt4*)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 UInt4 BBAG => ref *(UInt4*)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 UInt4 BBAB => ref *(UInt4*)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 UInt4 BBAA => ref *(UInt4*)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 UInt4 BARR => ref *(UInt4*)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 UInt4 BARG => ref *(UInt4*)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 UInt4 BARB => ref *(UInt4*)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 UInt4 BARA => ref *(UInt4*)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 UInt4 BAGR => ref *(UInt4*)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 UInt4 BAGG => ref *(UInt4*)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 UInt4 BAGB => ref *(UInt4*)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 UInt4 BAGA => ref *(UInt4*)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 UInt4 BABR => ref *(UInt4*)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 UInt4 BABG => ref *(UInt4*)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 UInt4 BABB => ref *(UInt4*)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 UInt4 BABA => ref *(UInt4*)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 UInt4 BAAR => ref *(UInt4*)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 UInt4 BAAG => ref *(UInt4*)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 UInt4 BAAB => ref *(UInt4*)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 UInt4 BAAA => ref *(UInt4*)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 UInt4 ARRR => ref *(UInt4*)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 UInt4 ARRG => ref *(UInt4*)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 UInt4 ARRB => ref *(UInt4*)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 UInt4 ARRA => ref *(UInt4*)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 UInt4 ARGR => ref *(UInt4*)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 UInt4 ARGG => ref *(UInt4*)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 UInt4 ARGB => ref *(UInt4*)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 UInt4 ARGA => ref *(UInt4*)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 UInt4 ARBR => ref *(UInt4*)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 UInt4 ARBG => ref *(UInt4*)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 UInt4 ARBB => ref *(UInt4*)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 UInt4 ARBA => ref *(UInt4*)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 UInt4 ARAR => ref *(UInt4*)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 UInt4 ARAG => ref *(UInt4*)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 UInt4 ARAB => ref *(UInt4*)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 UInt4 ARAA => ref *(UInt4*)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 UInt4 AGRR => ref *(UInt4*)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 UInt4 AGRG => ref *(UInt4*)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 UInt4 AGRB => ref *(UInt4*)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 UInt4 AGRA => ref *(UInt4*)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 UInt4 AGGR => ref *(UInt4*)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 UInt4 AGGG => ref *(UInt4*)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 UInt4 AGGB => ref *(UInt4*)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 UInt4 AGGA => ref *(UInt4*)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 UInt4 AGBR => ref *(UInt4*)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 UInt4 AGBG => ref *(UInt4*)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 UInt4 AGBB => ref *(UInt4*)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 UInt4 AGBA => ref *(UInt4*)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 UInt4 AGAR => ref *(UInt4*)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 UInt4 AGAG => ref *(UInt4*)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 UInt4 AGAB => ref *(UInt4*)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 UInt4 AGAA => ref *(UInt4*)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 UInt4 ABRR => ref *(UInt4*)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 UInt4 ABRG => ref *(UInt4*)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 UInt4 ABRB => ref *(UInt4*)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 UInt4 ABRA => ref *(UInt4*)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 UInt4 ABGR => ref *(UInt4*)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 UInt4 ABGG => ref *(UInt4*)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 UInt4 ABGB => ref *(UInt4*)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 UInt4 ABGA => ref *(UInt4*)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 UInt4 ABBR => ref *(UInt4*)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 UInt4 ABBG => ref *(UInt4*)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 UInt4 ABBB => ref *(UInt4*)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 UInt4 ABBA => ref *(UInt4*)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 UInt4 ABAR => ref *(UInt4*)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 UInt4 ABAG => ref *(UInt4*)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 UInt4 ABAB => ref *(UInt4*)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 UInt4 ABAA => ref *(UInt4*)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 UInt4 AARR => ref *(UInt4*)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 UInt4 AARG => ref *(UInt4*)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 UInt4 AARB => ref *(UInt4*)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 UInt4 AARA => ref *(UInt4*)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 UInt4 AAGR => ref *(UInt4*)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 UInt4 AAGG => ref *(UInt4*)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 UInt4 AAGB => ref *(UInt4*)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 UInt4 AAGA => ref *(UInt4*)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 UInt4 AABR => ref *(UInt4*)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 UInt4 AABG => ref *(UInt4*)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 UInt4 AABB => ref *(UInt4*)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 UInt4 AABA => ref *(UInt4*)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 UInt4 AAAR => ref *(UInt4*)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 UInt4 AAAG => ref *(UInt4*)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 UInt4 AAAB => ref *(UInt4*)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 UInt4 AAAA => ref *(UInt4*)UndefinedData; + + /// + public override readonly string ToString() { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4), sizeof(UInt4)); - - [FieldOffset(0)] - private uint x; - - [FieldOffset(4)] - private uint y; - - [FieldOffset(8)] - private uint z; - - [FieldOffset(12)] - private uint w; - - /// - /// 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 uint this[int i] => ref *(uint*)UndefinedData; - - /// - /// Gets a reference to the value representing the X component. - /// - public readonly ref uint 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 uint Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the Z component. - /// - public readonly ref uint Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the W component. - /// - public readonly ref uint W => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 UInt2 XX => ref *(UInt2*)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 UInt2 XY => ref *(UInt2*)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 UInt2 XZ => ref *(UInt2*)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 UInt2 XW => ref *(UInt2*)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 UInt2 YX => ref *(UInt2*)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 UInt2 YY => ref *(UInt2*)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 UInt2 YZ => ref *(UInt2*)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 UInt2 YW => ref *(UInt2*)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 UInt2 ZX => ref *(UInt2*)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 UInt2 ZY => ref *(UInt2*)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 UInt2 ZZ => ref *(UInt2*)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 UInt2 ZW => ref *(UInt2*)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 UInt2 WX => ref *(UInt2*)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 UInt2 WY => ref *(UInt2*)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 UInt2 WZ => ref *(UInt2*)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 UInt2 WW => ref *(UInt2*)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 UInt3 XXX => ref *(UInt3*)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 UInt3 XXY => ref *(UInt3*)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 UInt3 XXZ => ref *(UInt3*)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 UInt3 XXW => ref *(UInt3*)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 UInt3 XYX => ref *(UInt3*)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 UInt3 XYY => ref *(UInt3*)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 UInt3 XYZ => ref *(UInt3*)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 UInt3 XYW => ref *(UInt3*)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 UInt3 XZX => ref *(UInt3*)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 UInt3 XZY => ref *(UInt3*)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 UInt3 XZZ => ref *(UInt3*)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 UInt3 XZW => ref *(UInt3*)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 UInt3 XWX => ref *(UInt3*)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 UInt3 XWY => ref *(UInt3*)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 UInt3 XWZ => ref *(UInt3*)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 UInt3 XWW => ref *(UInt3*)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 UInt3 YXX => ref *(UInt3*)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 UInt3 YXY => ref *(UInt3*)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 UInt3 YXZ => ref *(UInt3*)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 UInt3 YXW => ref *(UInt3*)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 UInt3 YYX => ref *(UInt3*)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 UInt3 YYY => ref *(UInt3*)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 UInt3 YYZ => ref *(UInt3*)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 UInt3 YYW => ref *(UInt3*)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 UInt3 YZX => ref *(UInt3*)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 UInt3 YZY => ref *(UInt3*)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 UInt3 YZZ => ref *(UInt3*)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 UInt3 YZW => ref *(UInt3*)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 UInt3 YWX => ref *(UInt3*)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 UInt3 YWY => ref *(UInt3*)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 UInt3 YWZ => ref *(UInt3*)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 UInt3 YWW => ref *(UInt3*)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 UInt3 ZXX => ref *(UInt3*)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 UInt3 ZXY => ref *(UInt3*)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 UInt3 ZXZ => ref *(UInt3*)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 UInt3 ZXW => ref *(UInt3*)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 UInt3 ZYX => ref *(UInt3*)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 UInt3 ZYY => ref *(UInt3*)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 UInt3 ZYZ => ref *(UInt3*)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 UInt3 ZYW => ref *(UInt3*)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 UInt3 ZZX => ref *(UInt3*)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 UInt3 ZZY => ref *(UInt3*)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 UInt3 ZZZ => ref *(UInt3*)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 UInt3 ZZW => ref *(UInt3*)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 UInt3 ZWX => ref *(UInt3*)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 UInt3 ZWY => ref *(UInt3*)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 UInt3 ZWZ => ref *(UInt3*)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 UInt3 ZWW => ref *(UInt3*)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 UInt3 WXX => ref *(UInt3*)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 UInt3 WXY => ref *(UInt3*)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 UInt3 WXZ => ref *(UInt3*)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 UInt3 WXW => ref *(UInt3*)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 UInt3 WYX => ref *(UInt3*)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 UInt3 WYY => ref *(UInt3*)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 UInt3 WYZ => ref *(UInt3*)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 UInt3 WYW => ref *(UInt3*)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 UInt3 WZX => ref *(UInt3*)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 UInt3 WZY => ref *(UInt3*)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 UInt3 WZZ => ref *(UInt3*)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 UInt3 WZW => ref *(UInt3*)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 UInt3 WWX => ref *(UInt3*)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 UInt3 WWY => ref *(UInt3*)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 UInt3 WWZ => ref *(UInt3*)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 UInt3 WWW => ref *(UInt3*)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 UInt4 XXXX => ref *(UInt4*)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 UInt4 XXXY => ref *(UInt4*)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 UInt4 XXXZ => ref *(UInt4*)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 UInt4 XXXW => ref *(UInt4*)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 UInt4 XXYX => ref *(UInt4*)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 UInt4 XXYY => ref *(UInt4*)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 UInt4 XXYZ => ref *(UInt4*)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 UInt4 XXYW => ref *(UInt4*)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 UInt4 XXZX => ref *(UInt4*)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 UInt4 XXZY => ref *(UInt4*)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 UInt4 XXZZ => ref *(UInt4*)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 UInt4 XXZW => ref *(UInt4*)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 UInt4 XXWX => ref *(UInt4*)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 UInt4 XXWY => ref *(UInt4*)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 UInt4 XXWZ => ref *(UInt4*)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 UInt4 XXWW => ref *(UInt4*)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 UInt4 XYXX => ref *(UInt4*)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 UInt4 XYXY => ref *(UInt4*)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 UInt4 XYXZ => ref *(UInt4*)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 UInt4 XYXW => ref *(UInt4*)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 UInt4 XYYX => ref *(UInt4*)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 UInt4 XYYY => ref *(UInt4*)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 UInt4 XYYZ => ref *(UInt4*)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 UInt4 XYYW => ref *(UInt4*)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 UInt4 XYZX => ref *(UInt4*)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 UInt4 XYZY => ref *(UInt4*)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 UInt4 XYZZ => ref *(UInt4*)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 UInt4 XYZW => ref *(UInt4*)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 UInt4 XYWX => ref *(UInt4*)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 UInt4 XYWY => ref *(UInt4*)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 UInt4 XYWZ => ref *(UInt4*)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 UInt4 XYWW => ref *(UInt4*)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 UInt4 XZXX => ref *(UInt4*)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 UInt4 XZXY => ref *(UInt4*)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 UInt4 XZXZ => ref *(UInt4*)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 UInt4 XZXW => ref *(UInt4*)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 UInt4 XZYX => ref *(UInt4*)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 UInt4 XZYY => ref *(UInt4*)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 UInt4 XZYZ => ref *(UInt4*)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 UInt4 XZYW => ref *(UInt4*)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 UInt4 XZZX => ref *(UInt4*)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 UInt4 XZZY => ref *(UInt4*)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 UInt4 XZZZ => ref *(UInt4*)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 UInt4 XZZW => ref *(UInt4*)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 UInt4 XZWX => ref *(UInt4*)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 UInt4 XZWY => ref *(UInt4*)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 UInt4 XZWZ => ref *(UInt4*)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 UInt4 XZWW => ref *(UInt4*)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 UInt4 XWXX => ref *(UInt4*)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 UInt4 XWXY => ref *(UInt4*)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 UInt4 XWXZ => ref *(UInt4*)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 UInt4 XWXW => ref *(UInt4*)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 UInt4 XWYX => ref *(UInt4*)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 UInt4 XWYY => ref *(UInt4*)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 UInt4 XWYZ => ref *(UInt4*)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 UInt4 XWYW => ref *(UInt4*)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 UInt4 XWZX => ref *(UInt4*)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 UInt4 XWZY => ref *(UInt4*)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 UInt4 XWZZ => ref *(UInt4*)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 UInt4 XWZW => ref *(UInt4*)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 UInt4 XWWX => ref *(UInt4*)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 UInt4 XWWY => ref *(UInt4*)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 UInt4 XWWZ => ref *(UInt4*)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 UInt4 XWWW => ref *(UInt4*)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 UInt4 YXXX => ref *(UInt4*)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 UInt4 YXXY => ref *(UInt4*)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 UInt4 YXXZ => ref *(UInt4*)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 UInt4 YXXW => ref *(UInt4*)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 UInt4 YXYX => ref *(UInt4*)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 UInt4 YXYY => ref *(UInt4*)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 UInt4 YXYZ => ref *(UInt4*)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 UInt4 YXYW => ref *(UInt4*)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 UInt4 YXZX => ref *(UInt4*)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 UInt4 YXZY => ref *(UInt4*)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 UInt4 YXZZ => ref *(UInt4*)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 UInt4 YXZW => ref *(UInt4*)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 UInt4 YXWX => ref *(UInt4*)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 UInt4 YXWY => ref *(UInt4*)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 UInt4 YXWZ => ref *(UInt4*)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 UInt4 YXWW => ref *(UInt4*)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 UInt4 YYXX => ref *(UInt4*)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 UInt4 YYXY => ref *(UInt4*)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 UInt4 YYXZ => ref *(UInt4*)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 UInt4 YYXW => ref *(UInt4*)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 UInt4 YYYX => ref *(UInt4*)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 UInt4 YYYY => ref *(UInt4*)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 UInt4 YYYZ => ref *(UInt4*)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 UInt4 YYYW => ref *(UInt4*)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 UInt4 YYZX => ref *(UInt4*)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 UInt4 YYZY => ref *(UInt4*)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 UInt4 YYZZ => ref *(UInt4*)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 UInt4 YYZW => ref *(UInt4*)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 UInt4 YYWX => ref *(UInt4*)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 UInt4 YYWY => ref *(UInt4*)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 UInt4 YYWZ => ref *(UInt4*)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 UInt4 YYWW => ref *(UInt4*)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 UInt4 YZXX => ref *(UInt4*)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 UInt4 YZXY => ref *(UInt4*)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 UInt4 YZXZ => ref *(UInt4*)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 UInt4 YZXW => ref *(UInt4*)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 UInt4 YZYX => ref *(UInt4*)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 UInt4 YZYY => ref *(UInt4*)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 UInt4 YZYZ => ref *(UInt4*)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 UInt4 YZYW => ref *(UInt4*)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 UInt4 YZZX => ref *(UInt4*)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 UInt4 YZZY => ref *(UInt4*)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 UInt4 YZZZ => ref *(UInt4*)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 UInt4 YZZW => ref *(UInt4*)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 UInt4 YZWX => ref *(UInt4*)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 UInt4 YZWY => ref *(UInt4*)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 UInt4 YZWZ => ref *(UInt4*)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 UInt4 YZWW => ref *(UInt4*)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 UInt4 YWXX => ref *(UInt4*)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 UInt4 YWXY => ref *(UInt4*)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 UInt4 YWXZ => ref *(UInt4*)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 UInt4 YWXW => ref *(UInt4*)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 UInt4 YWYX => ref *(UInt4*)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 UInt4 YWYY => ref *(UInt4*)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 UInt4 YWYZ => ref *(UInt4*)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 UInt4 YWYW => ref *(UInt4*)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 UInt4 YWZX => ref *(UInt4*)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 UInt4 YWZY => ref *(UInt4*)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 UInt4 YWZZ => ref *(UInt4*)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 UInt4 YWZW => ref *(UInt4*)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 UInt4 YWWX => ref *(UInt4*)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 UInt4 YWWY => ref *(UInt4*)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 UInt4 YWWZ => ref *(UInt4*)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 UInt4 YWWW => ref *(UInt4*)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 UInt4 ZXXX => ref *(UInt4*)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 UInt4 ZXXY => ref *(UInt4*)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 UInt4 ZXXZ => ref *(UInt4*)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 UInt4 ZXXW => ref *(UInt4*)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 UInt4 ZXYX => ref *(UInt4*)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 UInt4 ZXYY => ref *(UInt4*)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 UInt4 ZXYZ => ref *(UInt4*)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 UInt4 ZXYW => ref *(UInt4*)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 UInt4 ZXZX => ref *(UInt4*)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 UInt4 ZXZY => ref *(UInt4*)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 UInt4 ZXZZ => ref *(UInt4*)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 UInt4 ZXZW => ref *(UInt4*)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 UInt4 ZXWX => ref *(UInt4*)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 UInt4 ZXWY => ref *(UInt4*)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 UInt4 ZXWZ => ref *(UInt4*)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 UInt4 ZXWW => ref *(UInt4*)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 UInt4 ZYXX => ref *(UInt4*)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 UInt4 ZYXY => ref *(UInt4*)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 UInt4 ZYXZ => ref *(UInt4*)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 UInt4 ZYXW => ref *(UInt4*)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 UInt4 ZYYX => ref *(UInt4*)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 UInt4 ZYYY => ref *(UInt4*)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 UInt4 ZYYZ => ref *(UInt4*)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 UInt4 ZYYW => ref *(UInt4*)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 UInt4 ZYZX => ref *(UInt4*)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 UInt4 ZYZY => ref *(UInt4*)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 UInt4 ZYZZ => ref *(UInt4*)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 UInt4 ZYZW => ref *(UInt4*)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 UInt4 ZYWX => ref *(UInt4*)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 UInt4 ZYWY => ref *(UInt4*)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 UInt4 ZYWZ => ref *(UInt4*)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 UInt4 ZYWW => ref *(UInt4*)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 UInt4 ZZXX => ref *(UInt4*)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 UInt4 ZZXY => ref *(UInt4*)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 UInt4 ZZXZ => ref *(UInt4*)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 UInt4 ZZXW => ref *(UInt4*)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 UInt4 ZZYX => ref *(UInt4*)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 UInt4 ZZYY => ref *(UInt4*)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 UInt4 ZZYZ => ref *(UInt4*)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 UInt4 ZZYW => ref *(UInt4*)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 UInt4 ZZZX => ref *(UInt4*)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 UInt4 ZZZY => ref *(UInt4*)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 UInt4 ZZZZ => ref *(UInt4*)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 UInt4 ZZZW => ref *(UInt4*)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 UInt4 ZZWX => ref *(UInt4*)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 UInt4 ZZWY => ref *(UInt4*)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 UInt4 ZZWZ => ref *(UInt4*)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 UInt4 ZZWW => ref *(UInt4*)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 UInt4 ZWXX => ref *(UInt4*)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 UInt4 ZWXY => ref *(UInt4*)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 UInt4 ZWXZ => ref *(UInt4*)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 UInt4 ZWXW => ref *(UInt4*)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 UInt4 ZWYX => ref *(UInt4*)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 UInt4 ZWYY => ref *(UInt4*)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 UInt4 ZWYZ => ref *(UInt4*)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 UInt4 ZWYW => ref *(UInt4*)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 UInt4 ZWZX => ref *(UInt4*)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 UInt4 ZWZY => ref *(UInt4*)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 UInt4 ZWZZ => ref *(UInt4*)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 UInt4 ZWZW => ref *(UInt4*)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 UInt4 ZWWX => ref *(UInt4*)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 UInt4 ZWWY => ref *(UInt4*)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 UInt4 ZWWZ => ref *(UInt4*)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 UInt4 ZWWW => ref *(UInt4*)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 UInt4 WXXX => ref *(UInt4*)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 UInt4 WXXY => ref *(UInt4*)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 UInt4 WXXZ => ref *(UInt4*)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 UInt4 WXXW => ref *(UInt4*)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 UInt4 WXYX => ref *(UInt4*)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 UInt4 WXYY => ref *(UInt4*)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 UInt4 WXYZ => ref *(UInt4*)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 UInt4 WXYW => ref *(UInt4*)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 UInt4 WXZX => ref *(UInt4*)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 UInt4 WXZY => ref *(UInt4*)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 UInt4 WXZZ => ref *(UInt4*)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 UInt4 WXZW => ref *(UInt4*)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 UInt4 WXWX => ref *(UInt4*)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 UInt4 WXWY => ref *(UInt4*)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 UInt4 WXWZ => ref *(UInt4*)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 UInt4 WXWW => ref *(UInt4*)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 UInt4 WYXX => ref *(UInt4*)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 UInt4 WYXY => ref *(UInt4*)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 UInt4 WYXZ => ref *(UInt4*)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 UInt4 WYXW => ref *(UInt4*)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 UInt4 WYYX => ref *(UInt4*)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 UInt4 WYYY => ref *(UInt4*)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 UInt4 WYYZ => ref *(UInt4*)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 UInt4 WYYW => ref *(UInt4*)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 UInt4 WYZX => ref *(UInt4*)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 UInt4 WYZY => ref *(UInt4*)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 UInt4 WYZZ => ref *(UInt4*)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 UInt4 WYZW => ref *(UInt4*)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 UInt4 WYWX => ref *(UInt4*)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 UInt4 WYWY => ref *(UInt4*)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 UInt4 WYWZ => ref *(UInt4*)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 UInt4 WYWW => ref *(UInt4*)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 UInt4 WZXX => ref *(UInt4*)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 UInt4 WZXY => ref *(UInt4*)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 UInt4 WZXZ => ref *(UInt4*)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 UInt4 WZXW => ref *(UInt4*)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 UInt4 WZYX => ref *(UInt4*)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 UInt4 WZYY => ref *(UInt4*)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 UInt4 WZYZ => ref *(UInt4*)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 UInt4 WZYW => ref *(UInt4*)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 UInt4 WZZX => ref *(UInt4*)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 UInt4 WZZY => ref *(UInt4*)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 UInt4 WZZZ => ref *(UInt4*)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 UInt4 WZZW => ref *(UInt4*)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 UInt4 WZWX => ref *(UInt4*)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 UInt4 WZWY => ref *(UInt4*)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 UInt4 WZWZ => ref *(UInt4*)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 UInt4 WZWW => ref *(UInt4*)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 UInt4 WWXX => ref *(UInt4*)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 UInt4 WWXY => ref *(UInt4*)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 UInt4 WWXZ => ref *(UInt4*)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 UInt4 WWXW => ref *(UInt4*)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 UInt4 WWYX => ref *(UInt4*)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 UInt4 WWYY => ref *(UInt4*)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 UInt4 WWYZ => ref *(UInt4*)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 UInt4 WWYW => ref *(UInt4*)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 UInt4 WWZX => ref *(UInt4*)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 UInt4 WWZY => ref *(UInt4*)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 UInt4 WWZZ => ref *(UInt4*)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 UInt4 WWZW => ref *(UInt4*)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 UInt4 WWWX => ref *(UInt4*)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 UInt4 WWWY => ref *(UInt4*)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 UInt4 WWWZ => ref *(UInt4*)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 UInt4 WWWW => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the R component. - /// - public readonly ref uint 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 uint G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.y), 1)); - - /// - /// Gets a reference to the value representing the B component. - /// - public readonly ref uint B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.z), 1)); - - /// - /// Gets a reference to the value representing the A component. - /// - public readonly ref uint A => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.w), 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 UInt2 RR => ref *(UInt2*)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 UInt2 RG => ref *(UInt2*)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 UInt2 RB => ref *(UInt2*)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 UInt2 RA => ref *(UInt2*)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 UInt2 GR => ref *(UInt2*)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 UInt2 GG => ref *(UInt2*)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 UInt2 GB => ref *(UInt2*)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 UInt2 GA => ref *(UInt2*)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 UInt2 BR => ref *(UInt2*)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 UInt2 BG => ref *(UInt2*)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 UInt2 BB => ref *(UInt2*)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 UInt2 BA => ref *(UInt2*)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 UInt2 AR => ref *(UInt2*)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 UInt2 AG => ref *(UInt2*)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 UInt2 AB => ref *(UInt2*)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 UInt2 AA => ref *(UInt2*)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 UInt3 RRR => ref *(UInt3*)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 UInt3 RRG => ref *(UInt3*)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 UInt3 RRB => ref *(UInt3*)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 UInt3 RRA => ref *(UInt3*)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 UInt3 RGR => ref *(UInt3*)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 UInt3 RGG => ref *(UInt3*)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 UInt3 RGB => ref *(UInt3*)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 UInt3 RGA => ref *(UInt3*)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 UInt3 RBR => ref *(UInt3*)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 UInt3 RBG => ref *(UInt3*)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 UInt3 RBB => ref *(UInt3*)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 UInt3 RBA => ref *(UInt3*)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 UInt3 RAR => ref *(UInt3*)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 UInt3 RAG => ref *(UInt3*)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 UInt3 RAB => ref *(UInt3*)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 UInt3 RAA => ref *(UInt3*)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 UInt3 GRR => ref *(UInt3*)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 UInt3 GRG => ref *(UInt3*)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 UInt3 GRB => ref *(UInt3*)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 UInt3 GRA => ref *(UInt3*)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 UInt3 GGR => ref *(UInt3*)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 UInt3 GGG => ref *(UInt3*)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 UInt3 GGB => ref *(UInt3*)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 UInt3 GGA => ref *(UInt3*)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 UInt3 GBR => ref *(UInt3*)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 UInt3 GBG => ref *(UInt3*)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 UInt3 GBB => ref *(UInt3*)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 UInt3 GBA => ref *(UInt3*)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 UInt3 GAR => ref *(UInt3*)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 UInt3 GAG => ref *(UInt3*)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 UInt3 GAB => ref *(UInt3*)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 UInt3 GAA => ref *(UInt3*)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 UInt3 BRR => ref *(UInt3*)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 UInt3 BRG => ref *(UInt3*)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 UInt3 BRB => ref *(UInt3*)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 UInt3 BRA => ref *(UInt3*)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 UInt3 BGR => ref *(UInt3*)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 UInt3 BGG => ref *(UInt3*)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 UInt3 BGB => ref *(UInt3*)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 UInt3 BGA => ref *(UInt3*)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 UInt3 BBR => ref *(UInt3*)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 UInt3 BBG => ref *(UInt3*)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 UInt3 BBB => ref *(UInt3*)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 UInt3 BBA => ref *(UInt3*)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 UInt3 BAR => ref *(UInt3*)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 UInt3 BAG => ref *(UInt3*)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 UInt3 BAB => ref *(UInt3*)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 UInt3 BAA => ref *(UInt3*)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 UInt3 ARR => ref *(UInt3*)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 UInt3 ARG => ref *(UInt3*)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 UInt3 ARB => ref *(UInt3*)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 UInt3 ARA => ref *(UInt3*)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 UInt3 AGR => ref *(UInt3*)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 UInt3 AGG => ref *(UInt3*)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 UInt3 AGB => ref *(UInt3*)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 UInt3 AGA => ref *(UInt3*)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 UInt3 ABR => ref *(UInt3*)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 UInt3 ABG => ref *(UInt3*)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 UInt3 ABB => ref *(UInt3*)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 UInt3 ABA => ref *(UInt3*)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 UInt3 AAR => ref *(UInt3*)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 UInt3 AAG => ref *(UInt3*)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 UInt3 AAB => ref *(UInt3*)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 UInt3 AAA => ref *(UInt3*)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 UInt4 RRRR => ref *(UInt4*)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 UInt4 RRRG => ref *(UInt4*)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 UInt4 RRRB => ref *(UInt4*)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 UInt4 RRRA => ref *(UInt4*)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 UInt4 RRGR => ref *(UInt4*)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 UInt4 RRGG => ref *(UInt4*)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 UInt4 RRGB => ref *(UInt4*)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 UInt4 RRGA => ref *(UInt4*)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 UInt4 RRBR => ref *(UInt4*)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 UInt4 RRBG => ref *(UInt4*)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 UInt4 RRBB => ref *(UInt4*)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 UInt4 RRBA => ref *(UInt4*)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 UInt4 RRAR => ref *(UInt4*)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 UInt4 RRAG => ref *(UInt4*)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 UInt4 RRAB => ref *(UInt4*)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 UInt4 RRAA => ref *(UInt4*)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 UInt4 RGRR => ref *(UInt4*)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 UInt4 RGRG => ref *(UInt4*)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 UInt4 RGRB => ref *(UInt4*)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 UInt4 RGRA => ref *(UInt4*)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 UInt4 RGGR => ref *(UInt4*)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 UInt4 RGGG => ref *(UInt4*)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 UInt4 RGGB => ref *(UInt4*)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 UInt4 RGGA => ref *(UInt4*)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 UInt4 RGBR => ref *(UInt4*)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 UInt4 RGBG => ref *(UInt4*)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 UInt4 RGBB => ref *(UInt4*)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 UInt4 RGBA => ref *(UInt4*)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 UInt4 RGAR => ref *(UInt4*)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 UInt4 RGAG => ref *(UInt4*)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 UInt4 RGAB => ref *(UInt4*)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 UInt4 RGAA => ref *(UInt4*)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 UInt4 RBRR => ref *(UInt4*)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 UInt4 RBRG => ref *(UInt4*)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 UInt4 RBRB => ref *(UInt4*)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 UInt4 RBRA => ref *(UInt4*)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 UInt4 RBGR => ref *(UInt4*)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 UInt4 RBGG => ref *(UInt4*)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 UInt4 RBGB => ref *(UInt4*)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 UInt4 RBGA => ref *(UInt4*)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 UInt4 RBBR => ref *(UInt4*)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 UInt4 RBBG => ref *(UInt4*)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 UInt4 RBBB => ref *(UInt4*)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 UInt4 RBBA => ref *(UInt4*)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 UInt4 RBAR => ref *(UInt4*)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 UInt4 RBAG => ref *(UInt4*)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 UInt4 RBAB => ref *(UInt4*)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 UInt4 RBAA => ref *(UInt4*)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 UInt4 RARR => ref *(UInt4*)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 UInt4 RARG => ref *(UInt4*)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 UInt4 RARB => ref *(UInt4*)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 UInt4 RARA => ref *(UInt4*)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 UInt4 RAGR => ref *(UInt4*)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 UInt4 RAGG => ref *(UInt4*)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 UInt4 RAGB => ref *(UInt4*)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 UInt4 RAGA => ref *(UInt4*)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 UInt4 RABR => ref *(UInt4*)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 UInt4 RABG => ref *(UInt4*)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 UInt4 RABB => ref *(UInt4*)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 UInt4 RABA => ref *(UInt4*)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 UInt4 RAAR => ref *(UInt4*)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 UInt4 RAAG => ref *(UInt4*)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 UInt4 RAAB => ref *(UInt4*)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 UInt4 RAAA => ref *(UInt4*)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 UInt4 GRRR => ref *(UInt4*)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 UInt4 GRRG => ref *(UInt4*)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 UInt4 GRRB => ref *(UInt4*)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 UInt4 GRRA => ref *(UInt4*)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 UInt4 GRGR => ref *(UInt4*)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 UInt4 GRGG => ref *(UInt4*)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 UInt4 GRGB => ref *(UInt4*)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 UInt4 GRGA => ref *(UInt4*)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 UInt4 GRBR => ref *(UInt4*)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 UInt4 GRBG => ref *(UInt4*)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 UInt4 GRBB => ref *(UInt4*)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 UInt4 GRBA => ref *(UInt4*)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 UInt4 GRAR => ref *(UInt4*)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 UInt4 GRAG => ref *(UInt4*)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 UInt4 GRAB => ref *(UInt4*)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 UInt4 GRAA => ref *(UInt4*)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 UInt4 GGRR => ref *(UInt4*)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 UInt4 GGRG => ref *(UInt4*)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 UInt4 GGRB => ref *(UInt4*)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 UInt4 GGRA => ref *(UInt4*)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 UInt4 GGGR => ref *(UInt4*)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 UInt4 GGGG => ref *(UInt4*)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 UInt4 GGGB => ref *(UInt4*)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 UInt4 GGGA => ref *(UInt4*)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 UInt4 GGBR => ref *(UInt4*)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 UInt4 GGBG => ref *(UInt4*)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 UInt4 GGBB => ref *(UInt4*)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 UInt4 GGBA => ref *(UInt4*)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 UInt4 GGAR => ref *(UInt4*)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 UInt4 GGAG => ref *(UInt4*)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 UInt4 GGAB => ref *(UInt4*)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 UInt4 GGAA => ref *(UInt4*)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 UInt4 GBRR => ref *(UInt4*)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 UInt4 GBRG => ref *(UInt4*)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 UInt4 GBRB => ref *(UInt4*)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 UInt4 GBRA => ref *(UInt4*)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 UInt4 GBGR => ref *(UInt4*)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 UInt4 GBGG => ref *(UInt4*)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 UInt4 GBGB => ref *(UInt4*)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 UInt4 GBGA => ref *(UInt4*)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 UInt4 GBBR => ref *(UInt4*)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 UInt4 GBBG => ref *(UInt4*)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 UInt4 GBBB => ref *(UInt4*)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 UInt4 GBBA => ref *(UInt4*)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 UInt4 GBAR => ref *(UInt4*)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 UInt4 GBAG => ref *(UInt4*)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 UInt4 GBAB => ref *(UInt4*)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 UInt4 GBAA => ref *(UInt4*)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 UInt4 GARR => ref *(UInt4*)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 UInt4 GARG => ref *(UInt4*)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 UInt4 GARB => ref *(UInt4*)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 UInt4 GARA => ref *(UInt4*)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 UInt4 GAGR => ref *(UInt4*)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 UInt4 GAGG => ref *(UInt4*)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 UInt4 GAGB => ref *(UInt4*)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 UInt4 GAGA => ref *(UInt4*)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 UInt4 GABR => ref *(UInt4*)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 UInt4 GABG => ref *(UInt4*)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 UInt4 GABB => ref *(UInt4*)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 UInt4 GABA => ref *(UInt4*)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 UInt4 GAAR => ref *(UInt4*)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 UInt4 GAAG => ref *(UInt4*)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 UInt4 GAAB => ref *(UInt4*)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 UInt4 GAAA => ref *(UInt4*)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 UInt4 BRRR => ref *(UInt4*)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 UInt4 BRRG => ref *(UInt4*)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 UInt4 BRRB => ref *(UInt4*)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 UInt4 BRRA => ref *(UInt4*)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 UInt4 BRGR => ref *(UInt4*)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 UInt4 BRGG => ref *(UInt4*)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 UInt4 BRGB => ref *(UInt4*)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 UInt4 BRGA => ref *(UInt4*)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 UInt4 BRBR => ref *(UInt4*)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 UInt4 BRBG => ref *(UInt4*)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 UInt4 BRBB => ref *(UInt4*)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 UInt4 BRBA => ref *(UInt4*)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 UInt4 BRAR => ref *(UInt4*)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 UInt4 BRAG => ref *(UInt4*)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 UInt4 BRAB => ref *(UInt4*)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 UInt4 BRAA => ref *(UInt4*)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 UInt4 BGRR => ref *(UInt4*)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 UInt4 BGRG => ref *(UInt4*)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 UInt4 BGRB => ref *(UInt4*)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 UInt4 BGRA => ref *(UInt4*)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 UInt4 BGGR => ref *(UInt4*)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 UInt4 BGGG => ref *(UInt4*)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 UInt4 BGGB => ref *(UInt4*)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 UInt4 BGGA => ref *(UInt4*)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 UInt4 BGBR => ref *(UInt4*)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 UInt4 BGBG => ref *(UInt4*)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 UInt4 BGBB => ref *(UInt4*)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 UInt4 BGBA => ref *(UInt4*)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 UInt4 BGAR => ref *(UInt4*)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 UInt4 BGAG => ref *(UInt4*)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 UInt4 BGAB => ref *(UInt4*)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 UInt4 BGAA => ref *(UInt4*)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 UInt4 BBRR => ref *(UInt4*)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 UInt4 BBRG => ref *(UInt4*)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 UInt4 BBRB => ref *(UInt4*)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 UInt4 BBRA => ref *(UInt4*)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 UInt4 BBGR => ref *(UInt4*)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 UInt4 BBGG => ref *(UInt4*)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 UInt4 BBGB => ref *(UInt4*)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 UInt4 BBGA => ref *(UInt4*)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 UInt4 BBBR => ref *(UInt4*)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 UInt4 BBBG => ref *(UInt4*)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 UInt4 BBBB => ref *(UInt4*)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 UInt4 BBBA => ref *(UInt4*)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 UInt4 BBAR => ref *(UInt4*)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 UInt4 BBAG => ref *(UInt4*)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 UInt4 BBAB => ref *(UInt4*)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 UInt4 BBAA => ref *(UInt4*)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 UInt4 BARR => ref *(UInt4*)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 UInt4 BARG => ref *(UInt4*)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 UInt4 BARB => ref *(UInt4*)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 UInt4 BARA => ref *(UInt4*)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 UInt4 BAGR => ref *(UInt4*)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 UInt4 BAGG => ref *(UInt4*)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 UInt4 BAGB => ref *(UInt4*)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 UInt4 BAGA => ref *(UInt4*)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 UInt4 BABR => ref *(UInt4*)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 UInt4 BABG => ref *(UInt4*)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 UInt4 BABB => ref *(UInt4*)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 UInt4 BABA => ref *(UInt4*)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 UInt4 BAAR => ref *(UInt4*)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 UInt4 BAAG => ref *(UInt4*)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 UInt4 BAAB => ref *(UInt4*)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 UInt4 BAAA => ref *(UInt4*)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 UInt4 ARRR => ref *(UInt4*)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 UInt4 ARRG => ref *(UInt4*)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 UInt4 ARRB => ref *(UInt4*)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 UInt4 ARRA => ref *(UInt4*)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 UInt4 ARGR => ref *(UInt4*)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 UInt4 ARGG => ref *(UInt4*)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 UInt4 ARGB => ref *(UInt4*)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 UInt4 ARGA => ref *(UInt4*)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 UInt4 ARBR => ref *(UInt4*)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 UInt4 ARBG => ref *(UInt4*)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 UInt4 ARBB => ref *(UInt4*)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 UInt4 ARBA => ref *(UInt4*)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 UInt4 ARAR => ref *(UInt4*)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 UInt4 ARAG => ref *(UInt4*)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 UInt4 ARAB => ref *(UInt4*)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 UInt4 ARAA => ref *(UInt4*)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 UInt4 AGRR => ref *(UInt4*)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 UInt4 AGRG => ref *(UInt4*)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 UInt4 AGRB => ref *(UInt4*)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 UInt4 AGRA => ref *(UInt4*)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 UInt4 AGGR => ref *(UInt4*)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 UInt4 AGGG => ref *(UInt4*)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 UInt4 AGGB => ref *(UInt4*)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 UInt4 AGGA => ref *(UInt4*)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 UInt4 AGBR => ref *(UInt4*)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 UInt4 AGBG => ref *(UInt4*)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 UInt4 AGBB => ref *(UInt4*)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 UInt4 AGBA => ref *(UInt4*)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 UInt4 AGAR => ref *(UInt4*)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 UInt4 AGAG => ref *(UInt4*)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 UInt4 AGAB => ref *(UInt4*)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 UInt4 AGAA => ref *(UInt4*)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 UInt4 ABRR => ref *(UInt4*)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 UInt4 ABRG => ref *(UInt4*)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 UInt4 ABRB => ref *(UInt4*)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 UInt4 ABRA => ref *(UInt4*)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 UInt4 ABGR => ref *(UInt4*)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 UInt4 ABGG => ref *(UInt4*)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 UInt4 ABGB => ref *(UInt4*)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 UInt4 ABGA => ref *(UInt4*)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 UInt4 ABBR => ref *(UInt4*)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 UInt4 ABBG => ref *(UInt4*)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 UInt4 ABBB => ref *(UInt4*)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 UInt4 ABBA => ref *(UInt4*)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 UInt4 ABAR => ref *(UInt4*)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 UInt4 ABAG => ref *(UInt4*)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 UInt4 ABAB => ref *(UInt4*)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 UInt4 ABAA => ref *(UInt4*)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 UInt4 AARR => ref *(UInt4*)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 UInt4 AARG => ref *(UInt4*)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 UInt4 AARB => ref *(UInt4*)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 UInt4 AARA => ref *(UInt4*)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 UInt4 AAGR => ref *(UInt4*)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 UInt4 AAGG => ref *(UInt4*)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 UInt4 AAGB => ref *(UInt4*)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 UInt4 AAGA => ref *(UInt4*)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 UInt4 AABR => ref *(UInt4*)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 UInt4 AABG => ref *(UInt4*)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 UInt4 AABB => ref *(UInt4*)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 UInt4 AABA => ref *(UInt4*)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 UInt4 AAAR => ref *(UInt4*)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 UInt4 AAAG => ref *(UInt4*)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 UInt4 AAAB => ref *(UInt4*)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 UInt4 AAAA => ref *(UInt4*)UndefinedData; - - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - - sb.Append('<'); - sb.Append(this.x.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.z.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(this.w.ToString(format, formatProvider)); - sb.Append('>'); - - return sb.ToString(); - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt4 operator +(UInt4 left, UInt4 right) => default; - - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt4 operator /(UInt4 left, UInt4 right) => default; - - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt4 operator *(UInt4 left, UInt4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt4 operator -(UInt4 left, UInt4 right) => default; + return ToString("G", CultureInfo.CurrentCulture); } + + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); + + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + + sb.Append('<'); + sb.Append(this.x.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.z.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.w.ToString(format, formatProvider)); + sb.Append('>'); + + return sb.ToString(); + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt4 operator +(UInt4 left, UInt4 right) => default; + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt4 operator /(UInt4 left, UInt4 right) => default; + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt4 operator *(UInt4 left, UInt4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt4 operator -(UInt4 left, UInt4 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs index 2831fabf..e15e2adf 100644 --- a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs +++ b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs @@ -5,2832 +5,2831 @@ using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers; using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #endif -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] +public unsafe partial struct UInt1x1 { - /// - [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] - public unsafe partial struct UInt1x1 + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x1), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public UInt1x1(uint m11) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x1), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - public UInt1x1(uint m11) - { - this.m11 = m11; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// 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 UInt1x1(uint x) - { - UInt1x1 matrix; - - matrix.m11 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt1x1 operator +(UInt1x1 left, UInt1x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt1x1 operator /(UInt1x1 left, UInt1x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt1x1 operator *(UInt1x1 left, UInt1x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt1x1 operator -(UInt1x1 left, UInt1x1 right) => default; + this.m11 = m11; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct UInt1x2 + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// 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 UInt1x1(uint x) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x2), sizeof(UInt4)); + UInt1x1 matrix; - [FieldOffset(0)] - private uint m11; + matrix.m11 = x; - [FieldOffset(4)] - private uint m12; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - public UInt1x2(uint m11, uint m12) - { - this.m11 = m11; - this.m12 = m12; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// 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 UInt1x2(uint x) - { - UInt1x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt1x2 operator +(UInt1x2 left, UInt1x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt1x2 operator /(UInt1x2 left, UInt1x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt1x2 operator *(UInt1x2 left, UInt1x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt1x2 operator -(UInt1x2 left, UInt1x2 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator UInt1x2(UInt2 vector) => *(UInt1x2*)&vector; + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct UInt1x3 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt1x1 operator +(UInt1x1 left, UInt1x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt1x1 operator /(UInt1x1 left, UInt1x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt1x1 operator *(UInt1x1 left, UInt1x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt1x1 operator -(UInt1x1 left, UInt1x1 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct UInt1x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x2), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public UInt1x2(uint m11, uint m12) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x3), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - public UInt1x3(uint m11, uint m12, uint m13) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// 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 UInt1x2(uint x) + { + UInt1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt1x2 operator +(UInt1x2 left, UInt1x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt1x2 operator /(UInt1x2 left, UInt1x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt1x2 operator *(UInt1x2 left, UInt1x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt1x2 operator -(UInt1x2 left, UInt1x2 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt1x2(UInt2 vector) => *(UInt1x2*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct UInt1x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x3), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public UInt1x3(uint m11, uint m12, uint m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// 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 UInt1x3(uint x) - { - UInt1x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt1x3 operator +(UInt1x3 left, UInt1x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt1x3 operator /(UInt1x3 left, UInt1x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt1x3 operator *(UInt1x3 left, UInt1x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt1x3 operator -(UInt1x3 left, UInt1x3 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator UInt1x3(UInt3 vector) => *(UInt1x3*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// 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 UInt1x3(uint x) + { + UInt1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct UInt1x4 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt1x3 operator +(UInt1x3 left, UInt1x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt1x3 operator /(UInt1x3 left, UInt1x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt1x3 operator *(UInt1x3 left, UInt1x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt1x3 operator -(UInt1x3 left, UInt1x3 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt1x3(UInt3 vector) => *(UInt1x3*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct UInt1x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x4), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public UInt1x4(uint m11, uint m12, uint m13, uint m14) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt1x4), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m14; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - public UInt1x4(uint m11, uint m12, uint m13, uint m14) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// 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 UInt1x4(uint x) - { - UInt1x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt1x4 operator +(UInt1x4 left, UInt1x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt1x4 operator /(UInt1x4 left, UInt1x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt1x4 operator *(UInt1x4 left, UInt1x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt1x4 operator -(UInt1x4 left, UInt1x4 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator UInt1x4(UInt4 vector) => *(UInt1x4*)&vector; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// 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 UInt1x4(uint x) + { + UInt1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] - public unsafe partial struct UInt2x1 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt1x4 operator +(UInt1x4 left, UInt1x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt1x4 operator /(UInt1x4 left, UInt1x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt1x4 operator *(UInt1x4 left, UInt1x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt1x4 operator -(UInt1x4 left, UInt1x4 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt1x4(UInt4 vector) => *(UInt1x4*)&vector; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] +public unsafe partial struct UInt2x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x1), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public UInt2x1(uint m11, uint m21) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x1), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m21; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - public UInt2x1(uint m11, uint m21) - { - this.m11 = m11; - this.m21 = m21; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// 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 UInt2x1(uint x) - { - UInt2x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt2x1 operator +(UInt2x1 left, UInt2x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt2x1 operator /(UInt2x1 left, UInt2x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt2x1 operator *(UInt2x1 left, UInt2x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt2x1 operator -(UInt2x1 left, UInt2x1 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator UInt2(UInt2x1 matrix) => *(UInt2*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// 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 UInt2x1(uint x) + { + UInt2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt2x1 operator +(UInt2x1 left, UInt2x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt2x1 operator /(UInt2x1 left, UInt2x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt2x1 operator *(UInt2x1 left, UInt2x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt2x1 operator -(UInt2x1 left, UInt2x1 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt2(UInt2x1 matrix) => *(UInt2*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct UInt2x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x2), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m21; + + [FieldOffset(12)] + private uint m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public UInt2x2(uint m11, uint m12, uint m21, uint m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct UInt2x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public UInt2x2(UInt2 row1, UInt2 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x2), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m21; - - [FieldOffset(12)] - private uint m22; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - public UInt2x2(uint m11, uint m12, uint m21, uint m22) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public UInt2x2(UInt2 row1, UInt2 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// 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 UInt2x2(uint x) - { - UInt2x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt2x2 operator +(UInt2x2 left, UInt2x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt2x2 operator /(UInt2x2 left, UInt2x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt2x2 operator *(UInt2x2 left, UInt2x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt2x2 operator -(UInt2x2 left, UInt2x2 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// 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 UInt2x2(uint x) + { + UInt2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt2x2 operator +(UInt2x2 left, UInt2x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt2x2 operator /(UInt2x2 left, UInt2x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt2x2 operator *(UInt2x2 left, UInt2x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt2x2 operator -(UInt2x2 left, UInt2x2 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct UInt2x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x3), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m21; + + [FieldOffset(16)] + private uint m22; + + [FieldOffset(20)] + private uint m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public UInt2x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct UInt2x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public UInt2x3(UInt3 row1, UInt3 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x3), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m21; - - [FieldOffset(16)] - private uint m22; - - [FieldOffset(20)] - private uint m23; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - public UInt2x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public UInt2x3(UInt3 row1, UInt3 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// 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 UInt2x3(uint x) - { - UInt2x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt2x3 operator +(UInt2x3 left, UInt2x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt2x3 operator /(UInt2x3 left, UInt2x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt2x3 operator *(UInt2x3 left, UInt2x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt2x3 operator -(UInt2x3 left, UInt2x3 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// 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 UInt2x3(uint x) + { + UInt2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt2x3 operator +(UInt2x3 left, UInt2x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt2x3 operator /(UInt2x3 left, UInt2x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt2x3 operator *(UInt2x3 left, UInt2x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt2x3 operator -(UInt2x3 left, UInt2x3 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct UInt2x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x4), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + [FieldOffset(16)] + private uint m21; + + [FieldOffset(20)] + private uint m22; + + [FieldOffset(24)] + private uint m23; + + [FieldOffset(28)] + private uint m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public UInt2x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct UInt2x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public UInt2x4(UInt4 row1, UInt4 row2) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2x4), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m14; - - [FieldOffset(16)] - private uint m21; - - [FieldOffset(20)] - private uint m22; - - [FieldOffset(24)] - private uint m23; - - [FieldOffset(28)] - private uint m24; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - public UInt2x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - public UInt2x4(UInt4 row1, UInt4 row2) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref uint M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// 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 UInt2x4(uint x) - { - UInt2x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt2x4 operator +(UInt2x4 left, UInt2x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt2x4 operator /(UInt2x4 left, UInt2x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt2x4 operator *(UInt2x4 left, UInt2x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt2x4 operator -(UInt2x4 left, UInt2x4 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref uint M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// 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 UInt2x4(uint x) + { + UInt2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] - public unsafe partial struct UInt3x1 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt2x4 operator +(UInt2x4 left, UInt2x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt2x4 operator /(UInt2x4 left, UInt2x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt2x4 operator *(UInt2x4 left, UInt2x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt2x4 operator -(UInt2x4 left, UInt2x4 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] +public unsafe partial struct UInt3x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x1), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m21; + + [FieldOffset(8)] + private uint m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public UInt3x1(uint m11, uint m21, uint m31) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x1), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m21; - - [FieldOffset(8)] - private uint m31; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - public UInt3x1(uint m11, uint m21, uint m31) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// 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 UInt3x1(uint x) - { - UInt3x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt3x1 operator +(UInt3x1 left, UInt3x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt3x1 operator /(UInt3x1 left, UInt3x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt3x1 operator *(UInt3x1 left, UInt3x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt3x1 operator -(UInt3x1 left, UInt3x1 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator UInt3(UInt3x1 matrix) => *(UInt3*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// 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 UInt3x1(uint x) + { + UInt3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt3x1 operator +(UInt3x1 left, UInt3x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt3x1 operator /(UInt3x1 left, UInt3x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt3x1 operator *(UInt3x1 left, UInt3x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt3x1 operator -(UInt3x1 left, UInt3x1 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt3(UInt3x1 matrix) => *(UInt3*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] +public unsafe partial struct UInt3x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x2), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m21; + + [FieldOffset(12)] + private uint m22; + + [FieldOffset(16)] + private uint m31; + + [FieldOffset(20)] + private uint m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public UInt3x2(uint m11, uint m12, uint m21, uint m22, uint m31, uint m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; } - /// - [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] - public unsafe partial struct UInt3x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public UInt3x2(UInt2 row1, UInt2 row2, UInt2 row3) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x2), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m21; - - [FieldOffset(12)] - private uint m22; - - [FieldOffset(16)] - private uint m31; - - [FieldOffset(20)] - private uint m32; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - public UInt3x2(uint m11, uint m12, uint m21, uint m22, uint m31, uint m32) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public UInt3x2(UInt2 row1, UInt2 row2, UInt2 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// 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 UInt3x2(uint x) - { - UInt3x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt3x2 operator +(UInt3x2 left, UInt3x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt3x2 operator /(UInt3x2 left, UInt3x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt3x2 operator *(UInt3x2 left, UInt3x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt3x2 operator -(UInt3x2 left, UInt3x2 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// 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 UInt3x2(uint x) + { + UInt3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] - public unsafe partial struct UInt3x3 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt3x2 operator +(UInt3x2 left, UInt3x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt3x2 operator /(UInt3x2 left, UInt3x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt3x2 operator *(UInt3x2 left, UInt3x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt3x2 operator -(UInt3x2 left, UInt3x2 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] +public unsafe partial struct UInt3x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x3), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m21; + + [FieldOffset(16)] + private uint m22; + + [FieldOffset(20)] + private uint m23; + + [FieldOffset(24)] + private uint m31; + + [FieldOffset(28)] + private uint m32; + + [FieldOffset(32)] + private uint m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public UInt3x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23, uint m31, uint m32, uint m33) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x3), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m21; - - [FieldOffset(16)] - private uint m22; - - [FieldOffset(20)] - private uint m23; - - [FieldOffset(24)] - private uint m31; - - [FieldOffset(28)] - private uint m32; - - [FieldOffset(32)] - private uint m33; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - public UInt3x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23, uint m31, uint m32, uint m33) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public UInt3x3(UInt3 row1, UInt3 row2, UInt3 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public UInt3x3(UInt3 row1, UInt3 row2, UInt3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// 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 UInt3x3(uint x) - { - UInt3x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt3x3 operator +(UInt3x3 left, UInt3x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt3x3 operator /(UInt3x3 left, UInt3x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt3x3 operator *(UInt3x3 left, UInt3x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt3x3 operator -(UInt3x3 left, UInt3x3 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// 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 UInt3x3(uint x) + { + UInt3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct UInt3x4 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt3x3 operator +(UInt3x3 left, UInt3x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt3x3 operator /(UInt3x3 left, UInt3x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt3x3 operator *(UInt3x3 left, UInt3x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt3x3 operator -(UInt3x3 left, UInt3x3 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct UInt3x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x4), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + [FieldOffset(16)] + private uint m21; + + [FieldOffset(20)] + private uint m22; + + [FieldOffset(24)] + private uint m23; + + [FieldOffset(28)] + private uint m24; + + [FieldOffset(32)] + private uint m31; + + [FieldOffset(36)] + private uint m32; + + [FieldOffset(40)] + private uint m33; + + [FieldOffset(44)] + private uint m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public UInt3x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24, uint m31, uint m32, uint m33, uint m34) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3x4), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m14; - - [FieldOffset(16)] - private uint m21; - - [FieldOffset(20)] - private uint m22; - - [FieldOffset(24)] - private uint m23; - - [FieldOffset(28)] - private uint m24; - - [FieldOffset(32)] - private uint m31; - - [FieldOffset(36)] - private uint m32; - - [FieldOffset(40)] - private uint m33; - - [FieldOffset(44)] - private uint m34; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - public UInt3x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24, uint m31, uint m32, uint m33, uint m34) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - public UInt3x4(UInt4 row1, UInt4 row2, UInt4 row3) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public UInt3x4(UInt4 row1, UInt4 row2, UInt4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref uint M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref uint M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// 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 UInt3x4(uint x) - { - UInt3x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt3x4 operator +(UInt3x4 left, UInt3x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt3x4 operator /(UInt3x4 left, UInt3x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt3x4 operator *(UInt3x4 left, UInt3x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt3x4 operator -(UInt3x4 left, UInt3x4 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref uint M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref uint M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// 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 UInt3x4(uint x) + { + UInt3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; } - /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] - public unsafe partial struct UInt4x1 + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt3x4 operator +(UInt3x4 left, UInt3x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt3x4 operator /(UInt3x4 left, UInt3x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt3x4 operator *(UInt3x4 left, UInt3x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt3x4 operator -(UInt3x4 left, UInt3x4 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] +public unsafe partial struct UInt4x1 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x1), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m21; + + [FieldOffset(8)] + private uint m31; + + [FieldOffset(12)] + private uint m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public UInt4x1(uint m11, uint m21, uint m31, uint m41) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x1), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m21; - - [FieldOffset(8)] - private uint m31; - - [FieldOffset(12)] - private uint m41; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [4, 1]. - public UInt4x1(uint m11, uint m21, uint m31, uint m41) - { - this.m11 = m11; - this.m21 = m21; - this.m31 = m31; - this.m41 = m41; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 uint this[int row] => ref *(uint*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// 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 UInt4x1(uint x) - { - UInt4x1 matrix; - - matrix.m11 = x; - matrix.m21 = x; - matrix.m31 = x; - matrix.m41 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt4x1 operator +(UInt4x1 left, UInt4x1 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt4x1 operator /(UInt4x1 left, UInt4x1 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt4x1 operator *(UInt4x1 left, UInt4x1 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt4x1 operator -(UInt4x1 left, UInt4x1 right) => default; - - /// - /// Casts a value to a one. - /// - /// The input value to cast. - public static implicit operator UInt4(UInt4x1 matrix) => *(UInt4*)&matrix; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// 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 UInt4x1(uint x) + { + UInt4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt4x1 operator +(UInt4x1 left, UInt4x1 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt4x1 operator /(UInt4x1 left, UInt4x1 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt4x1 operator *(UInt4x1 left, UInt4x1 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt4x1 operator -(UInt4x1 left, UInt4x1 right) => default; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt4(UInt4x1 matrix) => *(UInt4*)&matrix; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] +public unsafe partial struct UInt4x2 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x2), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m21; + + [FieldOffset(12)] + private uint m22; + + [FieldOffset(16)] + private uint m31; + + [FieldOffset(20)] + private uint m32; + + [FieldOffset(24)] + private uint m41; + + [FieldOffset(28)] + private uint m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public UInt4x2(uint m11, uint m12, uint m21, uint m22, uint m31, uint m32, uint m41, uint m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; } - /// - [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] - public unsafe partial struct UInt4x2 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public UInt4x2(UInt2 row1, UInt2 row2, UInt2 row3, UInt2 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x2), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m21; - - [FieldOffset(12)] - private uint m22; - - [FieldOffset(16)] - private uint m31; - - [FieldOffset(20)] - private uint m32; - - [FieldOffset(24)] - private uint m41; - - [FieldOffset(28)] - private uint m42; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - public UInt4x2(uint m11, uint m12, uint m21, uint m22, uint m31, uint m32, uint m41, uint m42) - { - this.m11 = m11; - this.m12 = m12; - this.m21 = m21; - this.m22 = m22; - this.m31 = m31; - this.m32 = m32; - this.m41 = m41; - this.m42 = m42; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public UInt4x2(UInt2 row1, UInt2 row2, UInt2 row3, UInt2 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m41 = row4.X; - this.m42 = row4.Y; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt2 this[int row] => ref *(UInt2*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref uint M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// 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 UInt4x2(uint x) - { - UInt4x2 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m41 = x; - matrix.m42 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt4x2 operator +(UInt4x2 left, UInt4x2 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt4x2 operator /(UInt4x2 left, UInt4x2 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt4x2 operator *(UInt4x2 left, UInt4x2 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt4x2 operator -(UInt4x2 left, UInt4x2 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref uint M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// 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 UInt4x2(uint x) + { + UInt4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt4x2 operator +(UInt4x2 left, UInt4x2 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt4x2 operator /(UInt4x2 left, UInt4x2 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt4x2 operator *(UInt4x2 left, UInt4x2 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt4x2 operator -(UInt4x2 left, UInt4x2 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] +public unsafe partial struct UInt4x3 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x3), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m21; + + [FieldOffset(16)] + private uint m22; + + [FieldOffset(20)] + private uint m23; + + [FieldOffset(24)] + private uint m31; + + [FieldOffset(28)] + private uint m32; + + [FieldOffset(32)] + private uint m33; + + [FieldOffset(36)] + private uint m41; + + [FieldOffset(40)] + private uint m42; + + [FieldOffset(44)] + private uint m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public UInt4x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23, uint m31, uint m32, uint m33, uint m41, uint m42, uint m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; } - /// - [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] - public unsafe partial struct UInt4x3 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public UInt4x3(UInt3 row1, UInt3 row2, UInt3 row3, UInt3 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x3), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m21; - - [FieldOffset(16)] - private uint m22; - - [FieldOffset(20)] - private uint m23; - - [FieldOffset(24)] - private uint m31; - - [FieldOffset(28)] - private uint m32; - - [FieldOffset(32)] - private uint m33; - - [FieldOffset(36)] - private uint m41; - - [FieldOffset(40)] - private uint m42; - - [FieldOffset(44)] - private uint m43; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - public UInt4x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23, uint m31, uint m32, uint m33, uint m41, uint m42, uint m43) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public UInt4x3(UInt3 row1, UInt3 row2, UInt3 row3, UInt3 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt3 this[int row] => ref *(UInt3*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref uint M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref uint M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// 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 UInt4x3(uint x) - { - UInt4x3 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt4x3 operator +(UInt4x3 left, UInt4x3 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt4x3 operator /(UInt4x3 left, UInt4x3 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt4x3 operator *(UInt4x3 left, UInt4x3 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt4x3 operator -(UInt4x3 left, UInt4x3 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref uint M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref uint M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// 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 UInt4x3(uint x) + { + UInt4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt4x3 operator +(UInt4x3 left, UInt4x3 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt4x3 operator /(UInt4x3 left, UInt4x3 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt4x3 operator *(UInt4x3 left, UInt4x3 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt4x3 operator -(UInt4x3 left, UInt4x3 right) => default; +} + +/// +[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] +public unsafe partial struct UInt4x4 +{ + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x4), sizeof(UInt4)); + + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + [FieldOffset(16)] + private uint m21; + + [FieldOffset(20)] + private uint m22; + + [FieldOffset(24)] + private uint m23; + + [FieldOffset(28)] + private uint m24; + + [FieldOffset(32)] + private uint m31; + + [FieldOffset(36)] + private uint m32; + + [FieldOffset(40)] + private uint m33; + + [FieldOffset(44)] + private uint m34; + + [FieldOffset(48)] + private uint m41; + + [FieldOffset(52)] + private uint m42; + + [FieldOffset(56)] + private uint m43; + + [FieldOffset(60)] + private uint m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public UInt4x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24, uint m31, uint m32, uint m33, uint m34, uint m41, uint m42, uint m43, uint m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; } - /// - [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] - public unsafe partial struct UInt4x4 + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public UInt4x4(UInt4 row1, UInt4 row2, UInt4 row3, UInt4 row4) { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt4x4), sizeof(UInt4)); - - [FieldOffset(0)] - private uint m11; - - [FieldOffset(4)] - private uint m12; - - [FieldOffset(8)] - private uint m13; - - [FieldOffset(12)] - private uint m14; - - [FieldOffset(16)] - private uint m21; - - [FieldOffset(20)] - private uint m22; - - [FieldOffset(24)] - private uint m23; - - [FieldOffset(28)] - private uint m24; - - [FieldOffset(32)] - private uint m31; - - [FieldOffset(36)] - private uint m32; - - [FieldOffset(40)] - private uint m33; - - [FieldOffset(44)] - private uint m34; - - [FieldOffset(48)] - private uint m41; - - [FieldOffset(52)] - private uint m42; - - [FieldOffset(56)] - private uint m43; - - [FieldOffset(60)] - private uint m44; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the component at position [1, 1]. - /// The value to assign to the component at position [1, 2]. - /// The value to assign to the component at position [1, 3]. - /// The value to assign to the component at position [1, 4]. - /// The value to assign to the component at position [2, 1]. - /// The value to assign to the component at position [2, 2]. - /// The value to assign to the component at position [2, 3]. - /// The value to assign to the component at position [2, 4]. - /// The value to assign to the component at position [3, 1]. - /// The value to assign to the component at position [3, 2]. - /// The value to assign to the component at position [3, 3]. - /// The value to assign to the component at position [3, 4]. - /// The value to assign to the component at position [4, 1]. - /// The value to assign to the component at position [4, 2]. - /// The value to assign to the component at position [4, 3]. - /// The value to assign to the component at position [4, 4]. - public UInt4x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24, uint m31, uint m32, uint m33, uint m34, uint m41, uint m42, uint m43, uint m44) - { - this.m11 = m11; - this.m12 = m12; - this.m13 = m13; - this.m14 = m14; - this.m21 = m21; - this.m22 = m22; - this.m23 = m23; - this.m24 = m24; - this.m31 = m31; - this.m32 = m32; - this.m33 = m33; - this.m34 = m34; - this.m41 = m41; - this.m42 = m42; - this.m43 = m43; - this.m44 = m44; - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The value to assign to the row at position [1]. - /// The value to assign to the row at position [2]. - /// The value to assign to the row at position [3]. - /// The value to assign to the row at position [4]. - public UInt4x4(UInt4 row1, UInt4 row2, UInt4 row3, UInt4 row4) - { - this.m11 = row1.X; - this.m12 = row1.Y; - this.m13 = row1.Z; - this.m14 = row1.W; - this.m21 = row2.X; - this.m22 = row2.Y; - this.m23 = row2.Z; - this.m24 = row2.W; - this.m31 = row3.X; - this.m32 = row3.Y; - this.m33 = row3.Z; - this.m34 = row3.W; - this.m41 = row4.X; - this.m42 = row4.Y; - this.m43 = row4.Z; - this.m44 = row4.W; - } - - /// - /// Gets a reference to a specific row in the current instance. - /// - /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row 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 UInt4 this[int row] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// 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 UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// 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 UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; - /// - /// Gets a swizzled reference to a specific sequence of items in the current instance. - /// - /// The identifier of the first item to index. - /// The identifier of the second item to index. - /// The identifier of the third item to index. - /// The identifier of the fourth item to index. - /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; - - /// - /// Gets a reference to the value representing the component at position [1, 1]. - /// - public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 2]. - /// - public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 3]. - /// - public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); - - /// - /// Gets a reference to the value representing the component at position [1, 4]. - /// - public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 1]. - /// - public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 2]. - /// - public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 3]. - /// - public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); - - /// - /// Gets a reference to the value representing the component at position [2, 4]. - /// - public readonly ref uint M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 1]. - /// - public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 2]. - /// - public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 3]. - /// - public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); - - /// - /// Gets a reference to the value representing the component at position [3, 4]. - /// - public readonly ref uint M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 1]. - /// - public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 2]. - /// - public readonly ref uint M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 3]. - /// - public readonly ref uint M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); - - /// - /// Gets a reference to the value representing the component at position [4, 4]. - /// - public readonly ref uint M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); - - /// - /// 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 UInt4x4(uint x) - { - UInt4x4 matrix; - - matrix.m11 = x; - matrix.m12 = x; - matrix.m13 = x; - matrix.m14 = x; - matrix.m21 = x; - matrix.m22 = x; - matrix.m23 = x; - matrix.m24 = x; - matrix.m31 = x; - matrix.m32 = x; - matrix.m33 = x; - matrix.m34 = x; - matrix.m41 = x; - matrix.m42 = x; - matrix.m43 = x; - matrix.m44 = x; - - return matrix; - } - - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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 UInt4x4 operator +(UInt4x4 left, UInt4x4 right) => default; - - /// - /// Divides two values (elementwise division). - /// - /// The first value to divide. - /// The second value to divide. - /// 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 UInt4x4 operator /(UInt4x4 left, UInt4x4 right) => default; - - /// - /// Multiplies two values (elementwise product). - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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 UInt4x4 operator *(UInt4x4 left, UInt4x4 right) => default; - - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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 UInt4x4 operator -(UInt4x4 left, UInt4x4 right) => default; + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + /// 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 UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(UInt4*)UndefinedData; + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public readonly ref uint M11 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m11), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public readonly ref uint M12 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m12), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public readonly ref uint M13 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m13), 1)); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public readonly ref uint M14 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m14), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public readonly ref uint M21 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m21), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public readonly ref uint M22 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m22), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public readonly ref uint M23 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m23), 1)); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public readonly ref uint M24 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m24), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public readonly ref uint M31 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m31), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public readonly ref uint M32 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m32), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public readonly ref uint M33 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m33), 1)); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public readonly ref uint M34 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m34), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public readonly ref uint M41 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m41), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public readonly ref uint M42 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m42), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public readonly ref uint M43 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m43), 1)); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public readonly ref uint M44 => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m44), 1)); + + /// + /// 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 UInt4x4(uint x) + { + UInt4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; } + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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 UInt4x4 operator +(UInt4x4 left, UInt4x4 right) => default; + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + /// 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 UInt4x4 operator /(UInt4x4 left, UInt4x4 right) => default; + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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 UInt4x4 operator *(UInt4x4 left, UInt4x4 right) => default; + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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 UInt4x4 operator -(UInt4x4 left, UInt4x4 right) => default; } diff --git a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude b/src/ComputeSharp/Core/Primitives/VectorType.ttinclude index 3514c799..2b64676a 100644 --- a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude +++ b/src/ComputeSharp/Core/Primitives/VectorType.ttinclude @@ -68,20 +68,19 @@ using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal; #nullable enable -namespace ComputeSharp +namespace ComputeSharp; + +/// +[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>, Pack = <#=elementSize#>)] +public unsafe partial struct <#=typeName#><#=formattable#> { - /// - [StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>, Pack = <#=elementSize#>)] - public unsafe partial struct <#=typeName#><#=formattable#> - { - /// - /// A private buffer to which the undefined properties will point to. - /// - private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<#=typeName#>), sizeof(<#=elementTypeName#>4)); + /// + /// A private buffer to which the undefined properties will point to. + /// + private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<#=typeName#>), sizeof(<#=elementTypeName#>4)); <# WriteLine(""); PushIndent(" "); - PushIndent(" "); // Generate the private fields foreach (char name in "xyzw".Substring(0, i)) @@ -92,17 +91,15 @@ namespace ComputeSharp } PopIndent(); - PopIndent(); #> - /// - /// 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 <#=hlslElementTypeName#> this[int i] => ref *(<#=hlslElementTypeName#>*)UndefinedData; + /// + /// 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 <#=hlslElementTypeName#> this[int i] => ref *(<#=hlslElementTypeName#>*)UndefinedData; <# PushIndent(" "); - PushIndent(" "); // Generate the combinatorial swizzling properties foreach ( @@ -147,23 +144,21 @@ namespace ComputeSharp } } - PopIndent(); PopIndent(); WriteLine(""); if (elementTypeName == "Bool") { #> - /// - public override readonly string ToString() - { - StringBuilder sb = new(); + /// + public override readonly string ToString() + { + StringBuilder sb = new(); - sb.Append('<'); + sb.Append('<'); <# PushIndent(" "); PushIndent(" "); - PushIndent(" "); for (int j = 0; j < i; j++) { @@ -177,35 +172,33 @@ namespace ComputeSharp PopIndent(); PopIndent(); - PopIndent(); #> - sb.Append('>'); + sb.Append('>'); - return sb.ToString(); - } + return sb.ToString(); + } <# } else { #> - /// - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } + /// + public override readonly string ToString() + { + return ToString("G", CultureInfo.CurrentCulture); + } - /// - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); + /// + public readonly string ToString(string? format, IFormatProvider? formatProvider) + { + StringBuilder sb = new(); - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - sb.Append('<'); + sb.Append('<'); <# PushIndent(" "); PushIndent(" "); - PushIndent(" "); for (int j = 0; j < i; j++) { @@ -220,12 +213,11 @@ namespace ComputeSharp PopIndent(); PopIndent(); - PopIndent(); #> - sb.Append('>'); + sb.Append('>'); - return sb.ToString(); - } + return sb.ToString(); + } <# } @@ -237,12 +229,12 @@ namespace ComputeSharp string argumentName = "xyzw".Substring(0, i); string operatorName = elementTypeName == "Bool" ? "!" : "-"; #> - /// - /// Negates a value. - /// - /// The value to negate. - /// 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 <#=operatorName#>(<#=typeName#> <#=argumentName#>) => default; + /// + /// Negates a value. + /// + /// The value to negate. + /// 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 <#=operatorName#>(<#=typeName#> <#=argumentName#>) => default; <# } @@ -251,41 +243,40 @@ namespace ComputeSharp { WriteLine(""); #> - /// - /// Sums two values. - /// - /// The first value to sum. - /// The second value to sum. - /// 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; + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + /// 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; - /// - /// Divides two values. - /// - /// The first value to divide. - /// The second value to divide. - /// 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; + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + /// 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; - /// - /// Multiplies two values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// 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; + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + /// 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; - /// - /// Subtracts two values. - /// - /// The first value to subtract. - /// The second value to subtract. - /// 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; + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + /// 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; <# } #> - } } <# } diff --git a/src/ComputeSharp/Gpu.cs b/src/ComputeSharp/Gpu.cs index 5d13d371..8efab27a 100644 --- a/src/ComputeSharp/Gpu.cs +++ b/src/ComputeSharp/Gpu.cs @@ -3,55 +3,54 @@ using System.Collections.Generic; using System.Diagnostics.Contracts; using ComputeSharp.Graphics.Helpers; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that acts as an entry-point for all the library APIs, exposing the available GPU devices. +/// +public static class Gpu { /// - /// A that acts as an entry-point for all the library APIs, exposing the available GPU devices. + /// Gets the default instance for the current machine. + /// This instance cannot be manually disposed - attempting to do so is safe and it will + /// not cause an exception, but it will simply do nothing and not dispose the device. /// - public static class Gpu + /// + /// This device will always be available, even when there isn't a compatible physical GPU + /// or integrated GPU in the system in use. In that case, the WARP device will be used. + /// For more info, see . + /// + public static GraphicsDevice Default => DeviceHelper.DefaultFactory.Value; + + /// + /// Enumerates all the currently available devices supporting the minimum necessary feature level. + /// Physical devices and integrated GPUs will be enumerated first, and the WARP device will always be last. + /// + /// A sequence of instances. + /// + /// Creating a device is a relatively expensive operation, so consider using to be + /// able to filter the existing adapters before creating a device from them, to reduce the system overhead. + /// + [Pure] + public static IEnumerable EnumerateDevices() { - /// - /// Gets the default instance for the current machine. - /// This instance cannot be manually disposed - attempting to do so is safe and it will - /// not cause an exception, but it will simply do nothing and not dispose the device. - /// - /// - /// This device will always be available, even when there isn't a compatible physical GPU - /// or integrated GPU in the system in use. In that case, the WARP device will be used. - /// For more info, see . - /// - public static GraphicsDevice Default => DeviceHelper.DefaultFactory.Value; + return new DeviceHelper.DeviceQuery(null); + } - /// - /// Enumerates all the currently available devices supporting the minimum necessary feature level. - /// Physical devices and integrated GPUs will be enumerated first, and the WARP device will always be last. - /// - /// A sequence of instances. - /// - /// Creating a device is a relatively expensive operation, so consider using to be - /// able to filter the existing adapters before creating a device from them, to reduce the system overhead. - /// - [Pure] - public static IEnumerable EnumerateDevices() - { - return new DeviceHelper.DeviceQuery(null); - } - - /// - /// Executes a query on the currently available devices matching a given predicate. - /// - /// The predicate to use to select the devices to create. - /// A sequence of instances matching . - /// - /// Note that only devices matching the minimum necessary feature level will actually be instantiated and returned. - /// This means that might not actually be used to match against all existing adapters on - /// the current system, if any of them doesn't meet the minimum criteria, and that additional filtering might be done - /// after the input predicate is invoked, so a match doesn't necessarily guarantee that that device will be returned. - /// - [Pure] - public static IEnumerable QueryDevices(Predicate predicate) - { - return new DeviceHelper.DeviceQuery(predicate); - } + /// + /// Executes a query on the currently available devices matching a given predicate. + /// + /// The predicate to use to select the devices to create. + /// A sequence of instances matching . + /// + /// Note that only devices matching the minimum necessary feature level will actually be instantiated and returned. + /// This means that might not actually be used to match against all existing adapters on + /// the current system, if any of them doesn't meet the minimum criteria, and that additional filtering might be done + /// after the input predicate is invoked, so a match doesn't necessarily guarantee that that device will be returned. + /// + [Pure] + public static IEnumerable QueryDevices(Predicate predicate) + { + return new DeviceHelper.DeviceQuery(predicate); } } diff --git a/src/ComputeSharp/Graphics/Commands/CommandList.cs b/src/ComputeSharp/Graphics/Commands/CommandList.cs index 9d265909..37fca894 100644 --- a/src/ComputeSharp/Graphics/Commands/CommandList.cs +++ b/src/ComputeSharp/Graphics/Commands/CommandList.cs @@ -4,136 +4,135 @@ using System.Runtime.CompilerServices; using TerraFX.Interop; using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; -namespace ComputeSharp.Graphics.Commands +namespace ComputeSharp.Graphics.Commands; + +/// +/// A command list to set and execute operations on the GPU. +/// +internal unsafe ref struct CommandList { /// - /// A command list to set and execute operations on the GPU. + /// The instance associated with the current command list. /// - internal unsafe ref struct CommandList + private readonly GraphicsDevice device; + + /// + /// The command list type being used by the current instance. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The object in use by the current instance. + /// + private ComPtr d3D12GraphicsCommandList; + + /// + /// The object in use by the current instance. + /// + private ComPtr d3D12CommandAllocator; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The target instance to use. + /// The type of command list to create. + public CommandList(GraphicsDevice device, D3D12_COMMAND_LIST_TYPE d3D12CommandListType) { - /// - /// The instance associated with the current command list. - /// - private readonly GraphicsDevice device; + this.device = device; + this.d3D12CommandListType = d3D12CommandListType; - /// - /// The command list type being used by the current instance. - /// - private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + Unsafe.SkipInit(out this.d3D12GraphicsCommandList); + Unsafe.SkipInit(out this.d3D12CommandAllocator); - /// - /// The object in use by the current instance. - /// - private ComPtr d3D12GraphicsCommandList; + device.GetCommandListAndAllocator( + d3D12CommandListType, + out *(ID3D12GraphicsCommandList**)Unsafe.AsPointer(ref this.d3D12GraphicsCommandList), + out *(ID3D12CommandAllocator**)Unsafe.AsPointer(ref this.d3D12CommandAllocator)); - /// - /// The object in use by the current instance. - /// - private ComPtr d3D12CommandAllocator; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The target instance to use. - /// The type of command list to create. - public CommandList(GraphicsDevice device, D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + // Set the heap descriptor if the command list is not for copy operations + if (d3D12CommandListType is not D3D12_COMMAND_LIST_TYPE_COPY) { - this.device = device; - this.d3D12CommandListType = d3D12CommandListType; - - Unsafe.SkipInit(out this.d3D12GraphicsCommandList); - Unsafe.SkipInit(out this.d3D12CommandAllocator); - - device.GetCommandListAndAllocator( - d3D12CommandListType, - out *(ID3D12GraphicsCommandList**)Unsafe.AsPointer(ref this.d3D12GraphicsCommandList), - out *(ID3D12CommandAllocator**)Unsafe.AsPointer(ref this.d3D12CommandAllocator)); - - // Set the heap descriptor if the command list is not for copy operations - if (d3D12CommandListType is not D3D12_COMMAND_LIST_TYPE_COPY) - { - device.SetDescriptorHeapForCommandList(this.d3D12GraphicsCommandList); - } - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The target instance to use. - /// The instance to use for the new command list. - public CommandList(GraphicsDevice device, ID3D12PipelineState* d3D12PipelineState) - { - this.device = device; - this.d3D12CommandListType = D3D12_COMMAND_LIST_TYPE_COMPUTE; - - Unsafe.SkipInit(out this.d3D12GraphicsCommandList); - Unsafe.SkipInit(out this.d3D12CommandAllocator); - - device.GetCommandListAndAllocator( - d3D12PipelineState, - out *(ID3D12GraphicsCommandList**)Unsafe.AsPointer(ref this.d3D12GraphicsCommandList), - out *(ID3D12CommandAllocator**)Unsafe.AsPointer(ref this.d3D12CommandAllocator)); - - // Set the heap descriptor for the command list device.SetDescriptorHeapForCommandList(this.d3D12GraphicsCommandList); } + } - /// - /// Gets the command list type being used by the current instance. - /// - public readonly D3D12_COMMAND_LIST_TYPE D3D12CommandListType => this.d3D12CommandListType; + /// + /// Creates a new instance with the specified parameters. + /// + /// The target instance to use. + /// The instance to use for the new command list. + public CommandList(GraphicsDevice device, ID3D12PipelineState* d3D12PipelineState) + { + this.device = device; + this.d3D12CommandListType = D3D12_COMMAND_LIST_TYPE_COMPUTE; - /// - /// Gets the object in use by the current instance. - /// - public readonly ID3D12GraphicsCommandList* D3D12GraphicsCommandList => this.d3D12GraphicsCommandList.Get(); + Unsafe.SkipInit(out this.d3D12GraphicsCommandList); + Unsafe.SkipInit(out this.d3D12CommandAllocator); - /// - /// Detaches the object in use by the current instance. - /// - /// The object in use, with ownership. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ID3D12CommandAllocator* DetachD3D12CommandAllocator() - { - return this.d3D12CommandAllocator.Detach(); - } + device.GetCommandListAndAllocator( + d3D12PipelineState, + out *(ID3D12GraphicsCommandList**)Unsafe.AsPointer(ref this.d3D12GraphicsCommandList), + out *(ID3D12CommandAllocator**)Unsafe.AsPointer(ref this.d3D12CommandAllocator)); - /// - /// Detaches the object in use by the current instance. - /// - /// The object in use, with ownership. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ID3D12GraphicsCommandList* DetachD3D12CommandList() - { - return this.d3D12GraphicsCommandList.Detach(); - } + // Set the heap descriptor for the command list + device.SetDescriptorHeapForCommandList(this.d3D12GraphicsCommandList); + } - /// - /// Gets a pointer to the object in use by the current instance. - /// - /// A double pointer to the current object to execute. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly ID3D12CommandList** GetD3D12CommandListAddressOf() - { - return (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf(); - } + /// + /// Gets the command list type being used by the current instance. + /// + public readonly D3D12_COMMAND_LIST_TYPE D3D12CommandListType => this.d3D12CommandListType; - /// - /// Executes the commands in the current commands list, and waits for completion. - /// - public void ExecuteAndWaitForCompletion() - { - this.d3D12GraphicsCommandList.Get()->Close(); + /// + /// Gets the object in use by the current instance. + /// + public readonly ID3D12GraphicsCommandList* D3D12GraphicsCommandList => this.d3D12GraphicsCommandList.Get(); - this.device.ExecuteCommandList(ref this); - } + /// + /// Detaches the object in use by the current instance. + /// + /// The object in use, with ownership. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ID3D12CommandAllocator* DetachD3D12CommandAllocator() + { + return this.d3D12CommandAllocator.Detach(); + } - /// - public void Dispose() - { - this.d3D12CommandAllocator.Dispose(); - this.d3D12GraphicsCommandList.Dispose(); - } + /// + /// Detaches the object in use by the current instance. + /// + /// The object in use, with ownership. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ID3D12GraphicsCommandList* DetachD3D12CommandList() + { + return this.d3D12GraphicsCommandList.Detach(); + } + + /// + /// Gets a pointer to the object in use by the current instance. + /// + /// A double pointer to the current object to execute. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly ID3D12CommandList** GetD3D12CommandListAddressOf() + { + return (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf(); + } + + /// + /// Executes the commands in the current commands list, and waits for completion. + /// + public void ExecuteAndWaitForCompletion() + { + this.d3D12GraphicsCommandList.Get()->Close(); + + this.device.ExecuteCommandList(ref this); + } + + /// + public void Dispose() + { + this.d3D12CommandAllocator.Dispose(); + this.d3D12GraphicsCommandList.Dispose(); } } diff --git a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandListPool.cs b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandListPool.cs index b8d3e991..167282d2 100644 --- a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandListPool.cs +++ b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandListPool.cs @@ -5,144 +5,143 @@ using ComputeSharp.Core.Extensions; using ComputeSharp.Graphics.Extensions; using TerraFX.Interop; -namespace ComputeSharp.Graphics.Commands.Interop +namespace ComputeSharp.Graphics.Commands.Interop; + +/// +/// A type that acts as a pool to get new instances wheen needed. +/// +internal readonly unsafe struct ID3D12CommandListPool : IDisposable { /// - /// A type that acts as a pool to get new instances wheen needed. + /// The command list type being used by the current instance. /// - internal readonly unsafe struct ID3D12CommandListPool : IDisposable + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The queue of items with the available command lists. + /// + private readonly Queue d3D12CommandListBundleQueue; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The command list type to use. + public ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE d3D12CommandListType) { - /// - /// The command list type being used by the current instance. - /// - private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + this.d3D12CommandListType = d3D12CommandListType; + this.d3D12CommandListBundleQueue = new Queue(); + } - /// - /// The queue of items with the available command lists. - /// - private readonly Queue d3D12CommandListBundleQueue; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The command list type to use. - public ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + /// + /// Rents a and pair. + /// + /// The renting the command list. + /// The instance to use for the new command list. + /// The resulting value. + /// The resulting value. + public void Rent(ID3D12Device* d3D12Device, ID3D12PipelineState* d3D12PipelineState, out ID3D12GraphicsCommandList* d3D12CommandList, out ID3D12CommandAllocator* d3D12CommandAllocator) + { + lock (this.d3D12CommandListBundleQueue) { - this.d3D12CommandListType = d3D12CommandListType; - this.d3D12CommandListBundleQueue = new Queue(); - } - - /// - /// Rents a and pair. - /// - /// The renting the command list. - /// The instance to use for the new command list. - /// The resulting value. - /// The resulting value. - public void Rent(ID3D12Device* d3D12Device, ID3D12PipelineState* d3D12PipelineState, out ID3D12GraphicsCommandList* d3D12CommandList, out ID3D12CommandAllocator* d3D12CommandAllocator) - { - lock (this.d3D12CommandListBundleQueue) + if (this.d3D12CommandListBundleQueue.TryDequeue(out D3D12CommandListBundle d3D12CommandListBundle)) { - if (this.d3D12CommandListBundleQueue.TryDequeue(out D3D12CommandListBundle d3D12CommandListBundle)) - { - d3D12CommandList = d3D12CommandListBundle.D3D12CommandList; - d3D12CommandAllocator = d3D12CommandListBundle.D3D12CommandAllocator; - } - else - { - d3D12CommandAllocator = null; - d3D12CommandList = null; - } - } - - // Reset the command allocator and command list outside of the lock, or create a new pair if one to be reused - // wasn't available. These operations are relatively expensive, so doing so here reduces thread contention - // when multiple shader executions are being dispatched in parallel on the same device. - if (d3D12CommandAllocator is not null) - { - d3D12CommandAllocator->Reset().Assert(); - d3D12CommandList->Reset(d3D12CommandAllocator, d3D12PipelineState).Assert(); + d3D12CommandList = d3D12CommandListBundle.D3D12CommandList; + d3D12CommandAllocator = d3D12CommandListBundle.D3D12CommandAllocator; } else { - CreateCommandListAndAllocator(d3D12Device, d3D12PipelineState, out d3D12CommandList, out d3D12CommandAllocator); + d3D12CommandAllocator = null; + d3D12CommandList = null; } } + // Reset the command allocator and command list outside of the lock, or create a new pair if one to be reused + // wasn't available. These operations are relatively expensive, so doing so here reduces thread contention + // when multiple shader executions are being dispatched in parallel on the same device. + if (d3D12CommandAllocator is not null) + { + d3D12CommandAllocator->Reset().Assert(); + d3D12CommandList->Reset(d3D12CommandAllocator, d3D12PipelineState).Assert(); + } + else + { + CreateCommandListAndAllocator(d3D12Device, d3D12PipelineState, out d3D12CommandList, out d3D12CommandAllocator); + } + } + + /// + /// Returns a and pair. + /// + /// The returned value. + /// The returned value. + public void Return(ID3D12GraphicsCommandList* d3D12CommandList, ID3D12CommandAllocator* d3D12CommandAllocator) + { + lock (this.d3D12CommandListBundleQueue) + { + this.d3D12CommandListBundleQueue.Enqueue(new D3D12CommandListBundle(d3D12CommandList, d3D12CommandAllocator)); + } + } + + /// + public void Dispose() + { + lock (this.d3D12CommandListBundleQueue) + { + foreach (D3D12CommandListBundle d3D12CommandListBundle in this.d3D12CommandListBundleQueue) + { + d3D12CommandListBundle.D3D12CommandList->Release(); + d3D12CommandListBundle.D3D12CommandAllocator->Release(); + } + + this.d3D12CommandListBundleQueue.Clear(); + } + } + + /// + /// Creates a new and pair. + /// + /// The renting the command list. + /// The instance to use for the new command list. + /// The resulting value. + /// The resulting value. + [MethodImpl(MethodImplOptions.NoInlining)] + private void CreateCommandListAndAllocator(ID3D12Device* d3D12Device, ID3D12PipelineState* d3D12PipelineState, out ID3D12GraphicsCommandList* d3D12CommandList, out ID3D12CommandAllocator* d3D12CommandAllocator) + { + using ComPtr d3D12CommandAllocatorComPtr = d3D12Device->CreateCommandAllocator(this.d3D12CommandListType); + using ComPtr d3D12CommandListComPtr = d3D12Device->CreateCommandList(this.d3D12CommandListType, d3D12CommandAllocatorComPtr.Get(), d3D12PipelineState); + + fixed (ID3D12GraphicsCommandList** d3D12CommandListPtr = &d3D12CommandList) + fixed (ID3D12CommandAllocator** d3D12CommandAllocatorPtr = &d3D12CommandAllocator) + { + d3D12CommandListComPtr.CopyTo(d3D12CommandListPtr); + d3D12CommandAllocatorComPtr.CopyTo(d3D12CommandAllocatorPtr); + } + } + + /// + /// A type representing a bundle of a cached command list and related allocator. + /// + private readonly struct D3D12CommandListBundle + { + /// + /// The value for the current entry. + /// + public readonly ID3D12GraphicsCommandList* D3D12CommandList; + /// - /// Returns a and pair. + /// The value for the current entry. /// - /// The returned value. - /// The returned value. - public void Return(ID3D12GraphicsCommandList* d3D12CommandList, ID3D12CommandAllocator* d3D12CommandAllocator) - { - lock (this.d3D12CommandListBundleQueue) - { - this.d3D12CommandListBundleQueue.Enqueue(new D3D12CommandListBundle(d3D12CommandList, d3D12CommandAllocator)); - } - } - - /// - public void Dispose() - { - lock (this.d3D12CommandListBundleQueue) - { - foreach (D3D12CommandListBundle d3D12CommandListBundle in this.d3D12CommandListBundleQueue) - { - d3D12CommandListBundle.D3D12CommandList->Release(); - d3D12CommandListBundle.D3D12CommandAllocator->Release(); - } - - this.d3D12CommandListBundleQueue.Clear(); - } - } + public readonly ID3D12CommandAllocator* D3D12CommandAllocator; /// - /// Creates a new and pair. + /// Creates a new instance with the given parameters. /// - /// The renting the command list. - /// The instance to use for the new command list. - /// The resulting value. - /// The resulting value. - [MethodImpl(MethodImplOptions.NoInlining)] - private void CreateCommandListAndAllocator(ID3D12Device* d3D12Device, ID3D12PipelineState* d3D12PipelineState, out ID3D12GraphicsCommandList* d3D12CommandList, out ID3D12CommandAllocator* d3D12CommandAllocator) + /// The value to wrap. + /// The value to wrap. + public D3D12CommandListBundle(ID3D12GraphicsCommandList* d3D12CommandList, ID3D12CommandAllocator* d3D12CommandAllocator) { - using ComPtr d3D12CommandAllocatorComPtr = d3D12Device->CreateCommandAllocator(this.d3D12CommandListType); - using ComPtr d3D12CommandListComPtr = d3D12Device->CreateCommandList(this.d3D12CommandListType, d3D12CommandAllocatorComPtr.Get(), d3D12PipelineState); - - fixed (ID3D12GraphicsCommandList** d3D12CommandListPtr = &d3D12CommandList) - fixed (ID3D12CommandAllocator** d3D12CommandAllocatorPtr = &d3D12CommandAllocator) - { - d3D12CommandListComPtr.CopyTo(d3D12CommandListPtr); - d3D12CommandAllocatorComPtr.CopyTo(d3D12CommandAllocatorPtr); - } - } - - /// - /// A type representing a bundle of a cached command list and related allocator. - /// - private readonly struct D3D12CommandListBundle - { - /// - /// The value for the current entry. - /// - public readonly ID3D12GraphicsCommandList* D3D12CommandList; - - /// - /// The value for the current entry. - /// - public readonly ID3D12CommandAllocator* D3D12CommandAllocator; - - /// - /// Creates a new instance with the given parameters. - /// - /// The value to wrap. - /// The value to wrap. - public D3D12CommandListBundle(ID3D12GraphicsCommandList* d3D12CommandList, ID3D12CommandAllocator* d3D12CommandAllocator) - { - D3D12CommandList = d3D12CommandList; - D3D12CommandAllocator = d3D12CommandAllocator; - } + D3D12CommandList = d3D12CommandList; + D3D12CommandAllocator = d3D12CommandAllocator; } } } diff --git a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs index e0b0c05b..2b1df78a 100644 --- a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs +++ b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs @@ -4,175 +4,174 @@ using Microsoft.Toolkit.Diagnostics; using TerraFX.Interop; using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE; -namespace ComputeSharp.Graphics.Commands.Interop +namespace ComputeSharp.Graphics.Commands.Interop; + +/// +/// A type that provides logic to create resource descriptors for a instance. +/// +internal unsafe struct ID3D12DescriptorHandleAllocator : IDisposable { /// - /// A type that provides logic to create resource descriptors for a instance. + /// The default number of available descriptors per heap. /// - internal unsafe struct ID3D12DescriptorHandleAllocator : IDisposable + private const uint DescriptorsPerHeap = 4096; + + /// + /// The in use for the current instance. + /// + private ComPtr d3D12DescriptorHeap; + + /// + /// The array of items with the available descriptor handles. + /// + private readonly D3D12DescriptorHandlePair[] d3D12DescriptorHandlePairs; + + /// + /// The head index for the queue. + /// + private int head; + + /// + /// The tail index for the queue. + /// + private int tail; + + /// + /// The current size of the queue (ie. the number of remaining pairs in ). + /// + private int size; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance to use. + public ID3D12DescriptorHandleAllocator(ID3D12Device* device) + { + this.d3D12DescriptorHeap = device->CreateDescriptorHeap(DescriptorsPerHeap); + this.d3D12DescriptorHandlePairs = GC.AllocateUninitializedArray((int)DescriptorsPerHeap); + this.head = 0; + this.tail = 0; + this.size = (int)DescriptorsPerHeap; + + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle = this.d3D12DescriptorHeap.Get()->GetCPUDescriptorHandleForHeapStart(); + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandleStart = this.d3D12DescriptorHeap.Get()->GetGPUDescriptorHandleForHeapStart(); + uint descriptorIncrementSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); + + for (int i = 0; i < this.d3D12DescriptorHandlePairs.Length; i++) + { + this.d3D12DescriptorHandlePairs[i] = new D3D12DescriptorHandlePair( + in d3D12CpuDescriptorHandle, + in d3D12GpuDescriptorHandleStart, + i, + descriptorIncrementSize); + } + } + + /// + /// Gets the in use for the current instance. + /// + public ID3D12DescriptorHeap* D3D12DescriptorHeap => this.d3D12DescriptorHeap; + + /// + /// Rents a new CPU and GPU handle pair to use in a memory buffer. + /// + /// The resulting value. + /// The resulting value. + public void Rent( + out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + out D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + lock (this.d3D12DescriptorHandlePairs) + { + Guard.IsGreaterThan(this.size, 0, nameof(size)); + + ref readonly D3D12DescriptorHandlePair d3D12DescriptorHandlePair = ref this.d3D12DescriptorHandlePairs[this.head++]; + + d3D12CpuDescriptorHandle = d3D12DescriptorHandlePair.D3D12CpuDescriptorHandle; + d3D12GpuDescriptorHandle = d3D12DescriptorHandlePair.D3D12GpuDescriptorhandle; + + if (this.head == DescriptorsPerHeap) + { + this.head = 0; + } + + this.size--; + } + } + + /// + /// Returns a CPU and GPU handle pair for later use. + /// + /// The returned value. + /// The returned value. + public void Return( + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + lock (this.d3D12DescriptorHandlePairs) + { + Guard.IsLessThan(this.size, DescriptorsPerHeap, nameof(size)); + + this.d3D12DescriptorHandlePairs[this.tail++] = new D3D12DescriptorHandlePair(d3D12CpuDescriptorHandle, d3D12GpuDescriptorHandle); + + if (this.tail == DescriptorsPerHeap) + { + this.tail = 0; + } + + this.size++; + } + } + + /// + public void Dispose() + { + this.d3D12DescriptorHeap.Dispose(); + } + + /// + /// A type representing a pair of reusable descriptor handles. + /// + private readonly struct D3D12DescriptorHandlePair { /// - /// The default number of available descriptors per heap. + /// The value for the current entry. /// - private const uint DescriptorsPerHeap = 4096; + public readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; /// - /// The in use for the current instance. + /// The value for the current entry. /// - private ComPtr d3D12DescriptorHeap; + public readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorhandle; /// - /// The array of items with the available descriptor handles. + /// Creates a new instance with the given parameters. /// - private readonly D3D12DescriptorHandlePair[] d3D12DescriptorHandlePairs; - - /// - /// The head index for the queue. - /// - private int head; - - /// - /// The tail index for the queue. - /// - private int tail; - - /// - /// The current size of the queue (ie. the number of remaining pairs in ). - /// - private int size; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance to use. - public ID3D12DescriptorHandleAllocator(ID3D12Device* device) - { - this.d3D12DescriptorHeap = device->CreateDescriptorHeap(DescriptorsPerHeap); - this.d3D12DescriptorHandlePairs = GC.AllocateUninitializedArray((int)DescriptorsPerHeap); - this.head = 0; - this.tail = 0; - this.size = (int)DescriptorsPerHeap; - - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle = this.d3D12DescriptorHeap.Get()->GetCPUDescriptorHandleForHeapStart(); - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandleStart = this.d3D12DescriptorHeap.Get()->GetGPUDescriptorHandleForHeapStart(); - uint descriptorIncrementSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); - - for (int i = 0; i < this.d3D12DescriptorHandlePairs.Length; i++) - { - this.d3D12DescriptorHandlePairs[i] = new D3D12DescriptorHandlePair( - in d3D12CpuDescriptorHandle, - in d3D12GpuDescriptorHandleStart, - i, - descriptorIncrementSize); - } - } - - /// - /// Gets the in use for the current instance. - /// - public ID3D12DescriptorHeap* D3D12DescriptorHeap => this.d3D12DescriptorHeap; - - /// - /// Rents a new CPU and GPU handle pair to use in a memory buffer. - /// - /// The resulting value. - /// The resulting value. - public void Rent( - out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, - out D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) - { - lock (this.d3D12DescriptorHandlePairs) - { - Guard.IsGreaterThan(this.size, 0, nameof(size)); - - ref readonly D3D12DescriptorHandlePair d3D12DescriptorHandlePair = ref this.d3D12DescriptorHandlePairs[this.head++]; - - d3D12CpuDescriptorHandle = d3D12DescriptorHandlePair.D3D12CpuDescriptorHandle; - d3D12GpuDescriptorHandle = d3D12DescriptorHandlePair.D3D12GpuDescriptorhandle; - - if (this.head == DescriptorsPerHeap) - { - this.head = 0; - } - - this.size--; - } - } - - /// - /// Returns a CPU and GPU handle pair for later use. - /// - /// The returned value. - /// The returned value. - public void Return( + /// The value to wrap. + /// The value to wrap. + public D3D12DescriptorHandlePair( D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) { - lock (this.d3D12DescriptorHandlePairs) - { - Guard.IsLessThan(this.size, DescriptorsPerHeap, nameof(size)); - - this.d3D12DescriptorHandlePairs[this.tail++] = new D3D12DescriptorHandlePair(d3D12CpuDescriptorHandle, d3D12GpuDescriptorHandle); - - if (this.tail == DescriptorsPerHeap) - { - this.tail = 0; - } - - this.size++; - } - } - - /// - public void Dispose() - { - this.d3D12DescriptorHeap.Dispose(); + D3D12CpuDescriptorHandle = d3D12CpuDescriptorHandle; + D3D12GpuDescriptorhandle = d3D12GpuDescriptorHandle; } /// - /// A type representing a pair of reusable descriptor handles. + /// Creates a new instance with the given parameters. /// - private readonly struct D3D12DescriptorHandlePair + /// The base value. + /// The base value. + /// The offset for the new pair of handles to compute. + /// The increment size for each consecutive handles pair. + public D3D12DescriptorHandlePair( + in D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandleStart, + in D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandleStart, + int offset, + uint descriptorIncrementSize) { - /// - /// The value for the current entry. - /// - public readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; - - /// - /// The value for the current entry. - /// - public readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorhandle; - - /// - /// Creates a new instance with the given parameters. - /// - /// The value to wrap. - /// The value to wrap. - public D3D12DescriptorHandlePair( - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) - { - D3D12CpuDescriptorHandle = d3D12CpuDescriptorHandle; - D3D12GpuDescriptorhandle = d3D12GpuDescriptorHandle; - } - - /// - /// Creates a new instance with the given parameters. - /// - /// The base value. - /// The base value. - /// The offset for the new pair of handles to compute. - /// The increment size for each consecutive handles pair. - public D3D12DescriptorHandlePair( - in D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandleStart, - in D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandleStart, - int offset, - uint descriptorIncrementSize) - { - D3D12_CPU_DESCRIPTOR_HANDLE.InitOffsetted(out D3D12CpuDescriptorHandle, in d3D12CpuDescriptorHandleStart, offset, descriptorIncrementSize); - D3D12_GPU_DESCRIPTOR_HANDLE.InitOffsetted(out D3D12GpuDescriptorhandle, in d3D12GpuDescriptorHandleStart, offset, descriptorIncrementSize); - } + D3D12_CPU_DESCRIPTOR_HANDLE.InitOffsetted(out D3D12CpuDescriptorHandle, in d3D12CpuDescriptorHandleStart, offset, descriptorIncrementSize); + D3D12_GPU_DESCRIPTOR_HANDLE.InitOffsetted(out D3D12GpuDescriptorhandle, in d3D12GpuDescriptorHandleStart, offset, descriptorIncrementSize); } } } diff --git a/src/ComputeSharp/Graphics/Commands/PipelineData.cs b/src/ComputeSharp/Graphics/Commands/PipelineData.cs index 602c4ded..53416b0d 100644 --- a/src/ComputeSharp/Graphics/Commands/PipelineData.cs +++ b/src/ComputeSharp/Graphics/Commands/PipelineData.cs @@ -1,49 +1,48 @@ using ComputeSharp.Interop; using TerraFX.Interop; -namespace ComputeSharp.Graphics.Commands +namespace ComputeSharp.Graphics.Commands; + +/// +/// A representing a custom pipeline state for a compute operation. +/// +internal sealed unsafe class PipelineData : NativeObject { /// - /// A representing a custom pipeline state for a compute operation. + /// The instance for the current object. /// - internal sealed unsafe class PipelineData : NativeObject + private ComPtr d3D12RootSignature; + + /// + /// The instance for the current object. + /// + private ComPtr d3D12PipelineState; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value for the current shader. + /// The compiled pipeline state to reuse for the current shader. + public PipelineData(ID3D12RootSignature* d3D12RootSignature, ID3D12PipelineState* d3D12PipelineState) { - /// - /// The instance for the current object. - /// - private ComPtr d3D12RootSignature; + this.d3D12RootSignature = new ComPtr(d3D12RootSignature); + this.d3D12PipelineState = new ComPtr(d3D12PipelineState); + } - /// - /// The instance for the current object. - /// - private ComPtr d3D12PipelineState; + /// + /// Gets the instance for the current object. + /// + public ID3D12RootSignature* D3D12RootSignature => this.d3D12RootSignature; - /// - /// Creates a new instance with the specified parameters. - /// - /// The value for the current shader. - /// The compiled pipeline state to reuse for the current shader. - public PipelineData(ID3D12RootSignature* d3D12RootSignature, ID3D12PipelineState* d3D12PipelineState) - { - this.d3D12RootSignature = new ComPtr(d3D12RootSignature); - this.d3D12PipelineState = new ComPtr(d3D12PipelineState); - } + /// + /// Gets the instance for the current object. + /// + public ID3D12PipelineState* D3D12PipelineState => this.d3D12PipelineState; - /// - /// Gets the instance for the current object. - /// - public ID3D12RootSignature* D3D12RootSignature => this.d3D12RootSignature; - - /// - /// Gets the instance for the current object. - /// - public ID3D12PipelineState* D3D12PipelineState => this.d3D12PipelineState; - - /// - protected override void OnDispose() - { - this.d3D12RootSignature.Dispose(); - this.d3D12PipelineState.Dispose(); - } + /// + protected override void OnDispose() + { + this.d3D12RootSignature.Dispose(); + this.d3D12PipelineState.Dispose(); } } diff --git a/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs b/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs index 39987597..cf362cfe 100644 --- a/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs +++ b/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs @@ -4,117 +4,116 @@ using System.Text; using ComputeSharp.Interop; using ComputeSharp.Resources; -namespace ComputeSharp.Exceptions +namespace ComputeSharp.Exceptions; + +/// +/// A custom that indicates when mismatched devices are being used. +/// +public sealed class GraphicsDeviceMismatchException : InvalidOperationException { /// - /// A custom that indicates when mismatched devices are being used. + /// Creates a new instance. /// - public sealed class GraphicsDeviceMismatchException : InvalidOperationException + /// The message that describes the error. + private GraphicsDeviceMismatchException(string message) + : base(message) { - /// - /// Creates a new instance. - /// - /// The message that describes the error. - private GraphicsDeviceMismatchException(string message) - : base(message) - { - } - - /// - /// Creates a new instance from the specified parameters. - /// - /// The input that was used. - /// The source instance tied to . - /// The target instance that was used. - /// A new instance with a formatted error message. - /// - /// This method only takes a instance and the associated instance as - /// will still be available, but without the unnecessary generic type specializations for the method. - /// - [Pure] - private static GraphicsDeviceMismatchException Create(NativeObject resource, GraphicsDevice sourceDevice, GraphicsDevice destinationDevice) - { - StringBuilder builder = new(512); - - builder.AppendLine("Invalid pairing of graphics devices used to run a compute shader and allocate memory buffers."); - builder.AppendLine($"The target device to run the compute shader is \"{destinationDevice}\"."); - builder.AppendLine($"The buffer of type {resource.GetType()} was allocated on device \"{sourceDevice}\"."); - builder.Append("Make sure to always allocate buffers on the same device used to actually run the code that accesses them."); - builder.ToString(); - - return new(builder.ToString()); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the input buffer. - /// The input that was used. - /// The target instance that was used. - internal static void Throw(Buffer buffer, GraphicsDevice device) - where T : unmanaged - { - throw Create(buffer, buffer.GraphicsDevice, device); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the input buffer. - /// The input that was used. - /// The target instance that was used. - internal static void Throw(Texture2D texture, GraphicsDevice device) - where T : unmanaged - { - throw Create(texture, texture.GraphicsDevice, device); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the input buffer. - /// The input that was used. - /// The target instance that was used. - internal static void Throw(Texture3D texture, GraphicsDevice device) - where T : unmanaged - { - throw Create(texture, texture.GraphicsDevice, device); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the input buffer. - /// The input that was used. - /// The target instance that was used. - internal static void Throw(TransferBuffer buffer, GraphicsDevice device) - where T : unmanaged - { - throw Create(buffer, buffer.GraphicsDevice, device); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the input buffer. - /// The input that was used. - /// The target instance that was used. - internal static void Throw(TransferTexture2D texture, GraphicsDevice device) - where T : unmanaged - { - throw Create(texture, texture.GraphicsDevice, device); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the input buffer. - /// The input that was used. - /// The target instance that was used. - internal static void Throw(TransferTexture3D texture, GraphicsDevice device) - where T : unmanaged - { - throw Create(texture, texture.GraphicsDevice, device); - } } -} \ No newline at end of file + + /// + /// Creates a new instance from the specified parameters. + /// + /// The input that was used. + /// The source instance tied to . + /// The target instance that was used. + /// A new instance with a formatted error message. + /// + /// This method only takes a instance and the associated instance as + /// will still be available, but without the unnecessary generic type specializations for the method. + /// + [Pure] + private static GraphicsDeviceMismatchException Create(NativeObject resource, GraphicsDevice sourceDevice, GraphicsDevice destinationDevice) + { + StringBuilder builder = new(512); + + builder.AppendLine("Invalid pairing of graphics devices used to run a compute shader and allocate memory buffers."); + builder.AppendLine($"The target device to run the compute shader is \"{destinationDevice}\"."); + builder.AppendLine($"The buffer of type {resource.GetType()} was allocated on device \"{sourceDevice}\"."); + builder.Append("Make sure to always allocate buffers on the same device used to actually run the code that accesses them."); + builder.ToString(); + + return new(builder.ToString()); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(Buffer buffer, GraphicsDevice device) + where T : unmanaged + { + throw Create(buffer, buffer.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(Texture2D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(Texture3D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(TransferBuffer buffer, GraphicsDevice device) + where T : unmanaged + { + throw Create(buffer, buffer.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(TransferTexture2D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(TransferTexture3D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } +} diff --git a/src/ComputeSharp/Graphics/Exceptions/UnsupportedDoubleOperationsException.cs b/src/ComputeSharp/Graphics/Exceptions/UnsupportedDoubleOperationsException.cs index e8bfe41d..fe2018e1 100644 --- a/src/ComputeSharp/Graphics/Exceptions/UnsupportedDoubleOperationsException.cs +++ b/src/ComputeSharp/Graphics/Exceptions/UnsupportedDoubleOperationsException.cs @@ -2,48 +2,47 @@ using System.Diagnostics.Contracts; using System.Text; -namespace ComputeSharp.Exceptions +namespace ComputeSharp.Exceptions; + +/// +/// A custom that indicates when a resource was attempted to be created with an unsupported type. +/// +public sealed class UnsupportedDoubleOperationsException : InvalidOperationException { /// - /// A custom that indicates when a resource was attempted to be created with an unsupported type. + /// Creates a new instance. /// - public sealed class UnsupportedDoubleOperationsException : InvalidOperationException + /// The message that describes the error. + public UnsupportedDoubleOperationsException(string message) + : base(message) { - /// - /// Creates a new instance. - /// - /// The message that describes the error. - public UnsupportedDoubleOperationsException(string message) - : base(message) - { - } - - /// - /// Creates a new instance from the specified parameters. - /// - /// The element type of resource that was being created. - /// A new instance with a formatted error message. - [Pure] - private static UnsupportedDoubleOperationsException Create(Type type) - { - StringBuilder builder = new(256); - - builder.AppendLine($"The device in use does not support creating resources of type {type}, as it does not support using double precision floating point numbers."); - builder.AppendLine("As a possible workaround, consider replacing usage of the double type with single precision floating point numbers."); - builder.AppendLine("Note that double precision operations are only partially supported on GPU devices, and are far slower than single precision ones."); - builder.ToString(); - - return new(builder.ToString()); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the resource that couldn't be created. - internal static void Throw() - where T : unmanaged - { - throw Create(typeof(T)); - } } -} \ No newline at end of file + + /// + /// Creates a new instance from the specified parameters. + /// + /// The element type of resource that was being created. + /// A new instance with a formatted error message. + [Pure] + private static UnsupportedDoubleOperationsException Create(Type type) + { + StringBuilder builder = new(256); + + builder.AppendLine($"The device in use does not support creating resources of type {type}, as it does not support using double precision floating point numbers."); + builder.AppendLine("As a possible workaround, consider replacing usage of the double type with single precision floating point numbers."); + builder.AppendLine("Note that double precision operations are only partially supported on GPU devices, and are far slower than single precision ones."); + builder.ToString(); + + return new(builder.ToString()); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the resource that couldn't be created. + internal static void Throw() + where T : unmanaged + { + throw Create(typeof(T)); + } +} diff --git a/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs b/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs index 3c9a7d96..fde643f1 100644 --- a/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs +++ b/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs @@ -3,66 +3,65 @@ using System.Diagnostics.Contracts; using System.Text; using Microsoft.Toolkit.Diagnostics; -namespace ComputeSharp.Exceptions +namespace ComputeSharp.Exceptions; + +/// +/// A custom that indicates when a texture was attempted to be created with an unsupported type. +/// +public sealed class UnsupportedTextureTypeException : InvalidOperationException { /// - /// A custom that indicates when a texture was attempted to be created with an unsupported type. + /// Creates a new instance. /// - public sealed class UnsupportedTextureTypeException : InvalidOperationException + /// The message that describes the error. + private UnsupportedTextureTypeException(string message) + : base(message) { - /// - /// Creates a new instance. - /// - /// The message that describes the error. - private UnsupportedTextureTypeException(string message) - : base(message) - { - } - - /// - /// Creates a new instance from the specified parameters. - /// - /// The rank of the texture that couldn't be created. - /// The element type of texture that was being created. - /// A new instance with a formatted error message. - [Pure] - private static UnsupportedTextureTypeException Create(int rank, Type type) - { - StringBuilder builder = new(256); - - builder.AppendLine($"The device in use does not support creating {rank}D textures of type {type}."); - builder.Append($"Make sure to check the support at runtime by using {nameof(GraphicsDevice)}."); - - builder.AppendLine(rank switch - { - 2 => $"{nameof(GraphicsDevice.IsReadOnlyTexture2DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture2DSupportedForType)}().", - 3 => $"{nameof(GraphicsDevice.IsReadOnlyTexture3DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture3DSupportedForType)}().", - _ => ThrowHelper.ThrowArgumentException("Invalid texture rank") - }); - - builder.Append("As a possible workaround on older devices, consider using a texture type of lower rank, or a linear buffer."); - - return new(builder.ToString()); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the texture that couldn't be created. - internal static void ThrowForTexture2D() - where T : unmanaged - { - throw Create(2, typeof(T)); - } - - /// - /// Throws a new instance from the specified parameters. - /// - /// The type of values in the texture that couldn't be created. - internal static void ThrowForTexture3D() - where T : unmanaged - { - throw Create(3, typeof(T)); - } } -} \ No newline at end of file + + /// + /// Creates a new instance from the specified parameters. + /// + /// The rank of the texture that couldn't be created. + /// The element type of texture that was being created. + /// A new instance with a formatted error message. + [Pure] + private static UnsupportedTextureTypeException Create(int rank, Type type) + { + StringBuilder builder = new(256); + + builder.AppendLine($"The device in use does not support creating {rank}D textures of type {type}."); + builder.Append($"Make sure to check the support at runtime by using {nameof(GraphicsDevice)}."); + + builder.AppendLine(rank switch + { + 2 => $"{nameof(GraphicsDevice.IsReadOnlyTexture2DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture2DSupportedForType)}().", + 3 => $"{nameof(GraphicsDevice.IsReadOnlyTexture3DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture3DSupportedForType)}().", + _ => ThrowHelper.ThrowArgumentException("Invalid texture rank") + }); + + builder.Append("As a possible workaround on older devices, consider using a texture type of lower rank, or a linear buffer."); + + return new(builder.ToString()); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the texture that couldn't be created. + internal static void ThrowForTexture2D() + where T : unmanaged + { + throw Create(2, typeof(T)); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the texture that couldn't be created. + internal static void ThrowForTexture3D() + where T : unmanaged + { + throw Create(3, typeof(T)); + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs index e231c449..edaaac86 100644 --- a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs @@ -4,153 +4,152 @@ using System.Runtime.InteropServices; using ComputeSharp.Resources; using Microsoft.Toolkit.Diagnostics; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class BufferExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of a instance and returns an array. /// - public static class BufferExtensions + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// A array with the contents of the input buffer. + [Pure] + public static T[] ToArray(this Buffer buffer) + where T : unmanaged { - /// - /// Reads the contents of a instance and returns an array. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// A array with the contents of the input buffer. - [Pure] - public static T[] ToArray(this Buffer buffer) - where T : unmanaged - { - return buffer.ToArray(0, buffer.Length); - } + return buffer.ToArray(0, buffer.Length); + } - /// - /// Reads the contents of a instance in a given range and returns an array. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The offset to start reading data from. - /// The number of items to read. - /// A array with the contents of the specified range from the current buffer. - [Pure] - public static T[] ToArray(this Buffer buffer, int offset, int count) - where T : unmanaged - { - Guard.IsGreaterThanOrEqualTo(count, 0, nameof(count)); + /// + /// Reads the contents of a instance in a given range and returns an array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The offset to start reading data from. + /// The number of items to read. + /// A array with the contents of the specified range from the current buffer. + [Pure] + public static T[] ToArray(this Buffer buffer, int offset, int count) + where T : unmanaged + { + Guard.IsGreaterThanOrEqualTo(count, 0, nameof(count)); - T[] data = GC.AllocateUninitializedArray(count); + T[] data = GC.AllocateUninitializedArray(count); - buffer.CopyTo(data.AsSpan(), offset); + buffer.CopyTo(data.AsSpan(), offset); - return data; - } + return data; + } - /// - /// Reads the contents of a instance and writes them into a target array. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The input array to write data to. - public static void CopyTo(this Buffer buffer, T[] destination) - where T : unmanaged - { - buffer.CopyTo(destination.AsSpan(), 0); - } + /// + /// Reads the contents of a instance and writes them into a target array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input array to write data to. + public static void CopyTo(this Buffer buffer, T[] destination) + where T : unmanaged + { + buffer.CopyTo(destination.AsSpan(), 0); + } - /// - /// Reads the contents of the specified range from a instance and writes them into a target array. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - /// The offset to start reading data from. - /// The number of items to read. - public static void CopyTo(this Buffer buffer, T[] destination, int destinationOffset, int bufferOffset, int count) - where T : unmanaged - { - Span span = destination.AsSpan(destinationOffset, count); + /// + /// Reads the contents of the specified range from a instance and writes them into a target array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The offset to start reading data from. + /// The number of items to read. + public static void CopyTo(this Buffer buffer, T[] destination, int destinationOffset, int bufferOffset, int count) + where T : unmanaged + { + Span span = destination.AsSpan(destinationOffset, count); - buffer.CopyTo(span, bufferOffset); - } + buffer.CopyTo(span, bufferOffset); + } - /// - /// Reads the contents of a instance and writes them into a target . - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The input to write data to. - public static void CopyTo(this Buffer buffer, Span destination) - where T : unmanaged - { - buffer.CopyTo(destination, 0); - } + /// + /// Reads the contents of a instance and writes them into a target . + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input to write data to. + public static void CopyTo(this Buffer buffer, Span destination) + where T : unmanaged + { + buffer.CopyTo(destination, 0); + } - /// - /// Reads the contents of the specified range from a instance and writes them into a target . - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The input to write data to. - /// The offset to start reading data from. - public static void CopyTo(this Buffer buffer, Span destination, int offset) - where T : unmanaged - { - buffer.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, offset); - } + /// + /// Reads the contents of the specified range from a instance and writes them into a target . + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input to write data to. + /// The offset to start reading data from. + public static void CopyTo(this Buffer buffer, Span destination, int offset) + where T : unmanaged + { + buffer.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, offset); + } - /// - /// Writes the contents of a given array to a instance. - /// - /// The type of items stored on the buffer. - /// The target instance to write data to. - /// The input array to read data from. - public static void CopyFrom(this Buffer buffer, T[] source) - where T : unmanaged - { - buffer.CopyFrom(source.AsSpan(), 0); - } + /// + /// Writes the contents of a given array to a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input array to read data from. + public static void CopyFrom(this Buffer buffer, T[] source) + where T : unmanaged + { + buffer.CopyFrom(source.AsSpan(), 0); + } - /// - /// Writes the contents of a given array to a specified area of a instance. - /// - /// The type of items stored on the buffer. - /// The target instance to write data to. - /// The input array to read data from. - /// The starting offset within to read data from. - /// The offset to start writing data to. - /// The number of items to write. - public static void CopyFrom(this Buffer buffer, T[] source, int sourceOffset, int bufferOffset, int count) - where T : unmanaged - { - ReadOnlySpan span = source.AsSpan(sourceOffset, count); + /// + /// Writes the contents of a given array to a specified area of a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The offset to start writing data to. + /// The number of items to write. + public static void CopyFrom(this Buffer buffer, T[] source, int sourceOffset, int bufferOffset, int count) + where T : unmanaged + { + ReadOnlySpan span = source.AsSpan(sourceOffset, count); - buffer.CopyFrom(span, bufferOffset); - } + buffer.CopyFrom(span, bufferOffset); + } - /// - /// Writes the contents of a given to a instance. - /// - /// The type of items stored on the buffer. - /// The target instance to write data to. - /// The input to read data from. - public static void CopyFrom(this Buffer buffer, ReadOnlySpan source) - where T : unmanaged - { - buffer.CopyFrom(source, 0); - } + /// + /// Writes the contents of a given to a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input to read data from. + public static void CopyFrom(this Buffer buffer, ReadOnlySpan source) + where T : unmanaged + { + buffer.CopyFrom(source, 0); + } - /// - /// Writes the contents of a given to a specified area of a instance. - /// - /// The type of items stored on the buffer. - /// The target instance to write data to. - /// The input to read data from. - /// The offset to start writing data to. - public static void CopyFrom(this Buffer buffer, ReadOnlySpan source, int offset) - where T : unmanaged - { - buffer.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, offset); - } + /// + /// Writes the contents of a given to a specified area of a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input to read data from. + /// The offset to start writing data to. + public static void CopyFrom(this Buffer buffer, ReadOnlySpan source, int offset) + where T : unmanaged + { + buffer.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, offset); } } diff --git a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs index ee6990d9..28475326 100644 --- a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs +++ b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Dispatching.cs @@ -1,100 +1,99 @@ using ComputeSharp.Shaders; using System.Runtime.CompilerServices; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type, used to run compute shaders. +/// +public static partial class GraphicsDeviceExtensions { /// - /// A that contains extension methods for the type, used to run compute shaders. + /// Compiles and runs the input shader on a target instance, with the specified parameters. /// - public static partial class GraphicsDeviceExtensions + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, in T shader) + where T : struct, IComputeShader { - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The type of compute shader to run. - /// The to use to run the shader. - /// The number of iterations to run on the X axis. - /// The input instance representing the compute shader to run. - public static void For(this GraphicsDevice device, int x, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, 1, 1, ref Unsafe.AsRef(in shader)); - } + ShaderRunner.Run(device, x, 1, 1, ref Unsafe.AsRef(in shader)); + } - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The type of compute shader to run. - /// The to use to run the shader. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The input instance representing the compute shader to run. - public static void For(this GraphicsDevice device, int x, int y, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, y, 1, ref Unsafe.AsRef(in shader)); - } + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, int y, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, y, 1, ref Unsafe.AsRef(in shader)); + } - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The type of compute shader to run. - /// The to use to run the shader. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The number of iterations to run on the Z axis. - /// The input instance representing the compute shader to run. - public static void For(this GraphicsDevice device, int x, int y, int z, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, y, z, ref Unsafe.AsRef(in shader)); - } + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, int y, int z, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, y, z, ref Unsafe.AsRef(in shader)); + } - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The type of compute shader to run. - /// The to use to run the shader. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The number of iterations to run on the Z axis. - /// The number of threads in each thread group for the X axis. - /// The number of threads in each thread group for the Y axis. - /// The number of threads in each thread group for the Z axis. - /// The input instance representing the compute shader to run. - public static void For(this GraphicsDevice device, int x, int y, int z, int threadsX, int threadsY, int threadsZ, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, y, z, threadsX, threadsY, threadsZ, ref Unsafe.AsRef(in shader)); - } + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, int y, int z, int threadsX, int threadsY, int threadsZ, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, y, z, threadsX, threadsY, threadsZ, ref Unsafe.AsRef(in shader)); + } - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The type of pixel shader to run. - /// The type of pixels being processed by the shader. - /// The to use to run the shader. - /// The target texture to apply the pixel shader to. - public static void ForEach(this GraphicsDevice device, IReadWriteTexture2D texture) - where T : struct, IPixelShader - where TPixel : unmanaged - { - ShaderRunner.Run(device, texture, ref Unsafe.AsRef(default(T))); - } + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of pixel shader to run. + /// The type of pixels being processed by the shader. + /// The to use to run the shader. + /// The target texture to apply the pixel shader to. + public static void ForEach(this GraphicsDevice device, IReadWriteTexture2D texture) + where T : struct, IPixelShader + where TPixel : unmanaged + { + ShaderRunner.Run(device, texture, ref Unsafe.AsRef(default(T))); + } - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The type of pixel shader to run. - /// The type of pixels being processed by the shader. - /// The to use to run the shader. - /// The target texture to apply the pixel shader to. - /// The input instance representing the pixel shader to run. - public static void ForEach(this GraphicsDevice device, IReadWriteTexture2D texture, in T shader) - where T : struct, IPixelShader - where TPixel : unmanaged - { - ShaderRunner.Run(device, texture, ref Unsafe.AsRef(in shader)); - } + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of pixel shader to run. + /// The type of pixels being processed by the shader. + /// The to use to run the shader. + /// The target texture to apply the pixel shader to. + /// The input instance representing the pixel shader to run. + public static void ForEach(this GraphicsDevice device, IReadWriteTexture2D texture, in T shader) + where T : struct, IPixelShader + where TPixel : unmanaged + { + ShaderRunner.Run(device, texture, ref Unsafe.AsRef(in shader)); } } diff --git a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs index 99f2f3f2..8ff10a5d 100644 --- a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs +++ b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.Resources.cs @@ -6,1156 +6,1155 @@ using ComputeSharp.Resources; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +public static partial class GraphicsDeviceExtensions { - /// - public static partial class GraphicsDeviceExtensions + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size . + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged { - /// - /// Allocates a new constant buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The length of the buffer to allocate. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size . - [Pure] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, length, allocationMode); - } - - /// - /// Allocates a new constant buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input array with the data to copy on the allocated buffer. - /// A constant instance with the contents of the input array. - [Pure] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[] source) - where T : unmanaged - { - return device.AllocateConstantBuffer(source.AsSpan()); - } - - /// - /// Allocates a new constant buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input with the data to copy on the allocated buffer. - /// A constant instance with the contents of the input . - [Pure] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, ReadOnlySpan source) - where T : unmanaged - { - ConstantBuffer buffer = new(device, source.Length, AllocationMode.Default); - - buffer.CopyFrom(source); - - return buffer; - } - - /// - /// Allocates a new constant buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input with the data to copy on the allocated buffer. - /// A constant instance with the contents of the input . - [Pure] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, Buffer source) - where T : unmanaged - { - ConstantBuffer constantBuffer = new(device, source.Length, AllocationMode.Default); - - constantBuffer.CopyFrom(source); - - return constantBuffer; - } - - /// - /// Allocates a new readonly buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The length of the buffer to allocate. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size . - [Pure] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, length, allocationMode); - } - - /// - /// Allocates a new readonly buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input array with the data to copy on the allocated buffer. - /// A read write instance with the contents of the input array. - [Pure] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[] source) - where T : unmanaged - { - return device.AllocateReadOnlyBuffer(source.AsSpan()); - } - - /// - /// Allocates a new readonly buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input with the data to copy on the allocated buffer. - /// A read write instance with the contents of the input . - [Pure] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, ReadOnlySpan source) - where T : unmanaged - { - ReadOnlyBuffer buffer = new(device, source.Length, AllocationMode.Default); - - buffer.CopyFrom(source); - - return buffer; - } - - /// - /// Allocates a new readonly buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input with the data to copy on the allocated buffer. - /// A read write instance with the contents of the input . - [Pure] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, Buffer source) - where T : unmanaged - { - ReadOnlyBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default); - - readWriteBuffer.CopyFrom(source); - - return readWriteBuffer; - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, ]. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, allocationMode); - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height) - where T : unmanaged - { - return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height); - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) - where T : unmanaged - { - return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height); - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source) - where T : unmanaged - { - ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) - where T : unmanaged - { - ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, ]. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return new(device, width, height, allocationMode); - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height); - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height); - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, , ]. - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, depth, allocationMode); - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) - where T : unmanaged - { - return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth); - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) - where T : unmanaged - { - return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth); - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - /// - /// The source 3D array needs to have each 2D plane stacked on the depth axis. - /// That is, the expected layout of the input array has to be [depth, height, width]. - /// - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source) - where T : unmanaged - { - ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) - where T : unmanaged - { - ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, , ]. - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return new(device, width, height, depth, allocationMode); - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth); - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth); - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - /// - /// The source 3D array needs to have each 2D plane stacked on the depth axis. - /// That is, the expected layout of the input array has to be [depth, height, width]. - /// - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new readonly 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new read write buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The length of the buffer to allocate. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size . - [Pure] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, length, allocationMode); - } - - /// - /// Allocates a new read write buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input array with the data to copy on the allocated buffer. - /// A read write instance with the contents of the input array. - [Pure] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[] source) - where T : unmanaged - { - return device.AllocateReadWriteBuffer(source.AsSpan()); - } - - /// - /// Allocates a new read write buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input with the data to copy on the allocated buffer. - /// A read write instance with the contents of the input . - [Pure] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, ReadOnlySpan source) - where T : unmanaged - { - ReadWriteBuffer buffer = new(device, source.Length, AllocationMode.Default); - - buffer.CopyFrom(source); - - return buffer; - } - - /// - /// Allocates a new read write buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The input with the data to copy on the allocated buffer. - /// A read write instance with the contents of the input . - [Pure] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, Buffer source) - where T : unmanaged - { - ReadWriteBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default); - - readWriteBuffer.CopyFrom(source); - - return readWriteBuffer; - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, ]. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, allocationMode); - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height) - where T : unmanaged - { - return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height); - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) - where T : unmanaged - { - return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height); - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source) - where T : unmanaged - { - ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) - where T : unmanaged - { - ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, ]. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return new(device, width, height, allocationMode); - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height); - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height); - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 2D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - /// A zeroed instance of size [, ]. - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, depth, allocationMode); - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) - where T : unmanaged - { - return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth); - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) - where T : unmanaged - { - return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth); - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - /// - /// The source 3D array needs to have each 2D plane stacked on the depth axis. - /// That is, the expected layout of the input array has to be [depth, height, width]. - /// - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source) - where T : unmanaged - { - ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) - where T : unmanaged - { - ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - /// A instance of size [, , ]. - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return new(device, width, height, depth, allocationMode); - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth); - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// The starting offset within to read data from. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input array. - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth); - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input array with the data to copy on the allocated texture. - /// A read write instance with the contents of the input array. - /// - /// The source 3D array needs to have each 2D plane stacked on the depth axis. - /// That is, the expected layout of the input array has to be [depth, height, width]. - /// - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new writeable 3D texture with the specified parameters. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The input with the data to copy on the allocated texture. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// A instance with the contents of the input . - [Pure] - public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default); - - texture.CopyFrom(source); - - return texture; - } - - /// - /// Allocates a new upload buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The length of the buffer to allocate. - /// The allocation mode to use for the new resource. - /// A instance of size . - [Pure] - public static UploadBuffer AllocateUploadBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, length, allocationMode); - } - - /// - /// Allocates a new upload 2D texture with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - /// A instance of size [, ]. - [Pure] - public static UploadTexture2D AllocateUploadTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, allocationMode); - } - - /// - /// Allocates a new upload 3D texture with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - /// A instance of size [, , ]. - [Pure] - public static UploadTexture3D AllocateUploadTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, depth, allocationMode); - } - - /// - /// Allocates a new readback buffer with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The length of the buffer to allocate. - /// The allocation mode to use for the new resource. - /// A instance of size . - [Pure] - public static ReadBackBuffer AllocateReadBackBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, length, allocationMode); - } - - /// - /// Allocates a new readback 2D texture with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - /// A instance of size [, ]. - [Pure] - public static ReadBackTexture2D AllocateReadBackTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, allocationMode); - } - - /// - /// Allocates a new readback 3D texture with the specified parameters. - /// - /// The type of items to store in the buffer. - /// The instance to use to allocate the buffer. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - /// A instance of size [, , ]. - [Pure] - public static ReadBackTexture3D AllocateReadBackTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged - { - return new(device, width, height, depth, allocationMode); - } - - /// - /// Loads a new readonly 2D texture with the contents of the specified file. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The filename of the image file to load and decode into the texture. - /// A instance with the contents of the specified file. - [Pure] - public static ReadOnlyTexture2D LoadReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan filename) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, filename); - - ReadOnlyTexture2D texture = device.AllocateReadOnlyTexture2D(upload.Width, upload.Height); - - upload.CopyTo(texture); - - return texture; - } - - /// - /// Loads a new readonly 2D texture with the contents of the specified buffer. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The buffer with the image data to load and decode into the texture. - /// A instance with the contents of the specified file. - [Pure] - public static ReadOnlyTexture2D LoadReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan span) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, span); - - ReadOnlyTexture2D texture = device.AllocateReadOnlyTexture2D(upload.Width, upload.Height); - - upload.CopyTo(texture); - - return texture; - } - - /// - /// Loads a new writeable 2D texture with the contents of the specified file. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The filename of the image file to load and decode into the texture. - /// A instance with the contents of the specified file. - [Pure] - public static ReadWriteTexture2D LoadReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan filename) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, filename); - - ReadWriteTexture2D texture = device.AllocateReadWriteTexture2D(upload.Width, upload.Height); - - upload.CopyTo(texture); - - return texture; - } - - /// - /// Loads a new writeable 2D texture with the contents of the specified buffer. - /// - /// The type of items to store in the texture. - /// The type of pixels used on the GPU side. - /// The instance to use to allocate the texture. - /// The buffer with the image data to load and decode into the texture. - /// A instance with the contents of the specified file. - [Pure] - public static ReadWriteTexture2D LoadReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan span) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, span); - - ReadWriteTexture2D texture = device.AllocateReadWriteTexture2D(upload.Width, upload.Height); - - upload.CopyTo(texture); - - return texture; - } + return new(device, length, allocationMode); + } + + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input array with the data to copy on the allocated buffer. + /// A constant instance with the contents of the input array. + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[] source) + where T : unmanaged + { + return device.AllocateConstantBuffer(source.AsSpan()); + } + + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A constant instance with the contents of the input . + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, ReadOnlySpan source) + where T : unmanaged + { + ConstantBuffer buffer = new(device, source.Length, AllocationMode.Default); + + buffer.CopyFrom(source); + + return buffer; + } + + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A constant instance with the contents of the input . + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, Buffer source) + where T : unmanaged + { + ConstantBuffer constantBuffer = new(device, source.Length, AllocationMode.Default); + + constantBuffer.CopyFrom(source); + + return constantBuffer; + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size . + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input array with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[] source) + where T : unmanaged + { + return device.AllocateReadOnlyBuffer(source.AsSpan()); + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, ReadOnlySpan source) + where T : unmanaged + { + ReadOnlyBuffer buffer = new(device, source.Length, AllocationMode.Default); + + buffer.CopyFrom(source); + + return buffer; + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, Buffer source) + where T : unmanaged + { + ReadOnlyBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default); + + readWriteBuffer.CopyFrom(source); + + return readWriteBuffer; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged + { + ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged + { + ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, , ]. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged + { + ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged + { + ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, , ]. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size . + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input array with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[] source) + where T : unmanaged + { + return device.AllocateReadWriteBuffer(source.AsSpan()); + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, ReadOnlySpan source) + where T : unmanaged + { + ReadWriteBuffer buffer = new(device, source.Length, AllocationMode.Default); + + buffer.CopyFrom(source); + + return buffer; + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, Buffer source) + where T : unmanaged + { + ReadWriteBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default); + + readWriteBuffer.CopyFrom(source); + + return readWriteBuffer; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged + { + ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged + { + ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged + { + ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged + { + ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, , ]. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new upload buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A instance of size . + [Pure] + public static UploadBuffer AllocateUploadBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new upload 2D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, ]. + [Pure] + public static UploadTexture2D AllocateUploadTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new upload 3D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, , ]. + [Pure] + public static UploadTexture3D AllocateUploadTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new readback buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A instance of size . + [Pure] + public static ReadBackBuffer AllocateReadBackBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new readback 2D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, ]. + [Pure] + public static ReadBackTexture2D AllocateReadBackTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new readback 3D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, , ]. + [Pure] + public static ReadBackTexture3D AllocateReadBackTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Loads a new readonly 2D texture with the contents of the specified file. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The filename of the image file to load and decode into the texture. + /// A instance with the contents of the specified file. + [Pure] + public static ReadOnlyTexture2D LoadReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan filename) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, filename); + + ReadOnlyTexture2D texture = device.AllocateReadOnlyTexture2D(upload.Width, upload.Height); + + upload.CopyTo(texture); + + return texture; + } + + /// + /// Loads a new readonly 2D texture with the contents of the specified buffer. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The buffer with the image data to load and decode into the texture. + /// A instance with the contents of the specified file. + [Pure] + public static ReadOnlyTexture2D LoadReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan span) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, span); + + ReadOnlyTexture2D texture = device.AllocateReadOnlyTexture2D(upload.Width, upload.Height); + + upload.CopyTo(texture); + + return texture; + } + + /// + /// Loads a new writeable 2D texture with the contents of the specified file. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The filename of the image file to load and decode into the texture. + /// A instance with the contents of the specified file. + [Pure] + public static ReadWriteTexture2D LoadReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan filename) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, filename); + + ReadWriteTexture2D texture = device.AllocateReadWriteTexture2D(upload.Width, upload.Height); + + upload.CopyTo(texture); + + return texture; + } + + /// + /// Loads a new writeable 2D texture with the contents of the specified buffer. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The buffer with the image data to load and decode into the texture. + /// A instance with the contents of the specified file. + [Pure] + public static ReadWriteTexture2D LoadReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan span) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + using UploadTexture2D upload = WICHelper.Instance.LoadTexture(device, span); + + ReadWriteTexture2D texture = device.AllocateReadWriteTexture2D(upload.Width, upload.Height); + + upload.CopyTo(texture); + + return texture; } } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs index 5e401f67..95dffd84 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs @@ -10,190 +10,189 @@ using static TerraFX.Interop.D3D12_RESOURCE_STATES; using static TerraFX.Interop.D3D12MA_ALLOCATION_FLAGS; using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; -namespace ComputeSharp.Graphics.Extensions +namespace ComputeSharp.Graphics.Extensions; + +/// +/// A with extensions for the type. +/// +internal static unsafe class AllocatorExtensions { /// - /// A with extensions for the type. + /// Creates a instance suited to be used for cache coherent UMA devices. /// - internal static unsafe class AllocatorExtensions + /// The instance in use. + /// A instance suited to be used for cache coherent UMA devices. + public static ReferenceCountPtr CreatePoolForCacheCoherentUMA(this ref D3D12MA_Allocator allocator) { - /// - /// Creates a instance suited to be used for cache coherent UMA devices. - /// - /// The instance in use. - /// A instance suited to be used for cache coherent UMA devices. - public static ReferenceCountPtr CreatePoolForCacheCoherentUMA(this ref D3D12MA_Allocator allocator) + using ReferenceCountPtr pool = default; + + D3D12MA_POOL_DESC poolDesc = default; + poolDesc.HeapProperties.CreationNodeMask = 1; + poolDesc.HeapProperties.VisibleNodeMask = 1; + poolDesc.HeapProperties.Type = D3D12_HEAP_TYPE_CUSTOM; + poolDesc.HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK; + poolDesc.HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + + allocator.CreatePool(&poolDesc, pool.GetAddressOf()).Assert(); + + return pool.Move(); + } + + /// + /// Creates a resource for a given buffer type. + /// + /// The instance in use. + /// The instance to use, if any. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The size in bytes of the current buffer. + /// An reference for the current object. + public static UniquePtr CreateResource( + this ref D3D12MA_Allocator allocator, + D3D12MA_Pool* pool, + ResourceType resourceType, + AllocationMode allocationMode, + ulong sizeInBytes) + { + D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; + (D3D12_HEAP_TYPE d3D12HeapType, + D3D12_RESOURCE_FLAGS d3D12ResourceFlags, + D3D12_RESOURCE_STATES d3D12ResourceStates) = resourceType switch { - using ReferenceCountPtr pool = default; + ResourceType.Constant => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), + ResourceType.ReadOnly => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadBack => (D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST), + ResourceType.Upload => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), + _ => ThrowHelper.ThrowArgumentException<(D3D12_HEAP_TYPE, D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; - D3D12MA_POOL_DESC poolDesc = default; - poolDesc.HeapProperties.CreationNodeMask = 1; - poolDesc.HeapProperties.VisibleNodeMask = 1; - poolDesc.HeapProperties.Type = D3D12_HEAP_TYPE_CUSTOM; - poolDesc.HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK; - poolDesc.HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + using UniquePtr allocation = default; - allocator.CreatePool(&poolDesc, pool.GetAddressOf()).Assert(); + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Buffer(sizeInBytes, d3D12ResourceFlags); - return pool.Move(); - } + D3D12MA_ALLOCATION_DESC allocationDesc = default; + allocationDesc.HeapType = d3D12HeapType; + allocationDesc.Flags = allocationFlags; + allocationDesc.CustomPool = pool; - /// - /// Creates a resource for a given buffer type. - /// - /// The instance in use. - /// The instance to use, if any. - /// The resource type currently in use. - /// The allocation mode to use for the new resource. - /// The size in bytes of the current buffer. - /// An reference for the current object. - public static UniquePtr CreateResource( - this ref D3D12MA_Allocator allocator, - D3D12MA_Pool* pool, - ResourceType resourceType, - AllocationMode allocationMode, - ulong sizeInBytes) + allocator.CreateResource( + &allocationDesc, + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + allocation.GetAddressOf(), + null, + null).Assert(); + + return allocation.Move(); + } + + /// + /// Creates a resource for a given 2D texture type. + /// + /// The instance in use. + /// The instance to use, if any. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The default value for the resource. + /// An reference for the current object. + public static UniquePtr CreateResource( + this ref D3D12MA_Allocator allocator, + D3D12MA_Pool* pool, + ResourceType resourceType, + AllocationMode allocationMode, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + out D3D12_RESOURCE_STATES d3D12ResourceStates) + { + D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; + D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + + (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch { - D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; - (D3D12_HEAP_TYPE d3D12HeapType, - D3D12_RESOURCE_FLAGS d3D12ResourceFlags, - D3D12_RESOURCE_STATES d3D12ResourceStates) = resourceType switch - { - ResourceType.Constant => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), - ResourceType.ReadOnly => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), - ResourceType.ReadWrite => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COMMON), - ResourceType.ReadBack => (D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST), - ResourceType.Upload => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), - _ => ThrowHelper.ThrowArgumentException<(D3D12_HEAP_TYPE, D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() - }; + ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), + _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; - using UniquePtr allocation = default; + using UniquePtr allocation = default; - D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Buffer(sizeInBytes, d3D12ResourceFlags); + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height, mipLevels: 1, flags: d3D12ResourceFlags); - D3D12MA_ALLOCATION_DESC allocationDesc = default; - allocationDesc.HeapType = d3D12HeapType; - allocationDesc.Flags = allocationFlags; - allocationDesc.CustomPool = pool; + D3D12MA_ALLOCATION_DESC allocationDesc = default; + allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; + allocationDesc.Flags = allocationFlags; + allocationDesc.CustomPool = pool; - allocator.CreateResource( - &allocationDesc, - &d3D12ResourceDescription, - d3D12ResourceStates, - null, - allocation.GetAddressOf(), - null, - null).Assert(); + allocator.CreateResource( + &allocationDesc, + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + allocation.GetAddressOf(), + null, + null).Assert(); - return allocation.Move(); - } + return allocation.Move(); + } - /// - /// Creates a resource for a given 2D texture type. - /// - /// The instance in use. - /// The instance to use, if any. - /// The resource type currently in use. - /// The allocation mode to use for the new resource. - /// The value to use. - /// The width of the texture resource. - /// The height of the texture resource. - /// The default value for the resource. - /// An reference for the current object. - public static UniquePtr CreateResource( - this ref D3D12MA_Allocator allocator, - D3D12MA_Pool* pool, - ResourceType resourceType, - AllocationMode allocationMode, - DXGI_FORMAT dxgiFormat, - uint width, - uint height, - out D3D12_RESOURCE_STATES d3D12ResourceStates) + /// + /// Creates a resource for a given 3D texture type. + /// + /// The instance in use. + /// The instance to use, if any. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The depth of the texture resource. + /// The default value for the resource. + /// An reference for the current object. + public static UniquePtr CreateResource( + this ref D3D12MA_Allocator allocator, + D3D12MA_Pool* pool, + ResourceType resourceType, + AllocationMode allocationMode, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + ushort depth, + out D3D12_RESOURCE_STATES d3D12ResourceStates) + { + D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; + D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + + (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch { - D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; - D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), + _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; - (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch - { - ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), - ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), - _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() - }; + using UniquePtr allocation = default; - using UniquePtr allocation = default; + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth, mipLevels: 1, flags: d3D12ResourceFlags); - D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height, mipLevels: 1, flags: d3D12ResourceFlags); + D3D12MA_ALLOCATION_DESC allocationDesc = default; + allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; + allocationDesc.Flags = allocationFlags; + allocationDesc.CustomPool = pool; - D3D12MA_ALLOCATION_DESC allocationDesc = default; - allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; - allocationDesc.Flags = allocationFlags; - allocationDesc.CustomPool = pool; + allocator.CreateResource( + &allocationDesc, + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + allocation.GetAddressOf(), + null, + null).Assert(); - allocator.CreateResource( - &allocationDesc, - &d3D12ResourceDescription, - d3D12ResourceStates, - null, - allocation.GetAddressOf(), - null, - null).Assert(); - - return allocation.Move(); - } - - /// - /// Creates a resource for a given 3D texture type. - /// - /// The instance in use. - /// The instance to use, if any. - /// The resource type currently in use. - /// The allocation mode to use for the new resource. - /// The value to use. - /// The width of the texture resource. - /// The height of the texture resource. - /// The depth of the texture resource. - /// The default value for the resource. - /// An reference for the current object. - public static UniquePtr CreateResource( - this ref D3D12MA_Allocator allocator, - D3D12MA_Pool* pool, - ResourceType resourceType, - AllocationMode allocationMode, - DXGI_FORMAT dxgiFormat, - uint width, - uint height, - ushort depth, - out D3D12_RESOURCE_STATES d3D12ResourceStates) - { - D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; - D3D12_RESOURCE_FLAGS d3D12ResourceFlags; - - (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch - { - ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), - ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), - _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() - }; - - using UniquePtr allocation = default; - - D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth, mipLevels: 1, flags: d3D12ResourceFlags); - - D3D12MA_ALLOCATION_DESC allocationDesc = default; - allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; - allocationDesc.Flags = allocationFlags; - allocationDesc.CustomPool = pool; - - allocator.CreateResource( - &allocationDesc, - &d3D12ResourceDescription, - d3D12ResourceStates, - null, - allocation.GetAddressOf(), - null, - null).Assert(); - - return allocation.Move(); - } + return allocation.Move(); } } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs index 7458b7d4..5906b523 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs @@ -2,61 +2,60 @@ using System.Runtime.CompilerServices; using TerraFX.Interop; -namespace ComputeSharp.Core.Extensions +namespace ComputeSharp.Core.Extensions; + +/// +/// Helper methods for working with the type. +/// +internal static class ComPtrExtensions { /// - /// Helper methods for working with the type. + /// Reinterprets the current instance as one of type . /// - internal static class ComPtrExtensions + /// The type of the current instance. + /// The input instance to upcast. + /// A instance of type . + /// + /// This method is meant to be used in a chained expression and it does not increment the reference + /// count for the input pointer. Do not expose the return value of this extension to consumers. + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ref readonly ComPtr AsIUnknown(this in ComPtr ptr) + where T : unmanaged { - /// - /// Reinterprets the current instance as one of type . - /// - /// The type of the current instance. - /// The input instance to upcast. - /// A instance of type . - /// - /// This method is meant to be used in a chained expression and it does not increment the reference - /// count for the input pointer. Do not expose the return value of this extension to consumers. - /// - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ref readonly ComPtr AsIUnknown(this in ComPtr ptr) - where T : unmanaged - { - return ref Unsafe.As, ComPtr>(ref Unsafe.AsRef(in ptr)); - } + return ref Unsafe.As, ComPtr>(ref Unsafe.AsRef(in ptr)); + } - /// - /// Gets the address of the current instance as a raw double pointer. - /// - /// The type to wrap in the current instance. - /// The input instance to get the address for. - /// The raw pointer to the input instance. - /// This method is only valid when the current instance is on the stack or pinned. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void** GetVoidAddressOf(this in ComPtr ptr) - where T : unmanaged - { - return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr)); - } + /// + /// Gets the address of the current instance as a raw double pointer. + /// + /// The type to wrap in the current instance. + /// The input instance to get the address for. + /// The raw pointer to the input instance. + /// This method is only valid when the current instance is on the stack or pinned. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void** GetVoidAddressOf(this in ComPtr ptr) + where T : unmanaged + { + return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr)); + } - /// - /// Moves the current instance and resets it without releasing the reference. - /// - /// The type to wrap in the current instance. - /// The input instance to move. - /// The moved instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ComPtr Move(this in ComPtr ptr) - where T : unmanaged - { - ComPtr copy = default; + /// + /// Moves the current instance and resets it without releasing the reference. + /// + /// The type to wrap in the current instance. + /// The input instance to move. + /// The moved instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ComPtr Move(this in ComPtr ptr) + where T : unmanaged + { + ComPtr copy = default; - Unsafe.AsRef(in ptr).Swap(ref copy); + Unsafe.AsRef(in ptr).Swap(ref copy); - return copy; - } + return copy; } } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs index ad12813a..f29c4851 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs @@ -7,40 +7,39 @@ using ComputeSharp.Graphics.Helpers; using Microsoft.Toolkit.Diagnostics; using HRESULT = System.Int32; -namespace ComputeSharp.Core.Extensions +namespace ComputeSharp.Core.Extensions; + +/// +/// Helper methods to efficiently throw exceptions. +/// +[DebuggerStepThrough] +internal static class HResultExtensions { /// - /// Helper methods to efficiently throw exceptions. + /// Throws a if represents an error. /// - [DebuggerStepThrough] - internal static class HResultExtensions + /// The input to check. + /// Thrown if represents an error. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Assert(this HRESULT result) { - /// - /// Throws a if represents an error. - /// - /// The input to check. - /// Thrown if represents an error. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Assert(this HRESULT result) - { #if DEBUG - bool hasErrorsOrWarnings = DeviceHelper.FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings(); + bool hasErrorsOrWarnings = DeviceHelper.FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings(); - if (result < 0) - { - ThrowHelper.ThrowWin32Exception(result); - } - - if (hasErrorsOrWarnings) - { - ThrowHelper.ThrowWin32Exception("Warning or error detected by ID3D12InfoQueue"); - } -#else - if (result < 0) - { - ThrowHelper.ThrowWin32Exception(result); - } -#endif + if (result < 0) + { + ThrowHelper.ThrowWin32Exception(result); } + + if (hasErrorsOrWarnings) + { + ThrowHelper.ThrowWin32Exception("Warning or error detected by ID3D12InfoQueue"); + } +#else + if (result < 0) + { + ThrowHelper.ThrowWin32Exception(result); + } +#endif } } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs index 87462db5..dbeb2c9d 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs @@ -15,413 +15,412 @@ using static TerraFX.Interop.D3D12_SRV_DIMENSION; using static TerraFX.Interop.D3D12_UAV_DIMENSION; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Graphics.Extensions +namespace ComputeSharp.Graphics.Extensions; + +/// +/// A with extensions for the type. +/// +internal static unsafe class ID3D12DeviceExtensions { /// - /// A with extensions for the type. + /// Creates a instance for a given device. /// - internal static unsafe class ID3D12DeviceExtensions + /// The target to use to create the allocator. + /// The that was created from. + /// A instance to create resources on the device in use. + public static ReferenceCountPtr CreateAllocator(this ref ID3D12Device d3D12Device, IDXGIAdapter* dxgiAdapter) { - /// - /// Creates a instance for a given device. - /// - /// The target to use to create the allocator. - /// The that was created from. - /// A instance to create resources on the device in use. - public static ReferenceCountPtr CreateAllocator(this ref ID3D12Device d3D12Device, IDXGIAdapter* dxgiAdapter) + using ReferenceCountPtr allocator = default; + + D3D12MA_ALLOCATOR_DESC allocatorDesc = default; + allocatorDesc.pDevice = (ID3D12Device*)Unsafe.AsPointer(ref d3D12Device); + allocatorDesc.pAdapter = dxgiAdapter; + + D3D12MemAlloc.D3D12MA_CreateAllocator(&allocatorDesc, allocator.GetAddressOf()).Assert(); + + return allocator.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the info queue. + /// A pointer to the newly created instance. + /// Thrown when the creation of the info queue fails. + public static ComPtr CreateInfoQueue(this ref ID3D12Device d3D12Device) + { + ComPtr d3D12InfoQueue = default; + + d3D12Device.QueryInterface(FX.__uuidof(), d3D12InfoQueue.GetVoidAddressOf()).Assert(); + + D3D12_MESSAGE_ID* d3D12MessageIds = stackalloc D3D12_MESSAGE_ID[3] { - using ReferenceCountPtr allocator = default; + D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS, + D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE, + D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE + }; - D3D12MA_ALLOCATOR_DESC allocatorDesc = default; - allocatorDesc.pDevice = (ID3D12Device*)Unsafe.AsPointer(ref d3D12Device); - allocatorDesc.pAdapter = dxgiAdapter; + D3D12_INFO_QUEUE_FILTER d3D12InfoQueueFilter = default; + d3D12InfoQueueFilter.DenyList.NumIDs = 3; + d3D12InfoQueueFilter.DenyList.pIDList = d3D12MessageIds; - D3D12MemAlloc.D3D12MA_CreateAllocator(&allocatorDesc, allocator.GetAddressOf()).Assert(); + d3D12InfoQueue.Get()->PushRetrievalFilter(&d3D12InfoQueueFilter).Assert(); - return allocator.Move(); + return d3D12InfoQueue.Move(); + } + + /// + /// Creates a new of the specified type, for a given device. + /// + /// The target to use to create the command queue. + /// The type of command queue to create. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command queue fails. + public static ComPtr CreateCommandQueue(this ref ID3D12Device d3D12Device, D3D12_COMMAND_LIST_TYPE type) + { + using ComPtr d3D12CommandQueue = default; + + D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; + d3D12CommandQueueDesc.Type = type; + d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; + d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; + d3D12CommandQueueDesc.NodeMask = 0; + + d3D12Device.CreateCommandQueue( + &d3D12CommandQueueDesc, + FX.__uuidof(), + d3D12CommandQueue.GetVoidAddressOf()).Assert(); + + return d3D12CommandQueue.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the fence. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command queue fails. + public static ComPtr CreateFence(this ref ID3D12Device d3D12Device) + { + using ComPtr d3D12Fence = default; + + d3D12Device.CreateFence( + 0, + D3D12_FENCE_FLAG_NONE, + FX.__uuidof(), + d3D12Fence.GetVoidAddressOf()).Assert(); + + return d3D12Fence.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the descriptor heap. + /// The number of descriptors to allocate. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command queue fails. + public static ComPtr CreateDescriptorHeap(this ref ID3D12Device d3D12Device, uint descriptorsCount) + { + using ComPtr d3D12DescriptorHeap = default; + + D3D12_DESCRIPTOR_HEAP_DESC d3D12DescriptorHeapDesc; + d3D12DescriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV; + d3D12DescriptorHeapDesc.NumDescriptors = descriptorsCount; + d3D12DescriptorHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; + d3D12DescriptorHeapDesc.NodeMask = 0; + + d3D12Device.CreateDescriptorHeap( + &d3D12DescriptorHeapDesc, + FX.__uuidof(), + d3D12DescriptorHeap.GetVoidAddressOf()).Assert(); + + return d3D12DescriptorHeap.Move(); + } + + /// + /// Creates a view for a constant buffer. + /// + /// The target instance in use. + /// The to create a view for. + /// The size of the target resource. + /// The instance for the current resource. + public static void CreateConstantBufferView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + nint bufferSize, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + uint constantBufferSize = checked((uint)((bufferSize + 255) & ~255)); + + D3D12_CONSTANT_BUFFER_VIEW_DESC d3D12ConstantBufferViewDescription; + d3D12ConstantBufferViewDescription.BufferLocation = d3D12Resource->GetGPUVirtualAddress(); + d3D12ConstantBufferViewDescription.SizeInBytes = constantBufferSize; + + d3D12Device.CreateConstantBufferView(&d3D12ConstantBufferViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a readonly buffer. + /// + /// The target instance in use. + /// The to create a view for. + /// The size of the target resource. + /// The size in byte of each item in the resource. + /// The instance for the current resource. + public static void CreateShaderResourceView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + uint bufferSize, + uint elementSize, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default; + d3D12ShaderResourceViewDescription.ViewDimension = D3D12_SRV_DIMENSION_BUFFER; + d3D12ShaderResourceViewDescription.Shader4ComponentMapping = FX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + d3D12ShaderResourceViewDescription.Buffer.NumElements = bufferSize; + d3D12ShaderResourceViewDescription.Buffer.StructureByteStride = elementSize; + + d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a readonly texture. + /// + /// The target instance in use. + /// The to create a view for. + /// The value to use. + /// The value for the view to create. + /// The instance for the current resource. + public static void CreateShaderResourceView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + DXGI_FORMAT dxgiFormat, + D3D12_SRV_DIMENSION d3D12SrvDimension, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default; + d3D12ShaderResourceViewDescription.ViewDimension = d3D12SrvDimension; + d3D12ShaderResourceViewDescription.Format = dxgiFormat; + d3D12ShaderResourceViewDescription.Shader4ComponentMapping = FX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + d3D12ShaderResourceViewDescription.Texture2D.MipLevels = uint.MaxValue; + + d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a buffer that can be both read and written to. + /// + /// The target instance in use. + /// The to create a view for. + /// The size of the target resource. + /// The size in byte of each item in the resource. + /// The instance for the current resource. + public static void CreateUnorderedAccessView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + uint bufferSize, + uint elementSize, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_UNORDERED_ACCESS_VIEW_DESC d3D12UnorderedAccessViewDescription = default; + d3D12UnorderedAccessViewDescription.ViewDimension = D3D12_UAV_DIMENSION_BUFFER; + d3D12UnorderedAccessViewDescription.Buffer.NumElements = bufferSize; + d3D12UnorderedAccessViewDescription.Buffer.StructureByteStride = elementSize; + + d3D12Device.CreateUnorderedAccessView(d3D12Resource, null, &d3D12UnorderedAccessViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a texture that can be both read and written to. + /// + /// The target instance in use. + /// The to create a view for. + /// The value to use. + /// The value for the view to create. + /// The instance for the current resource. + public static void CreateUnorderedAccessView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + DXGI_FORMAT dxgiFormat, + D3D12_UAV_DIMENSION d3D12UavDimension, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_UNORDERED_ACCESS_VIEW_DESC d3D12UnorderedAccessViewDescription = default; + d3D12UnorderedAccessViewDescription.ViewDimension = d3D12UavDimension; + d3D12UnorderedAccessViewDescription.Format = dxgiFormat; + d3D12UnorderedAccessViewDescription.Texture3D.WSize = uint.MaxValue; + + d3D12Device.CreateUnorderedAccessView(d3D12Resource, null, &d3D12UnorderedAccessViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the command allocator. + /// The type of command list allocator to create. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command allocator fails. + public static ComPtr CreateCommandAllocator( + this ref ID3D12Device d3D12Device, + D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + { + using ComPtr d3D12CommandAllocator = default; + + d3D12Device.CreateCommandAllocator( + d3D12CommandListType, + FX.__uuidof(), + d3D12CommandAllocator.GetVoidAddressOf()).Assert(); + + return d3D12CommandAllocator.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the command list. + /// The type of command list to create. + /// The command allocator to use to create the command list. + /// The initial object, if present. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command list fails. + public static ComPtr CreateCommandList( + this ref ID3D12Device d3D12Device, + D3D12_COMMAND_LIST_TYPE d3D12CommandListType, + ID3D12CommandAllocator* d3D12CommandAllocator, + ID3D12PipelineState* d3D12PipelineState) + { + using ComPtr d3D12GraphicsCommandList = default; + + d3D12Device.CreateCommandList( + 0, + d3D12CommandListType, + d3D12CommandAllocator, + d3D12PipelineState, + FX.__uuidof(), + d3D12GraphicsCommandList.GetVoidAddressOf()).Assert(); + + return d3D12GraphicsCommandList.Move(); + } + + /// + /// Gets the layout data for a target resource. + /// + /// The target to use to get the layout info. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The resulting layout info for the resource. + /// The size in bytes of each row in the resource. + /// The total number of bytes for the resource. + public static void GetCopyableFootprint( + this ref ID3D12Device d3D12Device, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes) + { + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height); + ulong a, b; + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* p = &d3D12PlacedSubresourceFootprint) + { + uint _; + + d3D12Device.GetCopyableFootprints(&d3D12ResourceDescription, 0, 1, 0, p, &_, &a, &b); } - /// - /// Creates a new for a given device. - /// - /// The target to use to create the info queue. - /// A pointer to the newly created instance. - /// Thrown when the creation of the info queue fails. - public static ComPtr CreateInfoQueue(this ref ID3D12Device d3D12Device) + rowSizeInBytes = a; + totalSizeInBytes = b; + } + + /// + /// Gets the layout data for a target resource. + /// + /// The target to use to get the layout info. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The depth of the texture resource. + /// The resulting layout info for the resource. + /// The size in bytes of each row in the resource. + /// The total number of bytes for the resource. + public static void GetCopyableFootprint( + this ref ID3D12Device d3D12Device, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + ushort depth, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes) + { + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth); + ulong a, b; + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* p = &d3D12PlacedSubresourceFootprint) { - ComPtr d3D12InfoQueue = default; + uint _; - d3D12Device.QueryInterface(FX.__uuidof(), d3D12InfoQueue.GetVoidAddressOf()).Assert(); - - D3D12_MESSAGE_ID* d3D12MessageIds = stackalloc D3D12_MESSAGE_ID[3] - { - D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS, - D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE, - D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE - }; - - D3D12_INFO_QUEUE_FILTER d3D12InfoQueueFilter = default; - d3D12InfoQueueFilter.DenyList.NumIDs = 3; - d3D12InfoQueueFilter.DenyList.pIDList = d3D12MessageIds; - - d3D12InfoQueue.Get()->PushRetrievalFilter(&d3D12InfoQueueFilter).Assert(); - - return d3D12InfoQueue.Move(); + d3D12Device.GetCopyableFootprints(&d3D12ResourceDescription, 0, 1, 0, p, &_, &a, &b); } - /// - /// Creates a new of the specified type, for a given device. - /// - /// The target to use to create the command queue. - /// The type of command queue to create. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the command queue fails. - public static ComPtr CreateCommandQueue(this ref ID3D12Device d3D12Device, D3D12_COMMAND_LIST_TYPE type) - { - using ComPtr d3D12CommandQueue = default; + rowSizeInBytes = a; + totalSizeInBytes = b; + } - D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; - d3D12CommandQueueDesc.Type = type; - d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; - d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; - d3D12CommandQueueDesc.NodeMask = 0; + /// + /// Checks the feature support of a given type for a given device. + /// + /// The type of feature support data to retrieve. + /// The target to use to check features for. + /// The type of features to check. + /// A value with the features data. + [Pure] + public static unsafe TFeature CheckFeatureSupport(this ref ID3D12Device d3D12Device, D3D12_FEATURE d3D12Feature) + where TFeature : unmanaged + { + TFeature feature = default; - d3D12Device.CreateCommandQueue( - &d3D12CommandQueueDesc, - FX.__uuidof(), - d3D12CommandQueue.GetVoidAddressOf()).Assert(); + d3D12Device.CheckFeatureSupport(d3D12Feature, &feature, (uint)sizeof(TFeature)).Assert(); - return d3D12CommandQueue.Move(); - } + return feature; + } - /// - /// Creates a new for a given device. - /// - /// The target to use to create the fence. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the command queue fails. - public static ComPtr CreateFence(this ref ID3D12Device d3D12Device) - { - using ComPtr d3D12Fence = default; + /// + /// Checks whether or not a given DXGI format is supported for the specified resource type. + /// + /// The target to use to check features for. + /// The type to check support for. + /// The resource type to check support for. + /// Whether or not the input device supports the requested format for the specified resource type. + [Pure] + public static unsafe bool IsDxgiFormatSupported(this ref ID3D12Device d3D12Device, DXGI_FORMAT dxgiFormat, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport1) + { + D3D12_FEATURE_DATA_FORMAT_SUPPORT d3D12FeatureDataFormatSupport = default; + d3D12FeatureDataFormatSupport.Format = dxgiFormat; - d3D12Device.CreateFence( - 0, - D3D12_FENCE_FLAG_NONE, - FX.__uuidof(), - d3D12Fence.GetVoidAddressOf()).Assert(); + d3D12Device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &d3D12FeatureDataFormatSupport, (uint)sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT)).Assert(); - return d3D12Fence.Move(); - } + return (d3D12FeatureDataFormatSupport.Support1 & d3D12FormatSupport1) == d3D12FormatSupport1; + } - /// - /// Creates a new for a given device. - /// - /// The target to use to create the descriptor heap. - /// The number of descriptors to allocate. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the command queue fails. - public static ComPtr CreateDescriptorHeap(this ref ID3D12Device d3D12Device, uint descriptorsCount) - { - using ComPtr d3D12DescriptorHeap = default; + /// + /// Checks whether or not a given shader model is supported. + /// + /// The target to use to check features for. + /// The value to check support for. + /// Whether or not the input device supports the requested shader model. + [Pure] + public static unsafe bool IsShaderModelSupported(this ref ID3D12Device d3D12Device, D3D_SHADER_MODEL d3DShaderModel) + { + D3D12_FEATURE_DATA_SHADER_MODEL d3D12ShaderModel = default; + d3D12ShaderModel.HighestShaderModel = d3DShaderModel; - D3D12_DESCRIPTOR_HEAP_DESC d3D12DescriptorHeapDesc; - d3D12DescriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV; - d3D12DescriptorHeapDesc.NumDescriptors = descriptorsCount; - d3D12DescriptorHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; - d3D12DescriptorHeapDesc.NodeMask = 0; + d3D12Device.CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &d3D12ShaderModel, (uint)sizeof(D3D12_FEATURE_DATA_SHADER_MODEL)).Assert(); - d3D12Device.CreateDescriptorHeap( - &d3D12DescriptorHeapDesc, - FX.__uuidof(), - d3D12DescriptorHeap.GetVoidAddressOf()).Assert(); - - return d3D12DescriptorHeap.Move(); - } - - /// - /// Creates a view for a constant buffer. - /// - /// The target instance in use. - /// The to create a view for. - /// The size of the target resource. - /// The instance for the current resource. - public static void CreateConstantBufferView( - this ref ID3D12Device d3D12Device, - ID3D12Resource* d3D12Resource, - nint bufferSize, - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) - { - uint constantBufferSize = checked((uint)((bufferSize + 255) & ~255)); - - D3D12_CONSTANT_BUFFER_VIEW_DESC d3D12ConstantBufferViewDescription; - d3D12ConstantBufferViewDescription.BufferLocation = d3D12Resource->GetGPUVirtualAddress(); - d3D12ConstantBufferViewDescription.SizeInBytes = constantBufferSize; - - d3D12Device.CreateConstantBufferView(&d3D12ConstantBufferViewDescription, d3D12CpuDescriptorHandle); - } - - /// - /// Creates a view for a readonly buffer. - /// - /// The target instance in use. - /// The to create a view for. - /// The size of the target resource. - /// The size in byte of each item in the resource. - /// The instance for the current resource. - public static void CreateShaderResourceView( - this ref ID3D12Device d3D12Device, - ID3D12Resource* d3D12Resource, - uint bufferSize, - uint elementSize, - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) - { - D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default; - d3D12ShaderResourceViewDescription.ViewDimension = D3D12_SRV_DIMENSION_BUFFER; - d3D12ShaderResourceViewDescription.Shader4ComponentMapping = FX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; - d3D12ShaderResourceViewDescription.Buffer.NumElements = bufferSize; - d3D12ShaderResourceViewDescription.Buffer.StructureByteStride = elementSize; - - d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle); - } - - /// - /// Creates a view for a readonly texture. - /// - /// The target instance in use. - /// The to create a view for. - /// The value to use. - /// The value for the view to create. - /// The instance for the current resource. - public static void CreateShaderResourceView( - this ref ID3D12Device d3D12Device, - ID3D12Resource* d3D12Resource, - DXGI_FORMAT dxgiFormat, - D3D12_SRV_DIMENSION d3D12SrvDimension, - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) - { - D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default; - d3D12ShaderResourceViewDescription.ViewDimension = d3D12SrvDimension; - d3D12ShaderResourceViewDescription.Format = dxgiFormat; - d3D12ShaderResourceViewDescription.Shader4ComponentMapping = FX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; - d3D12ShaderResourceViewDescription.Texture2D.MipLevels = uint.MaxValue; - - d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle); - } - - /// - /// Creates a view for a buffer that can be both read and written to. - /// - /// The target instance in use. - /// The to create a view for. - /// The size of the target resource. - /// The size in byte of each item in the resource. - /// The instance for the current resource. - public static void CreateUnorderedAccessView( - this ref ID3D12Device d3D12Device, - ID3D12Resource* d3D12Resource, - uint bufferSize, - uint elementSize, - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) - { - D3D12_UNORDERED_ACCESS_VIEW_DESC d3D12UnorderedAccessViewDescription = default; - d3D12UnorderedAccessViewDescription.ViewDimension = D3D12_UAV_DIMENSION_BUFFER; - d3D12UnorderedAccessViewDescription.Buffer.NumElements = bufferSize; - d3D12UnorderedAccessViewDescription.Buffer.StructureByteStride = elementSize; - - d3D12Device.CreateUnorderedAccessView(d3D12Resource, null, &d3D12UnorderedAccessViewDescription, d3D12CpuDescriptorHandle); - } - - /// - /// Creates a view for a texture that can be both read and written to. - /// - /// The target instance in use. - /// The to create a view for. - /// The value to use. - /// The value for the view to create. - /// The instance for the current resource. - public static void CreateUnorderedAccessView( - this ref ID3D12Device d3D12Device, - ID3D12Resource* d3D12Resource, - DXGI_FORMAT dxgiFormat, - D3D12_UAV_DIMENSION d3D12UavDimension, - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) - { - D3D12_UNORDERED_ACCESS_VIEW_DESC d3D12UnorderedAccessViewDescription = default; - d3D12UnorderedAccessViewDescription.ViewDimension = d3D12UavDimension; - d3D12UnorderedAccessViewDescription.Format = dxgiFormat; - d3D12UnorderedAccessViewDescription.Texture3D.WSize = uint.MaxValue; - - d3D12Device.CreateUnorderedAccessView(d3D12Resource, null, &d3D12UnorderedAccessViewDescription, d3D12CpuDescriptorHandle); - } - - /// - /// Creates a new for a given device. - /// - /// The target to use to create the command allocator. - /// The type of command list allocator to create. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the command allocator fails. - public static ComPtr CreateCommandAllocator( - this ref ID3D12Device d3D12Device, - D3D12_COMMAND_LIST_TYPE d3D12CommandListType) - { - using ComPtr d3D12CommandAllocator = default; - - d3D12Device.CreateCommandAllocator( - d3D12CommandListType, - FX.__uuidof(), - d3D12CommandAllocator.GetVoidAddressOf()).Assert(); - - return d3D12CommandAllocator.Move(); - } - - /// - /// Creates a new for a given device. - /// - /// The target to use to create the command list. - /// The type of command list to create. - /// The command allocator to use to create the command list. - /// The initial object, if present. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the command list fails. - public static ComPtr CreateCommandList( - this ref ID3D12Device d3D12Device, - D3D12_COMMAND_LIST_TYPE d3D12CommandListType, - ID3D12CommandAllocator* d3D12CommandAllocator, - ID3D12PipelineState* d3D12PipelineState) - { - using ComPtr d3D12GraphicsCommandList = default; - - d3D12Device.CreateCommandList( - 0, - d3D12CommandListType, - d3D12CommandAllocator, - d3D12PipelineState, - FX.__uuidof(), - d3D12GraphicsCommandList.GetVoidAddressOf()).Assert(); - - return d3D12GraphicsCommandList.Move(); - } - - /// - /// Gets the layout data for a target resource. - /// - /// The target to use to get the layout info. - /// The value to use. - /// The width of the texture resource. - /// The height of the texture resource. - /// The resulting layout info for the resource. - /// The size in bytes of each row in the resource. - /// The total number of bytes for the resource. - public static void GetCopyableFootprint( - this ref ID3D12Device d3D12Device, - DXGI_FORMAT dxgiFormat, - uint width, - uint height, - out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint, - out ulong rowSizeInBytes, - out ulong totalSizeInBytes) - { - D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height); - ulong a, b; - - fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* p = &d3D12PlacedSubresourceFootprint) - { - uint _; - - d3D12Device.GetCopyableFootprints(&d3D12ResourceDescription, 0, 1, 0, p, &_, &a, &b); - } - - rowSizeInBytes = a; - totalSizeInBytes = b; - } - - /// - /// Gets the layout data for a target resource. - /// - /// The target to use to get the layout info. - /// The value to use. - /// The width of the texture resource. - /// The height of the texture resource. - /// The depth of the texture resource. - /// The resulting layout info for the resource. - /// The size in bytes of each row in the resource. - /// The total number of bytes for the resource. - public static void GetCopyableFootprint( - this ref ID3D12Device d3D12Device, - DXGI_FORMAT dxgiFormat, - uint width, - uint height, - ushort depth, - out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint, - out ulong rowSizeInBytes, - out ulong totalSizeInBytes) - { - D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth); - ulong a, b; - - fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* p = &d3D12PlacedSubresourceFootprint) - { - uint _; - - d3D12Device.GetCopyableFootprints(&d3D12ResourceDescription, 0, 1, 0, p, &_, &a, &b); - } - - rowSizeInBytes = a; - totalSizeInBytes = b; - } - - /// - /// Checks the feature support of a given type for a given device. - /// - /// The type of feature support data to retrieve. - /// The target to use to check features for. - /// The type of features to check. - /// A value with the features data. - [Pure] - public static unsafe TFeature CheckFeatureSupport(this ref ID3D12Device d3D12Device, D3D12_FEATURE d3D12Feature) - where TFeature : unmanaged - { - TFeature feature = default; - - d3D12Device.CheckFeatureSupport(d3D12Feature, &feature, (uint)sizeof(TFeature)).Assert(); - - return feature; - } - - /// - /// Checks whether or not a given DXGI format is supported for the specified resource type. - /// - /// The target to use to check features for. - /// The type to check support for. - /// The resource type to check support for. - /// Whether or not the input device supports the requested format for the specified resource type. - [Pure] - public static unsafe bool IsDxgiFormatSupported(this ref ID3D12Device d3D12Device, DXGI_FORMAT dxgiFormat, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport1) - { - D3D12_FEATURE_DATA_FORMAT_SUPPORT d3D12FeatureDataFormatSupport = default; - d3D12FeatureDataFormatSupport.Format = dxgiFormat; - - d3D12Device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &d3D12FeatureDataFormatSupport, (uint)sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT)).Assert(); - - return (d3D12FeatureDataFormatSupport.Support1 & d3D12FormatSupport1) == d3D12FormatSupport1; - } - - /// - /// Checks whether or not a given shader model is supported. - /// - /// The target to use to check features for. - /// The value to check support for. - /// Whether or not the input device supports the requested shader model. - [Pure] - public static unsafe bool IsShaderModelSupported(this ref ID3D12Device d3D12Device, D3D_SHADER_MODEL d3DShaderModel) - { - D3D12_FEATURE_DATA_SHADER_MODEL d3D12ShaderModel = default; - d3D12ShaderModel.HighestShaderModel = d3DShaderModel; - - d3D12Device.CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &d3D12ShaderModel, (uint)sizeof(D3D12_FEATURE_DATA_SHADER_MODEL)).Assert(); - - return d3D12ShaderModel.HighestShaderModel == d3DShaderModel; - } + return d3D12ShaderModel.HighestShaderModel == d3DShaderModel; } } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs index 04d8fb1a..ad1378ae 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs @@ -1,161 +1,160 @@ using System; using TerraFX.Interop; -namespace ComputeSharp.Graphics.Extensions +namespace ComputeSharp.Graphics.Extensions; + +/// +/// A with extensions for the type. +/// +internal static unsafe class ID3D12GraphicsCommandListExtensions { /// - /// A with extensions for the type. + /// Copies a texture memory region from one resource (a texture) to another (a buffer). /// - internal static unsafe class ID3D12GraphicsCommandListExtensions + /// The instance in use. + /// The destination (a buffer) to write to. + /// The value describing . + /// The horizontal offset in the destination buffer. + /// The vertical offset in the destination buffer. + /// The depthwise offset in the destination buffer. + /// The source (a texture) to read from. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to read from. + /// The height of the memory area to read from. + /// The depth of the memory area to read from. + public static void CopyTextureRegion( + this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, + ID3D12Resource* d3D12ResourceDestination, + D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination, + uint destinationX, + uint destinationY, + ushort destinationZ, + ID3D12Resource* d3D12ResourceSource, + uint sourceX, + uint sourceY, + ushort sourceZ, + uint width, + uint height, + ushort depth) { - /// - /// Copies a texture memory region from one resource (a texture) to another (a buffer). - /// - /// The instance in use. - /// The destination (a buffer) to write to. - /// The value describing . - /// The horizontal offset in the destination buffer. - /// The vertical offset in the destination buffer. - /// The depthwise offset in the destination buffer. - /// The source (a texture) to read from. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to read from. - /// The height of the memory area to read from. - /// The depth of the memory area to read from. - public static void CopyTextureRegion( - this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, - ID3D12Resource* d3D12ResourceDestination, - D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination, - uint destinationX, - uint destinationY, - ushort destinationZ, - ID3D12Resource* d3D12ResourceSource, - uint sourceX, - uint sourceY, - ushort sourceZ, - uint width, - uint height, - ushort depth) + D3D12_RESOURCE_DESC d3D12ResourceDescriptionSource = d3D12ResourceSource->GetDesc(); + D3D12_TEXTURE_COPY_LOCATION + d3D12TextureCopyLocationDestination = new(d3D12ResourceDestination, in *d3D12PlacedSubresourceFootprintDestination), + d3D12TextureCopyLocationSource = new(d3D12ResourceSource, 0); + D3D12_BOX d3D12Box; + D3D12_BOX* pD3D12Box; + + if (sourceX == 0 && sourceY == 0 && sourceZ == 0 && + width == d3D12ResourceDescriptionSource.Width && + height == d3D12ResourceDescriptionSource.Height && + depth == d3D12ResourceDescriptionSource.Depth) { - D3D12_RESOURCE_DESC d3D12ResourceDescriptionSource = d3D12ResourceSource->GetDesc(); - D3D12_TEXTURE_COPY_LOCATION - d3D12TextureCopyLocationDestination = new(d3D12ResourceDestination, in *d3D12PlacedSubresourceFootprintDestination), - d3D12TextureCopyLocationSource = new(d3D12ResourceSource, 0); - D3D12_BOX d3D12Box; - D3D12_BOX* pD3D12Box; - - if (sourceX == 0 && sourceY == 0 && sourceZ == 0 && - width == d3D12ResourceDescriptionSource.Width && - height == d3D12ResourceDescriptionSource.Height && - depth == d3D12ResourceDescriptionSource.Depth) - { - pD3D12Box = null; - } - else - { - d3D12Box = new D3D12_BOX((int)sourceX, (int)sourceY, sourceZ, (int)(sourceX + width), (int)(sourceY + height), sourceZ + depth); - pD3D12Box = &d3D12Box; - } - - d3D12GraphicsCommandList.CopyTextureRegion( - &d3D12TextureCopyLocationDestination, - destinationX, - destinationY, - destinationZ, - &d3D12TextureCopyLocationSource, - pD3D12Box); + pD3D12Box = null; + } + else + { + d3D12Box = new D3D12_BOX((int)sourceX, (int)sourceY, sourceZ, (int)(sourceX + width), (int)(sourceY + height), sourceZ + depth); + pD3D12Box = &d3D12Box; } - /// - /// Copies a texture memory region from one resource (a buffer) to another (a texture). - /// - /// The instance in use. - /// The destination (a texture) to write to. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The depthwise offset in the destination texture. - /// The source (a buffer) to read from. - /// The value describing . - /// The horizontal offset in the source buffer. - /// The vertical offset in the source buffer. - /// The depthwise offset in the source buffer. - /// The width of the memory area to read from. - /// The height of the memory area to read from. - /// The depth of the memory area to read from. - public static void CopyTextureRegion( - this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, - ID3D12Resource* d3D12ResourceDestination, - uint destinationX, - uint destinationY, - ushort destinationZ, - ID3D12Resource* d3D12ResourceSource, - D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource, - uint sourceX, - uint sourceY, - ushort sourceZ, - uint width, - uint height, - ushort depth) + d3D12GraphicsCommandList.CopyTextureRegion( + &d3D12TextureCopyLocationDestination, + destinationX, + destinationY, + destinationZ, + &d3D12TextureCopyLocationSource, + pD3D12Box); + } + + /// + /// Copies a texture memory region from one resource (a buffer) to another (a texture). + /// + /// The instance in use. + /// The destination (a texture) to write to. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The source (a buffer) to read from. + /// The value describing . + /// The horizontal offset in the source buffer. + /// The vertical offset in the source buffer. + /// The depthwise offset in the source buffer. + /// The width of the memory area to read from. + /// The height of the memory area to read from. + /// The depth of the memory area to read from. + public static void CopyTextureRegion( + this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, + ID3D12Resource* d3D12ResourceDestination, + uint destinationX, + uint destinationY, + ushort destinationZ, + ID3D12Resource* d3D12ResourceSource, + D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource, + uint sourceX, + uint sourceY, + ushort sourceZ, + uint width, + uint height, + ushort depth) + { + D3D12_TEXTURE_COPY_LOCATION + d3D12TextureCopyLocationDestination = new(d3D12ResourceDestination, 0), + d3D12TextureCopyLocationSource = new(d3D12ResourceSource, in *d3D12PlacedSubresourceFootprintSource); + D3D12_BOX d3D12Box; + D3D12_BOX* pD3D12Box; + + if (sourceX == 0 && sourceY == 0 && sourceZ == 0 && + width == d3D12PlacedSubresourceFootprintSource->Footprint.Width && + height == d3D12PlacedSubresourceFootprintSource->Footprint.Height && + depth == d3D12PlacedSubresourceFootprintSource->Footprint.Depth) { - D3D12_TEXTURE_COPY_LOCATION - d3D12TextureCopyLocationDestination = new(d3D12ResourceDestination, 0), - d3D12TextureCopyLocationSource = new(d3D12ResourceSource, in *d3D12PlacedSubresourceFootprintSource); - D3D12_BOX d3D12Box; - D3D12_BOX* pD3D12Box; - - if (sourceX == 0 && sourceY == 0 && sourceZ == 0 && - width == d3D12PlacedSubresourceFootprintSource->Footprint.Width && - height == d3D12PlacedSubresourceFootprintSource->Footprint.Height && - depth == d3D12PlacedSubresourceFootprintSource->Footprint.Depth) - { - pD3D12Box = null; - } - else - { - d3D12Box = new D3D12_BOX((int)sourceX, (int)sourceY, sourceZ, (int)(sourceX + width), (int)(sourceY + height), sourceZ + depth); - pD3D12Box = &d3D12Box; - } - - d3D12GraphicsCommandList.CopyTextureRegion( - &d3D12TextureCopyLocationDestination, - destinationX, - destinationY, - destinationZ, - &d3D12TextureCopyLocationSource, - pD3D12Box); + pD3D12Box = null; + } + else + { + d3D12Box = new D3D12_BOX((int)sourceX, (int)sourceY, sourceZ, (int)(sourceX + width), (int)(sourceY + height), sourceZ + depth); + pD3D12Box = &d3D12Box; } - /// - /// Creates a resource barrier to transition a resource to a specific state. - /// - /// The instance in use. - /// The to change state for. - /// The starting value for the transition. - /// The destnation value for the transition. - public static void ResourceBarrier( - this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, - ID3D12Resource* d3D12Resource, - D3D12_RESOURCE_STATES d3D12ResourceStatesBefore, - D3D12_RESOURCE_STATES d3D12ResourceStatesAfter) - { - D3D12_RESOURCE_BARRIER d3D12ResourceBarrier = D3D12_RESOURCE_BARRIER.InitTransition(d3D12Resource, d3D12ResourceStatesBefore, d3D12ResourceStatesAfter); + d3D12GraphicsCommandList.CopyTextureRegion( + &d3D12TextureCopyLocationDestination, + destinationX, + destinationY, + destinationZ, + &d3D12TextureCopyLocationSource, + pD3D12Box); + } - d3D12GraphicsCommandList.ResourceBarrier(1, &d3D12ResourceBarrier); - } + /// + /// Creates a resource barrier to transition a resource to a specific state. + /// + /// The instance in use. + /// The to change state for. + /// The starting value for the transition. + /// The destnation value for the transition. + public static void ResourceBarrier( + this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, + ID3D12Resource* d3D12Resource, + D3D12_RESOURCE_STATES d3D12ResourceStatesBefore, + D3D12_RESOURCE_STATES d3D12ResourceStatesAfter) + { + D3D12_RESOURCE_BARRIER d3D12ResourceBarrier = D3D12_RESOURCE_BARRIER.InitTransition(d3D12Resource, d3D12ResourceStatesBefore, d3D12ResourceStatesAfter); - /// - /// Binds an input constant buffer to the first root parameter. - /// - /// The instance in use. - /// The input buffer with the constant data to bind. - public static void SetComputeRoot32BitConstants(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, ReadOnlySpan data) + d3D12GraphicsCommandList.ResourceBarrier(1, &d3D12ResourceBarrier); + } + + /// + /// Binds an input constant buffer to the first root parameter. + /// + /// The instance in use. + /// The input buffer with the constant data to bind. + public static void SetComputeRoot32BitConstants(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, ReadOnlySpan data) + { + fixed (uint* p = data) { - fixed (uint* p = data) - { - d3D12GraphicsCommandList.SetComputeRoot32BitConstants(0, (uint)data.Length, p, 0); - } + d3D12GraphicsCommandList.SetComputeRoot32BitConstants(0, (uint)data.Length, p, 0); } } } diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs index 3995f71e..9a262d1a 100644 --- a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs @@ -5,56 +5,55 @@ using ComputeSharp.Core.Extensions; using ComputeSharp.Graphics.Resources.Interop; using TerraFX.Interop; -namespace ComputeSharp.Graphics.Extensions +namespace ComputeSharp.Graphics.Extensions; + +/// +/// A with extensions for the type. +/// +internal static unsafe class ID3D12ResourceExtensions { /// - /// A with extensions for the type. + /// Maps the current resource to a specified subresource. /// - internal static unsafe class ID3D12ResourceExtensions + /// The target to map. + /// A instance representing the mapped resource. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ID3D12ResourceMap Map(this ref ID3D12Resource d3D12Resource) { - /// - /// Maps the current resource to a specified subresource. - /// - /// The target to map. - /// A instance representing the mapped resource. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ID3D12ResourceMap Map(this ref ID3D12Resource d3D12Resource) + void* pointer; + + d3D12Resource.Map(0, null, &pointer).Assert(); + + return new((ID3D12Resource*)Unsafe.AsPointer(ref d3D12Resource), pointer); + } + + /// + /// Maps a given memory area. + /// + /// The target to map. + /// A pointer to the mapped area for . + /// Thrown when the mapping operation fails. + /// Only use this method to unmap resources that were mapped with . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Unmap(this ref ID3D12Resource d3D12Resource) + { + d3D12Resource.Unmap(0, null); + } + + /// + /// Assigns a name to a given . + /// + /// The target to map. + /// The wrapper object to get the name from. + /// Thrown when the mapping operation fails. + [Conditional("DEBUG")] + public static void SetName(this ref ID3D12Resource d3D12Resource, object wrapper) + { + string name = wrapper.ToString()!; + + fixed (char* p = name) { - void* pointer; - - d3D12Resource.Map(0, null, &pointer).Assert(); - - return new((ID3D12Resource*)Unsafe.AsPointer(ref d3D12Resource), pointer); - } - - /// - /// Maps a given memory area. - /// - /// The target to map. - /// A pointer to the mapped area for . - /// Thrown when the mapping operation fails. - /// Only use this method to unmap resources that were mapped with . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Unmap(this ref ID3D12Resource d3D12Resource) - { - d3D12Resource.Unmap(0, null); - } - - /// - /// Assigns a name to a given . - /// - /// The target to map. - /// The wrapper object to get the name from. - /// Thrown when the mapping operation fails. - [Conditional("DEBUG")] - public static void SetName(this ref ID3D12Resource d3D12Resource, object wrapper) - { - string name = wrapper.ToString()!; - - fixed (char* p = name) - { - d3D12Resource.SetName((ushort*)p).Assert(); - } + d3D12Resource.SetName((ushort*)p).Assert(); } } } diff --git a/src/ComputeSharp/Graphics/Extensions/ReadBackTexture2DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/ReadBackTexture2DExtensions.cs index 83b075cf..8f08ebb9 100644 --- a/src/ComputeSharp/Graphics/Extensions/ReadBackTexture2DExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/ReadBackTexture2DExtensions.cs @@ -1,23 +1,22 @@ using System; using ComputeSharp.Graphics.Helpers; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class ReadBackTexture2DExtensions { /// - /// A that contains extension methods for the type. + /// Saves a texture to a specified file. /// - public static class ReadBackTexture2DExtensions + /// The type of items to store in the texture. + /// The texture to save to an image. + /// The filename of the image file to save. + public static void Save(this ReadBackTexture2D texture, ReadOnlySpan filename) + where T : unmanaged { - /// - /// Saves a texture to a specified file. - /// - /// The type of items to store in the texture. - /// The texture to save to an image. - /// The filename of the image file to save. - public static void Save(this ReadBackTexture2D texture, ReadOnlySpan filename) - where T : unmanaged - { - WICHelper.Instance.SaveTexture(texture.View, filename); - } + WICHelper.Instance.SaveTexture(texture.View, filename); } } diff --git a/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs index 90288139..bde72b1f 100644 --- a/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs @@ -1,37 +1,36 @@ using ComputeSharp.Resources; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class StructuredBufferExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of a instance and writes them into a target instance. /// - public static class StructuredBufferExtensions + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this StructuredBuffer buffer, ReadBackBuffer destination) + where T : unmanaged { - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The target instance to write data to. - public static void CopyTo(this StructuredBuffer buffer, ReadBackBuffer destination) - where T : unmanaged - { - buffer.CopyTo(destination, 0, buffer.Length, 0); - } + buffer.CopyTo(destination, 0, buffer.Length, 0); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The target instance to write data to. - /// The starting offset within to write data to. - /// The offset to start reading data from. - /// The number of items to read. - public static void CopyTo(this StructuredBuffer buffer, ReadBackBuffer destination, int destinationOffset, int bufferOffset, int count) - where T : unmanaged - { - buffer.CopyTo(destination, destinationOffset, count, bufferOffset); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + /// The starting offset within to write data to. + /// The offset to start reading data from. + /// The number of items to read. + public static void CopyTo(this StructuredBuffer buffer, ReadBackBuffer destination, int destinationOffset, int bufferOffset, int count) + where T : unmanaged + { + buffer.CopyTo(destination, destinationOffset, count, bufferOffset); } } diff --git a/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs b/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs index 0a35af0a..ab081614 100644 --- a/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs @@ -2,83 +2,82 @@ using ComputeSharp; using static System.Runtime.InteropServices.MemoryMarshal; -namespace System.Numerics +namespace System.Numerics; + +/// +/// A that contains extension methods for the , and types. +/// +public static class FloatExtensions { /// - /// A that contains extension methods for the , and types. + /// Converts a array into a with items of type . /// - public static class FloatExtensions - { - /// - /// Converts a array into a with items of type . - /// - /// The input array. - /// A with items of type , mapping the original array. - [Pure] - public static Span AsVector2Span(this Float2[] array) => Cast(array); + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsVector2Span(this Float2[] array) => Cast(array); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static ReadOnlySpan AsVector2Span(this ReadOnlySpan span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsVector2Span(this ReadOnlySpan span) => Cast(span); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static Span AsVector2Span(this Span span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsVector2Span(this Span span) => Cast(span); - /// - /// Converts a array into a with items of type . - /// - /// The input array. - /// A with items of type , mapping the original array. - [Pure] - public static Span AsVector3Span(this Float3[] array) => Cast(array); + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsVector3Span(this Float3[] array) => Cast(array); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static ReadOnlySpan AsVector3Span(this ReadOnlySpan span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsVector3Span(this ReadOnlySpan span) => Cast(span); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static Span AsVector3Span(this Span span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsVector3Span(this Span span) => Cast(span); - /// - /// Converts a array into a with items of type . - /// - /// The input array. - /// A with items of type , mapping the original array. - [Pure] - public static Span AsVector4Span(this Float4[] array) => Cast(array); + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsVector4Span(this Float4[] array) => Cast(array); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static ReadOnlySpan AsVector4Span(this ReadOnlySpan span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsVector4Span(this ReadOnlySpan span) => Cast(span); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static Span AsVector4Span(this Span span) => Cast(span); - } + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsVector4Span(this Span span) => Cast(span); } diff --git a/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs b/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs index ea8c6da2..b29132e5 100644 --- a/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs @@ -2,83 +2,82 @@ using ComputeSharp; using static System.Runtime.InteropServices.MemoryMarshal; -namespace System.Numerics +namespace System.Numerics; + +/// +/// A that contains extension methods for the , and types. +/// +public static class VectorExtensions { /// - /// A that contains extension methods for the , and types. + /// Converts a array into a with items of type . /// - public static class VectorExtensions - { - /// - /// Converts a array into a with items of type . - /// - /// The input array. - /// A with items of type , mapping the original array. - [Pure] - public static Span AsFloat2Span(this Vector2[] array) => Cast(array); + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsFloat2Span(this Vector2[] array) => Cast(array); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static ReadOnlySpan AsFloat2Span(this ReadOnlySpan span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsFloat2Span(this ReadOnlySpan span) => Cast(span); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static Span AsFloat2Span(this Span span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsFloat2Span(this Span span) => Cast(span); - /// - /// Converts a array into a with items of type . - /// - /// The input array. - /// A with items of type , mapping the original array. - [Pure] - public static Span AsFloat3Span(this Vector3[] array) => Cast(array); + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsFloat3Span(this Vector3[] array) => Cast(array); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static ReadOnlySpan AsFloat3Span(this ReadOnlySpan span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsFloat3Span(this ReadOnlySpan span) => Cast(span); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static Span AsFloat3Span(this Span span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsFloat3Span(this Span span) => Cast(span); - /// - /// Converts a array into a with items of type . - /// - /// The input array. - /// A with items of type , mapping the original array. - [Pure] - public static Span AsFloat4Span(this Vector4[] array) => Cast(array); + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsFloat4Span(this Vector4[] array) => Cast(array); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static ReadOnlySpan AsFloat4Span(this ReadOnlySpan span) => Cast(span); + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsFloat4Span(this ReadOnlySpan span) => Cast(span); - /// - /// Converts a into a with items of type . - /// - /// The input . - /// A with items of type , mapping the original . - [Pure] - public static Span AsFloat4Span(this Span span) => Cast(span); - } + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsFloat4Span(this Span span) => Cast(span); } diff --git a/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs index e1e2b755..330a81d2 100644 --- a/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs @@ -5,355 +5,354 @@ using ComputeSharp.Graphics.Helpers; using ComputeSharp.Resources; using Microsoft.Toolkit.Diagnostics; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class Texture2DExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of the current instance and returns an array. /// - public static class Texture2DExtensions + /// The type of items stored on the texture. + /// The input instance to read data from. + /// A array with the contents of the current texture. + [Pure] + public static T[,] ToArray(this Texture2D texture) + where T : unmanaged { - /// - /// Reads the contents of the current instance and returns an array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// A array with the contents of the current texture. - [Pure] - public static T[,] ToArray(this Texture2D texture) - where T : unmanaged - { - T[,] data = new T[texture.Height, texture.Width]; + T[,] data = new T[texture.Height, texture.Width]; - texture.CopyTo(data); + texture.CopyTo(data); - return data; - } + return data; + } - /// - /// Reads the contents of the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - public static void CopyTo(this Texture2D texture, T[,] destination) - where T : unmanaged - { - Guard.IsEqualTo(destination.GetLength(0), texture.Height, nameof(destination)); - Guard.IsEqualTo(destination.GetLength(1), texture.Width, nameof(destination)); + /// + /// Reads the contents of the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + public static void CopyTo(this Texture2D texture, T[,] destination) + where T : unmanaged + { + Guard.IsEqualTo(destination.GetLength(0), texture.Height, nameof(destination)); + Guard.IsEqualTo(destination.GetLength(1), texture.Width, nameof(destination)); - texture.CopyTo(ref destination[0, 0], destination.Length, 0, 0, texture.Width, texture.Height); - } + texture.CopyTo(ref destination[0, 0], destination.Length, 0, 0, texture.Width, texture.Height); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - public static void CopyTo(this Texture2D texture, T[] destination) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(), 0, 0, texture.Width, texture.Height); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + public static void CopyTo(this Texture2D texture, T[] destination) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(), 0, 0, texture.Width, texture.Height); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The horizontal range of items to copy. - /// The vertical range of items to copy. - public static void CopyTo(this Texture2D texture, T[] destination, Range x, Range y) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(), x, y); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + public static void CopyTo(this Texture2D texture, T[] destination, Range x, Range y) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(), x, y); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - public static void CopyTo(this Texture2D texture, T[] destination, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(), x, y, width, height); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, T[] destination, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(), x, y, width, height); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - public static void CopyTo(this Texture2D texture, T[] destination, int offset) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(offset), 0, 0, texture.Width, texture.Height); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + public static void CopyTo(this Texture2D texture, T[] destination, int offset) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), 0, 0, texture.Width, texture.Height); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - /// The horizontal range of items to copy. - /// The vertical range of items to copy. - public static void CopyTo(this Texture2D texture, T[] destination, int offset, Range x, Range y) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(offset), x, y); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + public static void CopyTo(this Texture2D texture, T[] destination, int offset, Range x, Range y) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - public static void CopyTo(this Texture2D texture, T[] destination, int offset, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(offset), x, y, width, height); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, T[] destination, int offset, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y, width, height); + } - /// - /// Reads the contents of the current instance and writes them into a target . - /// The input data will be read from the start of the texture. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input to write data to. - public static void CopyTo(this Texture2D texture, Span destination) - where T : unmanaged - { - texture.CopyTo(destination, 0, 0, texture.Width, texture.Height); - } + /// + /// Reads the contents of the current instance and writes them into a target . + /// The input data will be read from the start of the texture. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + public static void CopyTo(this Texture2D texture, Span destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, texture.Width, texture.Height); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target . - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input to write data to. - /// The horizontal range of items to copy. - /// The vertical range of items to copy. - public static void CopyTo(this Texture2D texture, Span destination, Range x, Range y) - where T : unmanaged - { - var (offsetX, width) = x.GetOffsetAndLength(texture.Width); - var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + public static void CopyTo(this Texture2D texture, Span destination, Range x, Range y) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); - texture.CopyTo(destination, offsetX, offsetY, width, height); - } + texture.CopyTo(destination, offsetX, offsetY, width, height); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target . - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - public static void CopyTo(this Texture2D texture, Span destination, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, x, y, width, height); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, Span destination, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, x, y, width, height); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - public static void CopyTo(this Texture2D texture, ReadBackTexture2D destination) - where T : unmanaged - { - texture.CopyTo(destination, 0, 0, 0, 0, texture.Width, texture.Height); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this Texture2D texture, ReadBackTexture2D destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, 0, texture.Width, texture.Height); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - public static void CopyTo(this Texture2D texture, ReadBackTexture2D destination, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyTo(destination, 0, 0, x, y, width, height); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, ReadBackTexture2D destination, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, x, y, width, height); + } - /// - /// Writes the contents of a given array to the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - public static unsafe void CopyFrom(this Texture2D texture, T[,] source) - where T : unmanaged - { - Guard.IsEqualTo(source.GetLength(0), texture.Height, nameof(source)); - Guard.IsEqualTo(source.GetLength(1), texture.Width, nameof(source)); + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + public static unsafe void CopyFrom(this Texture2D texture, T[,] source) + where T : unmanaged + { + Guard.IsEqualTo(source.GetLength(0), texture.Height, nameof(source)); + Guard.IsEqualTo(source.GetLength(1), texture.Width, nameof(source)); - texture.CopyFrom(ref source[0, 0], source.Length, 0, 0, texture.Width, texture.Height); - } + texture.CopyFrom(ref source[0, 0], source.Length, 0, 0, texture.Width, texture.Height); + } - /// - /// Writes the contents of a given array to the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - public static void CopyFrom(this Texture2D texture, T[] source) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(), 0, 0, texture.Width, texture.Height); - } + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + public static void CopyFrom(this Texture2D texture, T[] source) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), 0, 0, texture.Width, texture.Height); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The horizontal range of items to write. - /// The vertical range of items to write. - public static void CopyFrom(this Texture2D texture, T[] source, Range x, Range y) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(), x, y); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + public static void CopyFrom(this Texture2D texture, T[] source, Range x, Range y) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - public static void CopyFrom(this Texture2D texture, T[] source, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(), x, y, width, height); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + public static void CopyFrom(this Texture2D texture, T[] source, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y, width, height); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The starting offset within to read data from. - /// The horizontal range of items to write. - /// The vertical range of items to write. - public static void CopyFrom(this Texture2D texture, T[] source, int offset, Range x, Range y) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(offset), x, y); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + public static void CopyFrom(this Texture2D texture, T[] source, int offset, Range x, Range y) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The starting offset within to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - public static void CopyFrom(this Texture2D texture, T[] source, int offset, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(offset), x, y, width, height); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + public static void CopyFrom(this Texture2D texture, T[] source, int offset, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y, width, height); + } - /// - /// Writes the contents of a given to the current instance. - /// The input data will be written to the start of the texture, and all input items will be copied. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input to read data from. - public static void CopyFrom(this Texture2D texture, ReadOnlySpan source) - where T : unmanaged - { - texture.CopyFrom(source, 0, 0, texture.Width, texture.Height); - } + /// + /// Writes the contents of a given to the current instance. + /// The input data will be written to the start of the texture, and all input items will be copied. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + public static void CopyFrom(this Texture2D texture, ReadOnlySpan source) + where T : unmanaged + { + texture.CopyFrom(source, 0, 0, texture.Width, texture.Height); + } - /// - /// Writes the contents of a given to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input to read data from. - /// The horizontal range of items to write. - /// The vertical range of items to write. - public static void CopyFrom(this Texture2D texture, ReadOnlySpan source, Range x, Range y) - where T : unmanaged - { - var (offsetX, width) = x.GetOffsetAndLength(texture.Width); - var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + public static void CopyFrom(this Texture2D texture, ReadOnlySpan source, Range x, Range y) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); - texture.CopyFrom(source, offsetX, offsetY, width, height); - } + texture.CopyFrom(source, offsetX, offsetY, width, height); + } - /// - /// Writes the contents of a given to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - public static void CopyFrom(this Texture2D texture, ReadOnlySpan source, int x, int y, int width, int height) - where T : unmanaged - { - texture.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, x, y, width, height); - } + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + public static void CopyFrom(this Texture2D texture, ReadOnlySpan source, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, x, y, width, height); + } - /// - /// Saves a texture to a specified file. - /// - /// The type of items to store in the texture. - /// The texture to save to an image. - /// The filename of the image file to save. - public static void Save(this Texture2D texture, ReadOnlySpan filename) - where T : unmanaged - { - using ReadBackTexture2D readback = texture.GraphicsDevice.AllocateReadBackTexture2D(texture.Width, texture.Height); + /// + /// Saves a texture to a specified file. + /// + /// The type of items to store in the texture. + /// The texture to save to an image. + /// The filename of the image file to save. + public static void Save(this Texture2D texture, ReadOnlySpan filename) + where T : unmanaged + { + using ReadBackTexture2D readback = texture.GraphicsDevice.AllocateReadBackTexture2D(texture.Width, texture.Height); - texture.CopyTo(readback); + texture.CopyTo(readback); - WICHelper.Instance.SaveTexture(readback.View, filename); - } + WICHelper.Instance.SaveTexture(readback.View, filename); } } diff --git a/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs index 83c0837d..436b1be1 100644 --- a/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs @@ -4,330 +4,329 @@ using System.Runtime.InteropServices; using ComputeSharp.Resources; using Microsoft.Toolkit.Diagnostics; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class Texture3DExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of the current instance and returns an array. /// - public static class Texture3DExtensions + /// The type of items stored on the texture. + /// The input instance to read data from. + /// A array with the contents of the current buffer. + /// + /// The returned array will be using the same memory layout as the texture, that is, each 2D plane + /// in the 3D volume represented by the texture is contiguous in memory, and planes are stacked in + /// the depth dimension. This means that the resulting 3D array will have a size of [D, H, W]. + /// + [Pure] + public static T[,,] ToArray(this Texture3D texture) + where T : unmanaged { - /// - /// Reads the contents of the current instance and returns an array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// A array with the contents of the current buffer. - /// - /// The returned array will be using the same memory layout as the texture, that is, each 2D plane - /// in the 3D volume represented by the texture is contiguous in memory, and planes are stacked in - /// the depth dimension. This means that the resulting 3D array will have a size of [D, H, W]. - /// - [Pure] - public static T[,,] ToArray(this Texture3D texture) - where T : unmanaged - { - T[,,] data = new T[texture.Depth, texture.Height, texture.Width]; + T[,,] data = new T[texture.Depth, texture.Height, texture.Width]; - texture.CopyTo(data); + texture.CopyTo(data); - return data; - } + return data; + } - /// - /// Reads the contents of the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// - /// The input 3D array needs to have each 2D plane stacked on the depth axis. That is, the expected - /// layout of the input array has to be of shape [depth, height, width]. - /// - public static void CopyTo(this Texture3D texture, T[,,] destination) - where T : unmanaged - { - Guard.IsEqualTo(destination.GetLength(0), texture.Depth, nameof(destination)); - Guard.IsEqualTo(destination.GetLength(1), texture.Height, nameof(destination)); - Guard.IsEqualTo(destination.GetLength(2), texture.Width, nameof(destination)); + /// + /// Reads the contents of the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// + /// The input 3D array needs to have each 2D plane stacked on the depth axis. That is, the expected + /// layout of the input array has to be of shape [depth, height, width]. + /// + public static void CopyTo(this Texture3D texture, T[,,] destination) + where T : unmanaged + { + Guard.IsEqualTo(destination.GetLength(0), texture.Depth, nameof(destination)); + Guard.IsEqualTo(destination.GetLength(1), texture.Height, nameof(destination)); + Guard.IsEqualTo(destination.GetLength(2), texture.Width, nameof(destination)); - texture.CopyTo(ref destination[0, 0, 0], destination.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + texture.CopyTo(ref destination[0, 0, 0], destination.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - public static void CopyTo(this Texture3D texture, T[] destination, int offset) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(offset), 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + public static void CopyTo(this Texture3D texture, T[] destination, int offset) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - /// The horizontal range of items to copy. - /// The vertical range of items to copy. - /// The depthwise range of items to copy. - public static void CopyTo(this Texture3D texture, T[] destination, int offset, Range x, Range y, Range z) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(offset), x, y, z); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + /// The depthwise range of items to copy. + public static void CopyTo(this Texture3D texture, T[] destination, int offset, Range x, Range y, Range z) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y, z); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target array. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input array to write data to. - /// The starting offset within to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - /// The depth of the memory area to copy. - public static void CopyTo(this Texture3D texture, T[] destination, int offset, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - texture.CopyTo(destination.AsSpan(offset), x, y, z, width, height, depth); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this Texture3D texture, T[] destination, int offset, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y, z, width, height, depth); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target . - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input to write data to. - public static void CopyTo(this Texture3D texture, Span destination) - where T : unmanaged - { - texture.CopyTo(destination, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + public static void CopyTo(this Texture3D texture, Span destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target . - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input to write data to. - /// The horizontal range in the source texture. - /// The vertical range in the source texture. - /// The depthwise range in the source texture. - public static void CopyTo(this Texture3D texture, Span destination, Range x, Range y, Range z) - where T : unmanaged - { - var (offsetX, width) = x.GetOffsetAndLength(texture.Width); - var (offsetY, height) = y.GetOffsetAndLength(texture.Height); - var (offsetZ, depth) = z.GetOffsetAndLength(texture.Depth); + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal range in the source texture. + /// The vertical range in the source texture. + /// The depthwise range in the source texture. + public static void CopyTo(this Texture3D texture, Span destination, Range x, Range y, Range z) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + var (offsetZ, depth) = z.GetOffsetAndLength(texture.Depth); - texture.CopyTo(destination, offsetX, offsetY, offsetZ, width, height, depth); - } + texture.CopyTo(destination, offsetX, offsetY, offsetZ, width, height, depth); + } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target . - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The input to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - /// The depth of the memory area to copy. - public static void CopyTo(this Texture3D texture, Span destination, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - texture.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, x, y, z, width, height, depth); - } + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this Texture3D texture, Span destination, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, x, y, z, width, height, depth); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - public static void CopyTo(this Texture3D texture, ReadBackTexture3D destination) - where T : unmanaged - { - texture.CopyTo(destination, 0, 0, 0, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this Texture3D texture, ReadBackTexture3D destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - /// The depth of the memory area to copy. - public static void CopyTo(this Texture3D texture, ReadBackTexture3D destination, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - texture.CopyTo(destination, 0, 0, 0, x, y, z, width, height, depth); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this Texture3D texture, ReadBackTexture3D destination, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, x, y, z, width, height, depth); + } - /// - /// Writes the contents of a given array to the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// - /// The source 3D array needs to have each 2D plane stacked on the depth axis. That is, the expected - /// layout of the input array has to be of shape [depth, height, width]. - /// - public static void CopyFrom(this Texture3D texture, T[,,] source) - where T : unmanaged - { - Guard.IsEqualTo(source.GetLength(0), texture.Depth, nameof(source)); - Guard.IsEqualTo(source.GetLength(1), texture.Height, nameof(source)); - Guard.IsEqualTo(source.GetLength(2), texture.Width, nameof(source)); + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. That is, the expected + /// layout of the input array has to be of shape [depth, height, width]. + /// + public static void CopyFrom(this Texture3D texture, T[,,] source) + where T : unmanaged + { + Guard.IsEqualTo(source.GetLength(0), texture.Depth, nameof(source)); + Guard.IsEqualTo(source.GetLength(1), texture.Height, nameof(source)); + Guard.IsEqualTo(source.GetLength(2), texture.Width, nameof(source)); - texture.CopyFrom(ref source[0, 0, 0], source.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + texture.CopyFrom(ref source[0, 0, 0], source.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Writes the contents of a given array to the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - public static void CopyFrom(this Texture3D texture, T[] source) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(), 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + public static void CopyFrom(this Texture3D texture, T[] source) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The horizontal range of items to write. - /// The vertical range of items to write. - /// The depthwise range of items to write. - public static void CopyFrom(this Texture3D texture, T[] source, Range x, Range y, Range z) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(), x, y, z); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + /// The depthwise range of items to write. + public static void CopyFrom(this Texture3D texture, T[] source, Range x, Range y, Range z) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y, z); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The depthwise offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - /// The depth of the memory area to write to. - public static void CopyFrom(this Texture3D texture, T[] source, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(), x, y, z, width, height, depth); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + public static void CopyFrom(this Texture3D texture, T[] source, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y, z, width, height, depth); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The starting offset within to read data from. - /// The horizontal range of items to write. - /// The vertical range of items to write. - /// The depthwise range of items to write. - public static void CopyFrom(this Texture3D texture, T[] source, int offset, Range x, Range y, Range z) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(offset), x, y, z); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + /// The depthwise range of items to write. + public static void CopyFrom(this Texture3D texture, T[] source, int offset, Range x, Range y, Range z) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y, z); + } - /// - /// Writes the contents of a given array to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input array to read data from. - /// The starting offset within to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The depthwise offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - /// The depth of the memory area to write to. - public static void CopyFrom(this Texture3D texture, T[] source, int offset, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - texture.CopyFrom(source.AsSpan(offset), x, y, z, width, height, depth); - } + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + public static void CopyFrom(this Texture3D texture, T[] source, int offset, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y, z, width, height, depth); + } - /// - /// Writes the contents of a given to the current instance. - /// The input data will be written to the start of the texture, and all input items will be copied. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input to read data from. - public static void CopyFrom(this Texture3D texture, ReadOnlySpan source) - where T : unmanaged - { - texture.CopyFrom(source, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + /// + /// Writes the contents of a given to the current instance. + /// The input data will be written to the start of the texture, and all input items will be copied. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + public static void CopyFrom(this Texture3D texture, ReadOnlySpan source) + where T : unmanaged + { + texture.CopyFrom(source, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Writes the contents of a given to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input to read data from. - /// The horizontal range of items to write. - /// The vertical range of items to write. - /// The depthwise range of items to write. - public static void CopyFrom(this Texture3D texture, ReadOnlySpan source, Range x, Range y, Range z) - where T : unmanaged - { - var (offsetX, width) = x.GetOffsetAndLength(texture.Width); - var (offsetY, height) = y.GetOffsetAndLength(texture.Height); - var (offsetZ, depth) = z.GetOffsetAndLength(texture.Depth); + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + /// The depthwise range of items to write. + public static void CopyFrom(this Texture3D texture, ReadOnlySpan source, Range x, Range y, Range z) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + var (offsetZ, depth) = z.GetOffsetAndLength(texture.Depth); - texture.CopyFrom(source, offsetX, offsetY, offsetZ, width, height, depth); - } + texture.CopyFrom(source, offsetX, offsetY, offsetZ, width, height, depth); + } - /// - /// Writes the contents of a given to a specified area of the current instance. - /// - /// The type of items stored on the texture. - /// The target instance to write data to. - /// The input to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The depthwise offseet in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - /// The depth of the memory area to write to. - public static void CopyFrom(this Texture3D texture, ReadOnlySpan source, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - texture.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, x, y, z, width, height, depth); - } + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offseet in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + public static void CopyFrom(this Texture3D texture, ReadOnlySpan source, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, x, y, z, width, height, depth); } } diff --git a/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs index 113b1c43..6dc443e8 100644 --- a/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs @@ -1,37 +1,36 @@ using ComputeSharp.Resources; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class UploadBufferExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of a instance and writes them into a target instance. /// - public static class UploadBufferExtensions + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this UploadBuffer buffer, StructuredBuffer destination) + where T : unmanaged { - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The target instance to write data to. - public static void CopyTo(this UploadBuffer buffer, StructuredBuffer destination) - where T : unmanaged - { - destination.CopyFrom(buffer, 0, buffer.Length, 0); - } + destination.CopyFrom(buffer, 0, buffer.Length, 0); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the buffer. - /// The input instance to read data from. - /// The target instance to write data to. - /// The starting offset within to write data to. - /// The offset to start reading data from. - /// The number of items to read. - public static void CopyTo(this UploadBuffer buffer, StructuredBuffer destination, int destinationOffset, int bufferOffset, int count) - where T : unmanaged - { - destination.CopyFrom(buffer, bufferOffset, count, destinationOffset); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + /// The starting offset within to write data to. + /// The offset to start reading data from. + /// The number of items to read. + public static void CopyTo(this UploadBuffer buffer, StructuredBuffer destination, int destinationOffset, int bufferOffset, int count) + where T : unmanaged + { + destination.CopyFrom(buffer, bufferOffset, count, destinationOffset); } } diff --git a/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs index 5b95c66b..ffb6b4d6 100644 --- a/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs @@ -1,38 +1,37 @@ using ComputeSharp.Resources; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class UploadTexture2DExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of a instance and writes them into a target instance. /// - public static class UploadTexture2DExtensions + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this UploadTexture2D texture, Texture2D destination) + where T : unmanaged { - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - public static void CopyTo(this UploadTexture2D texture, Texture2D destination) - where T : unmanaged - { - destination.CopyFrom(texture, 0, 0, 0, 0, texture.Width, texture.Height); - } + destination.CopyFrom(texture, 0, 0, 0, 0, texture.Width, texture.Height); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - public static void CopyTo(this UploadTexture2D texture, Texture2D destination, int x, int y, int width, int height) - where T : unmanaged - { - destination.CopyFrom(texture, x, y, 0, 0, width, height); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this UploadTexture2D texture, Texture2D destination, int x, int y, int width, int height) + where T : unmanaged + { + destination.CopyFrom(texture, x, y, 0, 0, width, height); } } diff --git a/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs index d5e42e85..6bd980f8 100644 --- a/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs +++ b/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs @@ -1,40 +1,39 @@ using ComputeSharp.Resources; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that contains extension methods for the type. +/// +public static class UploadTexture3DExtensions { /// - /// A that contains extension methods for the type. + /// Reads the contents of a instance and writes them into a target instance. /// - public static class UploadTexture3DExtensions + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this UploadTexture3D texture, Texture3D destination) + where T : unmanaged { - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - public static void CopyTo(this UploadTexture3D texture, Texture3D destination) - where T : unmanaged - { - destination.CopyFrom(texture, 0, 0, 0, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - } + destination.CopyFrom(texture, 0, 0, 0, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } - /// - /// Reads the contents of a instance and writes them into a target instance. - /// - /// The type of items stored on the texture. - /// The input instance to read data from. - /// The target instance to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - /// The depth of the memory area to copy. - public static void CopyTo(this UploadTexture3D texture, Texture3D destination, int x, int y, int z, int width, int height, int depth) - where T : unmanaged - { - destination.CopyFrom(texture, x, y, z, 0, 0, 0, width, height, depth); - } + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this UploadTexture3D texture, Texture3D destination, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + destination.CopyFrom(texture, x, y, z, 0, 0, 0, width, height, depth); } } diff --git a/src/ComputeSharp/Graphics/GraphicsDevice.cs b/src/ComputeSharp/Graphics/GraphicsDevice.cs index f11840c8..12ac2757 100644 --- a/src/ComputeSharp/Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp/Graphics/GraphicsDevice.cs @@ -15,392 +15,391 @@ using static TerraFX.Interop.D3D12_FEATURE; using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; using static TerraFX.Interop.DXGI_ADAPTER_FLAG; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A that represents an instance that can be used to run compute shaders. +/// +[DebuggerDisplay("{ToString(),raw}")] +public sealed unsafe class GraphicsDevice : NativeObject { /// - /// A that represents an instance that can be used to run compute shaders. + /// The underlying wrapped by the current instance. /// - [DebuggerDisplay("{ToString(),raw}")] - public sealed unsafe class GraphicsDevice : NativeObject + private ComPtr d3D12Device; + + /// + /// The instance to use for compute operations. + /// + private ComPtr d3D12ComputeCommandQueue; + + /// + /// The instance to use for copy operations. + /// + private ComPtr d3D12CopyCommandQueue; + + /// + /// The instance used for compute operations. + /// + private ComPtr d3D12ComputeFence; + + /// + /// The instance used for copy operations. + /// + private ComPtr d3D12CopyFence; + + /// + /// The instance to use when allocating new buffers. + /// + private ID3D12DescriptorHandleAllocator shaderResourceViewDescriptorAllocator; + + /// + /// The instance for compute operations. + /// + private readonly ID3D12CommandListPool computeCommandListPool; + + /// + /// Gets the instance for copy operations. + /// + private readonly ID3D12CommandListPool copyCommandListPool; + + /// + /// The next fence value for compute operations using . + /// + private ulong nextD3D12ComputeFenceValue; + + /// + /// The next fence value for copy operations using . + /// + private ulong nextD3D12CopyFenceValue; + + /// + /// The in use associated to the current device. + /// + private ReferenceCountPtr allocator; + + /// + /// The instance in use, if is . + /// + private ReferenceCountPtr pool; + + /// + /// Creates a new instance for the input . + /// + /// The to use for the new instance. + /// The that was created from. + /// The available info for the new instance. + internal GraphicsDevice(ID3D12Device* d3D12Device, IDXGIAdapter* dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) { - /// - /// The underlying wrapped by the current instance. - /// - private ComPtr d3D12Device; + this.d3D12Device = new ComPtr(d3D12Device); - /// - /// The instance to use for compute operations. - /// - private ComPtr d3D12ComputeCommandQueue; + this.d3D12ComputeCommandQueue = d3D12Device->CreateCommandQueue(D3D12_COMMAND_LIST_TYPE_COMPUTE); + this.d3D12CopyCommandQueue = d3D12Device->CreateCommandQueue(D3D12_COMMAND_LIST_TYPE_COPY); + this.d3D12ComputeFence = d3D12Device->CreateFence(); + this.d3D12CopyFence = d3D12Device->CreateFence(); - /// - /// The instance to use for copy operations. - /// - private ComPtr d3D12CopyCommandQueue; + this.shaderResourceViewDescriptorAllocator = new ID3D12DescriptorHandleAllocator(d3D12Device); + this.computeCommandListPool = new ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE_COMPUTE); + this.copyCommandListPool = new ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE_COPY); - /// - /// The instance used for compute operations. - /// - private ComPtr d3D12ComputeFence; + Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + Name = new string((char*)dxgiDescription1->Description); + DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory; + SharedMemorySize = dxgiDescription1->SharedSystemMemory; + IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0; - /// - /// The instance used for copy operations. - /// - private ComPtr d3D12CopyFence; + var d3D12Options1Data = d3D12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1); - /// - /// The instance to use when allocating new buffers. - /// - private ID3D12DescriptorHandleAllocator shaderResourceViewDescriptorAllocator; + ComputeUnits = d3D12Options1Data.TotalLaneCount; + WavefrontSize = d3D12Options1Data.WaveLaneCountMin; - /// - /// The instance for compute operations. - /// - private readonly ID3D12CommandListPool computeCommandListPool; + var d3D12Architecture1Data = d3D12Device->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1); - /// - /// Gets the instance for copy operations. - /// - private readonly ID3D12CommandListPool copyCommandListPool; + IsCacheCoherentUMA = d3D12Architecture1Data.CacheCoherentUMA != 0; - /// - /// The next fence value for compute operations using . - /// - private ulong nextD3D12ComputeFenceValue; + this.allocator = d3D12Device->CreateAllocator(dxgiAdapter); - /// - /// The next fence value for copy operations using . - /// - private ulong nextD3D12CopyFenceValue; - - /// - /// The in use associated to the current device. - /// - private ReferenceCountPtr allocator; - - /// - /// The instance in use, if is . - /// - private ReferenceCountPtr pool; - - /// - /// Creates a new instance for the input . - /// - /// The to use for the new instance. - /// The that was created from. - /// The available info for the new instance. - internal GraphicsDevice(ID3D12Device* d3D12Device, IDXGIAdapter* dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + if (IsCacheCoherentUMA) { - this.d3D12Device = new ComPtr(d3D12Device); - - this.d3D12ComputeCommandQueue = d3D12Device->CreateCommandQueue(D3D12_COMMAND_LIST_TYPE_COMPUTE); - this.d3D12CopyCommandQueue = d3D12Device->CreateCommandQueue(D3D12_COMMAND_LIST_TYPE_COPY); - this.d3D12ComputeFence = d3D12Device->CreateFence(); - this.d3D12CopyFence = d3D12Device->CreateFence(); - - this.shaderResourceViewDescriptorAllocator = new ID3D12DescriptorHandleAllocator(d3D12Device); - this.computeCommandListPool = new ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE_COMPUTE); - this.copyCommandListPool = new ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE_COPY); - - Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); - Name = new string((char*)dxgiDescription1->Description); - DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory; - SharedMemorySize = dxgiDescription1->SharedSystemMemory; - IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0; - - var d3D12Options1Data = d3D12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1); - - ComputeUnits = d3D12Options1Data.TotalLaneCount; - WavefrontSize = d3D12Options1Data.WaveLaneCountMin; - - var d3D12Architecture1Data = d3D12Device->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1); - - IsCacheCoherentUMA = d3D12Architecture1Data.CacheCoherentUMA != 0; - - this.allocator = d3D12Device->CreateAllocator(dxgiAdapter); - - if (IsCacheCoherentUMA) - { - this.pool = this.allocator.Get()->CreatePoolForCacheCoherentUMA(); - } - } - - /// - /// Gets the locally unique identifier for the current device. - /// - public Luid Luid { get; } - - /// - /// Gets the name of the current instance. - /// - public string Name { get; } - - /// - /// Gets the size of the dedicated memory for the current device. - /// - public nuint DedicatedMemorySize { get; } - - /// - /// Gets the size of the shared system memory for the current device. - /// - public nuint SharedMemorySize { get; } - - /// - /// Gets whether or not the current device is hardware accelerated. - /// This value is for software fallback devices. - /// - public bool IsHardwareAccelerated { get; } - - /// - /// Gets the number of total lanes on the current device (eg. CUDA cores on an nVidia GPU). - /// - public uint ComputeUnits { get; } - - /// - /// Gets the number of lanes in a SIMD wave on the current device (also known as "wavefront size" or "warp width"). - /// - public uint WavefrontSize { get; } - - /// - /// Gets the underlying wrapped by the current instance. - /// - internal ID3D12Device* D3D12Device => this.d3D12Device; - - /// - /// Gets the underlying wrapped by the current instance. - /// - internal D3D12MA_Allocator* Allocator => this.allocator; - - /// - /// Gets the underlying wrapped by the current instance, if any. - /// - internal D3D12MA_Pool* Pool => this.pool; - - /// - /// Gets whether or not the current device has a cache coherent UMA architecture. - /// - internal bool IsCacheCoherentUMA { get; } - - /// - /// Checks whether the current device supports the creation of - /// resources for a specified type . - /// - /// The type of values to check support for. - /// Whether instances can be created by the current device. - [Pure] - public bool IsReadOnlyTexture2DSupportedForType() - where T : unmanaged - { - ThrowIfDisposed(); - - return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE2D); - } - - /// - /// Checks whether the current device supports the creation of - /// resources for a specified type . - /// - /// The type of values to check support for. - /// Whether instances can be created by the current device. - [Pure] - public bool IsReadWriteTexture2DSupportedForType() - where T : unmanaged - { - ThrowIfDisposed(); - - return this.d3D12Device.Get()->IsDxgiFormatSupported( - DXGIFormatHelper.GetForType(), - D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW); - } - - /// - /// Checks whether the current device supports the creation of - /// resources for a specified type . - /// - /// The type of values to check support for. - /// Whether instances can be created by the current device. - [Pure] - public bool IsReadOnlyTexture3DSupportedForType() - where T : unmanaged - { - ThrowIfDisposed(); - - return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE3D); - } - - /// - /// Checks whether the current device supports the creation of - /// resources for a specified type . - /// - /// The type of values to check support for. - /// Whether instances can be created by the current device. - [Pure] - public bool IsReadWriteTexture3DSupportedForType() - where T : unmanaged - { - ThrowIfDisposed(); - - return this.d3D12Device.Get()->IsDxgiFormatSupported( - DXGIFormatHelper.GetForType(), - D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW); - } - - /// - /// Registers that a new resource has been allocated on the current device. - /// - internal void RegisterAllocatedResource() - { - this.pool.AddRef(); - this.allocator.AddRef(); - } - - /// - /// Unregisters a generic resource that was allocated on the current device. - /// - internal void UnregisterAllocatedResource() - { - this.pool.Dispose(); - this.allocator.Dispose(); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void RentShaderResourceViewDescriptorHandles( - out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, - out D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) - { - this.shaderResourceViewDescriptorAllocator.Rent(out d3D12CpuDescriptorHandle, out d3D12GpuDescriptorHandle); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ReturnShaderResourceViewDescriptorHandles( - D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) - { - this.shaderResourceViewDescriptorAllocator.Return(d3D12CpuDescriptorHandle, d3D12GpuDescriptorHandle); - } - - /// - /// The type of command allocator to rent. - /// The resulting value. - /// The resulting value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void GetCommandListAndAllocator( - D3D12_COMMAND_LIST_TYPE d3D12CommandListType, - out ID3D12GraphicsCommandList* d3D12CommandList, - out ID3D12CommandAllocator* d3D12CommandAllocator) - { - switch (d3D12CommandListType) - { - case D3D12_COMMAND_LIST_TYPE_COMPUTE: - this.computeCommandListPool.Rent(this.d3D12Device.Get(), null, out d3D12CommandList, out d3D12CommandAllocator); - break; - case D3D12_COMMAND_LIST_TYPE_COPY: - this.copyCommandListPool.Rent(this.d3D12Device.Get(), null, out d3D12CommandList, out d3D12CommandAllocator); - break; - default: - ThrowHelper.ThrowArgumentException>(); - d3D12CommandList = null; - d3D12CommandAllocator = null; - break; - } - } - - /// - /// The instance to use for the new command list. - /// The resulting value. - /// The resulting value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void GetCommandListAndAllocator( - ID3D12PipelineState* d3D12PipelineState, - out ID3D12GraphicsCommandList* d3D12CommandList, - out ID3D12CommandAllocator* d3D12CommandAllocator) - { - this.computeCommandListPool.Rent(this.d3D12Device.Get(), d3D12PipelineState, out d3D12CommandList, out d3D12CommandAllocator); - } - - /// - /// Sets the descriptor heap for a given instance. - /// - /// The input instance to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void SetDescriptorHeapForCommandList(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) - { - ID3D12DescriptorHeap* d3D12DescriptorHeap = this.shaderResourceViewDescriptorAllocator.D3D12DescriptorHeap; - - d3D12GraphicsCommandList->SetDescriptorHeaps(1, &d3D12DescriptorHeap); - } - - /// - /// Executes a given command list and waits for the operation to be completed. - /// - /// The input to execute. - internal void ExecuteCommandList(ref CommandList commandList) - { - ref readonly ID3D12CommandListPool commandListPool = ref Unsafe.NullRef(); - ID3D12CommandQueue* d3D12CommandQueue; - ID3D12Fence* d3D12Fence; - ref ulong d3D12FenceValue = ref Unsafe.NullRef(); - - // Get the target command queue, fence and pool for the list type - switch (commandList.D3D12CommandListType) - { - case D3D12_COMMAND_LIST_TYPE_COMPUTE: - commandListPool = ref this.computeCommandListPool; - d3D12CommandQueue = this.d3D12ComputeCommandQueue; - d3D12Fence = this.d3D12ComputeFence; - d3D12FenceValue = ref this.nextD3D12ComputeFenceValue; - break; - case D3D12_COMMAND_LIST_TYPE_COPY: - commandListPool = ref this.copyCommandListPool; - d3D12CommandQueue = this.d3D12CopyCommandQueue; - d3D12Fence = this.d3D12CopyFence; - d3D12FenceValue = ref this.nextD3D12CopyFenceValue; - break; - default: ThrowHelper.ThrowArgumentException(); return; - } - - // Execute the command list - d3D12CommandQueue->ExecuteCommandLists(1, commandList.GetD3D12CommandListAddressOf()); - - ulong updatedFenceValue = Interlocked.Increment(ref d3D12FenceValue); - - // Signal to the target fence with the updated value. Note that incrementing the - // target fence value to signal must be done after executing the command list. - d3D12CommandQueue->Signal(d3D12Fence, updatedFenceValue).Assert(); - - // If the fence value hasn't been reached, wait until the operation completes - if (updatedFenceValue > d3D12Fence->GetCompletedValue()) - { - d3D12Fence->SetEventOnCompletion(updatedFenceValue, default).Assert(); - } - - // Return the rented command list and command allocator so that they can be reused - commandListPool.Return(commandList.DetachD3D12CommandList(), commandList.DetachD3D12CommandAllocator()); - } - - /// - protected override void OnDispose() - { - DeviceHelper.NotifyDisposedDevice(this); - - this.d3D12Device.Dispose(); - this.d3D12ComputeCommandQueue.Dispose(); - this.d3D12CopyCommandQueue.Dispose(); - this.d3D12ComputeFence.Dispose(); - this.d3D12CopyFence.Dispose(); - this.computeCommandListPool.Dispose(); - this.copyCommandListPool.Dispose(); - this.shaderResourceViewDescriptorAllocator.Dispose(); - this.pool.Dispose(); - this.allocator.Dispose(); - } - - /// - public override string ToString() - { - return $"[{Luid}] {Name}"; + this.pool = this.allocator.Get()->CreatePoolForCacheCoherentUMA(); } } + + /// + /// Gets the locally unique identifier for the current device. + /// + public Luid Luid { get; } + + /// + /// Gets the name of the current instance. + /// + public string Name { get; } + + /// + /// Gets the size of the dedicated memory for the current device. + /// + public nuint DedicatedMemorySize { get; } + + /// + /// Gets the size of the shared system memory for the current device. + /// + public nuint SharedMemorySize { get; } + + /// + /// Gets whether or not the current device is hardware accelerated. + /// This value is for software fallback devices. + /// + public bool IsHardwareAccelerated { get; } + + /// + /// Gets the number of total lanes on the current device (eg. CUDA cores on an nVidia GPU). + /// + public uint ComputeUnits { get; } + + /// + /// Gets the number of lanes in a SIMD wave on the current device (also known as "wavefront size" or "warp width"). + /// + public uint WavefrontSize { get; } + + /// + /// Gets the underlying wrapped by the current instance. + /// + internal ID3D12Device* D3D12Device => this.d3D12Device; + + /// + /// Gets the underlying wrapped by the current instance. + /// + internal D3D12MA_Allocator* Allocator => this.allocator; + + /// + /// Gets the underlying wrapped by the current instance, if any. + /// + internal D3D12MA_Pool* Pool => this.pool; + + /// + /// Gets whether or not the current device has a cache coherent UMA architecture. + /// + internal bool IsCacheCoherentUMA { get; } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadOnlyTexture2DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE2D); + } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadWriteTexture2DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported( + DXGIFormatHelper.GetForType(), + D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW); + } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadOnlyTexture3DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE3D); + } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadWriteTexture3DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported( + DXGIFormatHelper.GetForType(), + D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW); + } + + /// + /// Registers that a new resource has been allocated on the current device. + /// + internal void RegisterAllocatedResource() + { + this.pool.AddRef(); + this.allocator.AddRef(); + } + + /// + /// Unregisters a generic resource that was allocated on the current device. + /// + internal void UnregisterAllocatedResource() + { + this.pool.Dispose(); + this.allocator.Dispose(); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void RentShaderResourceViewDescriptorHandles( + out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + out D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + this.shaderResourceViewDescriptorAllocator.Rent(out d3D12CpuDescriptorHandle, out d3D12GpuDescriptorHandle); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ReturnShaderResourceViewDescriptorHandles( + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + this.shaderResourceViewDescriptorAllocator.Return(d3D12CpuDescriptorHandle, d3D12GpuDescriptorHandle); + } + + /// + /// The type of command allocator to rent. + /// The resulting value. + /// The resulting value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void GetCommandListAndAllocator( + D3D12_COMMAND_LIST_TYPE d3D12CommandListType, + out ID3D12GraphicsCommandList* d3D12CommandList, + out ID3D12CommandAllocator* d3D12CommandAllocator) + { + switch (d3D12CommandListType) + { + case D3D12_COMMAND_LIST_TYPE_COMPUTE: + this.computeCommandListPool.Rent(this.d3D12Device.Get(), null, out d3D12CommandList, out d3D12CommandAllocator); + break; + case D3D12_COMMAND_LIST_TYPE_COPY: + this.copyCommandListPool.Rent(this.d3D12Device.Get(), null, out d3D12CommandList, out d3D12CommandAllocator); + break; + default: + ThrowHelper.ThrowArgumentException>(); + d3D12CommandList = null; + d3D12CommandAllocator = null; + break; + } + } + + /// + /// The instance to use for the new command list. + /// The resulting value. + /// The resulting value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void GetCommandListAndAllocator( + ID3D12PipelineState* d3D12PipelineState, + out ID3D12GraphicsCommandList* d3D12CommandList, + out ID3D12CommandAllocator* d3D12CommandAllocator) + { + this.computeCommandListPool.Rent(this.d3D12Device.Get(), d3D12PipelineState, out d3D12CommandList, out d3D12CommandAllocator); + } + + /// + /// Sets the descriptor heap for a given instance. + /// + /// The input instance to use. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void SetDescriptorHeapForCommandList(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) + { + ID3D12DescriptorHeap* d3D12DescriptorHeap = this.shaderResourceViewDescriptorAllocator.D3D12DescriptorHeap; + + d3D12GraphicsCommandList->SetDescriptorHeaps(1, &d3D12DescriptorHeap); + } + + /// + /// Executes a given command list and waits for the operation to be completed. + /// + /// The input to execute. + internal void ExecuteCommandList(ref CommandList commandList) + { + ref readonly ID3D12CommandListPool commandListPool = ref Unsafe.NullRef(); + ID3D12CommandQueue* d3D12CommandQueue; + ID3D12Fence* d3D12Fence; + ref ulong d3D12FenceValue = ref Unsafe.NullRef(); + + // Get the target command queue, fence and pool for the list type + switch (commandList.D3D12CommandListType) + { + case D3D12_COMMAND_LIST_TYPE_COMPUTE: + commandListPool = ref this.computeCommandListPool; + d3D12CommandQueue = this.d3D12ComputeCommandQueue; + d3D12Fence = this.d3D12ComputeFence; + d3D12FenceValue = ref this.nextD3D12ComputeFenceValue; + break; + case D3D12_COMMAND_LIST_TYPE_COPY: + commandListPool = ref this.copyCommandListPool; + d3D12CommandQueue = this.d3D12CopyCommandQueue; + d3D12Fence = this.d3D12CopyFence; + d3D12FenceValue = ref this.nextD3D12CopyFenceValue; + break; + default: ThrowHelper.ThrowArgumentException(); return; + } + + // Execute the command list + d3D12CommandQueue->ExecuteCommandLists(1, commandList.GetD3D12CommandListAddressOf()); + + ulong updatedFenceValue = Interlocked.Increment(ref d3D12FenceValue); + + // Signal to the target fence with the updated value. Note that incrementing the + // target fence value to signal must be done after executing the command list. + d3D12CommandQueue->Signal(d3D12Fence, updatedFenceValue).Assert(); + + // If the fence value hasn't been reached, wait until the operation completes + if (updatedFenceValue > d3D12Fence->GetCompletedValue()) + { + d3D12Fence->SetEventOnCompletion(updatedFenceValue, default).Assert(); + } + + // Return the rented command list and command allocator so that they can be reused + commandListPool.Return(commandList.DetachD3D12CommandList(), commandList.DetachD3D12CommandAllocator()); + } + + /// + protected override void OnDispose() + { + DeviceHelper.NotifyDisposedDevice(this); + + this.d3D12Device.Dispose(); + this.d3D12ComputeCommandQueue.Dispose(); + this.d3D12CopyCommandQueue.Dispose(); + this.d3D12ComputeFence.Dispose(); + this.d3D12CopyFence.Dispose(); + this.computeCommandListPool.Dispose(); + this.copyCommandListPool.Dispose(); + this.shaderResourceViewDescriptorAllocator.Dispose(); + this.pool.Dispose(); + this.allocator.Dispose(); + } + + /// + public override string ToString() + { + return $"[{Luid}] {Name}"; + } } diff --git a/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs b/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs index 8212f7fe..9b077b67 100644 --- a/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs +++ b/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs @@ -1,50 +1,49 @@ using TerraFX.Interop; using static TerraFX.Interop.DXGI_ADAPTER_FLAG; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A type containing info on a given device that can be used. +/// +public readonly struct GraphicsDeviceInfo { /// - /// A type containing info on a given device that can be used. + /// Creates a new instance with the specified parameters. /// - public readonly struct GraphicsDeviceInfo + /// The available info for the associated device. + internal unsafe GraphicsDeviceInfo(DXGI_ADAPTER_DESC1* dxgiDescription1) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The available info for the associated device. - internal unsafe GraphicsDeviceInfo(DXGI_ADAPTER_DESC1* dxgiDescription1) - { - Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); - Name = new string((char*)dxgiDescription1->Description); - DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory; - SharedMemorySize = dxgiDescription1->SharedSystemMemory; - IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0; - } - - /// - /// Gets the locally unique identifier for the current device. - /// - public Luid Luid { get; } - - /// - /// Gets the name of the associated device. - /// - public string Name { get; } - - /// - /// Gets the size of the dedicated memory for the associated device. - /// - public nuint DedicatedMemorySize { get; } - - /// - /// Gets the size of the shared system memory for the associated device. - /// - public nuint SharedMemorySize { get; } - - /// - /// Gets whether or not the associated device is hardware accelerated. - /// This value is for software fallback devices. - /// - public bool IsHardwareAccelerated { get; } + Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + Name = new string((char*)dxgiDescription1->Description); + DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory; + SharedMemorySize = dxgiDescription1->SharedSystemMemory; + IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0; } + + /// + /// Gets the locally unique identifier for the current device. + /// + public Luid Luid { get; } + + /// + /// Gets the name of the associated device. + /// + public string Name { get; } + + /// + /// Gets the size of the dedicated memory for the associated device. + /// + public nuint DedicatedMemorySize { get; } + + /// + /// Gets the size of the shared system memory for the associated device. + /// + public nuint SharedMemorySize { get; } + + /// + /// Gets whether or not the associated device is hardware accelerated. + /// This value is for software fallback devices. + /// + public bool IsHardwareAccelerated { get; } } diff --git a/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs b/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs index 8c3e003b..127c8b0f 100644 --- a/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs @@ -5,62 +5,61 @@ using TerraFX.Interop; using static TerraFX.Interop.D3D12_FEATURE; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A helper exposing some runtime or OS dependent D3D12 features. +/// +internal static class D3D12FeatureHelper { /// - /// A helper exposing some runtime or OS dependent D3D12 features. + /// The currently supported flag (or fallback). /// - internal static class D3D12FeatureHelper - { - /// - /// The currently supported flag (or fallback). - /// - private static readonly D3D12_HEAP_FLAGS D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = GetD3D12_HEAP_FLAG_CREATE_NOT_ZEROED(); + private static readonly D3D12_HEAP_FLAGS D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = GetD3D12_HEAP_FLAG_CREATE_NOT_ZEROED(); - /// - /// Gets the value for a given setting. - /// - /// The allocation mode to use for creating new resources. - /// The matching that is currently supported - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static D3D12_HEAP_FLAGS GetD3D12HeapFlags(AllocationMode allocationMode) + /// + /// Gets the value for a given setting. + /// + /// The allocation mode to use for creating new resources. + /// The matching that is currently supported + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static D3D12_HEAP_FLAGS GetD3D12HeapFlags(AllocationMode allocationMode) + { + if (allocationMode == AllocationMode.Default) { - if (allocationMode == AllocationMode.Default) + return D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + } + + return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_NONE; + } + + /// + /// Initializes the field. + /// + /// The currently supported flag. + private static unsafe D3D12_HEAP_FLAGS GetD3D12_HEAP_FLAG_CREATE_NOT_ZEROED() + { + lock (DeviceHelper.DevicesCache) + { + foreach (KeyValuePair pair in DeviceHelper.DevicesCache) { - return D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + D3D12_FEATURE_DATA_D3D12_OPTIONS7 d3D12Options7; + + int result = pair.Value.D3D12Device->CheckFeatureSupport( + D3D12_FEATURE_D3D12_OPTIONS7, + &d3D12Options7, + (uint)sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS7)); + + if (result == FX.S_OK) + { + return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + } + + break; } return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_NONE; } - - /// - /// Initializes the field. - /// - /// The currently supported flag. - private static unsafe D3D12_HEAP_FLAGS GetD3D12_HEAP_FLAG_CREATE_NOT_ZEROED() - { - lock (DeviceHelper.DevicesCache) - { - foreach (KeyValuePair pair in DeviceHelper.DevicesCache) - { - D3D12_FEATURE_DATA_D3D12_OPTIONS7 d3D12Options7; - - int result = pair.Value.D3D12Device->CheckFeatureSupport( - D3D12_FEATURE_D3D12_OPTIONS7, - &d3D12Options7, - (uint)sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS7)); - - if (result == FX.S_OK) - { - return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; - } - - break; - } - - return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_NONE; - } - } } } diff --git a/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs index c12698ae..f9eddcfe 100644 --- a/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs @@ -5,47 +5,46 @@ using Microsoft.Toolkit.Diagnostics; using TerraFX.Interop; using static TerraFX.Interop.DXGI_FORMAT; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A helper type with utility methods for . +/// +internal static class DXGIFormatHelper { /// - /// A helper type with utility methods for . + /// Gets the appropriate value for the input type argument. /// - internal static class DXGIFormatHelper + /// The input type argument to get the corresponding for. + /// The value corresponding to . + /// Thrown when the input type is not supported. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static DXGI_FORMAT GetForType() + where T : unmanaged { - /// - /// Gets the appropriate value for the input type argument. - /// - /// The input type argument to get the corresponding for. - /// The value corresponding to . - /// Thrown when the input type is not supported. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static DXGI_FORMAT GetForType() - where T : unmanaged - { - if (typeof(T) == typeof(int)) return DXGI_FORMAT_R32_SINT; - else if (typeof(T) == typeof(Int2)) return DXGI_FORMAT_R32G32_SINT; - else if (typeof(T) == typeof(Int3)) return DXGI_FORMAT_R32G32B32_SINT; - else if (typeof(T) == typeof(Int4)) return DXGI_FORMAT_R32G32B32A32_SINT; - else if (typeof(T) == typeof(uint)) return DXGI_FORMAT_R32_UINT; - else if (typeof(T) == typeof(UInt2)) return DXGI_FORMAT_R32G32_UINT; - else if (typeof(T) == typeof(UInt3)) return DXGI_FORMAT_R32G32B32_UINT; - else if (typeof(T) == typeof(UInt4)) return DXGI_FORMAT_R32G32B32A32_UINT; - else if (typeof(T) == typeof(float)) return DXGI_FORMAT_R32_FLOAT; - else if (typeof(T) == typeof(Float2)) return DXGI_FORMAT_R32G32_FLOAT; - else if (typeof(T) == typeof(Float3)) return DXGI_FORMAT_R32G32B32_FLOAT; - else if (typeof(T) == typeof(Float4)) return DXGI_FORMAT_R32G32B32A32_FLOAT; - else if (typeof(T) == typeof(Vector2)) return DXGI_FORMAT_R32G32_FLOAT; - else if (typeof(T) == typeof(Vector3)) return DXGI_FORMAT_R32G32B32_FLOAT; - else if (typeof(T) == typeof(Vector4)) return DXGI_FORMAT_R32G32B32A32_FLOAT; - else if (typeof(T) == typeof(Bgra32)) return DXGI_FORMAT_B8G8R8A8_UNORM; - else if (typeof(T) == typeof(Rgba32)) return DXGI_FORMAT_R8G8B8A8_UNORM; - else if (typeof(T) == typeof(Rgba64)) return DXGI_FORMAT_R16G16B16A16_UNORM; - else if (typeof(T) == typeof(R8)) return DXGI_FORMAT_R8_UNORM; - else if (typeof(T) == typeof(R16)) return DXGI_FORMAT_R16_UNORM; - else if (typeof(T) == typeof(Rg16)) return DXGI_FORMAT_R8G8_UNORM; - else if (typeof(T) == typeof(Rg32)) return DXGI_FORMAT_R16G16_UNORM; - else return ThrowHelper.ThrowArgumentException("Invalid texture type"); - } + if (typeof(T) == typeof(int)) return DXGI_FORMAT_R32_SINT; + else if (typeof(T) == typeof(Int2)) return DXGI_FORMAT_R32G32_SINT; + else if (typeof(T) == typeof(Int3)) return DXGI_FORMAT_R32G32B32_SINT; + else if (typeof(T) == typeof(Int4)) return DXGI_FORMAT_R32G32B32A32_SINT; + else if (typeof(T) == typeof(uint)) return DXGI_FORMAT_R32_UINT; + else if (typeof(T) == typeof(UInt2)) return DXGI_FORMAT_R32G32_UINT; + else if (typeof(T) == typeof(UInt3)) return DXGI_FORMAT_R32G32B32_UINT; + else if (typeof(T) == typeof(UInt4)) return DXGI_FORMAT_R32G32B32A32_UINT; + else if (typeof(T) == typeof(float)) return DXGI_FORMAT_R32_FLOAT; + else if (typeof(T) == typeof(Float2)) return DXGI_FORMAT_R32G32_FLOAT; + else if (typeof(T) == typeof(Float3)) return DXGI_FORMAT_R32G32B32_FLOAT; + else if (typeof(T) == typeof(Float4)) return DXGI_FORMAT_R32G32B32A32_FLOAT; + else if (typeof(T) == typeof(Vector2)) return DXGI_FORMAT_R32G32_FLOAT; + else if (typeof(T) == typeof(Vector3)) return DXGI_FORMAT_R32G32B32_FLOAT; + else if (typeof(T) == typeof(Vector4)) return DXGI_FORMAT_R32G32B32A32_FLOAT; + else if (typeof(T) == typeof(Bgra32)) return DXGI_FORMAT_B8G8R8A8_UNORM; + else if (typeof(T) == typeof(Rgba32)) return DXGI_FORMAT_R8G8B8A8_UNORM; + else if (typeof(T) == typeof(Rgba64)) return DXGI_FORMAT_R16G16B16A16_UNORM; + else if (typeof(T) == typeof(R8)) return DXGI_FORMAT_R8_UNORM; + else if (typeof(T) == typeof(R16)) return DXGI_FORMAT_R16_UNORM; + else if (typeof(T) == typeof(Rg16)) return DXGI_FORMAT_R8G8_UNORM; + else if (typeof(T) == typeof(Rg32)) return DXGI_FORMAT_R16G16_UNORM; + else return ThrowHelper.ThrowArgumentException("Invalid texture type"); } } diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs index 0eba5434..83a94ad5 100644 --- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs @@ -11,205 +11,204 @@ using static TerraFX.Interop.D3D_FEATURE_LEVEL; using static TerraFX.Interop.D3D_SHADER_MODEL; using static TerraFX.Interop.DXGI_GPU_PREFERENCE; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +internal static partial class DeviceHelper { - /// - internal static partial class DeviceHelper + /// + /// A custom query type that iterates through devices matching a given predicate. + /// + public sealed unsafe class DeviceQuery : IEnumerable { /// - /// A custom query type that iterates through devices matching a given predicate. + /// The instance to use to select devices to create. /// - public sealed unsafe class DeviceQuery : IEnumerable + private readonly Predicate? predicate; + + /// + /// Creates a new instance for the given predicate. + /// + /// The input predicate to select devices to create. + public DeviceQuery(Predicate? predicate) + { + this.predicate = predicate; + } + + /// + public IEnumerator GetEnumerator() + { + return new Enumerator(this.predicate); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return new Enumerator(this.predicate); + } + + /// + /// The enumerator type for a instance. + /// + private sealed unsafe class Enumerator : NativeObject, IEnumerator { /// - /// The instance to use to select devices to create. + /// The instance to use to select devices to create, if present. /// private readonly Predicate? predicate; + /// + /// The instance used to enumerate devices. + /// + private ComPtr dxgiFactory6; + + /// + /// Indicates whether or not the enumerator has already been initialized and is set. + /// + private bool isInitialized; + + /// + /// The current adapter index to enumerate adapters from . + /// + private uint index; + + /// + /// Indicates whether or not the enumerator has completed the enumeration of all possible devices. + /// + private bool isCompleted; + + /// + /// The current instance to return. + /// + private GraphicsDevice? graphicsDevice; + /// /// Creates a new instance for the given predicate. /// /// The input predicate to select devices to create. - public DeviceQuery(Predicate? predicate) + public Enumerator(Predicate? predicate) { this.predicate = predicate; } /// - public IEnumerator GetEnumerator() - { - return new Enumerator(this.predicate); - } + public GraphicsDevice Current => this.graphicsDevice!; /// - IEnumerator IEnumerable.GetEnumerator() + object IEnumerator.Current => this.graphicsDevice!; + + /// + public bool MoveNext() { - return new Enumerator(this.predicate); - } - - /// - /// The enumerator type for a instance. - /// - private sealed unsafe class Enumerator : NativeObject, IEnumerator - { - /// - /// The instance to use to select devices to create, if present. - /// - private readonly Predicate? predicate; - - /// - /// The instance used to enumerate devices. - /// - private ComPtr dxgiFactory6; - - /// - /// Indicates whether or not the enumerator has already been initialized and is set. - /// - private bool isInitialized; - - /// - /// The current adapter index to enumerate adapters from . - /// - private uint index; - - /// - /// Indicates whether or not the enumerator has completed the enumeration of all possible devices. - /// - private bool isCompleted; - - /// - /// The current instance to return. - /// - private GraphicsDevice? graphicsDevice; - - /// - /// Creates a new instance for the given predicate. - /// - /// The input predicate to select devices to create. - public Enumerator(Predicate? predicate) + if (!this.isInitialized) { - this.predicate = predicate; + this.isInitialized = true; + + fixed (IDXGIFactory6** dxgiFactory6 = this.dxgiFactory6) + { + CreateDXGIFactory6(dxgiFactory6); + } } - /// - public GraphicsDevice Current => this.graphicsDevice!; + if (this.isCompleted) return false; - /// - object IEnumerator.Current => this.graphicsDevice!; - - /// - public bool MoveNext() + while (true) { - if (!this.isInitialized) + using ComPtr dxgiAdapter1 = default; + + HRESULT enumAdapters1Result = this.dxgiFactory6.Get()->EnumAdapterByGpuPreference( + this.index, + DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, + FX.__uuidof(), + dxgiAdapter1.GetVoidAddressOf()); + + if (enumAdapters1Result == FX.DXGI_ERROR_NOT_FOUND) { - this.isInitialized = true; + this.dxgiFactory6.Get()->EnumWarpAdapter(FX.__uuidof(), dxgiAdapter1.GetVoidAddressOf()).Assert(); - fixed (IDXGIFactory6** dxgiFactory6 = this.dxgiFactory6) + DXGI_ADAPTER_DESC1 dxgiDescription1; + + dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert(); + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + null); + + if (FX.SUCCEEDED(createDeviceResult) && + this.predicate?.Invoke(new GraphicsDeviceInfo(&dxgiDescription1)) != false) { - CreateDXGIFactory6(dxgiFactory6); - } - } + using ComPtr d3D12Device = default; - if (this.isCompleted) return false; - - while (true) - { - using ComPtr dxgiAdapter1 = default; - - HRESULT enumAdapters1Result = this.dxgiFactory6.Get()->EnumAdapterByGpuPreference( - this.index, - DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, - FX.__uuidof(), - dxgiAdapter1.GetVoidAddressOf()); - - if (enumAdapters1Result == FX.DXGI_ERROR_NOT_FOUND) - { - this.dxgiFactory6.Get()->EnumWarpAdapter(FX.__uuidof(), dxgiAdapter1.GetVoidAddressOf()).Assert(); - - DXGI_ADAPTER_DESC1 dxgiDescription1; - - dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert(); - - HRESULT createDeviceResult = FX.D3D12CreateDevice( + FX.D3D12CreateDevice( dxgiAdapter1.AsIUnknown().Get(), D3D_FEATURE_LEVEL_11_0, FX.__uuidof(), - null); + d3D12Device.GetVoidAddressOf()).Assert(); - if (FX.SUCCEEDED(createDeviceResult) && - this.predicate?.Invoke(new GraphicsDeviceInfo(&dxgiDescription1)) != false) + this.graphicsDevice = GetOrCreateDevice(d3D12Device.Get(), (IDXGIAdapter*)dxgiAdapter1.Get(), &dxgiDescription1); + this.isCompleted = true; + + return true; + } + + return false; + } + else + { + enumAdapters1Result.Assert(); + + this.index++; + + DXGI_ADAPTER_DESC1 dxgiDescription1; + + dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert(); + + if (dxgiDescription1.VendorId == MicrosoftVendorId && + dxgiDescription1.DeviceId == WarpDeviceId) + { + continue; + } + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + null); + + if (FX.SUCCEEDED(createDeviceResult) && + this.predicate?.Invoke(new GraphicsDeviceInfo(&dxgiDescription1)) != false) + { + using ComPtr d3D12Device = default; + + FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + d3D12Device.GetVoidAddressOf()).Assert(); + + if (d3D12Device.Get()->IsShaderModelSupported(D3D_SHADER_MODEL_6_0)) { - using ComPtr d3D12Device = default; - - FX.D3D12CreateDevice( - dxgiAdapter1.AsIUnknown().Get(), - D3D_FEATURE_LEVEL_11_0, - FX.__uuidof(), - d3D12Device.GetVoidAddressOf()).Assert(); - this.graphicsDevice = GetOrCreateDevice(d3D12Device.Get(), (IDXGIAdapter*)dxgiAdapter1.Get(), &dxgiDescription1); - this.isCompleted = true; return true; } - - return false; - } - else - { - enumAdapters1Result.Assert(); - - this.index++; - - DXGI_ADAPTER_DESC1 dxgiDescription1; - - dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert(); - - if (dxgiDescription1.VendorId == MicrosoftVendorId && - dxgiDescription1.DeviceId == WarpDeviceId) - { - continue; - } - - HRESULT createDeviceResult = FX.D3D12CreateDevice( - dxgiAdapter1.AsIUnknown().Get(), - D3D_FEATURE_LEVEL_11_0, - FX.__uuidof(), - null); - - if (FX.SUCCEEDED(createDeviceResult) && - this.predicate?.Invoke(new GraphicsDeviceInfo(&dxgiDescription1)) != false) - { - using ComPtr d3D12Device = default; - - FX.D3D12CreateDevice( - dxgiAdapter1.AsIUnknown().Get(), - D3D_FEATURE_LEVEL_11_0, - FX.__uuidof(), - d3D12Device.GetVoidAddressOf()).Assert(); - - if (d3D12Device.Get()->IsShaderModelSupported(D3D_SHADER_MODEL_6_0)) - { - this.graphicsDevice = GetOrCreateDevice(d3D12Device.Get(), (IDXGIAdapter*)dxgiAdapter1.Get(), &dxgiDescription1); - - return true; - } - } } } } + } - /// - public void Reset() - { - throw new NotImplementedException(); - } + /// + public void Reset() + { + throw new NotImplementedException(); + } - /// - protected override void OnDispose() - { - this.dxgiFactory6.Dispose(); - } + /// + protected override void OnDispose() + { + this.dxgiFactory6.Dispose(); } } } diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs index cf5d55f9..992c8152 100644 --- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs @@ -4,67 +4,66 @@ using ComputeSharp.Graphics.Extensions; #endif using TerraFX.Interop; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +internal static partial class DeviceHelper { - /// - internal static partial class DeviceHelper + /// + /// The local cache of instances that are currently usable. + /// + internal static readonly Dictionary DevicesCache = new(); + +#if DEBUG + /// + /// The local map of instances for the existing devices. + /// + private static readonly Dictionary> D3D12InfoQueueMap = new(); +#endif + + /// + /// Retrieves a instance for an object. + /// + /// The to use to get a instance. + /// The that was created from. + /// The available info for the instance. + /// A instance for the input device. + private static unsafe GraphicsDevice GetOrCreateDevice(ID3D12Device* d3D12Device, IDXGIAdapter* dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) { - /// - /// The local cache of instances that are currently usable. - /// - internal static readonly Dictionary DevicesCache = new(); - -#if DEBUG - /// - /// The local map of instances for the existing devices. - /// - private static readonly Dictionary> D3D12InfoQueueMap = new(); -#endif - - /// - /// Retrieves a instance for an object. - /// - /// The to use to get a instance. - /// The that was created from. - /// The available info for the instance. - /// A instance for the input device. - private static unsafe GraphicsDevice GetOrCreateDevice(ID3D12Device* d3D12Device, IDXGIAdapter* dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + lock (DevicesCache) { - lock (DevicesCache) + Luid luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + + if (!DevicesCache.TryGetValue(luid, out GraphicsDevice? device)) { - Luid luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + device = new GraphicsDevice(d3D12Device, dxgiAdapter, dxgiDescription1); - if (!DevicesCache.TryGetValue(luid, out GraphicsDevice? device)) - { - device = new GraphicsDevice(d3D12Device, dxgiAdapter, dxgiDescription1); - - DevicesCache.Add(luid, device); + DevicesCache.Add(luid, device); #if DEBUG - D3D12InfoQueueMap.Add(luid, d3D12Device->CreateInfoQueue()); + D3D12InfoQueueMap.Add(luid, d3D12Device->CreateInfoQueue()); #endif - } - - return device; } + + return device; } + } - /// - /// Removes a from the internal cache. - /// - /// The instance to remove from the internal cache. - public static void NotifyDisposedDevice(GraphicsDevice device) + /// + /// Removes a from the internal cache. + /// + /// The instance to remove from the internal cache. + public static void NotifyDisposedDevice(GraphicsDevice device) + { + lock (DevicesCache) { - lock (DevicesCache) - { - DevicesCache.Remove(device.Luid); + DevicesCache.Remove(device.Luid); #if DEBUG - D3D12InfoQueueMap.Remove(device.Luid, out ComPtr queue); + D3D12InfoQueueMap.Remove(device.Luid, out ComPtr queue); - queue.Dispose(); + queue.Dispose(); #endif - } } } } diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs index ad37f005..4884f5ca 100644 --- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs @@ -7,75 +7,74 @@ using System.Text; using TerraFX.Interop; using static TerraFX.Interop.D3D12_MESSAGE_SEVERITY; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +internal static partial class DeviceHelper { - /// - internal static partial class DeviceHelper + /// + /// Flushes all the pending debug messages for all existing instances to the console/debugger. + /// It also checks whether or not there are any error messages being logged that didn't result in an actual crash yet. + /// + /// Whether or not there are any logged errors or warnings. + public static unsafe bool FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings() { - /// - /// Flushes all the pending debug messages for all existing instances to the console/debugger. - /// It also checks whether or not there are any error messages being logged that didn't result in an actual crash yet. - /// - /// Whether or not there are any logged errors or warnings. - public static unsafe bool FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings() + bool hasErrorsOrWarnings = false; + + lock (DevicesCache) { - bool hasErrorsOrWarnings = false; + int j = 0; + StringBuilder builder = new(1024); - lock (DevicesCache) + foreach (var pair in D3D12InfoQueueMap) { - int j = 0; - StringBuilder builder = new(1024); + var device = DevicesCache[pair.Key]; + var queue = pair.Value; - foreach (var pair in D3D12InfoQueueMap) + ulong messages = queue.Get()->GetNumStoredMessagesAllowedByRetrievalFilter(); + + for (ulong i = 0; i < messages; i++) { - var device = DevicesCache[pair.Key]; - var queue = pair.Value; + nuint length; + queue.Get()->GetMessage(i, null, &length); - ulong messages = queue.Get()->GetNumStoredMessagesAllowedByRetrievalFilter(); + D3D12_MESSAGE* message = (D3D12_MESSAGE*)Marshal.AllocHGlobal((nint)length); - for (ulong i = 0; i < messages; i++) + queue.Get()->GetMessage(i, message, &length); + + builder.Clear(); + builder.AppendLine($"[D3D12 message #{i} for \"{device}\" (HW: {device.IsHardwareAccelerated}, UMA: {device.IsCacheCoherentUMA})]"); + builder.AppendLine($"[Category]: {Enum.GetName(message->Category)}"); + builder.AppendLine($"[Severity]: {Enum.GetName(message->Severity)}"); + builder.AppendLine($"[ID]: {Enum.GetName(message->ID)}"); + builder.Append($"[Description]: \"{new string(message->pDescription)}\""); + + Marshal.FreeHGlobal((IntPtr)message); + + if (message->Severity is D3D12_MESSAGE_SEVERITY_ERROR or D3D12_MESSAGE_SEVERITY_CORRUPTION or D3D12_MESSAGE_SEVERITY_WARNING) { - nuint length; - queue.Get()->GetMessage(i, null, &length); - - D3D12_MESSAGE* message = (D3D12_MESSAGE*)Marshal.AllocHGlobal((nint)length); - - queue.Get()->GetMessage(i, message, &length); - - builder.Clear(); - builder.AppendLine($"[D3D12 message #{i} for \"{device}\" (HW: {device.IsHardwareAccelerated}, UMA: {device.IsCacheCoherentUMA})]"); - builder.AppendLine($"[Category]: {Enum.GetName(message->Category)}"); - builder.AppendLine($"[Severity]: {Enum.GetName(message->Severity)}"); - builder.AppendLine($"[ID]: {Enum.GetName(message->ID)}"); - builder.Append($"[Description]: \"{new string(message->pDescription)}\""); - - Marshal.FreeHGlobal((IntPtr)message); - - if (message->Severity is D3D12_MESSAGE_SEVERITY_ERROR or D3D12_MESSAGE_SEVERITY_CORRUPTION or D3D12_MESSAGE_SEVERITY_WARNING) - { - hasErrorsOrWarnings = true; - } - - string text = builder.ToString(); - - if (Debugger.IsAttached) - { - Debug.WriteLine(text); - } - else - { - Console.WriteLine(text); - } + hasErrorsOrWarnings = true; } - queue.Get()->ClearStoredMessages(); + string text = builder.ToString(); - j++; + if (Debugger.IsAttached) + { + Debug.WriteLine(text); + } + else + { + Console.WriteLine(text); + } } - } - return hasErrorsOrWarnings; + queue.Get()->ClearStoredMessages(); + + j++; + } } + + return hasErrorsOrWarnings; } } diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs index 3e74affd..db0b8524 100644 --- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.IDXGIFactory6.cs @@ -7,148 +7,147 @@ using TerraFX.Interop; using FX = TerraFX.Interop.Windows; using HRESULT = System.Int32; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +internal static partial class DeviceHelper { - /// - internal static partial class DeviceHelper - { - /// - /// The creation flags for instances. - /// - private const uint IDXGIFactoryCreationFlags = + /// + /// The creation flags for instances. + /// + private const uint IDXGIFactoryCreationFlags = #if DEBUG - FX.DXGI_CREATE_FACTORY_DEBUG; + FX.DXGI_CREATE_FACTORY_DEBUG; #else - 0; + 0; #endif - /// - /// Creates a new instance to be used to enumerate devices. - /// - /// The resulting instance. - private static unsafe void CreateDXGIFactory6(IDXGIFactory6** dxgiFactory6) + /// + /// Creates a new instance to be used to enumerate devices. + /// + /// The resulting instance. + private static unsafe void CreateDXGIFactory6(IDXGIFactory6** dxgiFactory6) + { + using ComPtr dxgiFactory4 = default; + + EnableDebugMode(); + + FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof(), dxgiFactory4.GetVoidAddressOf()).Assert(); + + HRESULT result = dxgiFactory4.CopyTo(dxgiFactory6); + + if (result == FX.S_OK) { - using ComPtr dxgiFactory4 = default; + return; + } - EnableDebugMode(); - - FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof(), dxgiFactory4.GetVoidAddressOf()).Assert(); - - HRESULT result = dxgiFactory4.CopyTo(dxgiFactory6); - - if (result == FX.S_OK) - { - return; - } - - if (result == FX.E_NOINTERFACE) - { - IDXGIFactory4As6Backcompat.Create(dxgiFactory4.Get(), dxgiFactory6); - - return; - } - - result.Assert(); + if (result == FX.E_NOINTERFACE) + { + IDXGIFactory4As6Backcompat.Create(dxgiFactory4.Get(), dxgiFactory6); return; } - /// - /// Enables the debug layer for DirectX APIs. - /// - [Conditional("DEBUG")] - private static unsafe void EnableDebugMode() + result.Assert(); + + return; + } + + /// + /// Enables the debug layer for DirectX APIs. + /// + [Conditional("DEBUG")] + private static unsafe void EnableDebugMode() + { + using ComPtr d3D12Debug = default; + using ComPtr d3D12Debug1 = default; + + FX.D3D12GetDebugInterface(FX.__uuidof(), d3D12Debug.GetVoidAddressOf()).Assert(); + + d3D12Debug.Get()->EnableDebugLayer(); + + if (FX.SUCCEEDED(d3D12Debug.CopyTo(d3D12Debug1.GetAddressOf()))) { - using ComPtr d3D12Debug = default; - using ComPtr d3D12Debug1 = default; + d3D12Debug1.Get()->SetEnableGPUBasedValidation(FX.TRUE); + d3D12Debug1.Get()->SetEnableSynchronizedCommandQueueValidation(FX.TRUE); + } + } - FX.D3D12GetDebugInterface(FX.__uuidof(), d3D12Debug.GetVoidAddressOf()).Assert(); + /// + /// A custom fallback implementation to use on systems with no support for it. + /// + private unsafe struct IDXGIFactory4As6Backcompat + { + /// + /// The shared method table pointer for all instances. + /// + private static readonly void** Vtbl = InitVtbl(); - d3D12Debug.Get()->EnableDebugLayer(); + /// + /// Builds the custom method table pointer for . + /// + /// The method table pointer for . + private static void** InitVtbl() + { + void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(IDXGIFactory4As6Backcompat), sizeof(void*) * 30); - if (FX.SUCCEEDED(d3D12Debug.CopyTo(d3D12Debug1.GetAddressOf()))) - { - d3D12Debug1.Get()->SetEnableGPUBasedValidation(FX.TRUE); - d3D12Debug1.Get()->SetEnableSynchronizedCommandQueueValidation(FX.TRUE); - } + new Span(lpVtbl, 30).Clear(); + + lpVtbl[2] = (delegate* unmanaged)&Release; + lpVtbl[27] = (delegate* unmanaged)&EnumWarpAdapter; + lpVtbl[29] = (delegate* unmanaged)&EnumAdapterByGpuPreference; + + return lpVtbl; } /// - /// A custom fallback implementation to use on systems with no support for it. + /// The method table pointer for the current instance. /// - private unsafe struct IDXGIFactory4As6Backcompat + private void** lpVtbl; + + /// + /// The wrapped instance. + /// + private IDXGIFactory4* dxgiFactory4; + + /// + /// Creates and initializes a new instance. + /// + /// The instance to wrap. + /// The resulting instance. + public static void Create(IDXGIFactory4* dxgiFactory4, IDXGIFactory6** dxgiFactory6) { - /// - /// The shared method table pointer for all instances. - /// - private static readonly void** Vtbl = InitVtbl(); + IDXGIFactory4As6Backcompat* @this = (IDXGIFactory4As6Backcompat*)Marshal.AllocHGlobal(sizeof(IDXGIFactory4As6Backcompat)); - /// - /// Builds the custom method table pointer for . - /// - /// The method table pointer for . - private static void** InitVtbl() - { - void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(IDXGIFactory4As6Backcompat), sizeof(void*) * 30); + @this->lpVtbl = Vtbl; + @this->dxgiFactory4 = dxgiFactory4; - new Span(lpVtbl, 30).Clear(); + *dxgiFactory6 = (IDXGIFactory6*)@this; + } - lpVtbl[2] = (delegate* unmanaged)&Release; - lpVtbl[27] = (delegate* unmanaged)&EnumWarpAdapter; - lpVtbl[29] = (delegate* unmanaged)&EnumAdapterByGpuPreference; + /// + [UnmanagedCallersOnly] + public static uint Release(IDXGIFactory4As6Backcompat* @this) + { + @this->dxgiFactory4->Release(); - return lpVtbl; - } + Marshal.FreeHGlobal((IntPtr)@this); - /// - /// The method table pointer for the current instance. - /// - private void** lpVtbl; + return 0; + } - /// - /// The wrapped instance. - /// - private IDXGIFactory4* dxgiFactory4; + /// + [UnmanagedCallersOnly] + public static int EnumWarpAdapter(IDXGIFactory4As6Backcompat* @this, Guid* riid, void** ppvAdapter) + { + return @this->dxgiFactory4->EnumWarpAdapter(riid, ppvAdapter); + } - /// - /// Creates and initializes a new instance. - /// - /// The instance to wrap. - /// The resulting instance. - public static void Create(IDXGIFactory4* dxgiFactory4, IDXGIFactory6** dxgiFactory6) - { - IDXGIFactory4As6Backcompat* @this = (IDXGIFactory4As6Backcompat*)Marshal.AllocHGlobal(sizeof(IDXGIFactory4As6Backcompat)); - - @this->lpVtbl = Vtbl; - @this->dxgiFactory4 = dxgiFactory4; - - *dxgiFactory6 = (IDXGIFactory6*)@this; - } - - /// - [UnmanagedCallersOnly] - public static uint Release(IDXGIFactory4As6Backcompat* @this) - { - @this->dxgiFactory4->Release(); - - Marshal.FreeHGlobal((IntPtr)@this); - - return 0; - } - - /// - [UnmanagedCallersOnly] - public static int EnumWarpAdapter(IDXGIFactory4As6Backcompat* @this, Guid* riid, void** ppvAdapter) - { - return @this->dxgiFactory4->EnumWarpAdapter(riid, ppvAdapter); - } - - /// - [UnmanagedCallersOnly] - public static int EnumAdapterByGpuPreference(IDXGIFactory4As6Backcompat* @this, uint Adapter, DXGI_GPU_PREFERENCE GpuPreference, Guid* riid, void** ppvAdapter) - { - return @this->dxgiFactory4->EnumAdapters1(Adapter, (IDXGIAdapter1**)ppvAdapter); - } + /// + [UnmanagedCallersOnly] + public static int EnumAdapterByGpuPreference(IDXGIFactory4As6Backcompat* @this, uint Adapter, DXGI_GPU_PREFERENCE GpuPreference, Guid* riid, void** ppvAdapter) + { + return @this->dxgiFactory4->EnumAdapters1(Adapter, (IDXGIAdapter1**)ppvAdapter); } } } diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs index f04fa75f..b5dd93d0 100644 --- a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs @@ -10,144 +10,127 @@ using static TerraFX.Interop.D3D_FEATURE_LEVEL; using static TerraFX.Interop.D3D_SHADER_MODEL; using static TerraFX.Interop.DXGI_GPU_PREFERENCE; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A with methods to inspect the available devices on the current machine. +/// +internal static partial class DeviceHelper { /// - /// A with methods to inspect the available devices on the current machine. + /// The vendor id for Microsoft adapters (the "Microsoft Basic Render"). /// - internal static partial class DeviceHelper + private const uint MicrosoftVendorId = 0x1414; + + /// + /// The device id for the WARP device. + /// + private const uint WarpDeviceId = 0x8C; + + /// + /// The instance used to produce the default instance. + /// + public static readonly Lazy DefaultFactory = new(GetDefaultDevice); + + /// + /// Gets the of the default device. + /// + /// The of the default device supporting and . + /// This methods assumes that a default device is available. + [Pure] + public static unsafe Luid GetDefaultDeviceLuid() { - /// - /// The vendor id for Microsoft adapters (the "Microsoft Basic Render"). - /// - private const uint MicrosoftVendorId = 0x1414; - - /// - /// The device id for the WARP device. - /// - private const uint WarpDeviceId = 0x8C; - - /// - /// The instance used to produce the default instance. - /// - public static readonly Lazy DefaultFactory = new(GetDefaultDevice); - - /// - /// Gets the of the default device. - /// - /// The of the default device supporting and . - /// This methods assumes that a default device is available. - [Pure] - public static unsafe Luid GetDefaultDeviceLuid() + if (DefaultFactory.IsValueCreated) { - if (DefaultFactory.IsValueCreated) - { - return DefaultFactory.Value.Luid; - } - - DXGI_ADAPTER_DESC1 dxgiDescription1; - - _ = TryGetDefaultDevice(null, null, &dxgiDescription1) || TryGetWarpDevice(null, null, &dxgiDescription1); - - return Luid.FromLUID(dxgiDescription1.AdapterLuid); + return DefaultFactory.Value.Luid; } - /// - /// Gets the default instance. - /// - /// The default instance supporting and . - /// Thrown when a default device is not available. - private static unsafe GraphicsDevice GetDefaultDevice() + DXGI_ADAPTER_DESC1 dxgiDescription1; + + _ = TryGetDefaultDevice(null, null, &dxgiDescription1) || TryGetWarpDevice(null, null, &dxgiDescription1); + + return Luid.FromLUID(dxgiDescription1.AdapterLuid); + } + + /// + /// Gets the default instance. + /// + /// The default instance supporting and . + /// Thrown when a default device is not available. + private static unsafe GraphicsDevice GetDefaultDevice() + { + using ComPtr d3D12Device = default; + using ComPtr dxgiAdapter = default; + + DXGI_ADAPTER_DESC1 dxgiDescription1; + + if (TryGetDefaultDevice(d3D12Device.GetAddressOf(), dxgiAdapter.GetAddressOf(), &dxgiDescription1) || + TryGetWarpDevice(d3D12Device.GetAddressOf(), dxgiAdapter.GetAddressOf(), &dxgiDescription1)) { - using ComPtr d3D12Device = default; - using ComPtr dxgiAdapter = default; - - DXGI_ADAPTER_DESC1 dxgiDescription1; - - if (TryGetDefaultDevice(d3D12Device.GetAddressOf(), dxgiAdapter.GetAddressOf(), &dxgiDescription1) || - TryGetWarpDevice(d3D12Device.GetAddressOf(), dxgiAdapter.GetAddressOf(), &dxgiDescription1)) - { - return GetOrCreateDevice(d3D12Device.Get(), dxgiAdapter.Get(), &dxgiDescription1); - } - - return ThrowHelper.ThrowNotSupportedException("Failed to retrieve the default device."); + return GetOrCreateDevice(d3D12Device.Get(), dxgiAdapter.Get(), &dxgiDescription1); } - /// - /// Tries to check or create a default object. - /// - /// A pointer to the object to create, or . - /// A pointer to the object used to create , or . - /// A pointer to the value for the device found. - /// Whether a default device was found with the requested feature level. - private static unsafe bool TryGetDefaultDevice(ID3D12Device** d3D12Device, IDXGIAdapter** dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + return ThrowHelper.ThrowNotSupportedException("Failed to retrieve the default device."); + } + + /// + /// Tries to check or create a default object. + /// + /// A pointer to the object to create, or . + /// A pointer to the object used to create , or . + /// A pointer to the value for the device found. + /// Whether a default device was found with the requested feature level. + private static unsafe bool TryGetDefaultDevice(ID3D12Device** d3D12Device, IDXGIAdapter** dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + { + using ComPtr dxgiFactory6 = default; + + CreateDXGIFactory6(dxgiFactory6.GetAddressOf()); + + uint i = 0; + + while (true) { - using ComPtr dxgiFactory6 = default; + using ComPtr dxgiAdapter1 = default; - CreateDXGIFactory6(dxgiFactory6.GetAddressOf()); + HRESULT enumAdapters1Result = dxgiFactory6.Get()->EnumAdapterByGpuPreference( + i++, + DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, + FX.__uuidof(), + dxgiAdapter1.GetVoidAddressOf()); - uint i = 0; - - while (true) + if (enumAdapters1Result == FX.DXGI_ERROR_NOT_FOUND) { - using ComPtr dxgiAdapter1 = default; + return false; + } - HRESULT enumAdapters1Result = dxgiFactory6.Get()->EnumAdapterByGpuPreference( - i++, - DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, - FX.__uuidof(), - dxgiAdapter1.GetVoidAddressOf()); + enumAdapters1Result.Assert(); - if (enumAdapters1Result == FX.DXGI_ERROR_NOT_FOUND) - { - return false; - } + dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert(); - enumAdapters1Result.Assert(); + if (dxgiDescription1->VendorId == MicrosoftVendorId && + dxgiDescription1->DeviceId == WarpDeviceId) + { + continue; + } - dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert(); + // Explicit paths for when a device is being retrieved or not, with special handling + // for the additional check that is required for the SM6 level. This can't be checked + // without creating a device first, so the path for when the target device pointer is + // null is useful to do an initial filtering using D3D12CreateDevice to avoid creating + // a device for adapters that would've failed at the FL11 check already. + if (d3D12Device == null) + { + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + null); - if (dxgiDescription1->VendorId == MicrosoftVendorId && - dxgiDescription1->DeviceId == WarpDeviceId) - { - continue; - } - - // Explicit paths for when a device is being retrieved or not, with special handling - // for the additional check that is required for the SM6 level. This can't be checked - // without creating a device first, so the path for when the target device pointer is - // null is useful to do an initial filtering using D3D12CreateDevice to avoid creating - // a device for adapters that would've failed at the FL11 check already. - if (d3D12Device == null) - { - HRESULT createDeviceResult = FX.D3D12CreateDevice( - dxgiAdapter1.AsIUnknown().Get(), - D3D_FEATURE_LEVEL_11_0, - FX.__uuidof(), - null); - - if (FX.SUCCEEDED(createDeviceResult)) - { - using ComPtr d3D12DeviceCandidate = default; - - createDeviceResult = FX.D3D12CreateDevice( - dxgiAdapter1.AsIUnknown().Get(), - D3D_FEATURE_LEVEL_11_0, - FX.__uuidof(), - d3D12DeviceCandidate.GetVoidAddressOf()); - - if (FX.SUCCEEDED(createDeviceResult) && - d3D12DeviceCandidate.Get()->IsShaderModelSupported(D3D_SHADER_MODEL_6_0)) - { - return true; - } - } - } - else + if (FX.SUCCEEDED(createDeviceResult)) { using ComPtr d3D12DeviceCandidate = default; - HRESULT createDeviceResult = FX.D3D12CreateDevice( + createDeviceResult = FX.D3D12CreateDevice( dxgiAdapter1.AsIUnknown().Get(), D3D_FEATURE_LEVEL_11_0, FX.__uuidof(), @@ -156,43 +139,59 @@ namespace ComputeSharp.Graphics.Helpers if (FX.SUCCEEDED(createDeviceResult) && d3D12DeviceCandidate.Get()->IsShaderModelSupported(D3D_SHADER_MODEL_6_0)) { - d3D12DeviceCandidate.CopyTo(d3D12Device); - dxgiAdapter1.CopyTo(dxgiAdapter); - return true; } } } - } + else + { + using ComPtr d3D12DeviceCandidate = default; - /// - /// Tries to check or create a warp object. - /// - /// A pointer to the object to create, or . - /// A pointer to the object used to create , or . - /// A pointer to the value for the device found. - /// Whether a warp device was created successfully. - private static unsafe bool TryGetWarpDevice(ID3D12Device** d3D12Device, IDXGIAdapter** dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) - { - using ComPtr dxgiFactory6 = default; + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + d3D12DeviceCandidate.GetVoidAddressOf()); - CreateDXGIFactory6(dxgiFactory6.GetAddressOf()); + if (FX.SUCCEEDED(createDeviceResult) && + d3D12DeviceCandidate.Get()->IsShaderModelSupported(D3D_SHADER_MODEL_6_0)) + { + d3D12DeviceCandidate.CopyTo(d3D12Device); + dxgiAdapter1.CopyTo(dxgiAdapter); - using ComPtr dxgiAdapter1 = default; - - dxgiFactory6.Get()->EnumWarpAdapter(FX.__uuidof(), dxgiAdapter1.GetVoidAddressOf()).Assert(); - - dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert(); - - HRESULT createDeviceResult = FX.D3D12CreateDevice( - dxgiAdapter1.AsIUnknown().Get(), - D3D_FEATURE_LEVEL_11_0, - FX.__uuidof(), - (void**)d3D12Device); - - dxgiAdapter1.CopyTo(dxgiAdapter); - - return FX.SUCCEEDED(createDeviceResult); + return true; + } + } } } + + /// + /// Tries to check or create a warp object. + /// + /// A pointer to the object to create, or . + /// A pointer to the object used to create , or . + /// A pointer to the value for the device found. + /// Whether a warp device was created successfully. + private static unsafe bool TryGetWarpDevice(ID3D12Device** d3D12Device, IDXGIAdapter** dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + { + using ComPtr dxgiFactory6 = default; + + CreateDXGIFactory6(dxgiFactory6.GetAddressOf()); + + using ComPtr dxgiAdapter1 = default; + + dxgiFactory6.Get()->EnumWarpAdapter(FX.__uuidof(), dxgiAdapter1.GetVoidAddressOf()).Assert(); + + dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert(); + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + (void**)d3D12Device); + + dxgiAdapter1.CopyTo(dxgiAdapter); + + return FX.SUCCEEDED(createDeviceResult); + } } diff --git a/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs b/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs index c3f56001..ec92d865 100644 --- a/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs @@ -1,250 +1,249 @@ using System; using System.Runtime.CompilerServices; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A with some helper methods to copy data between memory areas. +/// +internal static class MemoryHelper { /// - /// A with some helper methods to copy data between memory areas. + /// Copies the content of a source memory area to a target one, accounting for padding. + /// The destination memory area has padding for each element, while the source does not. /// - internal static class MemoryHelper + /// The source memory area to read from. + /// The pointer for the destination memory area. + /// The destination offset to start writing data to. + /// The number of items to copy. + /// The padded size of each element. + /// Indicates whether or not the source is padded too. + public static unsafe void Copy( + void* source, + void* destination, + uint offset, + uint length, + uint elementPitchInBytes, + bool isPaddingInSourceToo) + where T : unmanaged { - /// - /// Copies the content of a source memory area to a target one, accounting for padding. - /// The destination memory area has padding for each element, while the source does not. - /// - /// The source memory area to read from. - /// The pointer for the destination memory area. - /// The destination offset to start writing data to. - /// The number of items to copy. - /// The padded size of each element. - /// Indicates whether or not the source is padded too. - public static unsafe void Copy( - void* source, - void* destination, - uint offset, - uint length, - uint elementPitchInBytes, - bool isPaddingInSourceToo) - where T : unmanaged + destination = (byte*)destination + offset * elementPitchInBytes; + + if (isPaddingInSourceToo) { - destination = (byte*)destination + offset * elementPitchInBytes; - - if (isPaddingInSourceToo) - { - for (int i = 0; i < length; i++) - { - *(T*)&((byte*)destination)[i * elementPitchInBytes] = *(T*)&((byte*)source)[i * elementPitchInBytes]; - } - } - else - { - for (int i = 0; i < length; i++) - { - *(T*)&((byte*)destination)[i * elementPitchInBytes] = ((T*)source)[i]; - } - } - } - - /// - /// Copies the content of a source memory area to a target one. - /// - /// The source memory area to read from. - /// The source offset to start reading data from. - /// The number of items to copy. - /// The size in bytes of each item to copy. - /// The pointer for the destination memory area. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void Copy( - void* source, - uint offset, - uint length, - uint elementSizeInBytes, - void* destination) - { - Buffer.MemoryCopy( - (byte*)source + offset * elementSizeInBytes, - destination, - ulong.MaxValue, - elementSizeInBytes * length); - } - - /// - /// Copies the content of a source memory area to a target one, accounting for padding. - /// The source memory area has padding for each element, while the destination does not. - /// - /// The source memory area to read from. - /// The source offset to start reading data from. - /// The number of items to copy. - /// The padded size of each element. - /// The pointer for the destination memory area. - public static unsafe void Copy( - void* source, - uint offset, - uint length, - uint elementPitchInBytes, - void* destination) - where T : unmanaged - { - source = (byte*)source + offset * elementPitchInBytes; - for (int i = 0; i < length; i++) { - ((T*)destination)[i] = *(T*)&((byte*)source)[i * elementPitchInBytes]; + *(T*)&((byte*)destination)[i * elementPitchInBytes] = *(T*)&((byte*)source)[i * elementPitchInBytes]; } } - - /// - /// Copies the content of a source memory area to the 2D area pointed by an input pointer. - /// The destination memory area has padding in each row, while the source does not. - /// - /// The source pointer to read from. - /// The pointer that indicates the 2D memory area to write to. - /// The height of the 2D memory area to write to. - /// The width of the memory area in bytes. - /// The pitch (padded width) of the memory area in bytes. - public static unsafe void Copy( - void* source, - void* destination, - uint height, - ulong widthInBytes, - ulong pitchInBytes) + else { - if (widthInBytes == pitchInBytes) + for (int i = 0; i < length; i++) { - Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height); + *(T*)&((byte*)destination)[i * elementPitchInBytes] = ((T*)source)[i]; } - else + } + } + + /// + /// Copies the content of a source memory area to a target one. + /// + /// The source memory area to read from. + /// The source offset to start reading data from. + /// The number of items to copy. + /// The size in bytes of each item to copy. + /// The pointer for the destination memory area. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void Copy( + void* source, + uint offset, + uint length, + uint elementSizeInBytes, + void* destination) + { + Buffer.MemoryCopy( + (byte*)source + offset * elementSizeInBytes, + destination, + ulong.MaxValue, + elementSizeInBytes * length); + } + + /// + /// Copies the content of a source memory area to a target one, accounting for padding. + /// The source memory area has padding for each element, while the destination does not. + /// + /// The source memory area to read from. + /// The source offset to start reading data from. + /// The number of items to copy. + /// The padded size of each element. + /// The pointer for the destination memory area. + public static unsafe void Copy( + void* source, + uint offset, + uint length, + uint elementPitchInBytes, + void* destination) + where T : unmanaged + { + source = (byte*)source + offset * elementPitchInBytes; + + for (int i = 0; i < length; i++) + { + ((T*)destination)[i] = *(T*)&((byte*)source)[i * elementPitchInBytes]; + } + } + + /// + /// Copies the content of a source memory area to the 2D area pointed by an input pointer. + /// The destination memory area has padding in each row, while the source does not. + /// + /// The source pointer to read from. + /// The pointer that indicates the 2D memory area to write to. + /// The height of the 2D memory area to write to. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + public static unsafe void Copy( + void* source, + void* destination, + uint height, + ulong widthInBytes, + ulong pitchInBytes) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height); + } + else + { + for (int i = 0; i < height; i++) { + Buffer.MemoryCopy( + (byte*)source + (uint)i * widthInBytes, + (byte*)destination + (uint)i * pitchInBytes, + ulong.MaxValue, + widthInBytes); + } + } + } + + /// + /// Copies a 2D memory area pointed by a pointer value to a target memory area. + /// The source memory area has padding in each row, while the target does not. + /// + /// The pointer that indicates the memory area to read from. + /// The height of the 2D memory area to read. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + /// The destination pointer to write to. + public static unsafe void Copy( + void* source, + uint height, + ulong widthInBytes, + ulong pitchInBytes, + void* destination) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height); + } + else + { + for (int i = 0; i < height; i++) + { + Buffer.MemoryCopy( + (byte*)source + (uint)i * pitchInBytes, + (byte*)destination + (uint)i * widthInBytes, + ulong.MaxValue, + widthInBytes); + } + } + } + + /// + /// Copies the content of a source memory area to the 3D area pointed by an input pointer. + /// The destination memory area has padding in each row, while the source does not. + /// + /// The source memory area to read from. + /// The pointer that indicates the 3D memory area to write to. + /// The height of the 3D memory area to write to. + /// The depth of the 3D memory area to write to. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + /// The size in bytes of each 2D slice within the target 3D memory area. + public static unsafe void Copy( + void* source, + void* destination, + uint height, + uint depth, + ulong widthInBytes, + ulong pitchInBytes, + ulong sliceInBytes) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height * depth); + } + else + { + for (int z = 0; z < depth; z++) + { + ulong + sourceZOffset = (uint)z * widthInBytes * height, + destinationZOffset = (uint)z * sliceInBytes; + for (int i = 0; i < height; i++) { Buffer.MemoryCopy( - (byte*)source + (uint)i * widthInBytes, - (byte*)destination + (uint)i * pitchInBytes, + (byte*)source + sourceZOffset + (uint)i * widthInBytes, + (byte*)destination + destinationZOffset + (uint)i * pitchInBytes, ulong.MaxValue, widthInBytes); } } } + } - /// - /// Copies a 2D memory area pointed by a pointer value to a target memory area. - /// The source memory area has padding in each row, while the target does not. - /// - /// The pointer that indicates the memory area to read from. - /// The height of the 2D memory area to read. - /// The width of the memory area in bytes. - /// The pitch (padded width) of the memory area in bytes. - /// The destination pointer to write to. - public static unsafe void Copy( - void* source, - uint height, - ulong widthInBytes, - ulong pitchInBytes, - void* destination) + /// + /// Copies a 3D memory area pointed by a pointer value to a target memory area. + /// The source memory area has padding in each row, while the target does not. + /// + /// The pointer that indicates the memory area to read from. + /// The height of the 3D memory area to read. + /// The depth of the 3D memory area to read. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + /// The size in bytes of each 2D slice within the source 3D memory area. + /// The destination pointer to write. + public static unsafe void Copy( + void* source, + uint height, + uint depth, + ulong widthInBytes, + ulong pitchInBytes, + ulong sliceInBytes, + void* destination) + { + if (widthInBytes == pitchInBytes) { - if (widthInBytes == pitchInBytes) - { - Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height); - } - else + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height * depth); + } + else + { + for (int z = 0; z < depth; z++) { + ulong + sourceZOffset = (uint)z * sliceInBytes, + destinationZOffset = (uint)z * widthInBytes * height; + for (int i = 0; i < height; i++) { Buffer.MemoryCopy( - (byte*)source + (uint)i * pitchInBytes, - (byte*)destination + (uint)i * widthInBytes, + (byte*)source + sourceZOffset + (uint)i * pitchInBytes, + (byte*)destination + destinationZOffset + (uint)i * widthInBytes, ulong.MaxValue, widthInBytes); } } } - - /// - /// Copies the content of a source memory area to the 3D area pointed by an input pointer. - /// The destination memory area has padding in each row, while the source does not. - /// - /// The source memory area to read from. - /// The pointer that indicates the 3D memory area to write to. - /// The height of the 3D memory area to write to. - /// The depth of the 3D memory area to write to. - /// The width of the memory area in bytes. - /// The pitch (padded width) of the memory area in bytes. - /// The size in bytes of each 2D slice within the target 3D memory area. - public static unsafe void Copy( - void* source, - void* destination, - uint height, - uint depth, - ulong widthInBytes, - ulong pitchInBytes, - ulong sliceInBytes) - { - if (widthInBytes == pitchInBytes) - { - Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height * depth); - } - else - { - for (int z = 0; z < depth; z++) - { - ulong - sourceZOffset = (uint)z * widthInBytes * height, - destinationZOffset = (uint)z * sliceInBytes; - - for (int i = 0; i < height; i++) - { - Buffer.MemoryCopy( - (byte*)source + sourceZOffset + (uint)i * widthInBytes, - (byte*)destination + destinationZOffset + (uint)i * pitchInBytes, - ulong.MaxValue, - widthInBytes); - } - } - } - } - - /// - /// Copies a 3D memory area pointed by a pointer value to a target memory area. - /// The source memory area has padding in each row, while the target does not. - /// - /// The pointer that indicates the memory area to read from. - /// The height of the 3D memory area to read. - /// The depth of the 3D memory area to read. - /// The width of the memory area in bytes. - /// The pitch (padded width) of the memory area in bytes. - /// The size in bytes of each 2D slice within the source 3D memory area. - /// The destination pointer to write. - public static unsafe void Copy( - void* source, - uint height, - uint depth, - ulong widthInBytes, - ulong pitchInBytes, - ulong sliceInBytes, - void* destination) - { - if (widthInBytes == pitchInBytes) - { - Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height * depth); - } - else - { - for (int z = 0; z < depth; z++) - { - ulong - sourceZOffset = (uint)z * sliceInBytes, - destinationZOffset = (uint)z * widthInBytes * height; - - for (int i = 0; i < height; i++) - { - Buffer.MemoryCopy( - (byte*)source + sourceZOffset + (uint)i * pitchInBytes, - (byte*)destination + destinationZOffset + (uint)i * widthInBytes, - ulong.MaxValue, - widthInBytes); - } - } - } - } } } diff --git a/src/ComputeSharp/Graphics/Helpers/TypeInfo{T}.cs b/src/ComputeSharp/Graphics/Helpers/TypeInfo{T}.cs index 3f1807c6..33750ed9 100644 --- a/src/ComputeSharp/Graphics/Helpers/TypeInfo{T}.cs +++ b/src/ComputeSharp/Graphics/Helpers/TypeInfo{T}.cs @@ -2,41 +2,40 @@ using System.Diagnostics.Contracts; using System.Reflection; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A class providing info on specific types. +/// +/// The input type to extract info for. +internal static class TypeInfo + where T : unmanaged { /// - /// A class providing info on specific types. + /// Whether or not type is or contains a field. /// - /// The input type to extract info for. - internal static class TypeInfo - where T : unmanaged + public static readonly bool IsDoubleOrContainsDoubles; + + /// + /// Checks the value for for type . + /// + /// The current type to check. + /// Whether or not is or contains a field. + [Pure] + private static bool ChecksIsDoubleOrContainsDoubles(Type type) { - /// - /// Whether or not type is or contains a field. - /// - public static readonly bool IsDoubleOrContainsDoubles; + if (type == typeof(double)) return true; - /// - /// Checks the value for for type . - /// - /// The current type to check. - /// Whether or not is or contains a field. - [Pure] - private static bool ChecksIsDoubleOrContainsDoubles(Type type) + if (type.IsPrimitive) return false; + + foreach (FieldInfo fieldInfo in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { - if (type == typeof(double)) return true; - - if (type.IsPrimitive) return false; - - foreach (FieldInfo fieldInfo in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) + if (ChecksIsDoubleOrContainsDoubles(fieldInfo.FieldType)) { - if (ChecksIsDoubleOrContainsDoubles(fieldInfo.FieldType)) - { - return true; - } + return true; } - - return false; } + + return false; } } diff --git a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs index 37e45512..7bd1eaef 100644 --- a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs @@ -5,128 +5,127 @@ using System.Runtime.CompilerServices; using Microsoft.Toolkit.Diagnostics; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A helper type with utility methods for WIC formats. +/// +internal static class WICFormatHelper { /// - /// A helper type with utility methods for WIC formats. + /// Gets the appropriate WIC format value for the input type argument. /// - internal static class WICFormatHelper + /// The input type argument to get the corresponding WIC format . + /// The WIC format value corresponding to . + /// Thrown when the input type is not supported. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Guid GetForType() + where T : unmanaged { - /// - /// Gets the appropriate WIC format value for the input type argument. - /// - /// The input type argument to get the corresponding WIC format . - /// The WIC format value corresponding to . - /// Thrown when the input type is not supported. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Guid GetForType() - where T : unmanaged + if (typeof(T) == typeof(Bgra32)) return FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(Rgba32)) return FX.GUID_WICPixelFormat32bppRGBA; + else if (typeof(T) == typeof(Rgba64)) return FX.GUID_WICPixelFormat64bppRGBA; + else if (typeof(T) == typeof(R8)) return FX.GUID_WICPixelFormat8bppGray; + else if (typeof(T) == typeof(R16)) return FX.GUID_WICPixelFormat16bppGray; + else return ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + + /// + /// Gets the appropriate WIC format value for the input type argument. + /// + /// The input type argument to get the corresponding WIC format . + /// The WIC format value corresponding to . + /// Thrown when the input type is not supported. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TryGetIntermediateFormatForType(Guid containerFormat, out Guid intermediateFormat) + where T : unmanaged + { + if (containerFormat == FX.GUID_ContainerFormatBmp) { - if (typeof(T) == typeof(Bgra32)) return FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(Rgba32)) return FX.GUID_WICPixelFormat32bppRGBA; - else if (typeof(T) == typeof(Rgba64)) return FX.GUID_WICPixelFormat64bppRGBA; - else if (typeof(T) == typeof(R8)) return FX.GUID_WICPixelFormat8bppGray; - else if (typeof(T) == typeof(R16)) return FX.GUID_WICPixelFormat16bppGray; - else return ThrowHelper.ThrowArgumentException("Invalid texture type"); + if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; + else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(Rgba64)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(R8)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; + else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + else if (containerFormat == FX.GUID_ContainerFormatPng) + { + if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; + else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; + else if (typeof(T) == typeof(R8)) intermediateFormat = default; + else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat8bppGray; + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + else if (containerFormat == FX.GUID_ContainerFormatJpeg) + { + if (typeof(T) == typeof(Bgra32)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; + else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; + else if (typeof(T) == typeof(Rgba64)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; + else if (typeof(T) == typeof(R8)) intermediateFormat = default; + else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat8bppGray; + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + else if (containerFormat == FX.GUID_ContainerFormatWmp) + { + if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; + else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; + else if (typeof(T) == typeof(R8)) intermediateFormat = default; + else if (typeof(T) == typeof(R16)) intermediateFormat = default; + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + else if (containerFormat == FX.GUID_ContainerFormatTiff) + { + if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; + else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; + else if (typeof(T) == typeof(R8)) intermediateFormat = default; + else if (typeof(T) == typeof(R16)) intermediateFormat = default; + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + else if (containerFormat == FX.GUID_ContainerFormatDds) + { + if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; + else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(Rgba64)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(R8)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; + else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + else + { + intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid container format"); } - /// - /// Gets the appropriate WIC format value for the input type argument. - /// - /// The input type argument to get the corresponding WIC format . - /// The WIC format value corresponding to . - /// Thrown when the input type is not supported. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool TryGetIntermediateFormatForType(Guid containerFormat, out Guid intermediateFormat) - where T : unmanaged - { - if (containerFormat == FX.GUID_ContainerFormatBmp) - { - if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; - else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(Rgba64)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(R8)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; - else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); - } - else if (containerFormat == FX.GUID_ContainerFormatPng) - { - if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; - else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; - else if (typeof(T) == typeof(R8)) intermediateFormat = default; - else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat8bppGray; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); - } - else if (containerFormat == FX.GUID_ContainerFormatJpeg) - { - if (typeof(T) == typeof(Bgra32)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; - else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; - else if (typeof(T) == typeof(Rgba64)) intermediateFormat = FX.GUID_WICPixelFormat24bppBGR; - else if (typeof(T) == typeof(R8)) intermediateFormat = default; - else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat8bppGray; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); - } - else if (containerFormat == FX.GUID_ContainerFormatWmp) - { - if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; - else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; - else if (typeof(T) == typeof(R8)) intermediateFormat = default; - else if (typeof(T) == typeof(R16)) intermediateFormat = default; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); - } - else if (containerFormat == FX.GUID_ContainerFormatTiff) - { - if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; - else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default; - else if (typeof(T) == typeof(R8)) intermediateFormat = default; - else if (typeof(T) == typeof(R16)) intermediateFormat = default; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); - } - else if (containerFormat == FX.GUID_ContainerFormatDds) - { - if (typeof(T) == typeof(Bgra32)) intermediateFormat = default; - else if (typeof(T) == typeof(Rgba32)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(Rgba64)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(R8)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else if (typeof(T) == typeof(R16)) intermediateFormat = FX.GUID_WICPixelFormat32bppBGRA; - else intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid texture type"); - } - else - { - intermediateFormat = ThrowHelper.ThrowArgumentException("Invalid container format"); - } + return intermediateFormat != default; + } - return intermediateFormat != default; - } - - /// - /// Gets the appropriate WIC container format value for the input filename. - /// - /// The target filename to get the container format for. - /// The WIC format container value matching . - /// Thrown when the input filename doesn't have a valid file extension. - [Pure] - public static Guid GetForFilename(ReadOnlySpan filename) + /// + /// Gets the appropriate WIC container format value for the input filename. + /// + /// The target filename to get the container format for. + /// The WIC format container value matching . + /// Thrown when the input filename doesn't have a valid file extension. + [Pure] + public static Guid GetForFilename(ReadOnlySpan filename) + { + return Path.GetExtension(filename).ToString() switch { - return Path.GetExtension(filename).ToString() switch - { - ".bmp" => FX.GUID_ContainerFormatBmp, - ".png" => FX.GUID_ContainerFormatPng, - ".jpg" or - ".jpeg" => FX.GUID_ContainerFormatJpeg, - ".jxr" or - ".hdp" or - ".wdp" or - ".wmp" => FX.GUID_ContainerFormatWmp, - ".tiff" => FX.GUID_ContainerFormatTiff, - ".dds" => FX.GUID_ContainerFormatDds, - _ => ThrowHelper.ThrowArgumentException("Invalid filename"), - }; - } + ".bmp" => FX.GUID_ContainerFormatBmp, + ".png" => FX.GUID_ContainerFormatPng, + ".jpg" or + ".jpeg" => FX.GUID_ContainerFormatJpeg, + ".jxr" or + ".hdp" or + ".wdp" or + ".wmp" => FX.GUID_ContainerFormatWmp, + ".tiff" => FX.GUID_ContainerFormatTiff, + ".dds" => FX.GUID_ContainerFormatDds, + _ => ThrowHelper.ThrowArgumentException("Invalid filename"), + }; } } diff --git a/src/ComputeSharp/Graphics/Helpers/WICHelper.cs b/src/ComputeSharp/Graphics/Helpers/WICHelper.cs index 1f7d7df3..67e7b7b5 100644 --- a/src/ComputeSharp/Graphics/Helpers/WICHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/WICHelper.cs @@ -4,282 +4,281 @@ using ComputeSharp.Core.Extensions; using TerraFX.Interop; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Graphics.Helpers +namespace ComputeSharp.Graphics.Helpers; + +/// +/// A that uses the WIC APIs to load and decode images. +/// +internal sealed unsafe class WICHelper { /// - /// A that uses the WIC APIs to load and decode images. + /// The instance to use to create decoders. /// - internal sealed unsafe class WICHelper + private readonly ComPtr wicImagingFactory2; + + /// + /// Creates a new instance. + /// + private WICHelper() { - /// - /// The instance to use to create decoders. - /// - private readonly ComPtr wicImagingFactory2; + using ComPtr wicImagingFactory2 = default; + Guid wicImagingFactor2Clsid = FX.CLSID_WICImagingFactory2; - /// - /// Creates a new instance. - /// - private WICHelper() + FX.CoCreateInstance( + &wicImagingFactor2Clsid, + null, + (uint)CLSCTX.CLSCTX_INPROC_SERVER, + FX.__uuidof(), + wicImagingFactory2.GetVoidAddressOf()).Assert(); + + this.wicImagingFactory2 = wicImagingFactory2.Move(); + } + + /// + /// Destroys the current instance. + /// + ~WICHelper() + { + this.wicImagingFactory2.Dispose(); + } + + /// + /// Gets a instance to use. + /// + public static WICHelper Instance { get; } = new(); + + /// + /// Loads an from a specified file. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The filename of the image file to load and decode into the texture. + /// An instance with the contents of the specified file. + [Pure] + public UploadTexture2D LoadTexture(GraphicsDevice device, ReadOnlySpan filename) + where T : unmanaged + { + using ComPtr wicBitmapDecoder = default; + + // Get the bitmap decoder for the target file + fixed (char* p = filename) { - using ComPtr wicImagingFactory2 = default; - Guid wicImagingFactor2Clsid = FX.CLSID_WICImagingFactory2; - - FX.CoCreateInstance( - &wicImagingFactor2Clsid, + this.wicImagingFactory2.Get()->CreateDecoderFromFilename( + (ushort*)p, null, - (uint)CLSCTX.CLSCTX_INPROC_SERVER, - FX.__uuidof(), - wicImagingFactory2.GetVoidAddressOf()).Assert(); - - this.wicImagingFactory2 = wicImagingFactory2.Move(); + FX.GENERIC_READ, + WICDecodeOptions.WICDecodeMetadataCacheOnDemand, + wicBitmapDecoder.GetAddressOf()).Assert(); } - /// - /// Destroys the current instance. - /// - ~WICHelper() + return LoadTexture(device, wicBitmapDecoder.Get()); + } + + /// + /// Loads an from a specified buffer. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The buffer with the image data to load and decode into the texture. + /// An instance with the contents of the specified file. + [Pure] + public UploadTexture2D LoadTexture(GraphicsDevice device, ReadOnlySpan span) + where T : unmanaged + { + using ComPtr wicBitmapDecoder = default; + using ComPtr wicStream = default; + + // Get the bitmap decoder for the target buffer + fixed (byte* p = span) { - this.wicImagingFactory2.Dispose(); - } + this.wicImagingFactory2.Get()->CreateStream(wicStream.GetAddressOf()).Assert(); - /// - /// Gets a instance to use. - /// - public static WICHelper Instance { get; } = new(); + wicStream.Get()->InitializeFromMemory(p, (uint)span.Length).Assert(); - /// - /// Loads an from a specified file. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The filename of the image file to load and decode into the texture. - /// An instance with the contents of the specified file. - [Pure] - public UploadTexture2D LoadTexture(GraphicsDevice device, ReadOnlySpan filename) - where T : unmanaged - { - using ComPtr wicBitmapDecoder = default; - - // Get the bitmap decoder for the target file - fixed (char* p = filename) - { - this.wicImagingFactory2.Get()->CreateDecoderFromFilename( - (ushort*)p, - null, - FX.GENERIC_READ, - WICDecodeOptions.WICDecodeMetadataCacheOnDemand, - wicBitmapDecoder.GetAddressOf()).Assert(); - } + this.wicImagingFactory2.Get()->CreateDecoderFromStream( + (IStream*)wicStream.Get(), + null, + WICDecodeOptions.WICDecodeMetadataCacheOnDemand, + wicBitmapDecoder.GetAddressOf()).Assert(); return LoadTexture(device, wicBitmapDecoder.Get()); } + } - /// - /// Loads an from a specified buffer. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The buffer with the image data to load and decode into the texture. - /// An instance with the contents of the specified file. - [Pure] - public UploadTexture2D LoadTexture(GraphicsDevice device, ReadOnlySpan span) - where T : unmanaged + /// + /// Saves a texture to a specified file. + /// + /// The type of items to store in the texture. + /// The texture data to save to an image. + /// The filename of the image file to save. + public void SaveTexture(TextureView2D texture, ReadOnlySpan filename) + where T : unmanaged + { + using ComPtr wicBitmapEncoder = default; + Guid containerGuid = WICFormatHelper.GetForFilename(filename); + + // Create the image encoder + this.wicImagingFactory2.Get()->CreateEncoder( + &containerGuid, + null, + wicBitmapEncoder.GetAddressOf()).Assert(); + + using ComPtr wicStream = default; + + // Create and initialize a stream to the target file + this.wicImagingFactory2.Get()->CreateStream(wicStream.GetAddressOf()).Assert(); + + fixed (char* p = filename) { - using ComPtr wicBitmapDecoder = default; - using ComPtr wicStream = default; - - // Get the bitmap decoder for the target buffer - fixed (byte* p = span) - { - this.wicImagingFactory2.Get()->CreateStream(wicStream.GetAddressOf()).Assert(); - - wicStream.Get()->InitializeFromMemory(p, (uint)span.Length).Assert(); - - this.wicImagingFactory2.Get()->CreateDecoderFromStream( - (IStream*)wicStream.Get(), - null, - WICDecodeOptions.WICDecodeMetadataCacheOnDemand, - wicBitmapDecoder.GetAddressOf()).Assert(); - - return LoadTexture(device, wicBitmapDecoder.Get()); - } + wicStream.Get()->InitializeFromFilename( + (ushort*)p, + FX.GENERIC_WRITE); } - /// - /// Saves a texture to a specified file. - /// - /// The type of items to store in the texture. - /// The texture data to save to an image. - /// The filename of the image file to save. - public void SaveTexture(TextureView2D texture, ReadOnlySpan filename) - where T : unmanaged - { - using ComPtr wicBitmapEncoder = default; - Guid containerGuid = WICFormatHelper.GetForFilename(filename); + // Initialize the encoder + wicBitmapEncoder.Get()->Initialize( + (IStream*)wicStream.Get(), + WICBitmapEncoderCacheOption.WICBitmapEncoderNoCache).Assert(); - // Create the image encoder - this.wicImagingFactory2.Get()->CreateEncoder( - &containerGuid, + using ComPtr wicBitmapFrameEncode = default; + + // Create the image frame and initialize it + wicBitmapEncoder.Get()->CreateNewFrame(wicBitmapFrameEncode.GetAddressOf(), null).Assert(); + + wicBitmapFrameEncode.Get()->Initialize(null).Assert(); + wicBitmapFrameEncode.Get()->SetSize((uint)texture.Width, (uint)texture.Height).Assert(); + + // Depending on the target format and the current pixel type, we need to check whether + // an intermediate encoding step is necessary. This is because not all pixel formats + // are directly supported by the native image encoders present in Windows. + if (WICFormatHelper.TryGetIntermediateFormatForType(containerGuid, out Guid intermediateGuid)) + { + T* data = texture.DangerousGetAddressAndByteStride(out int strideInBytes); + + using ComPtr wicBitmap = default; + Guid initialGuid = WICFormatHelper.GetForType(); + + // Create a bitmap wrapping the input texture + this.wicImagingFactory2.Get()->CreateBitmapFromMemory( + (uint)texture.Width, + (uint)texture.Height, + &initialGuid, + (uint)strideInBytes, + (uint)(strideInBytes * texture.Height), + (byte*)data, + wicBitmap.GetAddressOf()).Assert(); + + using ComPtr wicFormatConverter = default; + + this.wicImagingFactory2.Get()->CreateFormatConverter(wicFormatConverter.GetAddressOf()).Assert(); + + // Get a format converter to encode the pixel data + wicFormatConverter.Get()->Initialize( + (IWICBitmapSource*)wicBitmap.Get(), + &intermediateGuid, + WICBitmapDitherType.WICBitmapDitherTypeNone, null, - wicBitmapEncoder.GetAddressOf()).Assert(); + 0, + WICBitmapPaletteType.WICBitmapPaletteTypeMedianCut).Assert(); - using ComPtr wicStream = default; - - // Create and initialize a stream to the target file - this.wicImagingFactory2.Get()->CreateStream(wicStream.GetAddressOf()).Assert(); - - fixed (char* p = filename) - { - wicStream.Get()->InitializeFromFilename( - (ushort*)p, - FX.GENERIC_WRITE); - } - - // Initialize the encoder - wicBitmapEncoder.Get()->Initialize( - (IStream*)wicStream.Get(), - WICBitmapEncoderCacheOption.WICBitmapEncoderNoCache).Assert(); - - using ComPtr wicBitmapFrameEncode = default; - - // Create the image frame and initialize it - wicBitmapEncoder.Get()->CreateNewFrame(wicBitmapFrameEncode.GetAddressOf(), null).Assert(); - - wicBitmapFrameEncode.Get()->Initialize(null).Assert(); - wicBitmapFrameEncode.Get()->SetSize((uint)texture.Width, (uint)texture.Height).Assert(); - - // Depending on the target format and the current pixel type, we need to check whether - // an intermediate encoding step is necessary. This is because not all pixel formats - // are directly supported by the native image encoders present in Windows. - if (WICFormatHelper.TryGetIntermediateFormatForType(containerGuid, out Guid intermediateGuid)) - { - T* data = texture.DangerousGetAddressAndByteStride(out int strideInBytes); - - using ComPtr wicBitmap = default; - Guid initialGuid = WICFormatHelper.GetForType(); - - // Create a bitmap wrapping the input texture - this.wicImagingFactory2.Get()->CreateBitmapFromMemory( - (uint)texture.Width, - (uint)texture.Height, - &initialGuid, - (uint)strideInBytes, - (uint)(strideInBytes * texture.Height), - (byte*)data, - wicBitmap.GetAddressOf()).Assert(); - - using ComPtr wicFormatConverter = default; - - this.wicImagingFactory2.Get()->CreateFormatConverter(wicFormatConverter.GetAddressOf()).Assert(); - - // Get a format converter to encode the pixel data - wicFormatConverter.Get()->Initialize( - (IWICBitmapSource*)wicBitmap.Get(), - &intermediateGuid, - WICBitmapDitherType.WICBitmapDitherTypeNone, - null, - 0, - WICBitmapPaletteType.WICBitmapPaletteTypeMedianCut).Assert(); - - // Write the encoded image data to the frame - wicBitmapFrameEncode.Get()->SetPixelFormat(&intermediateGuid).Assert(); - wicBitmapFrameEncode.Get()->WriteSource( - (IWICBitmapSource*)wicBitmap.Get(), - null).Assert(); - } - else - { - T* data = texture.DangerousGetAddressAndByteStride(out int strideInBytes); - Guid initialGuid = WICFormatHelper.GetForType(); - - // Write the image data to the frame - wicBitmapFrameEncode.Get()->SetPixelFormat(&initialGuid).Assert(); - wicBitmapFrameEncode.Get()->WritePixels( - lineCount: (uint)texture.Height, - cbStride: (uint)strideInBytes, - cbBufferSize: (uint)(strideInBytes * texture.Height), - pbPixels: (byte*)data).Assert(); - } - - wicBitmapFrameEncode.Get()->Commit(); - wicBitmapEncoder.Get()->Commit(); + // Write the encoded image data to the frame + wicBitmapFrameEncode.Get()->SetPixelFormat(&intermediateGuid).Assert(); + wicBitmapFrameEncode.Get()->WriteSource( + (IWICBitmapSource*)wicBitmap.Get(), + null).Assert(); } - - /// - /// Loads an from a specified object. - /// - /// The type of items to store in the texture. - /// The instance to use to allocate the texture. - /// The object in use. - /// An instance with the contents of the specified file. - [Pure] - private UploadTexture2D LoadTexture(GraphicsDevice device, IWICBitmapDecoder* wicBitmapDecoder) - where T : unmanaged + else { - using ComPtr wicBitmapFrameDecode = default; + T* data = texture.DangerousGetAddressAndByteStride(out int strideInBytes); + Guid initialGuid = WICFormatHelper.GetForType(); - // Get the first frame of the loaded image (if more are present, they will be ignored) - wicBitmapDecoder->GetFrame(0, wicBitmapFrameDecode.GetAddressOf()).Assert(); + // Write the image data to the frame + wicBitmapFrameEncode.Get()->SetPixelFormat(&initialGuid).Assert(); + wicBitmapFrameEncode.Get()->WritePixels( + lineCount: (uint)texture.Height, + cbStride: (uint)strideInBytes, + cbBufferSize: (uint)(strideInBytes * texture.Height), + pbPixels: (byte*)data).Assert(); + } - uint width, height; + wicBitmapFrameEncode.Get()->Commit(); + wicBitmapEncoder.Get()->Commit(); + } - // Extract the image size info - wicBitmapFrameDecode.Get()->GetSize(&width, &height).Assert(); + /// + /// Loads an from a specified object. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The object in use. + /// An instance with the contents of the specified file. + [Pure] + private UploadTexture2D LoadTexture(GraphicsDevice device, IWICBitmapDecoder* wicBitmapDecoder) + where T : unmanaged + { + using ComPtr wicBitmapFrameDecode = default; - Guid - wicTargetPixelFormatGuid = WICFormatHelper.GetForType(), - wicActualPixelFormatGuid; + // Get the first frame of the loaded image (if more are present, they will be ignored) + wicBitmapDecoder->GetFrame(0, wicBitmapFrameDecode.GetAddressOf()).Assert(); - // Get the current and target pixel format info - wicBitmapFrameDecode.Get()->GetPixelFormat(&wicActualPixelFormatGuid).Assert(); + uint width, height; - // If the current pixel format is the same as the target one, we can just read the - // decoded pixel data directly. Otherwise, we need a pixel format conversion step. - if (wicTargetPixelFormatGuid == wicActualPixelFormatGuid) - { - // Allocate an upload texture to transfer the decoded pixel data - UploadTexture2D upload = device.AllocateUploadTexture2D((int)width, (int)height); + // Extract the image size info + wicBitmapFrameDecode.Get()->GetSize(&width, &height).Assert(); - T* data = upload.View.DangerousGetAddressAndByteStride(out int strideInBytes); + Guid + wicTargetPixelFormatGuid = WICFormatHelper.GetForType(), + wicActualPixelFormatGuid; - // Copy the decoded pixels directly from the loaded image - wicBitmapFrameDecode.Get()->CopyPixels( - prc: null, - cbStride: (uint)strideInBytes, - cbBufferSize: (uint)strideInBytes * height, - pbBuffer: (byte*)data).Assert(); + // Get the current and target pixel format info + wicBitmapFrameDecode.Get()->GetPixelFormat(&wicActualPixelFormatGuid).Assert(); - return upload; - } - else - { - using ComPtr wicFormatConverter = default; + // If the current pixel format is the same as the target one, we can just read the + // decoded pixel data directly. Otherwise, we need a pixel format conversion step. + if (wicTargetPixelFormatGuid == wicActualPixelFormatGuid) + { + // Allocate an upload texture to transfer the decoded pixel data + UploadTexture2D upload = device.AllocateUploadTexture2D((int)width, (int)height); - this.wicImagingFactory2.Get()->CreateFormatConverter(wicFormatConverter.GetAddressOf()).Assert(); + T* data = upload.View.DangerousGetAddressAndByteStride(out int strideInBytes); - // Get a format converter to decode the pixel data - wicFormatConverter.Get()->Initialize( - (IWICBitmapSource*)wicBitmapFrameDecode.Get(), - &wicTargetPixelFormatGuid, - WICBitmapDitherType.WICBitmapDitherTypeNone, - null, - 0, - WICBitmapPaletteType.WICBitmapPaletteTypeMedianCut).Assert(); + // Copy the decoded pixels directly from the loaded image + wicBitmapFrameDecode.Get()->CopyPixels( + prc: null, + cbStride: (uint)strideInBytes, + cbBufferSize: (uint)strideInBytes * height, + pbBuffer: (byte*)data).Assert(); - // Allocate an upload texture to transfer the converted pixel data - UploadTexture2D upload = device.AllocateUploadTexture2D((int)width, (int)height); + return upload; + } + else + { + using ComPtr wicFormatConverter = default; - T* data = upload.View.DangerousGetAddressAndByteStride(out int strideInBytes); + this.wicImagingFactory2.Get()->CreateFormatConverter(wicFormatConverter.GetAddressOf()).Assert(); - // Decode the pixel data into the upload buffer - wicFormatConverter.Get()->CopyPixels( - prc: null, - cbStride: (uint)strideInBytes, - cbBufferSize: (uint)strideInBytes * height, - pbBuffer: (byte*)data).Assert(); + // Get a format converter to decode the pixel data + wicFormatConverter.Get()->Initialize( + (IWICBitmapSource*)wicBitmapFrameDecode.Get(), + &wicTargetPixelFormatGuid, + WICBitmapDitherType.WICBitmapDitherTypeNone, + null, + 0, + WICBitmapPaletteType.WICBitmapPaletteTypeMedianCut).Assert(); - return upload; - } + // Allocate an upload texture to transfer the converted pixel data + UploadTexture2D upload = device.AllocateUploadTexture2D((int)width, (int)height); + + T* data = upload.View.DangerousGetAddressAndByteStride(out int strideInBytes); + + // Decode the pixel data into the upload buffer + wicFormatConverter.Get()->CopyPixels( + prc: null, + cbStride: (uint)strideInBytes, + cbBufferSize: (uint)strideInBytes * height, + pbBuffer: (byte*)data).Assert(); + + return upload; } } } diff --git a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs index 17eaea5f..89a703f2 100644 --- a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs @@ -5,195 +5,194 @@ using ComputeSharp.Resources; using Microsoft.Toolkit.Diagnostics; using TerraFX.Interop; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// A helper class with some proxy methods to expose to generated code in external projects. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This type is not intended to be used directly by user code")] +public static class GraphicsResourceHelper { /// - /// A helper class with some proxy methods to expose to generated code in external projects. + /// An interface for non-generic graphics resource types. /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This type is not intended to be used directly by user code")] - public static class GraphicsResourceHelper + internal interface IGraphicsResource { /// - /// An interface for non-generic graphics resource types. + /// Validates the given resource for usage with a specified device, and retrieves its GPU descriptor handle. /// - internal interface IGraphicsResource - { - /// - /// Validates the given resource for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The target instance in use. - /// The GPU descriptor handle for the resource. - D3D12_GPU_DESCRIPTOR_HANDLE ValidateAndGetGpuDescriptorHandle(GraphicsDevice device); - } - - /// - /// Validates the given buffer for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of values stored in the input buffer. - /// The input instance to check. /// The target instance in use. - /// The GPU descriptor handle for the buffer. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ulong ValidateAndGetGpuDescriptorHandle(Buffer buffer, GraphicsDevice device) - where T : unmanaged - { - buffer.ThrowIfDisposed(); - buffer.ThrowIfDeviceMismatch(device); + /// The GPU descriptor handle for the resource. + D3D12_GPU_DESCRIPTOR_HANDLE ValidateAndGetGpuDescriptorHandle(GraphicsDevice device); + } - return Unsafe.As(ref Unsafe.AsRef(in buffer.D3D12GpuDescriptorHandle)); + /// + /// Validates the given buffer for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input buffer. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the buffer. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(Buffer buffer, GraphicsDevice device) + where T : unmanaged + { + buffer.ThrowIfDisposed(); + buffer.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in buffer.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture2D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture2D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture2D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; } - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture2D texture, GraphicsDevice device) - where T : unmanaged - { - texture.ThrowIfDisposed(); - texture.ThrowIfDeviceMismatch(device); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } - return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture2D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; } - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture2D texture, GraphicsDevice device) - where T : unmanaged - { - texture.ThrowIfDisposed(); - texture.ThrowIfDeviceMismatch(device); + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } - return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture3D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture3D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture3D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; } - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of normalized values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture2D texture, GraphicsDevice device) - where TPixel : unmanaged + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture3D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) { - if (texture is IGraphicsResource resource) - { - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); - return *(ulong*)&d3D12GpuDescriptorHandle; - } - - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + return *(ulong*)&d3D12GpuDescriptorHandle; } - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of normalized values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture2D texture, GraphicsDevice device) - where TPixel : unmanaged - { - if (texture is IGraphicsResource resource) - { - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); - - return *(ulong*)&d3D12GpuDescriptorHandle; - } - - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); - } - - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture3D texture, GraphicsDevice device) - where T : unmanaged - { - texture.ThrowIfDisposed(); - texture.ThrowIfDeviceMismatch(device); - - return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); - } - - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture3D texture, GraphicsDevice device) - where T : unmanaged - { - texture.ThrowIfDisposed(); - texture.ThrowIfDeviceMismatch(device); - - return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); - } - - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of normalized values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture3D texture, GraphicsDevice device) - where TPixel : unmanaged - { - if (texture is IGraphicsResource resource) - { - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); - - return *(ulong*)&d3D12GpuDescriptorHandle; - } - - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); - } - - /// - /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. - /// - /// The type of normalized values stored in the input texture. - /// The input instance to check. - /// The target instance in use. - /// The GPU descriptor handle for the texture. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture3D texture, GraphicsDevice device) - where TPixel : unmanaged - { - if (texture is IGraphicsResource resource) - { - D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); - - return *(ulong*)&d3D12GpuDescriptorHandle; - } - - return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); - } + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); } } diff --git a/src/ComputeSharp/Graphics/Interop/InteropServices.cs b/src/ComputeSharp/Graphics/Interop/InteropServices.cs index c4aced19..288679f7 100644 --- a/src/ComputeSharp/Graphics/Interop/InteropServices.cs +++ b/src/ComputeSharp/Graphics/Interop/InteropServices.cs @@ -3,251 +3,250 @@ using System.ComponentModel; using ComputeSharp.Core.Extensions; using ComputeSharp.Resources; -namespace ComputeSharp.Interop +namespace ComputeSharp.Interop; + +/// +/// Provides methods to interoperate with the native APIs and the managed types in this library. +/// +/// None of the APIs in perform input validation, and it is responsibility +/// of consumers to ensure the input arguments are in a correct state to be used (eg. not disposed). +/// +/// +/// Manually interfering with the underlying COM objects for any of these types can result in issues if +/// the operations are not done correctly, which can prevent other APIs from functioning as expected. +/// Consumers should ensure the executed operations do not result in any errors. Furthermore, even when +/// the reference count to the returned COM object is incremented, consumers should ensure that the owning +/// objects will remain alive as long as the returned pointers are in use, to avoid unexpected issues. This +/// is because the lifecycle of certain COM objects (eg. resources) is delegated to an internal allocator +/// that relies on resources being disposed as soon as the relative allocation object is disposed. +/// +/// +public static unsafe class InteropServices { /// - /// Provides methods to interoperate with the native APIs and the managed types in this library. - /// - /// None of the APIs in perform input validation, and it is responsibility - /// of consumers to ensure the input arguments are in a correct state to be used (eg. not disposed). - /// - /// - /// Manually interfering with the underlying COM objects for any of these types can result in issues if - /// the operations are not done correctly, which can prevent other APIs from functioning as expected. - /// Consumers should ensure the executed operations do not result in any errors. Furthermore, even when - /// the reference count to the returned COM object is incremented, consumers should ensure that the owning - /// objects will remain alive as long as the returned pointers are in use, to avoid unexpected issues. This - /// is because the lifecycle of certain COM objects (eg. resources) is delegated to an internal allocator - /// that relies on resources being disposed as soon as the relative allocation object is disposed. - /// + /// Gets the underlying COM object for a given device, as a specified interface. This method invokes + /// IUnknown::QueryInterface. /// - public static unsafe class InteropServices + /// The input instance in use. + /// A reference to the interface identifier (IID) of the device interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Device(GraphicsDevice device, Guid* riid, void** ppvObject) { - /// - /// Gets the underlying COM object for a given device, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The input instance in use. - /// A reference to the interface identifier (IID) of the device interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Device(GraphicsDevice device, Guid* riid, void** ppvObject) - { - device.D3D12Device->QueryInterface(riid, ppvObject).Assert(); - } + device.D3D12Device->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the buffer. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Resource(Buffer buffer, Guid* riid, void** ppvObject) - where T : unmanaged - { - buffer.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); - } + /// + /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the buffer. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Resource(Buffer buffer, Guid* riid, void** ppvObject) + where T : unmanaged + { + buffer.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Resource(Texture2D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); - } + /// + /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Resource(Texture2D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Resource(Texture3D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); - } + /// + /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Resource(Texture3D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the buffer. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Resource(TransferBuffer buffer, Guid* riid, void** ppvObject) - where T : unmanaged - { - buffer.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); - } + /// + /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the buffer. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Resource(TransferBuffer buffer, Guid* riid, void** ppvObject) + where T : unmanaged + { + buffer.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Resource(TransferTexture2D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); - } + /// + /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Resource(TransferTexture2D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. - public static void GetID3D12Resource(TransferTexture3D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); - } + /// + /// Gets the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// Thrown if the IUnknown::QueryInterface call doesn't return S_OK. + public static void GetID3D12Resource(TransferTexture3D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + texture.D3D12Resource->QueryInterface(riid, ppvObject).Assert(); + } - /// - /// Tries to get the underlying COM object for a given device, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The input instance in use. - /// A reference to the interface identifier (IID) of the device interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Device(GraphicsDevice device, Guid* riid, void** ppvObject) - { - return device.D3D12Device->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given device, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The input instance in use. + /// A reference to the interface identifier (IID) of the device interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Device(GraphicsDevice device, Guid* riid, void** ppvObject) + { + return device.D3D12Device->QueryInterface(riid, ppvObject); + } - /// - /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the buffer. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Resource(Buffer buffer, Guid* riid, void** ppvObject) - where T : unmanaged - { - return buffer.D3D12Resource->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the buffer. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(Buffer buffer, Guid* riid, void** ppvObject) + where T : unmanaged + { + return buffer.D3D12Resource->QueryInterface(riid, ppvObject); + } - /// - /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Resource(Texture2D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - return texture.D3D12Resource->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(Texture2D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } - /// - /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Resource(Texture3D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - return texture.D3D12Resource->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(Texture3D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } - /// - /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the buffer. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Resource(TransferBuffer buffer, Guid* riid, void** ppvObject) - where T : unmanaged - { - return buffer.D3D12Resource->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the buffer. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(TransferBuffer buffer, Guid* riid, void** ppvObject) + where T : unmanaged + { + return buffer.D3D12Resource->QueryInterface(riid, ppvObject); + } - /// - /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Resource(TransferTexture2D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - return texture.D3D12Resource->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(TransferTexture2D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } - /// - /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes - /// IUnknown::QueryInterface. - /// - /// The type of items stored on the texture. - /// The input instance in use. - /// A reference to the interface identifier (IID) of the resource interface being queried for. - /// The address of a pointer to an interface with the IID specified in . - /// - /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. - /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. - /// - public static int TryGetID3D12Resource(TransferTexture3D texture, Guid* riid, void** ppvObject) - where T : unmanaged - { - return texture.D3D12Resource->QueryInterface(riid, ppvObject); - } + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(TransferTexture3D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); } } diff --git a/src/ComputeSharp/Graphics/Interop/NativeObject.cs b/src/ComputeSharp/Graphics/Interop/NativeObject.cs index 6bb2f3ce..28d49e0b 100644 --- a/src/ComputeSharp/Graphics/Interop/NativeObject.cs +++ b/src/ComputeSharp/Graphics/Interop/NativeObject.cs @@ -3,87 +3,86 @@ using System.Runtime.CompilerServices; using System.Threading; using ComputeSharp.Graphics.Helpers; -namespace ComputeSharp.Interop +namespace ComputeSharp.Interop; + +/// +/// Base class for a class. +/// +public abstract class NativeObject : IDisposable { /// - /// Base class for a class. + /// Indicates whether or not the current instance has been disposed. /// - public abstract class NativeObject : IDisposable - { - /// - /// Indicates whether or not the current instance has been disposed. - /// - private volatile int isDisposed; + private volatile int isDisposed; - /// - /// Releases unmanaged resources and performs other cleanup operations. - /// - ~NativeObject() + /// + /// Releases unmanaged resources and performs other cleanup operations. + /// + ~NativeObject() + { + if (Interlocked.CompareExchange(ref this.isDisposed, 1, 0) == 0) { - if (Interlocked.CompareExchange(ref this.isDisposed, 1, 0) == 0) + OnDispose(); + } + } + + /// + /// Gets whether or not the current instance has already been disposed. + /// + internal bool IsDisposed + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.isDisposed != 0; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + // If the current instance is a graphics device, check that the LUID doesn't + // match the one for the default device, which is deliberately never disposed. + // This type check is inlined and then resolved at JIT time if the target instance + // is visible to the compiler. That is, if Dispose() is explicitly called on a + // sealed type that is not GraphicsDevice, this entire path will just be removed. + if (GetType() == typeof(GraphicsDevice) && + DeviceHelper.GetDefaultDeviceLuid() == Unsafe.As(this).Luid) + { + return; + } + + if (Interlocked.CompareExchange(ref this.isDisposed, 1, 0) == 0) + { + [MethodImpl(MethodImplOptions.NoInlining)] + void DisposeAndSuppressFinalize() { OnDispose(); + + GC.SuppressFinalize(this); } + + DisposeAndSuppressFinalize(); } + } - /// - /// Gets whether or not the current instance has already been disposed. - /// - internal bool IsDisposed + /// + /// Releases unmanaged and (optionally) managed resources. + /// + protected abstract void OnDispose(); + + /// + /// Throws an if the current instance has been disposed. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDisposed() + { + if (IsDisposed) { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.isDisposed != 0; - } + // We can't use ThrowHelper here as we only want to invoke ToString if we + // are about to throw an exception. The JIT will recognize this pattern + // as this method has a single basic block that always throws an exception. + void Throw() => throw new ObjectDisposedException(ToString()); - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dispose() - { - // If the current instance is a graphics device, check that the LUID doesn't - // match the one for the default device, which is deliberately never disposed. - // This type check is inlined and then resolved at JIT time if the target instance - // is visible to the compiler. That is, if Dispose() is explicitly called on a - // sealed type that is not GraphicsDevice, this entire path will just be removed. - if (GetType() == typeof(GraphicsDevice) && - DeviceHelper.GetDefaultDeviceLuid() == Unsafe.As(this).Luid) - { - return; - } - - if (Interlocked.CompareExchange(ref this.isDisposed, 1, 0) == 0) - { - [MethodImpl(MethodImplOptions.NoInlining)] - void DisposeAndSuppressFinalize() - { - OnDispose(); - - GC.SuppressFinalize(this); - } - - DisposeAndSuppressFinalize(); - } - } - - /// - /// Releases unmanaged and (optionally) managed resources. - /// - protected abstract void OnDispose(); - - /// - /// Throws an if the current instance has been disposed. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDisposed() - { - if (IsDisposed) - { - // We can't use ThrowHelper here as we only want to invoke ToString if we - // are about to throw an exception. The JIT will recognize this pattern - // as this method has a single basic block that always throws an exception. - void Throw() => throw new ObjectDisposedException(ToString()); - - Throw(); - } + Throw(); } } } diff --git a/src/ComputeSharp/Graphics/Interop/ReferenceCountPtr{T}.cs b/src/ComputeSharp/Graphics/Interop/ReferenceCountPtr{T}.cs index cc7d8e51..0cf8d2f0 100644 --- a/src/ComputeSharp/Graphics/Interop/ReferenceCountPtr{T}.cs +++ b/src/ComputeSharp/Graphics/Interop/ReferenceCountPtr{T}.cs @@ -5,129 +5,128 @@ using System.Runtime.CompilerServices; using System.Threading; using TerraFX.Interop; -namespace ComputeSharp.Interop +namespace ComputeSharp.Interop; + +/// +/// A -equivalent type to safely work with pointers to public APIs. +/// This special type internally keeps track of a reference count for the wrapped native object. +/// This works around the lack of internal reference counting for objects from . +/// +/// Must be either , , or . +/// +/// This type is not marked as so that it can also be used in fields, so make sure to +/// avoid copying it and disposing it multiple times, as that would lead to a access violation exceptions. +/// +internal unsafe struct ReferenceCountPtr : IDisposable + where T : unmanaged { /// - /// A -equivalent type to safely work with pointers to public APIs. - /// This special type internally keeps track of a reference count for the wrapped native object. - /// This works around the lack of internal reference counting for objects from . + /// The raw pointer to an object, if existing. /// - /// Must be either , , or . - /// - /// This type is not marked as so that it can also be used in fields, so make sure to - /// avoid copying it and disposing it multiple times, as that would lead to a access violation exceptions. - /// - internal unsafe struct ReferenceCountPtr : IDisposable - where T : unmanaged + private T* pointer; + + /// + /// The current reference count - 1 for . + /// + private volatile int count; + + /// + /// Creates a new instance from a raw pointer. + /// + /// The raw pointer to wrap. + public ReferenceCountPtr(T* other) { - /// - /// The raw pointer to an object, if existing. - /// - private T* pointer; + this.pointer = other; + this.count = 0; + } - /// - /// The current reference count - 1 for . - /// - private volatile int count; + /// + /// Unwraps a instance and returns the internal raw pointer. + /// + /// The instance to unwrap. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator T*(ReferenceCountPtr other) + { + return other.Get(); + } - /// - /// Creates a new instance from a raw pointer. - /// - /// The raw pointer to wrap. - public ReferenceCountPtr(T* other) + /// + /// Increments the internal reference count. + /// + public void AddRef() + { + Interlocked.Increment(ref this.count); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + if (Interlocked.Decrement(ref this.count) < 0) { - this.pointer = other; - this.count = 0; - } + T* pointer = this.pointer; - /// - /// Unwraps a instance and returns the internal raw pointer. - /// - /// The instance to unwrap. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator T*(ReferenceCountPtr other) - { - return other.Get(); - } - - /// - /// Increments the internal reference count. - /// - public void AddRef() - { - Interlocked.Increment(ref this.count); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dispose() - { - if (Interlocked.Decrement(ref this.count) < 0) + if (pointer != null) { - T* pointer = this.pointer; + this.pointer = null; - if (pointer != null) - { - this.pointer = null; - - if (typeof(T) == typeof(D3D12MA_Allocator)) ((D3D12MA_Allocator*)pointer)->Release(); - else if (typeof(T) == typeof(D3D12MA_Allocation)) ((D3D12MA_Allocation*)pointer)->Release(); - else if (typeof(T) == typeof(D3D12MA_Pool)) ((D3D12MA_Pool*)pointer)->Release(); - else if (typeof(T) == typeof(D3D12MA_VirtualBlock)) ((D3D12MA_VirtualBlock*)pointer)->Release(); - else throw new ArgumentException("Invalid pointer type"); - } + if (typeof(T) == typeof(D3D12MA_Allocator)) ((D3D12MA_Allocator*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_Allocation)) ((D3D12MA_Allocation*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_Pool)) ((D3D12MA_Pool*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_VirtualBlock)) ((D3D12MA_VirtualBlock*)pointer)->Release(); + else throw new ArgumentException("Invalid pointer type"); } } + } - /// - /// Gets the currently wrapped raw pointer to an object. - /// - /// The raw pointer wrapped by the current instance. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly T* Get() - { - return this.pointer; - } + /// + /// Gets the currently wrapped raw pointer to an object. + /// + /// The raw pointer wrapped by the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly T* Get() + { + return this.pointer; + } - /// - /// Gets the address of the current instance as a raw double pointer. - /// - /// The raw pointer to the current instance. - /// This method is only valid when the current instance is on the stack or pinned. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly T** GetAddressOf() - { - return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); - } + /// + /// Gets the address of the current instance as a raw double pointer. + /// + /// The raw pointer to the current instance. + /// This method is only valid when the current instance is on the stack or pinned. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly T** GetAddressOf() + { + return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); + } - /// - /// Gets the address of the current instance as a managed reference to pointer. - /// - /// The reference to the current instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [EditorBrowsable(EditorBrowsableState.Never)] - public readonly ref T* GetPinnableReference() + /// + /// Gets the address of the current instance as a managed reference to pointer. + /// + /// The reference to the current instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [EditorBrowsable(EditorBrowsableState.Never)] + public readonly ref T* GetPinnableReference() + { + fixed (T** ptr = &this.pointer) { - fixed (T** ptr = &this.pointer) - { - return ref *ptr; - } + return ref *ptr; } + } - /// - /// Moves the current instance and resets it without releasing the reference. - /// - /// The moved instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ReferenceCountPtr Move() - { - ReferenceCountPtr copy = this; + /// + /// Moves the current instance and resets it without releasing the reference. + /// + /// The moved instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ReferenceCountPtr Move() + { + ReferenceCountPtr copy = this; - this = default; + this = default; - return copy; - } + return copy; } } diff --git a/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs b/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs index 0a074455..f76b1fa1 100644 --- a/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs +++ b/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs @@ -4,110 +4,109 @@ using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; using TerraFX.Interop; -namespace ComputeSharp.Interop +namespace ComputeSharp.Interop; + +/// +/// A -equivalent type to safely work with pointers to public APIs. +/// +/// Must be either , , or . +/// +/// This type is not marked as so that it can also be used in fields, so make sure to +/// avoid copying it and disposing it multiple times, as that would lead to a access violation exceptions. +/// +internal unsafe struct UniquePtr : IDisposable + where T : unmanaged { /// - /// A -equivalent type to safely work with pointers to public APIs. + /// The raw pointer to an object, if existing. /// - /// Must be either , , or . - /// - /// This type is not marked as so that it can also be used in fields, so make sure to - /// avoid copying it and disposing it multiple times, as that would lead to a access violation exceptions. - /// - internal unsafe struct UniquePtr : IDisposable - where T : unmanaged + private T* pointer; + + /// + /// Creates a new instance from a raw pointer. + /// + /// The raw pointer to wrap. + public UniquePtr(T* other) { - /// - /// The raw pointer to an object, if existing. - /// - private T* pointer; + this.pointer = other; + } - /// - /// Creates a new instance from a raw pointer. - /// - /// The raw pointer to wrap. - public UniquePtr(T* other) + /// + /// Unwraps a instance and returns the internal raw pointer. + /// + /// The instance to unwrap. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator T*(UniquePtr other) + { + return other.Get(); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + T* pointer = this.pointer; + + if (pointer != null) { - this.pointer = other; - } + this.pointer = null; - /// - /// Unwraps a instance and returns the internal raw pointer. - /// - /// The instance to unwrap. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator T*(UniquePtr other) - { - return other.Get(); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dispose() - { - T* pointer = this.pointer; - - if (pointer != null) - { - this.pointer = null; - - if (typeof(T) == typeof(D3D12MA_Allocator)) ((D3D12MA_Allocator*)pointer)->Release(); - else if (typeof(T) == typeof(D3D12MA_Allocation)) ((D3D12MA_Allocation*)pointer)->Release(); - else if (typeof(T) == typeof(D3D12MA_Pool)) ((D3D12MA_Pool*)pointer)->Release(); - else if (typeof(T) == typeof(D3D12MA_VirtualBlock)) ((D3D12MA_VirtualBlock*)pointer)->Release(); - else throw new ArgumentException("Invalid pointer type"); - } - } - - /// - /// Gets the currently wrapped raw pointer to an object. - /// - /// The raw pointer wrapped by the current instance. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly T* Get() - { - return this.pointer; - } - - /// - /// Gets the address of the current instance as a raw double pointer. - /// - /// The raw pointer to the current instance. - /// This method is only valid when the current instance is on the stack or pinned. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly T** GetAddressOf() - { - return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); - } - - /// - /// Gets the address of the current instance as a managed reference to pointer. - /// - /// The reference to the current instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [EditorBrowsable(EditorBrowsableState.Never)] - public readonly ref T* GetPinnableReference() - { - fixed (T** ptr = &this.pointer) - { - return ref *ptr; - } - } - - /// - /// Moves the current instance and resets it without releasing the reference. - /// - /// The moved instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public UniquePtr Move() - { - UniquePtr copy = this; - - this = default; - - return copy; + if (typeof(T) == typeof(D3D12MA_Allocator)) ((D3D12MA_Allocator*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_Allocation)) ((D3D12MA_Allocation*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_Pool)) ((D3D12MA_Pool*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_VirtualBlock)) ((D3D12MA_VirtualBlock*)pointer)->Release(); + else throw new ArgumentException("Invalid pointer type"); } } + + /// + /// Gets the currently wrapped raw pointer to an object. + /// + /// The raw pointer wrapped by the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly T* Get() + { + return this.pointer; + } + + /// + /// Gets the address of the current instance as a raw double pointer. + /// + /// The raw pointer to the current instance. + /// This method is only valid when the current instance is on the stack or pinned. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly T** GetAddressOf() + { + return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); + } + + /// + /// Gets the address of the current instance as a managed reference to pointer. + /// + /// The reference to the current instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [EditorBrowsable(EditorBrowsableState.Never)] + public readonly ref T* GetPinnableReference() + { + fixed (T** ptr = &this.pointer) + { + return ref *ptr; + } + } + + /// + /// Moves the current instance and resets it without releasing the reference. + /// + /// The moved instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniquePtr Move() + { + UniquePtr copy = this; + + this = default; + + return copy; + } } diff --git a/src/ComputeSharp/Graphics/Luid.cs b/src/ComputeSharp/Graphics/Luid.cs index f28d1089..89db2015 100644 --- a/src/ComputeSharp/Graphics/Luid.cs +++ b/src/ComputeSharp/Graphics/Luid.cs @@ -3,86 +3,85 @@ using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; using TerraFX.Interop; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A locally unique identifier for a graphics device. +/// +public readonly struct Luid : IEquatable { + #pragma warning disable CS0649 + + private readonly uint lowPart; + private readonly int highPart; + + #pragma warning restore + /// - /// A locally unique identifier for a graphics device. + /// Creates a new instance from a raw value. /// - public readonly struct Luid : IEquatable + /// The input value. + /// A instance with the same value. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe Luid FromLUID(LUID luid) { - #pragma warning disable CS0649 + return *(Luid*)&luid; + } - private readonly uint lowPart; - private readonly int highPart; + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Luid other) + { + return + this.lowPart == other.lowPart && + this.highPart == other.highPart; + } - #pragma warning restore + /// + [Pure] + public override bool Equals(object? other) + { + return other is Luid luid && Equals(luid); + } - /// - /// Creates a new instance from a raw value. - /// - /// The input value. - /// A instance with the same value. - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe Luid FromLUID(LUID luid) - { - return *(Luid*)&luid; - } + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() + { + return HashCode.Combine(this.lowPart, this.highPart); + } - /// - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(Luid other) - { - return - this.lowPart == other.lowPart && - this.highPart == other.highPart; - } + /// + [Pure] + public override string ToString() + { + return (((long)this.highPart) << 32 | this.lowPart).ToString(); + } - /// - [Pure] - public override bool Equals(object? other) - { - return other is Luid luid && Equals(luid); - } + /// + /// Check whether two values are equal. + /// + /// The first value to compare. + /// The second value to compare. + /// Whether and are the same. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Luid a, Luid b) + { + return a.Equals(b); + } - /// - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override int GetHashCode() - { - return HashCode.Combine(this.lowPart, this.highPart); - } - - /// - [Pure] - public override string ToString() - { - return (((long)this.highPart) << 32 | this.lowPart).ToString(); - } - - /// - /// Check whether two values are equal. - /// - /// The first value to compare. - /// The second value to compare. - /// Whether and are the same. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator ==(Luid a, Luid b) - { - return a.Equals(b); - } - - /// - /// Check whether two values are different. - /// - /// The first value to compare. - /// The second value to compare. - /// Whether and are different. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Luid a, Luid b) - { - return !a.Equals(b); - } + /// + /// Check whether two values are different. + /// + /// The first value to compare. + /// The second value to compare. + /// Whether and are different. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Luid a, Luid b) + { + return !a.Equals(b); } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs index b0aeafa0..d18f5050 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs @@ -11,185 +11,184 @@ using static TerraFX.Interop.D3D12_FEATURE; using FX = TerraFX.Interop.Windows; using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed buffer stored on GPU memory. +/// +/// The type of items stored on the buffer. +public unsafe abstract class Buffer : NativeObject + where T : unmanaged { /// - /// A representing a typed buffer stored on GPU memory. + /// The instance used to retrieve . /// - /// The type of items stored on the buffer. - public unsafe abstract class Buffer : NativeObject - where T : unmanaged + private UniquePtr allocation; + + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The instance for the current resource. + /// + private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The instance for the current resource. + /// + internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; + + /// + /// The size in bytes of the current buffer (this value is never negative). + /// + protected readonly nint SizeInBytes; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The size in bytes of each buffer item (including padding, if any). + /// The resource type for the current buffer. + /// The allocation mode to use for the new resource. + private protected Buffer(GraphicsDevice device, int length, uint elementSizeInBytes, ResourceType resourceType, AllocationMode allocationMode) { - /// - /// The instance used to retrieve . - /// - private UniquePtr allocation; + device.ThrowIfDisposed(); - /// - /// The instance currently mapped. - /// - private ComPtr d3D12Resource; - - /// - /// The instance for the current resource. - /// - private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; - - /// - /// The instance for the current resource. - /// - internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; - - /// - /// The size in bytes of the current buffer (this value is never negative). - /// - protected readonly nint SizeInBytes; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The size in bytes of each buffer item (including padding, if any). - /// The resource type for the current buffer. - /// The allocation mode to use for the new resource. - private protected Buffer(GraphicsDevice device, int length, uint elementSizeInBytes, ResourceType resourceType, AllocationMode allocationMode) + if (resourceType == ResourceType.Constant) { - device.ThrowIfDisposed(); - - if (resourceType == ResourceType.Constant) - { - Guard.IsBetweenOrEqualTo(length, 1, FX.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length)); - } - else - { - // The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue - Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / elementSizeInBytes) & ~255, nameof(length)); - } - - if (TypeInfo.IsDoubleOrContainsDoubles && - device.D3D12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS).DoublePrecisionFloatShaderOps == 0) - { - UnsupportedDoubleOperationsException.Throw(); - } - - SizeInBytes = checked((nint)(length * elementSizeInBytes)); - GraphicsDevice = device; - Length = length; - - this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, (ulong)SizeInBytes); - this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - - device.RegisterAllocatedResource(); - device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); - - switch (resourceType) - { - case ResourceType.Constant: - device.D3D12Device->CreateConstantBufferView(this.d3D12Resource.Get(), SizeInBytes, D3D12CpuDescriptorHandle); - break; - case ResourceType.ReadOnly: - device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle); - break; - case ResourceType.ReadWrite: - device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle); - break; - } - - this.d3D12Resource.Get()->SetName(this); + Guard.IsBetweenOrEqualTo(length, 1, FX.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length)); + } + else + { + // The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue + Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / elementSizeInBytes) & ~255, nameof(length)); } - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } - - /// - /// Gets the length of the current buffer. - /// - public int Length { get; } - - /// - /// Gets whether or not there is some padding between elements in the current buffer. - /// - internal bool IsPaddingPresent + if (TypeInfo.IsDoubleOrContainsDoubles && + device.D3D12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS).DoublePrecisionFloatShaderOps == 0) { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => SizeInBytes > (nint)Length * sizeof(T); + UnsupportedDoubleOperationsException.Throw(); } - /// - /// Gets the instance currently mapped. - /// - internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + SizeInBytes = checked((nint)(length * elementSizeInBytes)); + GraphicsDevice = device; + Length = length; - /// - /// Reads the contents of the specified range from the current instance and writes them into a target memory area. - /// - /// The input memory area to write data to. - /// The length of the memory area to write data to. - /// The offset to start reading data from. - internal abstract void CopyTo(ref T destination, int length, int offset); + this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, (ulong)SizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - /// - /// Writes the contents of a given memory area to a specified area of the current instance. - /// - /// The input memory area to read data from. - /// The length of the input memory area to read data from. - /// The offset to start writing data to. - internal abstract void CopyFrom(ref T source, int length, int offset); + device.RegisterAllocatedResource(); + device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); - /// - /// Writes the contents of a given to the current instance. - /// - /// The input to read data from. - public abstract void CopyFrom(Buffer source); - - /// - /// Writes the contents of a given to the current instance, using a temporary CPU buffer. - /// - /// The input to read data from. - protected void CopyFromWithCpuBuffer(Buffer source) + switch (resourceType) { - T[] array = ArrayPool.Shared.Rent(source.Length); - - try - { - ref T r0 = ref MemoryMarshal.GetArrayDataReference(array); - - source.CopyTo(ref r0, source.Length, 0); - - CopyFrom(ref r0, source.Length, 0); - } - finally - { - ArrayPool.Shared.Return(array); - } + case ResourceType.Constant: + device.D3D12Device->CreateConstantBufferView(this.d3D12Resource.Get(), SizeInBytes, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadOnly: + device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadWrite: + device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle); + break; } - /// - protected override void OnDispose() - { - this.d3D12Resource.Dispose(); - this.allocation.Dispose(); + this.d3D12Resource.Get()->SetName(this); + } - if (GraphicsDevice is GraphicsDevice device) - { - device.UnregisterAllocatedResource(); - device.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); - } - } + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } - /// - /// Throws a if the target device doesn't match the current one. - /// + /// + /// Gets the length of the current buffer. + /// + public int Length { get; } + + /// + /// Gets whether or not there is some padding between elements in the current buffer. + /// + internal bool IsPaddingPresent + { [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDeviceMismatch(GraphicsDevice device) + get => SizeInBytes > (nint)Length * sizeof(T); + } + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target memory area. + /// + /// The input memory area to write data to. + /// The length of the memory area to write data to. + /// The offset to start reading data from. + internal abstract void CopyTo(ref T destination, int length, int offset); + + /// + /// Writes the contents of a given memory area to a specified area of the current instance. + /// + /// The input memory area to read data from. + /// The length of the input memory area to read data from. + /// The offset to start writing data to. + internal abstract void CopyFrom(ref T source, int length, int offset); + + /// + /// Writes the contents of a given to the current instance. + /// + /// The input to read data from. + public abstract void CopyFrom(Buffer source); + + /// + /// Writes the contents of a given to the current instance, using a temporary CPU buffer. + /// + /// The input to read data from. + protected void CopyFromWithCpuBuffer(Buffer source) + { + T[] array = ArrayPool.Shared.Rent(source.Length); + + try { - if (GraphicsDevice != device) - { - GraphicsDeviceMismatchException.Throw(this, device); - } + ref T r0 = ref MemoryMarshal.GetArrayDataReference(array); + + source.CopyTo(ref r0, source.Length, 0); + + CopyFrom(ref r0, source.Length, 0); + } + finally + { + ArrayPool.Shared.Return(array); + } + } + + /// + protected override void OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice is GraphicsDevice device) + { + device.UnregisterAllocatedResource(); + device.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); + } + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); } } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs index dc7ca98b..095ed525 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs @@ -8,242 +8,241 @@ using TerraFX.Interop; using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed structured buffer stored on GPU memory. +/// +/// The type of items stored on the buffer. +public abstract class StructuredBuffer : Buffer + where T : unmanaged { /// - /// A representing a typed structured buffer stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the buffer. - public abstract class StructuredBuffer : Buffer - where T : unmanaged + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The buffer type for the current buffer. + /// The allocation mode to use for the new resource. + private protected unsafe StructuredBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode) + : base(device, length, (uint)sizeof(T), resourceType, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The buffer type for the current buffer. - /// The allocation mode to use for the new resource. - private protected unsafe StructuredBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode) - : base(device, length, (uint)sizeof(T), resourceType, allocationMode) + } + + /// + internal override unsafe void CopyTo(ref T destination, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) { - } + using ID3D12ResourceMap resource = D3D12Resource->Map(); - /// - internal override unsafe void CopyTo(ref T destination, int length, int offset) - { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - Guard.IsInRange(offset, 0, Length, nameof(offset)); - Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); - - if (GraphicsDevice.IsCacheCoherentUMA) + fixed (void* destinationPointer = &destination) { - using ID3D12ResourceMap resource = D3D12Resource->Map(); - - fixed (void* destinationPointer = &destination) - { - MemoryHelper.Copy( - resource.Pointer, - (uint)offset, - (uint)length, - (uint)sizeof(T), - destinationPointer); - } - } - else - { - nint - byteOffset = (nint)offset * sizeof(T), - byteLength = length * sizeof(T); - - using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource(null, ResourceType.ReadBack, AllocationMode.Default, (ulong)byteLength); - - using (CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY)) - { - copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(allocation.Get()->GetResource(), 0, D3D12Resource, (ulong)byteOffset, (ulong)byteLength); - copyCommandList.ExecuteAndWaitForCompletion(); - } - - using ID3D12ResourceMap resource = allocation.Get()->GetResource()->Map(); - - fixed (void* destinationPointer = &destination) - { - MemoryHelper.Copy( - resource.Pointer, - 0u, - (uint)length, - (uint)sizeof(T), - destinationPointer); - } - } - } - - /// - /// Reads the contents of the specified range from the current instance and writes them into a target instance. - /// - /// The target instance to write data to. - /// The starting offset within to write data to. - /// The number of items to read. - /// The offset to start reading data from. - internal unsafe void CopyTo(ReadBackBuffer destination, int destinationOffset, int length, int offset) - { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - destination.ThrowIfDeviceMismatch(GraphicsDevice); - destination.ThrowIfDisposed(); - - Guard.IsInRange(offset, 0, Length, nameof(offset)); - Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); - Guard.IsInRange(destinationOffset, 0, destination.Length, nameof(destinationOffset)); - Guard.IsLessThanOrEqualTo(destinationOffset + length, destination.Length, nameof(length)); - - if (GraphicsDevice.IsCacheCoherentUMA) - { - using ID3D12ResourceMap resource = D3D12Resource->Map(); - MemoryHelper.Copy( resource.Pointer, (uint)offset, (uint)length, (uint)sizeof(T), - destination.MappedData + destinationOffset); - } - else - { - ulong - byteDestinationOffset = (uint)destinationOffset * (uint)sizeof(T), - byteOffset = (uint)offset * (uint)sizeof(T), - byteLength = (uint)length * (uint)sizeof(T); - - using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); - - copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(destination.D3D12Resource, byteDestinationOffset, D3D12Resource, byteOffset, byteLength); - copyCommandList.ExecuteAndWaitForCompletion(); + destinationPointer); } } - - /// - internal override unsafe void CopyFrom(ref T source, int length, int offset) + else { - GraphicsDevice.ThrowIfDisposed(); + nint + byteOffset = (nint)offset * sizeof(T), + byteLength = length * sizeof(T); - ThrowIfDisposed(); + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource(null, ResourceType.ReadBack, AllocationMode.Default, (ulong)byteLength); - Guard.IsInRange(offset, 0, Length, nameof(offset)); - Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); - - if (GraphicsDevice.IsCacheCoherentUMA) + using (CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY)) { - using ID3D12ResourceMap resource = D3D12Resource->Map(); - - fixed (void* sourcePointer = &source) - { - MemoryHelper.Copy( - sourcePointer, - (uint)offset, - (uint)length, - (uint)sizeof(T), - resource.Pointer); - } - } - else - { - nint - byteOffset = (nint)offset * sizeof(T), - byteLength = length * sizeof(T); - - using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource(null, ResourceType.Upload, AllocationMode.Default, (ulong)byteLength); - - using (ID3D12ResourceMap resource = allocation.Get()->GetResource()->Map()) - fixed (void* sourcePointer = &source) - { - MemoryHelper.Copy( - sourcePointer, - 0u, - (uint)length, - (uint)sizeof(T), - resource.Pointer); - } - - using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); - - copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, (ulong)byteOffset, allocation.Get()->GetResource(), 0, (ulong)byteLength); + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(allocation.Get()->GetResource(), 0, D3D12Resource, (ulong)byteOffset, (ulong)byteLength); copyCommandList.ExecuteAndWaitForCompletion(); } - } - /// - /// Reads the contents of the specified range from an input instance and writes them to the current the current instance. - /// - /// The input instance to read data from. - /// The starting offset within to read data from. - /// The number of items to read. - /// The offset to start reading writing data to. - internal unsafe void CopyFrom(UploadBuffer source, int sourceOffset, int length, int offset) - { - GraphicsDevice.ThrowIfDisposed(); + using ID3D12ResourceMap resource = allocation.Get()->GetResource()->Map(); - ThrowIfDisposed(); - - source.ThrowIfDeviceMismatch(GraphicsDevice); - source.ThrowIfDisposed(); - - Guard.IsInRange(offset, 0, Length, nameof(offset)); - Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); - Guard.IsInRange(sourceOffset, 0, source.Length, nameof(sourceOffset)); - Guard.IsLessThanOrEqualTo(sourceOffset + length, source.Length, nameof(length)); - - if (GraphicsDevice.IsCacheCoherentUMA) + fixed (void* destinationPointer = &destination) { - using ID3D12ResourceMap resource = D3D12Resource->Map(); - MemoryHelper.Copy( - source.MappedData, - (uint)sourceOffset, + resource.Pointer, + 0u, (uint)length, (uint)sizeof(T), - (T*)resource.Pointer + offset); + destinationPointer); } - else - { - ulong - byteSourceOffset = (uint)sourceOffset * (uint)sizeof(T), - byteOffset = (uint)offset * (uint)sizeof(T), - byteLength = (uint)length * (uint)sizeof(T); - - using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); - - copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, byteOffset, source.D3D12Resource, byteSourceOffset, byteLength); - copyCommandList.ExecuteAndWaitForCompletion(); - } - } - - /// - public override unsafe void CopyFrom(Buffer source) - { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - source.ThrowIfDeviceMismatch(GraphicsDevice); - source.ThrowIfDisposed(); - - Guard.IsLessThanOrEqualTo(source.Length, Length, nameof(Length)); - - if (!source.IsPaddingPresent) - { - // Directly copy the input buffer - using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); - - copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, 0, source.D3D12Resource, 0,(ulong)SizeInBytes); - copyCommandList.ExecuteAndWaitForCompletion(); - } - else CopyFromWithCpuBuffer(source); } } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target instance. + /// + /// The target instance to write data to. + /// The starting offset within to write data to. + /// The number of items to read. + /// The offset to start reading data from. + internal unsafe void CopyTo(ReadBackBuffer destination, int destinationOffset, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + destination.ThrowIfDeviceMismatch(GraphicsDevice); + destination.ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + Guard.IsInRange(destinationOffset, 0, destination.Length, nameof(destinationOffset)); + Guard.IsLessThanOrEqualTo(destinationOffset + length, destination.Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)length, + (uint)sizeof(T), + destination.MappedData + destinationOffset); + } + else + { + ulong + byteDestinationOffset = (uint)destinationOffset * (uint)sizeof(T), + byteOffset = (uint)offset * (uint)sizeof(T), + byteLength = (uint)length * (uint)sizeof(T); + + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(destination.D3D12Resource, byteDestinationOffset, D3D12Resource, byteOffset, byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + } + + /// + internal override unsafe void CopyFrom(ref T source, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + (uint)offset, + (uint)length, + (uint)sizeof(T), + resource.Pointer); + } + } + else + { + nint + byteOffset = (nint)offset * sizeof(T), + byteLength = length * sizeof(T); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource(null, ResourceType.Upload, AllocationMode.Default, (ulong)byteLength); + + using (ID3D12ResourceMap resource = allocation.Get()->GetResource()->Map()) + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + 0u, + (uint)length, + (uint)sizeof(T), + resource.Pointer); + } + + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, (ulong)byteOffset, allocation.Get()->GetResource(), 0, (ulong)byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + } + + /// + /// Reads the contents of the specified range from an input instance and writes them to the current the current instance. + /// + /// The input instance to read data from. + /// The starting offset within to read data from. + /// The number of items to read. + /// The offset to start reading writing data to. + internal unsafe void CopyFrom(UploadBuffer source, int sourceOffset, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + Guard.IsInRange(sourceOffset, 0, source.Length, nameof(sourceOffset)); + Guard.IsLessThanOrEqualTo(sourceOffset + length, source.Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + MemoryHelper.Copy( + source.MappedData, + (uint)sourceOffset, + (uint)length, + (uint)sizeof(T), + (T*)resource.Pointer + offset); + } + else + { + ulong + byteSourceOffset = (uint)sourceOffset * (uint)sizeof(T), + byteOffset = (uint)offset * (uint)sizeof(T), + byteLength = (uint)length * (uint)sizeof(T); + + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, byteOffset, source.D3D12Resource, byteSourceOffset, byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + } + + /// + public override unsafe void CopyFrom(Buffer source) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsLessThanOrEqualTo(source.Length, Length, nameof(Length)); + + if (!source.IsPaddingPresent) + { + // Directly copy the input buffer + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, 0, source.D3D12Resource, 0,(ulong)SizeInBytes); + copyCommandList.ExecuteAndWaitForCompletion(); + } + else CopyFromWithCpuBuffer(source); + } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs index 4ef3b3e7..56329c71 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs @@ -17,268 +17,191 @@ using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; #pragma warning disable CS0618 -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed 2D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +public unsafe abstract class Texture2D : NativeObject, GraphicsResourceHelper.IGraphicsResource + where T : unmanaged { /// - /// A representing a typed 2D texture stored on GPU memory. + /// The instance used to retrieve . /// - /// The type of items stored on the texture. - public unsafe abstract class Texture2D : NativeObject, GraphicsResourceHelper.IGraphicsResource - where T : unmanaged + private UniquePtr allocation; + + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The instance for the current resource. + /// + private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The instance for the current resource. + /// + internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; + + /// + /// The default value for the current resource. + /// + private readonly D3D12_RESOURCE_STATES d3D12ResourceState; + + /// + /// The value to use for copy operations. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + /// The format support for the current texture type. + private protected Texture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, AllocationMode allocationMode, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport) { - /// - /// The instance used to retrieve . - /// - private UniquePtr allocation; + device.ThrowIfDisposed(); - /// - /// The instance currently mapped. - /// - private ComPtr d3D12Resource; + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height)); - /// - /// The instance for the current resource. - /// - private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; - - /// - /// The instance for the current resource. - /// - internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; - - /// - /// The default value for the current resource. - /// - private readonly D3D12_RESOURCE_STATES d3D12ResourceState; - - /// - /// The value to use for copy operations. - /// - private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; - - /// - /// The description for the current resource. - /// - private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The height of the texture. - /// The width of the texture. - /// The resource type for the current texture. - /// The allocation mode to use for the new resource. - /// The format support for the current texture type. - private protected Texture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, AllocationMode allocationMode, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport) + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), d3D12FormatSupport)) { - device.ThrowIfDisposed(); - - Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height)); - - if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), d3D12FormatSupport)) - { - UnsupportedTextureTypeException.ThrowForTexture2D(); - } - - GraphicsDevice = device; - - this.allocation = device.Allocator->CreateResource( - device.Pool, - resourceType, - allocationMode, - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - out this.d3D12ResourceState); - - this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - - this.d3D12CommandListType = this.d3D12ResourceState == D3D12_RESOURCE_STATE_COMMON - ? D3D12_COMMAND_LIST_TYPE_COPY - : D3D12_COMMAND_LIST_TYPE_COMPUTE; - - device.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - out this.d3D12PlacedSubresourceFootprint, - out _, - out _); - - device.RegisterAllocatedResource(); - device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); - - switch (resourceType) - { - case ResourceType.ReadOnly: - device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_SRV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle); - break; - case ResourceType.ReadWrite: - device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_UAV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle); - break; - } - - this.d3D12Resource.Get()->SetName(this); + UnsupportedTextureTypeException.ThrowForTexture2D(); } - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } + GraphicsDevice = device; - /// - /// Gets the width of the current texture. - /// - public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + this.allocation = device.Allocator->CreateResource( + device.Pool, + resourceType, + allocationMode, + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out this.d3D12ResourceState); - /// - /// Gets the height of the current texture. - /// - public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - /// - /// Gets the instance currently mapped. - /// - internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + this.d3D12CommandListType = this.d3D12ResourceState == D3D12_RESOURCE_STATE_COMMON + ? D3D12_COMMAND_LIST_TYPE_COPY + : D3D12_COMMAND_LIST_TYPE_COMPUTE; - /// - /// Reads the contents of the specified range from the current instance and writes them into a target memory area. - /// - /// The target memory area to write data to. - /// The size of the target memory area to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - internal void CopyTo(ref T destination, int size, int x, int y, int width, int height) + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out this.d3D12PlacedSubresourceFootprint, + out _, + out _); + + device.RegisterAllocatedResource(); + device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); + + switch (resourceType) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - Guard.IsInRange(x, 0, Width, nameof(x)); - Guard.IsInRange(y, 0, Height, nameof(y)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); - Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); - Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size)); - - GraphicsDevice.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintDestination, - out ulong rowSizeInBytes, - out ulong totalSizeInBytes); - - using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( - GraphicsDevice.Pool, - ResourceType.ReadBack, - AllocationMode.Default, - totalSizeInBytes); - - using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); - - using (CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType)) - { - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); - } - - copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: d3D12Resource.Get(), - &d3D12PlacedSubresourceFootprintDestination, - destinationX: 0, - destinationY: 0, - destinationZ: 0, - d3D12ResourceSource: D3D12Resource, - sourceX: (uint)x, - sourceY: (uint)y, - sourceZ: 0, - (uint)width, - (uint)height, - depth: 1); - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); - } - - copyCommandList.ExecuteAndWaitForCompletion(); - } - - using ID3D12ResourceMap resource = d3D12Resource.Get()->Map(); - - fixed (void* destinationPointer = &destination) - { - MemoryHelper.Copy( - resource.Pointer, - (uint)height, - rowSizeInBytes, - d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch, - destinationPointer); - } + case ResourceType.ReadOnly: + device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_SRV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadWrite: + device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_UAV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle); + break; } - /// - /// Reads the contents of the specified range from the current instance and writes them into a target instance. - /// - /// The target instance to write data to. - /// The horizontal offset within . - /// The vertical offset within . - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - internal void CopyTo(ReadBackTexture2D destination, int destinationX, int destinationY, int sourceX, int sourceY, int width, int height) + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target memory area. + /// + /// The target memory area to write data to. + /// The size of the target memory area to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + internal void CopyTo(ref T destination, int size, int x, int y, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintDestination, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( + GraphicsDevice.Pool, + ResourceType.ReadBack, + AllocationMode.Default, + totalSizeInBytes); + + using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); + + using (CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType)) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - destination.ThrowIfDeviceMismatch(GraphicsDevice); - destination.ThrowIfDisposed(); - - Guard.IsInRange(destinationX, 0, destination.Width, nameof(destinationX)); - Guard.IsInRange(destinationY, 0, destination.Height, nameof(destinationY)); - Guard.IsInRange(sourceX, 0, Width, nameof(sourceX)); - Guard.IsInRange(sourceY, 0, Height, nameof(sourceY)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height)); - Guard.IsBetweenOrEqualTo(destinationX + width, 1, destination.Width, nameof(destinationX)); - Guard.IsBetweenOrEqualTo(destinationY + height, 1, destination.Height, nameof(destinationY)); - Guard.IsLessThanOrEqualTo(sourceX + width, Width, nameof(sourceX)); - Guard.IsLessThanOrEqualTo(sourceY + height, Height, nameof(sourceY)); - - using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); } - fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination = &destination.D3D12PlacedSubresourceFootprint) - { - copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: destination.D3D12Resource, - d3D12PlacedSubresourceFootprintDestination, - (uint)destinationX, - (uint)destinationY, - destinationZ: 0, - d3D12ResourceSource: D3D12Resource, - (uint)sourceX, - (uint)sourceY, - sourceZ: 0, - (uint)width, - (uint)height, - 1); - } + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintDestination, + destinationX: 0, + destinationY: 0, + destinationZ: 0, + d3D12ResourceSource: D3D12Resource, + sourceX: (uint)x, + sourceY: (uint)y, + sourceZ: 0, + (uint)width, + (uint)height, + depth: 1); if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { @@ -288,181 +211,257 @@ namespace ComputeSharp.Resources copyCommandList.ExecuteAndWaitForCompletion(); } - /// - /// Writes the contents of a given memory area to a specified area of the current instance. - /// - /// The input memory area to read data from. - /// The size of the memory area to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - internal void CopyFrom(ref T source, int size, int x, int y, int width, int height) + using ID3D12ResourceMap resource = d3D12Resource.Get()->Map(); + + fixed (void* destinationPointer = &destination) { - GraphicsDevice.ThrowIfDisposed(); + MemoryHelper.Copy( + resource.Pointer, + (uint)height, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch, + destinationPointer); + } + } - ThrowIfDisposed(); + /// + /// Reads the contents of the specified range from the current instance and writes them into a target instance. + /// + /// The target instance to write data to. + /// The horizontal offset within . + /// The vertical offset within . + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + internal void CopyTo(ReadBackTexture2D destination, int destinationX, int destinationY, int sourceX, int sourceY, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); - Guard.IsInRange(x, 0, Width, nameof(x)); - Guard.IsInRange(y, 0, Height, nameof(y)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); - Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); - Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size)); + ThrowIfDisposed(); - GraphicsDevice.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), + destination.ThrowIfDeviceMismatch(GraphicsDevice); + destination.ThrowIfDisposed(); + + Guard.IsInRange(destinationX, 0, destination.Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, destination.Height, nameof(destinationY)); + Guard.IsInRange(sourceX, 0, Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, Height, nameof(sourceY)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height)); + Guard.IsBetweenOrEqualTo(destinationX + width, 1, destination.Width, nameof(destinationX)); + Guard.IsBetweenOrEqualTo(destinationY + height, 1, destination.Height, nameof(destinationY)); + Guard.IsLessThanOrEqualTo(sourceX + width, Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, Height, nameof(sourceY)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination = &destination.D3D12PlacedSubresourceFootprint) + { + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: destination.D3D12Resource, + d3D12PlacedSubresourceFootprintDestination, + (uint)destinationX, + (uint)destinationY, + destinationZ: 0, + d3D12ResourceSource: D3D12Resource, + (uint)sourceX, + (uint)sourceY, + sourceZ: 0, (uint)width, (uint)height, - out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintSource, - out ulong rowSizeInBytes, - out ulong totalSizeInBytes); + 1); + } - using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( - GraphicsDevice.Pool, - ResourceType.Upload, - AllocationMode.Default, - totalSizeInBytes); + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); + } - using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); + copyCommandList.ExecuteAndWaitForCompletion(); + } - using (ID3D12ResourceMap resource = d3D12Resource.Get()->Map()) - fixed (void* sourcePointer = &source) - { - MemoryHelper.Copy( - sourcePointer, - resource.Pointer, - (uint)height, - rowSizeInBytes, - d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch); - } + /// + /// Writes the contents of a given memory area to a specified area of the current instance. + /// + /// The input memory area to read data from. + /// The size of the memory area to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + internal void CopyFrom(ref T source, int size, int x, int y, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); - using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + ThrowIfDisposed(); - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); - } + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size)); + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintSource, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( + GraphicsDevice.Pool, + ResourceType.Upload, + AllocationMode.Default, + totalSizeInBytes); + + using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); + + using (ID3D12ResourceMap resource = d3D12Resource.Get()->Map()) + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + resource.Pointer, + (uint)height, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch); + } + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + destinationX: (uint)x, + destinationY: (uint)y, + destinationZ: 0, + d3D12ResourceSource: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintSource, + sourceX: 0, + sourceY: 0, + sourceZ: 0, + (uint)width, + (uint)height, + depth: 1); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Writes the contents of a given instance to a specified area of the current instance. + /// + /// The input instance to read data from. + /// The horizontal offset within . + /// The vertical offset within . + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + internal void CopyFrom(UploadTexture2D source, int sourceX, int sourceY, int destinationX, int destinationY, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsInRange(sourceX, 0, source.Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, source.Height, nameof(sourceY)); + Guard.IsInRange(destinationX, 0, Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, Height, nameof(destinationY)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height)); + Guard.IsLessThanOrEqualTo(sourceX + width, source.Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, source.Height, nameof(sourceY)); + Guard.IsLessThanOrEqualTo(destinationX + width, Width, nameof(destinationX)); + Guard.IsLessThanOrEqualTo(destinationY + height, Height, nameof(destinationY)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource = &source.D3D12PlacedSubresourceFootprint) + { copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( d3D12ResourceDestination: D3D12Resource, - destinationX: (uint)x, - destinationY: (uint)y, + (uint)destinationX, + (uint)destinationY, destinationZ: 0, - d3D12ResourceSource: d3D12Resource.Get(), - &d3D12PlacedSubresourceFootprintSource, - sourceX: 0, - sourceY: 0, + d3D12ResourceSource: source.D3D12Resource, + d3D12PlacedSubresourceFootprintSource, + (uint)sourceX, + (uint)sourceY, sourceZ: 0, (uint)width, (uint)height, depth: 1); - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); - } - - copyCommandList.ExecuteAndWaitForCompletion(); } - /// - /// Writes the contents of a given instance to a specified area of the current instance. - /// - /// The input instance to read data from. - /// The horizontal offset within . - /// The vertical offset within . - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - internal void CopyFrom(UploadTexture2D source, int sourceX, int sourceY, int destinationX, int destinationY, int width, int height) + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - source.ThrowIfDeviceMismatch(GraphicsDevice); - source.ThrowIfDisposed(); - - Guard.IsInRange(sourceX, 0, source.Width, nameof(sourceX)); - Guard.IsInRange(sourceY, 0, source.Height, nameof(sourceY)); - Guard.IsInRange(destinationX, 0, Width, nameof(destinationX)); - Guard.IsInRange(destinationY, 0, Height, nameof(destinationY)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height)); - Guard.IsLessThanOrEqualTo(sourceX + width, source.Width, nameof(sourceX)); - Guard.IsLessThanOrEqualTo(sourceY + height, source.Height, nameof(sourceY)); - Guard.IsLessThanOrEqualTo(destinationX + width, Width, nameof(destinationX)); - Guard.IsLessThanOrEqualTo(destinationY + height, Height, nameof(destinationY)); - - using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); - } - - fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource = &source.D3D12PlacedSubresourceFootprint) - { - copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: D3D12Resource, - (uint)destinationX, - (uint)destinationY, - destinationZ: 0, - d3D12ResourceSource: source.D3D12Resource, - d3D12PlacedSubresourceFootprintSource, - (uint)sourceX, - (uint)sourceY, - sourceZ: 0, - (uint)width, - (uint)height, - depth: 1); - } - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); - } - - copyCommandList.ExecuteAndWaitForCompletion(); + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); } - /// - protected override void OnDispose() + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + protected override void OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice is GraphicsDevice device) { - this.d3D12Resource.Dispose(); - this.allocation.Dispose(); - - if (GraphicsDevice is GraphicsDevice device) - { - device.UnregisterAllocatedResource(); - device.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); - } - } - - /// - /// Throws a if the target device doesn't match the current one. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDeviceMismatch(GraphicsDevice device) - { - if (GraphicsDevice != device) - { - GraphicsDeviceMismatchException.Throw(this, device); - } - } - - /// - D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device) - { - ThrowIfDisposed(); - ThrowIfDeviceMismatch(device); - - return D3D12GpuDescriptorHandle; + device.UnregisterAllocatedResource(); + device.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); } } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + + /// + D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device) + { + ThrowIfDisposed(); + ThrowIfDeviceMismatch(device); + + return D3D12GpuDescriptorHandle; + } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs index 680f7f35..44985ebc 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs @@ -17,294 +17,206 @@ using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; #pragma warning disable CS0618 -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed 3D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +public unsafe abstract class Texture3D : NativeObject, GraphicsResourceHelper.IGraphicsResource + where T : unmanaged { /// - /// A representing a typed 3D texture stored on GPU memory. + /// The instance used to retrieve . /// - /// The type of items stored on the texture. - public unsafe abstract class Texture3D : NativeObject, GraphicsResourceHelper.IGraphicsResource - where T : unmanaged + private UniquePtr allocation; + + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The instance for the current resource. + /// + private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The instance for the current resource. + /// + internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; + + /// + /// The default value for the current resource. + /// + private readonly D3D12_RESOURCE_STATES d3D12ResourceState; + + /// + /// The value to use for copy operations. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The depth of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + /// The format support for the current texture type. + private protected Texture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, AllocationMode allocationMode, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport) { - /// - /// The instance used to retrieve . - /// - private UniquePtr allocation; + device.ThrowIfDisposed(); - /// - /// The instance currently mapped. - /// - private ComPtr d3D12Resource; + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth)); - /// - /// The instance for the current resource. - /// - private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; - - /// - /// The instance for the current resource. - /// - internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; - - /// - /// The default value for the current resource. - /// - private readonly D3D12_RESOURCE_STATES d3D12ResourceState; - - /// - /// The value to use for copy operations. - /// - private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; - - /// - /// The description for the current resource. - /// - private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The height of the texture. - /// The width of the texture. - /// The depth of the texture. - /// The resource type for the current texture. - /// The allocation mode to use for the new resource. - /// The format support for the current texture type. - private protected Texture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, AllocationMode allocationMode, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport) + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), d3D12FormatSupport)) { - device.ThrowIfDisposed(); - - Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth)); - - if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), d3D12FormatSupport)) - { - UnsupportedTextureTypeException.ThrowForTexture3D(); - } - - GraphicsDevice = device; - - this.allocation = device.Allocator->CreateResource( - device.Pool, - resourceType, - allocationMode, - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - (ushort)depth, - out this.d3D12ResourceState); - - this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - - this.d3D12CommandListType = this.d3D12ResourceState == D3D12_RESOURCE_STATE_COMMON - ? D3D12_COMMAND_LIST_TYPE_COPY - : D3D12_COMMAND_LIST_TYPE_COMPUTE; - - device.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - (ushort)depth, - out this.d3D12PlacedSubresourceFootprint, - out _, - out _); - - device.RegisterAllocatedResource(); - device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); - - switch (resourceType) - { - case ResourceType.ReadOnly: - device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_SRV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle); - break; - case ResourceType.ReadWrite: - device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_UAV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle); - break; - } - - this.d3D12Resource.Get()->SetName(this); + UnsupportedTextureTypeException.ThrowForTexture3D(); } - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } + GraphicsDevice = device; - /// - /// Gets the width of the current texture. - /// - public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + this.allocation = device.Allocator->CreateResource( + device.Pool, + resourceType, + allocationMode, + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out this.d3D12ResourceState); - /// - /// Gets the height of the current texture. - /// - public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - /// - /// Gets the depth of the current texture. - /// - public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; + this.d3D12CommandListType = this.d3D12ResourceState == D3D12_RESOURCE_STATE_COMMON + ? D3D12_COMMAND_LIST_TYPE_COPY + : D3D12_COMMAND_LIST_TYPE_COMPUTE; - /// - /// Gets the instance currently mapped. - /// - internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out this.d3D12PlacedSubresourceFootprint, + out _, + out _); - /// - /// Reads the contents of the specified range from the current instance and writes them into a target memory area. - /// - /// The target memory area to write data to. - /// The size of the memory area to write data to. - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - /// The depth of the memory area to copy. - internal void CopyTo(ref T destination, int size, int x, int y, int z, int width, int height, int depth) + device.RegisterAllocatedResource(); + device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); + + switch (resourceType) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - Guard.IsInRange(x, 0, Width, nameof(x)); - Guard.IsInRange(y, 0, Height, nameof(y)); - Guard.IsInRange(z, 0, Depth, nameof(z)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); - Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); - Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); - Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); - Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size)); - - GraphicsDevice.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - (ushort)depth, - out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintDestination, - out ulong rowSizeInBytes, - out ulong totalSizeInBytes); - - using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( - GraphicsDevice.Pool, - ResourceType.ReadBack, - AllocationMode.Default, - totalSizeInBytes); - - using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); - - using (CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType)) - { - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); - } - - copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: d3D12Resource.Get(), - &d3D12PlacedSubresourceFootprintDestination, - destinationX: 0, - destinationY: 0, - destinationZ: 0, - d3D12ResourceSource: D3D12Resource, - sourceX: (uint)x, - sourceY: (uint)y, - sourceZ: (ushort)z, - (uint)width, - (uint)height, - (ushort)depth); - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); - } - - copyCommandList.ExecuteAndWaitForCompletion(); - } - - using ID3D12ResourceMap resource = d3D12Resource.Get()->Map(); - - fixed (void* destinationPointer = &destination) - { - MemoryHelper.Copy( - resource.Pointer, - (uint)height, - (uint)depth, - rowSizeInBytes, - d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch, - d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch * (uint)height, - destinationPointer); - } + case ResourceType.ReadOnly: + device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_SRV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadWrite: + device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_UAV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle); + break; } - /// - /// Reads the contents of the specified range from the current instance and writes them into a instance. - /// - /// The target instance to write data to. - /// The horizontal offset within . - /// The vertical offset within . - /// The depthwise offset within . - /// The horizontal offset in the source texture. - /// The vertical offset in the source texture. - /// The depthwise offset in the source texture. - /// The width of the memory area to copy. - /// The height of the memory area to copy. - /// The depth of the memory area to copy. - internal void CopyTo(ReadBackTexture3D destination, int destinationX, int destinationY, int destinationZ, int sourceX, int sourceY, int sourceZ, int width, int height, int depth) + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + + /// + /// Gets the depth of the current texture. + /// + public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target memory area. + /// + /// The target memory area to write data to. + /// The size of the memory area to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + internal void CopyTo(ref T destination, int size, int x, int y, int z, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsInRange(z, 0, Depth, nameof(z)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintDestination, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( + GraphicsDevice.Pool, + ResourceType.ReadBack, + AllocationMode.Default, + totalSizeInBytes); + + using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); + + using (CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType)) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - destination.ThrowIfDeviceMismatch(GraphicsDevice); - destination.ThrowIfDisposed(); - - Guard.IsInRange(destinationX, 0, destination.Width, nameof(destinationX)); - Guard.IsInRange(destinationY, 0, destination.Height, nameof(destinationY)); - Guard.IsInRange(destinationZ, 0, destination.Depth, nameof(destinationZ)); - Guard.IsInRange(sourceX, 0, Width, nameof(sourceX)); - Guard.IsInRange(sourceY, 0, Height, nameof(sourceY)); - Guard.IsInRange(sourceZ, 0, Depth, nameof(sourceZ)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); - Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth, nameof(depth)); - Guard.IsBetweenOrEqualTo(destinationX + width, 1, destination.Width, nameof(destinationX)); - Guard.IsBetweenOrEqualTo(destinationY + height, 1, destination.Height, nameof(destinationY)); - Guard.IsBetweenOrEqualTo(destinationZ + depth, 1, destination.Depth, nameof(destinationZ)); - Guard.IsLessThanOrEqualTo(sourceX + width, Width, nameof(sourceX)); - Guard.IsLessThanOrEqualTo(sourceY + height, Height, nameof(sourceY)); - Guard.IsLessThanOrEqualTo(sourceZ + depth, Depth, nameof(sourceZ)); - - using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); } - fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination = &destination.D3D12PlacedSubresourceFootprint) - { - copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: destination.D3D12Resource, - d3D12PlacedSubresourceFootprintDestination, - (uint)destinationX, - (uint)destinationY, - (ushort)destinationZ, - d3D12ResourceSource: D3D12Resource, - (uint)sourceX, - (uint)sourceY, - (ushort)sourceZ, - (uint)width, - (uint)height, - (ushort)depth); - } + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintDestination, + destinationX: 0, + destinationY: 0, + destinationZ: 0, + d3D12ResourceSource: D3D12Resource, + sourceX: (uint)x, + sourceY: (uint)y, + sourceZ: (ushort)z, + (uint)width, + (uint)height, + (ushort)depth); if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { @@ -314,198 +226,285 @@ namespace ComputeSharp.Resources copyCommandList.ExecuteAndWaitForCompletion(); } - /// - /// Writes the contents of a given memory area to a specified area of the current instance. - /// - /// The input memory area to read data from. - /// The size of the memory area to read data from. - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The depthwise offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - /// The depth of the memory area to write to. - internal void CopyFrom(ref T source, int size, int x, int y, int z, int width, int height, int depth) + using ID3D12ResourceMap resource = d3D12Resource.Get()->Map(); + + fixed (void* destinationPointer = &destination) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - Guard.IsInRange(x, 0, Width, nameof(x)); - Guard.IsInRange(y, 0, Height, nameof(y)); - Guard.IsInRange(z, 0, Depth, nameof(z)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); - Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); - Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); - Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); - Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size)); - - GraphicsDevice.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, + MemoryHelper.Copy( + resource.Pointer, (uint)height, - (ushort)depth, - out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintSource, - out ulong rowSizeInBytes, - out ulong totalSizeInBytes); + (uint)depth, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch, + d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch * (uint)height, + destinationPointer); + } + } - using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( - GraphicsDevice.Pool, - ResourceType.Upload, - AllocationMode.Default, - totalSizeInBytes); + /// + /// Reads the contents of the specified range from the current instance and writes them into a instance. + /// + /// The target instance to write data to. + /// The horizontal offset within . + /// The vertical offset within . + /// The depthwise offset within . + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + internal void CopyTo(ReadBackTexture3D destination, int destinationX, int destinationY, int destinationZ, int sourceX, int sourceY, int sourceZ, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); - using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); + ThrowIfDisposed(); - using (ID3D12ResourceMap resource = d3D12Resource.Get()->Map()) - fixed (void* sourcePointer = &source) - { - MemoryHelper.Copy( - sourcePointer, - resource.Pointer, - (uint)height, - (uint)depth, - rowSizeInBytes, - d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch, - d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch * (uint)height); - } + destination.ThrowIfDeviceMismatch(GraphicsDevice); + destination.ThrowIfDisposed(); - using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + Guard.IsInRange(destinationX, 0, destination.Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, destination.Height, nameof(destinationY)); + Guard.IsInRange(destinationZ, 0, destination.Depth, nameof(destinationZ)); + Guard.IsInRange(sourceX, 0, Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, Height, nameof(sourceY)); + Guard.IsInRange(sourceZ, 0, Depth, nameof(sourceZ)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(destinationX + width, 1, destination.Width, nameof(destinationX)); + Guard.IsBetweenOrEqualTo(destinationY + height, 1, destination.Height, nameof(destinationY)); + Guard.IsBetweenOrEqualTo(destinationZ + depth, 1, destination.Depth, nameof(destinationZ)); + Guard.IsLessThanOrEqualTo(sourceX + width, Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, Height, nameof(sourceY)); + Guard.IsLessThanOrEqualTo(sourceZ + depth, Depth, nameof(sourceZ)); - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); - } + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination = &destination.D3D12PlacedSubresourceFootprint) + { copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: D3D12Resource, - destinationX: (uint)x, - destinationY: (uint)y, - destinationZ: (ushort)z, - d3D12ResourceSource: d3D12Resource.Get(), - &d3D12PlacedSubresourceFootprintSource, - sourceX: 0, - sourceY: 0, - sourceZ: 0, + d3D12ResourceDestination: destination.D3D12Resource, + d3D12PlacedSubresourceFootprintDestination, + (uint)destinationX, + (uint)destinationY, + (ushort)destinationZ, + d3D12ResourceSource: D3D12Resource, + (uint)sourceX, + (uint)sourceY, + (ushort)sourceZ, (uint)width, (uint)height, (ushort)depth); - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); - } - - copyCommandList.ExecuteAndWaitForCompletion(); } - /// - /// Writes the contents of a given instance to a specified area of the current instance. - /// - /// The input instance to read data from. - /// The horizontal offset within . - /// The vertical offset within . - /// The depthwise offset within . - /// The horizontal offset in the destination texture. - /// The vertical offset in the destination texture. - /// The depthwise offset in the destination texture. - /// The width of the memory area to write to. - /// The height of the memory area to write to. - /// The depth of the memory area to write to. - internal void CopyFrom(UploadTexture3D source, int sourceX, int sourceY, int sourceZ, int destinationX, int destinationY, int destinationZ, int width, int height, int depth) + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - source.ThrowIfDeviceMismatch(GraphicsDevice); - source.ThrowIfDisposed(); - - Guard.IsInRange(sourceX, 0, source.Width, nameof(sourceX)); - Guard.IsInRange(sourceY, 0, source.Height, nameof(sourceY)); - Guard.IsInRange(sourceZ, 0, source.Depth, nameof(sourceZ)); - Guard.IsInRange(destinationX, 0, Width, nameof(destinationX)); - Guard.IsInRange(destinationY, 0, Height, nameof(destinationY)); - Guard.IsInRange(destinationZ, 0, Depth, nameof(destinationZ)); - Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); - Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, source.Depth, nameof(depth)); - Guard.IsLessThanOrEqualTo(sourceX + width, source.Width, nameof(sourceX)); - Guard.IsLessThanOrEqualTo(sourceY + height, source.Height, nameof(sourceY)); - Guard.IsLessThanOrEqualTo(sourceZ + depth, source.Depth, nameof(sourceZ)); - Guard.IsLessThanOrEqualTo(destinationX + width, Width, nameof(destinationX)); - Guard.IsLessThanOrEqualTo(destinationY + height, Height, nameof(destinationY)); - Guard.IsLessThanOrEqualTo(destinationZ + depth, Depth, nameof(destinationZ)); - - using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); - } - - fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource = &source.D3D12PlacedSubresourceFootprint) - { - copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( - d3D12ResourceDestination: D3D12Resource, - (uint)destinationX, - (uint)destinationY, - (ushort)destinationZ, - d3D12ResourceSource: source.D3D12Resource, - d3D12PlacedSubresourceFootprintSource, - (uint)sourceX, - (uint)sourceY, - (ushort)sourceZ, - (uint)width, - (uint)height, - (ushort)depth); - } - - if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) - { - copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); - } - - copyCommandList.ExecuteAndWaitForCompletion(); + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); } - /// - protected override void OnDispose() - { - this.d3D12Resource.Dispose(); - this.allocation.Dispose(); + copyCommandList.ExecuteAndWaitForCompletion(); + } - if (GraphicsDevice is GraphicsDevice device) - { - device.UnregisterAllocatedResource(); - device.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); - } + /// + /// Writes the contents of a given memory area to a specified area of the current instance. + /// + /// The input memory area to read data from. + /// The size of the memory area to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + internal void CopyFrom(ref T source, int size, int x, int y, int z, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsInRange(z, 0, Depth, nameof(z)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintSource, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource( + GraphicsDevice.Pool, + ResourceType.Upload, + AllocationMode.Default, + totalSizeInBytes); + + using ComPtr d3D12Resource = new(allocation.Get()->GetResource()); + + using (ID3D12ResourceMap resource = d3D12Resource.Get()->Map()) + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + resource.Pointer, + (uint)height, + (uint)depth, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch, + d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch * (uint)height); } - /// - /// Throws a if the target device doesn't match the current one. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDeviceMismatch(GraphicsDevice device) + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) { - if (GraphicsDevice != device) - { - GraphicsDeviceMismatchException.Throw(this, device); - } + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); } - /// - D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device) - { - ThrowIfDisposed(); - ThrowIfDeviceMismatch(device); + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + destinationX: (uint)x, + destinationY: (uint)y, + destinationZ: (ushort)z, + d3D12ResourceSource: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintSource, + sourceX: 0, + sourceY: 0, + sourceZ: 0, + (uint)width, + (uint)height, + (ushort)depth); - return D3D12GpuDescriptorHandle; + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Writes the contents of a given instance to a specified area of the current instance. + /// + /// The input instance to read data from. + /// The horizontal offset within . + /// The vertical offset within . + /// The depthwise offset within . + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + internal void CopyFrom(UploadTexture3D source, int sourceX, int sourceY, int sourceZ, int destinationX, int destinationY, int destinationZ, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsInRange(sourceX, 0, source.Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, source.Height, nameof(sourceY)); + Guard.IsInRange(sourceZ, 0, source.Depth, nameof(sourceZ)); + Guard.IsInRange(destinationX, 0, Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, Height, nameof(destinationY)); + Guard.IsInRange(destinationZ, 0, Depth, nameof(destinationZ)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, source.Depth, nameof(depth)); + Guard.IsLessThanOrEqualTo(sourceX + width, source.Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, source.Height, nameof(sourceY)); + Guard.IsLessThanOrEqualTo(sourceZ + depth, source.Depth, nameof(sourceZ)); + Guard.IsLessThanOrEqualTo(destinationX + width, Width, nameof(destinationX)); + Guard.IsLessThanOrEqualTo(destinationY + height, Height, nameof(destinationY)); + Guard.IsLessThanOrEqualTo(destinationZ + depth, Depth, nameof(destinationZ)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource = &source.D3D12PlacedSubresourceFootprint) + { + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + (uint)destinationX, + (uint)destinationY, + (ushort)destinationZ, + d3D12ResourceSource: source.D3D12Resource, + d3D12PlacedSubresourceFootprintSource, + (uint)sourceX, + (uint)sourceY, + (ushort)sourceZ, + (uint)width, + (uint)height, + (ushort)depth); + } + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + protected override void OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice is GraphicsDevice device) + { + device.UnregisterAllocatedResource(); + device.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); } } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + + /// + D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device) + { + ThrowIfDisposed(); + ThrowIfDeviceMismatch(device); + + return D3D12GpuDescriptorHandle; + } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs index 75b0199a..8c8ff41d 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs @@ -8,177 +8,176 @@ using Microsoft.Toolkit.Diagnostics; using TerraFX.Interop; using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed buffer stored on CPU memory, that can be used to transfer data to/from the GPU. +/// +/// The type of items stored on the buffer. +public abstract unsafe class TransferBuffer : NativeObject, IMemoryOwner + where T : unmanaged { /// - /// A representing a typed buffer stored on CPU memory, that can be used to transfer data to/from the GPU. + /// The instance used to retrieve . /// - /// The type of items stored on the buffer. - public abstract unsafe class TransferBuffer : NativeObject, IMemoryOwner - where T : unmanaged + private UniquePtr allocation; + + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The pointer to the start of the mapped buffer data. + /// + private readonly T* mappedData; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The resource type for the current buffer. + /// The allocation mode to use for the new resource. + private protected TransferBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode) + { + device.ThrowIfDisposed(); + + // The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue + Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / (uint)sizeof(T)) & ~255, nameof(length)); + + GraphicsDevice = device; + Length = length; + + ulong sizeInBytes = (uint)length * (uint)sizeof(T); + + this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, sizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + + device.RegisterAllocatedResource(); + + this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the length of the current buffer. + /// + public int Length { get; } + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Gets the pointer to the start of the mapped buffer data. + /// + internal T* MappedData => this.mappedData; + + /// + public Memory Memory + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowIfDisposed(); + + return new MemoryManager(this).Memory; + } + } + + /// + public Span Span + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowIfDisposed(); + + return new(this.mappedData, Length); + } + } + + /// + protected override void OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice is GraphicsDevice device) + { + device.UnregisterAllocatedResource(); + } + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + + /// + /// A implementation wrapping a instance. + /// + private sealed class MemoryManager : MemoryManager { /// - /// The instance used to retrieve . + /// The in use. /// - private UniquePtr allocation; + private readonly TransferBuffer buffer; /// - /// The instance currently mapped. + /// Creates a new instance for a given buffer. /// - private ComPtr d3D12Resource; - - /// - /// The pointer to the start of the mapped buffer data. - /// - private readonly T* mappedData; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The resource type for the current buffer. - /// The allocation mode to use for the new resource. - private protected TransferBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode) + /// The in use. + public MemoryManager(TransferBuffer buffer) { - device.ThrowIfDisposed(); - - // The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue - Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / (uint)sizeof(T)) & ~255, nameof(length)); - - GraphicsDevice = device; - Length = length; - - ulong sizeInBytes = (uint)length * (uint)sizeof(T); - - this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, sizeInBytes); - this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - - device.RegisterAllocatedResource(); - - this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; - - this.d3D12Resource.Get()->SetName(this); - } - - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } - - /// - /// Gets the length of the current buffer. - /// - public int Length { get; } - - /// - /// Gets the instance currently mapped. - /// - internal ID3D12Resource* D3D12Resource => this.d3D12Resource; - - /// - /// Gets the pointer to the start of the mapped buffer data. - /// - internal T* MappedData => this.mappedData; - - /// - public Memory Memory - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ThrowIfDisposed(); - - return new MemoryManager(this).Memory; - } + this.buffer = buffer; } /// - public Span Span + public override Memory Memory { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ThrowIfDisposed(); - - return new(this.mappedData, Length); - } + get => CreateMemory(this.buffer.Length); } /// - protected override void OnDispose() + public override Span GetSpan() { - this.d3D12Resource.Dispose(); - this.allocation.Dispose(); - - if (GraphicsDevice is GraphicsDevice device) - { - device.UnregisterAllocatedResource(); - } + return this.buffer.Span; } - /// - /// Throws a if the target device doesn't match the current one. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDeviceMismatch(GraphicsDevice device) + /// + public override MemoryHandle Pin(int elementIndex = 0) { - if (GraphicsDevice != device) - { - GraphicsDeviceMismatchException.Throw(this, device); - } + Guard.IsEqualTo(elementIndex, 0, nameof(elementIndex)); + + this.buffer.ThrowIfDisposed(); + + return new(this.buffer.mappedData); } - /// - /// A implementation wrapping a instance. - /// - private sealed class MemoryManager : MemoryManager + /// + public override void Unpin() { - /// - /// The in use. - /// - private readonly TransferBuffer buffer; + } - /// - /// Creates a new instance for a given buffer. - /// - /// The in use. - public MemoryManager(TransferBuffer buffer) - { - this.buffer = buffer; - } - - /// - public override Memory Memory - { - get => CreateMemory(this.buffer.Length); - } - - /// - public override Span GetSpan() - { - return this.buffer.Span; - } - - /// - public override MemoryHandle Pin(int elementIndex = 0) - { - Guard.IsEqualTo(elementIndex, 0, nameof(elementIndex)); - - this.buffer.ThrowIfDisposed(); - - return new(this.buffer.mappedData); - } - - /// - public override void Unpin() - { - } - - /// - protected override void Dispose(bool disposing) - { - } + /// + protected override void Dispose(bool disposing) + { } } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs index 462cfcd1..e927940d 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs @@ -9,134 +9,133 @@ using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; using FX = TerraFX.Interop.Windows; using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed 2D texture stored on on CPU memory, that can be used to transfer data to/from the GPU. +/// +/// The type of items stored on the texture. +public unsafe abstract class TransferTexture2D : NativeObject + where T : unmanaged { /// - /// A representing a typed 2D texture stored on on CPU memory, that can be used to transfer data to/from the GPU. + /// The instance used to retrieve . /// - /// The type of items stored on the texture. - public unsafe abstract class TransferTexture2D : NativeObject - where T : unmanaged + private UniquePtr allocation; + + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The pointer to the start of the mapped buffer data. + /// + private readonly T* mappedData; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + private protected TransferTexture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, AllocationMode allocationMode) { - /// - /// The instance used to retrieve . - /// - private UniquePtr allocation; + device.ThrowIfDisposed(); - /// - /// The instance currently mapped. - /// - private ComPtr d3D12Resource; + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height)); - /// - /// The pointer to the start of the mapped buffer data. - /// - private readonly T* mappedData; - - /// - /// The description for the current resource. - /// - private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The height of the texture. - /// The width of the texture. - /// The resource type for the current texture. - /// The allocation mode to use for the new resource. - private protected TransferTexture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, AllocationMode allocationMode) + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE2D)) { - device.ThrowIfDisposed(); - - Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height)); - - if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE2D)) - { - UnsupportedTextureTypeException.ThrowForTexture2D(); - } - - GraphicsDevice = device; - - device.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - out this.d3D12PlacedSubresourceFootprint, - out _, - out ulong totalSizeInBytes); - - this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, totalSizeInBytes); - this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - - device.RegisterAllocatedResource(); - - this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; - - this.d3D12Resource.Get()->SetName(this); + UnsupportedTextureTypeException.ThrowForTexture2D(); } - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } + GraphicsDevice = device; - /// - /// Gets the width of the current texture. - /// - public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out this.d3D12PlacedSubresourceFootprint, + out _, + out ulong totalSizeInBytes); - /// - /// Gets the height of the current texture. - /// - public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, totalSizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - /// - /// Gets the instance currently mapped. - /// - internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + device.RegisterAllocatedResource(); - /// - /// Gets the value for the current resource. - /// - internal ref readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT D3D12PlacedSubresourceFootprint => ref this.d3D12PlacedSubresourceFootprint; + this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; - /// - public TextureView2D View - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ThrowIfDisposed(); + this.d3D12Resource.Get()->SetName(this); + } - return new(this.mappedData, Width, Height, (int)this.d3D12PlacedSubresourceFootprint.Footprint.RowPitch); - } - } + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } - /// - protected override void OnDispose() - { - this.d3D12Resource.Dispose(); - this.allocation.Dispose(); + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; - if (GraphicsDevice is GraphicsDevice device) - { - device.UnregisterAllocatedResource(); - } - } + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; - /// - /// Throws a if the target device doesn't match the current one. - /// + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Gets the value for the current resource. + /// + internal ref readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT D3D12PlacedSubresourceFootprint => ref this.d3D12PlacedSubresourceFootprint; + + /// + public TextureView2D View + { [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDeviceMismatch(GraphicsDevice device) + get { - if (GraphicsDevice != device) - { - GraphicsDeviceMismatchException.Throw(this, device); - } + ThrowIfDisposed(); + + return new(this.mappedData, Width, Height, (int)this.d3D12PlacedSubresourceFootprint.Footprint.RowPitch); + } + } + + /// + protected override void OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice is GraphicsDevice device) + { + device.UnregisterAllocatedResource(); + } + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); } } } diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs index 53fe5ae8..bd98aea0 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs @@ -9,142 +9,141 @@ using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; using FX = TerraFX.Interop.Windows; using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; -namespace ComputeSharp.Resources +namespace ComputeSharp.Resources; + +/// +/// A representing a typed 3D texture stored on on CPU memory, that can be used to transfer data to/from the GPU. +/// +/// The type of items stored on the texture. +public unsafe abstract class TransferTexture3D : NativeObject + where T : unmanaged { /// - /// A representing a typed 3D texture stored on on CPU memory, that can be used to transfer data to/from the GPU. + /// The instance used to retrieve . /// - /// The type of items stored on the texture. - public unsafe abstract class TransferTexture3D : NativeObject - where T : unmanaged + private UniquePtr allocation; + + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The pointer to the start of the mapped buffer data. + /// + private readonly T* mappedData; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The depth of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + private protected TransferTexture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, AllocationMode allocationMode) { - /// - /// The instance used to retrieve . - /// - private UniquePtr allocation; + device.ThrowIfDisposed(); - /// - /// The instance currently mapped. - /// - private ComPtr d3D12Resource; + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth)); - /// - /// The pointer to the start of the mapped buffer data. - /// - private readonly T* mappedData; - - /// - /// The description for the current resource. - /// - private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The height of the texture. - /// The width of the texture. - /// The depth of the texture. - /// The resource type for the current texture. - /// The allocation mode to use for the new resource. - private protected TransferTexture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, AllocationMode allocationMode) + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE3D)) { - device.ThrowIfDisposed(); - - Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth)); - - if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE3D)) - { - UnsupportedTextureTypeException.ThrowForTexture3D(); - } - - GraphicsDevice = device; - - device.D3D12Device->GetCopyableFootprint( - DXGIFormatHelper.GetForType(), - (uint)width, - (uint)height, - (ushort)depth, - out this.d3D12PlacedSubresourceFootprint, - out _, - out ulong totalSizeInBytes); - - this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, totalSizeInBytes); - this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - - device.RegisterAllocatedResource(); - - this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; - - this.d3D12Resource.Get()->SetName(this); + UnsupportedTextureTypeException.ThrowForTexture3D(); } - /// - /// Gets the associated with the current instance. - /// - public GraphicsDevice GraphicsDevice { get; } + GraphicsDevice = device; - /// - /// Gets the width of the current texture. - /// - public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out this.d3D12PlacedSubresourceFootprint, + out _, + out ulong totalSizeInBytes); - /// - /// Gets the height of the current texture. - /// - public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + this.allocation = device.Allocator->CreateResource(device.Pool, resourceType, allocationMode, totalSizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); - /// - /// Gets the depth of the current texture. - /// - public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; + device.RegisterAllocatedResource(); - /// - /// Gets the instance currently mapped. - /// - internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; - /// - /// Gets the value for the current resource. - /// - internal ref readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT D3D12PlacedSubresourceFootprint => ref this.d3D12PlacedSubresourceFootprint; + this.d3D12Resource.Get()->SetName(this); + } - /// - public TextureView3D View - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ThrowIfDisposed(); + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } - return new(this.mappedData, Width, Height, Depth, (int)this.d3D12PlacedSubresourceFootprint.Footprint.RowPitch); - } - } + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; - /// - protected override void OnDispose() - { - this.d3D12Resource.Dispose(); - this.allocation.Dispose(); + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; - if (GraphicsDevice is GraphicsDevice device) - { - device.UnregisterAllocatedResource(); - } - } + /// + /// Gets the depth of the current texture. + /// + public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; - /// - /// Throws a if the target device doesn't match the current one. - /// + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Gets the value for the current resource. + /// + internal ref readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT D3D12PlacedSubresourceFootprint => ref this.d3D12PlacedSubresourceFootprint; + + /// + public TextureView3D View + { [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ThrowIfDeviceMismatch(GraphicsDevice device) + get { - if (GraphicsDevice != device) - { - GraphicsDeviceMismatchException.Throw(this, device); - } + ThrowIfDisposed(); + + return new(this.mappedData, Width, Height, Depth, (int)this.d3D12PlacedSubresourceFootprint.Footprint.RowPitch); + } + } + + /// + protected override void OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice is GraphicsDevice device) + { + device.UnregisterAllocatedResource(); + } + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); } } } diff --git a/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs index 2fdd7ed4..705b70d9 100644 --- a/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs @@ -12,165 +12,164 @@ using ComputeSharp.Resources.Debug; using Microsoft.Toolkit.Diagnostics; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed read write buffer stored on GPU memory. +/// +/// The type of items stored on the buffer. +[DebuggerTypeProxy(typeof(BufferDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ConstantBuffer : Buffer + where T : unmanaged { /// - /// A representing a typed read write buffer stored on GPU memory. + /// The alignment boundary for elements in a constant buffer. /// - /// The type of items stored on the buffer. - [DebuggerTypeProxy(typeof(BufferDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ConstantBuffer : Buffer - where T : unmanaged + private const int ElementAlignment = FX.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ConstantBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, (uint)GetPaddedSize(), ResourceType.Constant, allocationMode) { - /// - /// The alignment boundary for elements in a constant buffer. - /// - private const int ElementAlignment = FX.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT; + } - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The allocation mode to use for the new resource. - internal ConstantBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) - : base(device, length, (uint)GetPaddedSize(), ResourceType.Constant, allocationMode) + /// + /// Gets a single value from the current constant buffer. + /// + /// The index of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int i] => throw new InvalidExecutionContextException($"{typeof(ConstantBuffer)}[{typeof(int)}]"); + + /// + /// Gets the right padded size for elements to store in the current instance. + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe int GetPaddedSize() + { + return AlignmentHelper.Pad(sizeof(T), ElementAlignment); + } + + /// + internal override unsafe void CopyTo(ref T destination, int size, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + size, Length, nameof(size)); + + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + fixed (void* destinationPointer = &destination) { - } - - /// - /// Gets a single value from the current constant buffer. - /// - /// The index of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public T this[int i] => throw new InvalidExecutionContextException($"{typeof(ConstantBuffer)}[{typeof(int)}]"); - - /// - /// Gets the right padded size for elements to store in the current instance. - /// - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static unsafe int GetPaddedSize() - { - return AlignmentHelper.Pad(sizeof(T), ElementAlignment); - } - - /// - internal override unsafe void CopyTo(ref T destination, int size, int offset) - { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - Guard.IsInRange(offset, 0, Length, nameof(offset)); - Guard.IsLessThanOrEqualTo(offset + size, Length, nameof(size)); - - using ID3D12ResourceMap resource = D3D12Resource->Map(); - - fixed (void* destinationPointer = &destination) + if (IsPaddingPresent) { - if (IsPaddingPresent) - { - MemoryHelper.Copy( - resource.Pointer, - (uint)offset, - (uint)size, - (uint)GetPaddedSize(), - destinationPointer); - } - else - { - MemoryHelper.Copy( - resource.Pointer, - (uint)offset, - (uint)size, - (uint)sizeof(T), - destinationPointer); - } + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)size, + (uint)GetPaddedSize(), + destinationPointer); } - } - - /// - internal override unsafe void CopyFrom(ref T source, int size, int offset) - { - GraphicsDevice.ThrowIfDisposed(); - - ThrowIfDisposed(); - - Guard.IsInRange(offset, 0, Length, nameof(offset)); - Guard.IsLessThanOrEqualTo(offset + size, Length, nameof(size)); - - using ID3D12ResourceMap resource = D3D12Resource->Map(); - - fixed (void* sourcePointer = &source) + else { - if (IsPaddingPresent) - { - MemoryHelper.Copy( - sourcePointer, - resource.Pointer, - (uint)offset, - (uint)size, - (uint)GetPaddedSize(), - isPaddingInSourceToo: false); - } - else - { - MemoryHelper.Copy( - sourcePointer, - (uint)offset, - (uint)size, - (uint)sizeof(T), - resource.Pointer); - } + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)size, + (uint)sizeof(T), + destinationPointer); } } + } - /// - public override unsafe void CopyFrom(Buffer source) - { - GraphicsDevice.ThrowIfDisposed(); + /// + internal override unsafe void CopyFrom(ref T source, int size, int offset) + { + GraphicsDevice.ThrowIfDisposed(); - ThrowIfDisposed(); + ThrowIfDisposed(); - source.ThrowIfDeviceMismatch(GraphicsDevice); - source.ThrowIfDisposed(); + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + size, Length, nameof(size)); - Guard.IsLessThanOrEqualTo(source.Length, Length, nameof(Length)); + using ID3D12ResourceMap resource = D3D12Resource->Map(); - if (source is ConstantBuffer buffer) + fixed (void* sourcePointer = &source) + { + if (IsPaddingPresent) + { + MemoryHelper.Copy( + sourcePointer, + resource.Pointer, + (uint)offset, + (uint)size, + (uint)GetPaddedSize(), + isPaddingInSourceToo: false); + } + else { - using ID3D12ResourceMap sourceMap = buffer.D3D12Resource->Map(); - using ID3D12ResourceMap destinationMap = D3D12Resource->Map(); - - if (IsPaddingPresent) - { - MemoryHelper.Copy( - sourceMap.Pointer, - destinationMap.Pointer, - 0, - (uint)source.Length, - (uint)GetPaddedSize(), - isPaddingInSourceToo: true); - } - else - { - MemoryHelper.Copy( - sourceMap.Pointer, - 0, - (uint)source.Length, - (uint)sizeof(T), - destinationMap.Pointer); - } + MemoryHelper.Copy( + sourcePointer, + (uint)offset, + (uint)size, + (uint)sizeof(T), + resource.Pointer); } - else CopyFromWithCpuBuffer(source); } + } + + /// + public override unsafe void CopyFrom(Buffer source) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); - /// - public override string ToString() + Guard.IsLessThanOrEqualTo(source.Length, Length, nameof(Length)); + + if (source is ConstantBuffer buffer) { - return $"ComputeSharp.ConstantBuffer<{typeof(T)}>[{Length}]"; + using ID3D12ResourceMap sourceMap = buffer.D3D12Resource->Map(); + using ID3D12ResourceMap destinationMap = D3D12Resource->Map(); + + if (IsPaddingPresent) + { + MemoryHelper.Copy( + sourceMap.Pointer, + destinationMap.Pointer, + 0, + (uint)source.Length, + (uint)GetPaddedSize(), + isPaddingInSourceToo: true); + } + else + { + MemoryHelper.Copy( + sourceMap.Pointer, + 0, + (uint)source.Length, + (uint)sizeof(T), + destinationMap.Pointer); + } } + else CopyFromWithCpuBuffer(source); + } + + /// + public override string ToString() + { + return $"ComputeSharp.ConstantBuffer<{typeof(T)}>[{Length}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs index 882298e6..7c761046 100644 --- a/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs @@ -1,35 +1,34 @@ using System; using System.Diagnostics; -namespace ComputeSharp.Resources.Debug +namespace ComputeSharp.Resources.Debug; + +/// +/// A debug proxy used to display items in a instance. +/// +/// The type of items to display. +internal sealed class BufferDebugView + where T : unmanaged { /// - /// A debug proxy used to display items in a instance. + /// Initializes a new instance of the class with the specified parameters. /// - /// The type of items to display. - internal sealed class BufferDebugView - where T : unmanaged + /// The input instance with the items to display. + public BufferDebugView(Buffer? buffer) { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance with the items to display. - public BufferDebugView(Buffer? buffer) + if (buffer is not null) { - if (buffer is not null) - { - var items = GC.AllocateUninitializedArray(buffer.Length); + var items = GC.AllocateUninitializedArray(buffer.Length); - buffer.CopyTo(ref items[0], buffer.Length, 0); + buffer.CopyTo(ref items[0], buffer.Length, 0); - Items = items; - } + Items = items; } - - /// - /// Gets the items to display for the current instance. - /// - [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] - public T[]? Items { get; } } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[]? Items { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs index 31874e62..bcfcf0d5 100644 --- a/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs @@ -1,34 +1,33 @@ using System.Diagnostics; -namespace ComputeSharp.Resources.Debug +namespace ComputeSharp.Resources.Debug; + +/// +/// A debug proxy used to display items in a instance. +/// +/// The type of items to display. +internal sealed class Texture2DDebugView + where T : unmanaged { /// - /// A debug proxy used to display items in a instance. + /// Initializes a new instance of the class with the specified parameters. /// - /// The type of items to display. - internal sealed class Texture2DDebugView - where T : unmanaged + /// The input instance with the items to display. + public Texture2DDebugView(Texture2D? texture) { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance with the items to display. - public Texture2DDebugView(Texture2D? texture) + if (texture is not null) { - if (texture is not null) - { - var items = new T[texture.Height, texture.Width]; + var items = new T[texture.Height, texture.Width]; - texture.CopyTo(ref items[0, 0], items.Length, 0, 0, texture.Width, texture.Height); + texture.CopyTo(ref items[0, 0], items.Length, 0, 0, texture.Width, texture.Height); - Items = items; - } + Items = items; } - - /// - /// Gets the items to display for the current instance. - /// - [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] - public T[,]? Items { get; } } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,]? Items { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs index 4525bb9d..7d1a3591 100644 --- a/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs @@ -1,34 +1,33 @@ using System.Diagnostics; -namespace ComputeSharp.Resources.Debug +namespace ComputeSharp.Resources.Debug; + +/// +/// A debug proxy used to display items in a instance. +/// +/// The type of items to display. +internal sealed class Texture3DDebugView + where T : unmanaged { /// - /// A debug proxy used to display items in a instance. + /// Initializes a new instance of the class with the specified parameters. /// - /// The type of items to display. - internal sealed class Texture3DDebugView - where T : unmanaged + /// The input instance with the items to display. + public Texture3DDebugView(Texture3D? texture) { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance with the items to display. - public Texture3DDebugView(Texture3D? texture) + if (texture is not null) { - if (texture is not null) - { - var items = new T[texture.Depth, texture.Height, texture.Width]; + var items = new T[texture.Depth, texture.Height, texture.Width]; - texture.CopyTo(ref items[0, 0, 0], items.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + texture.CopyTo(ref items[0, 0, 0], items.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); - Items = items; - } + Items = items; } - - /// - /// Gets the items to display for the current instance. - /// - [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] - public T[,,]? Items { get; } } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,,]? Items { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs index cdab1e29..e90b1027 100644 --- a/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs @@ -1,35 +1,34 @@ using System; using System.Diagnostics; -namespace ComputeSharp.Resources.Debug +namespace ComputeSharp.Resources.Debug; + +/// +/// A debug proxy used to display items in a instance. +/// +/// The type of items to display. +internal sealed class TransferBufferDebugView + where T : unmanaged { /// - /// A debug proxy used to display items in a instance. + /// Initializes a new instance of the class with the specified parameters. /// - /// The type of items to display. - internal sealed class TransferBufferDebugView - where T : unmanaged + /// The input instance with the items to display. + public TransferBufferDebugView(TransferBuffer? buffer) { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance with the items to display. - public TransferBufferDebugView(TransferBuffer? buffer) + if (buffer is not null) { - if (buffer is not null) - { - var items = GC.AllocateUninitializedArray(buffer.Length); + var items = GC.AllocateUninitializedArray(buffer.Length); - buffer.Span.CopyTo(items); + buffer.Span.CopyTo(items); - Items = items; - } + Items = items; } - - /// - /// Gets the items to display for the current instance. - /// - [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] - public T[]? Items { get; } } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[]? Items { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs index a98ed5d5..9ef6327e 100644 --- a/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs @@ -1,27 +1,26 @@ using System.Diagnostics; -namespace ComputeSharp.Resources.Debug +namespace ComputeSharp.Resources.Debug; + +/// +/// A debug proxy used to display items in a instance. +/// +/// The type of items to display. +internal sealed class TransferTexture2DDebugView + where T : unmanaged { /// - /// A debug proxy used to display items in a instance. + /// Initializes a new instance of the class with the specified parameters. /// - /// The type of items to display. - internal sealed class TransferTexture2DDebugView - where T : unmanaged + /// The input instance with the items to display. + public TransferTexture2DDebugView(TransferTexture2D? texture) { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance with the items to display. - public TransferTexture2DDebugView(TransferTexture2D? texture) - { - Items = texture?.View.ToArray(); - } - - /// - /// Gets the items to display for the current instance. - /// - [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] - public T[,]? Items { get; } + Items = texture?.View.ToArray(); } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,]? Items { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs index 213a0845..b3b0f63c 100644 --- a/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs @@ -1,27 +1,26 @@ using System.Diagnostics; -namespace ComputeSharp.Resources.Debug +namespace ComputeSharp.Resources.Debug; + +/// +/// A debug proxy used to display items in a instance. +/// +/// The type of items to display. +internal sealed class TransferTexture3DDebugView + where T : unmanaged { /// - /// A debug proxy used to display items in a instance. + /// Initializes a new instance of the class with the specified parameters. /// - /// The type of items to display. - internal sealed class TransferTexture3DDebugView - where T : unmanaged + /// The input instance with the items to display. + public TransferTexture3DDebugView(TransferTexture3D? texture) { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance with the items to display. - public TransferTexture3DDebugView(TransferTexture3D? texture) - { - Items = texture?.View.ToArray(); - } - - /// - /// Gets the items to display for the current instance. - /// - [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] - public T[,,]? Items { get; } + Items = texture?.View.ToArray(); } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,,]? Items { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs b/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs index 4f2e508b..a6ec6b97 100644 --- a/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs +++ b/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs @@ -1,20 +1,19 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An that indicates a mode to use when allocating resources. +/// +public enum AllocationMode { /// - /// An that indicates a mode to use when allocating resources. + /// The default allocation mode for graphics resources. Allocated buffers are not explicitly cleared when created. + /// They can still be cleared for security reasons in some situations, but this step will be skipped whenever possible. + /// As such, always make sure not to read directly to buffers created this way before writing data to them first. /// - public enum AllocationMode - { - /// - /// The default allocation mode for graphics resources. Allocated buffers are not explicitly cleared when created. - /// They can still be cleared for security reasons in some situations, but this step will be skipped whenever possible. - /// As such, always make sure not to read directly to buffers created this way before writing data to them first. - /// - Default, + Default, - /// - /// Clear allocated buffers when creating them. - /// - Clear - } + /// + /// Clear allocated buffers when creating them. + /// + Clear } diff --git a/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs b/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs index 99505b8b..4dadf0c1 100644 --- a/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs +++ b/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs @@ -1,43 +1,42 @@ -namespace ComputeSharp.Graphics.Resources.Enums +namespace ComputeSharp.Graphics.Resources.Enums; + +/// +/// An that indicates the type of a given HLSL resource. +/// +internal enum ResourceType { /// - /// An that indicates the type of a given HLSL resource. + /// A constant resource, with items aligned to 16 bytes, used for individual values or very small arrays. + /// This is only supported for buffers and is mapped to a . + /// Resources of this type are located in . /// - internal enum ResourceType - { - /// - /// A constant resource, with items aligned to 16 bytes, used for individual values or very small arrays. - /// This is only supported for buffers and is mapped to a . - /// Resources of this type are located in . - /// - Constant, + Constant, - /// - /// A readonly resource, that can store arbitrary arrays of values and can only be read from by the GPU. - /// This is mapped to either or . - /// Resources of this type are located in . - /// - ReadOnly, + /// + /// A readonly resource, that can store arbitrary arrays of values and can only be read from by the GPU. + /// This is mapped to either or . + /// Resources of this type are located in . + /// + ReadOnly, - /// - /// A read write resource, that can store arbitrary arrays with both read and write access for the GPU. - /// This is mapped to either or . - /// Resources of this type are located in . - /// - ReadWrite, + /// + /// A read write resource, that can store arbitrary arrays with both read and write access for the GPU. + /// This is mapped to either or . + /// Resources of this type are located in . + /// + ReadWrite, - /// - /// A readback resource, used temporarily to read data back from and resources. - /// This has no direct mapping to a type in HLSL, as it's only used for copy operations. - /// Resources of this type are located in . - /// - ReadBack, + /// + /// A readback resource, used temporarily to read data back from and resources. + /// This has no direct mapping to a type in HLSL, as it's only used for copy operations. + /// Resources of this type are located in . + /// + ReadBack, - /// - /// A transfer resource, used temporarily to set data to and resources. - /// This has no direct mapping to a type in HLSL, as it's only used for copy operations (like ). - /// Resources of this type are located in . - /// - Upload - } + /// + /// A transfer resource, used temporarily to set data to and resources. + /// This has no direct mapping to a type in HLSL, as it's only used for copy operations (like ). + /// Resources of this type are located in . + /// + Upload } diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs index c668331f..085a81c8 100644 --- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs @@ -1,51 +1,50 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An interface representing a typed readonly 2D texture containing normalized pixel data stored on GPU memory. +/// This interface can only be used to wrap instances. +/// +/// The type of normalized pixels used on the GPU side. +public interface IReadOnlyTexture2D + where TPixel : unmanaged { /// - /// An interface representing a typed readonly 2D texture containing normalized pixel data stored on GPU memory. - /// This interface can only be used to wrap instances. + /// Gets the width of the current texture. /// - /// The type of normalized pixels used on the GPU side. - public interface IReadOnlyTexture2D - where TPixel : unmanaged - { - /// - /// Gets the width of the current texture. - /// - int Width { get; } + int Width { get; } - /// - /// Gets the height of the current texture. - /// - int Height { get; } + /// + /// Gets the height of the current texture. + /// + int Height { get; } - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[int x, int y] { get; } + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[int x, int y] { get; } - /// - /// Gets a single value from the current readonly texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[Int2 xy] { get; } + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[Int2 xy] { get; } - /// - /// Gets a single value from the current readonly texture with linear sampling. - /// - /// The horizontal normalized offset of the value to get. - /// The vertical normalized offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[float u, float v] { get; } + /// + /// Gets a single value from the current readonly texture with linear sampling. + /// + /// The horizontal normalized offset of the value to get. + /// The vertical normalized offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[float u, float v] { get; } - /// - /// Gets a single value from the current readonly texture with linear sampling. - /// - /// The normalized coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[Float2 uv] { get; } - } + /// + /// Gets a single value from the current readonly texture with linear sampling. + /// + /// The normalized coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[Float2 uv] { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs index 79536de0..04625bd5 100644 --- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs @@ -1,58 +1,57 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An interface representing a typed readonly 3D texture containing normalized pixel data stored on GPU memory. +/// This interface can only be used to wrap instances. +/// +/// The type of normalized pixels used on the GPU side. +public interface IReadOnlyTexture3D + where TPixel : unmanaged { /// - /// An interface representing a typed readonly 3D texture containing normalized pixel data stored on GPU memory. - /// This interface can only be used to wrap instances. + /// Gets the width of the current texture. /// - /// The type of normalized pixels used on the GPU side. - public interface IReadOnlyTexture3D - where TPixel : unmanaged - { - /// - /// Gets the width of the current texture. - /// - int Width { get; } + int Width { get; } - /// - /// Gets the height of the current texture. - /// - int Height { get; } + /// + /// Gets the height of the current texture. + /// + int Height { get; } - /// - /// Gets the depth of the current texture. - /// - int Depth { get; } + /// + /// Gets the depth of the current texture. + /// + int Depth { get; } - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// The depthwise offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[int x, int y, int z] { get; } + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[int x, int y, int z] { get; } - /// - /// Gets a single value from the current readonly texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[Int3 xyz] { get; } + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[Int3 xyz] { get; } - /// - /// Gets a single value from the current readonly texture with linear sampling. - /// - /// The horizontal normalized offset of the value to get. - /// The vertical normalized offset of the value to get. - /// The depthwise normalized offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[float u, float v, float w] { get; } + /// + /// Gets a single value from the current readonly texture with linear sampling. + /// + /// The horizontal normalized offset of the value to get. + /// The vertical normalized offset of the value to get. + /// The depthwise normalized offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[float u, float v, float w] { get; } - /// - /// Gets a single value from the current readonly texture with linear sampling. - /// - /// The normalized coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - TPixel this[Float3 uvw] { get; } - } + /// + /// Gets a single value from the current readonly texture with linear sampling. + /// + /// The normalized coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[Float3 uvw] { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs index 547c3683..aaa76334 100644 --- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs @@ -1,36 +1,35 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory. +/// This interface can only be used to wrap instances. +/// +/// The type of normalized pixels used on the GPU side. +public interface IReadWriteTexture2D + where TPixel : unmanaged { /// - /// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory. - /// This interface can only be used to wrap instances. + /// Gets the width of the current texture. /// - /// The type of normalized pixels used on the GPU side. - public interface IReadWriteTexture2D - where TPixel : unmanaged - { - /// - /// Gets the width of the current texture. - /// - int Width { get; } + int Width { get; } - /// - /// Gets the height of the current texture. - /// - int Height { get; } + /// + /// Gets the height of the current texture. + /// + int Height { get; } - /// - /// Gets a single value from the current writeable texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - ref TPixel this[int x, int y] { get; } + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[int x, int y] { get; } - /// - /// Gets or sets a single value from the current writeable texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - ref TPixel this[Int2 xy] { get; } - } + /// + /// Gets or sets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[Int2 xy] { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs index 61536271..af43c3dc 100644 --- a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs @@ -1,42 +1,41 @@ -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory. +/// This interface can only be used to wrap instances. +/// +/// The type of normalized pixels used on the GPU side. +public interface IReadWriteTexture3D + where TPixel : unmanaged { /// - /// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory. - /// This interface can only be used to wrap instances. + /// Gets the width of the current texture. /// - /// The type of normalized pixels used on the GPU side. - public interface IReadWriteTexture3D - where TPixel : unmanaged - { - /// - /// Gets the width of the current texture. - /// - int Width { get; } + int Width { get; } - /// - /// Gets the height of the current texture. - /// - int Height { get; } + /// + /// Gets the height of the current texture. + /// + int Height { get; } - /// - /// Gets the depth of the current texture. - /// - int Depth { get; } + /// + /// Gets the depth of the current texture. + /// + int Depth { get; } - /// - /// Gets a single value from the current writeable texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// The depthwise offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - ref TPixel this[int x, int y, int z] { get; } + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[int x, int y, int z] { get; } - /// - /// Gets a single value from the current writeable texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - ref TPixel this[Int3 xyz] { get; } - } + /// + /// Gets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[Int3 xyz] { get; } } diff --git a/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs b/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs index d6cb938b..17732cd2 100644 --- a/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs +++ b/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs @@ -3,41 +3,40 @@ using System.Runtime.CompilerServices; using ComputeSharp.Graphics.Extensions; using TerraFX.Interop; -namespace ComputeSharp.Graphics.Resources.Interop +namespace ComputeSharp.Graphics.Resources.Interop; + +/// +/// A type representing a mapped memory resource. +/// +internal readonly unsafe ref struct ID3D12ResourceMap { /// - /// A type representing a mapped memory resource. + /// The target to map. /// - internal readonly unsafe ref struct ID3D12ResourceMap + private readonly ID3D12Resource* d3D12Resource; + + /// + /// The pointer to the mapped resource. + /// + public readonly void* Pointer; + + /// + /// Creates a new instance for a given value. + /// + /// The input instance to map. + /// The pointer to the mapped resource. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ID3D12ResourceMap(ID3D12Resource* d3D12Resource, void* pointer) { - /// - /// The target to map. - /// - private readonly ID3D12Resource* d3D12Resource; + this.d3D12Resource = d3D12Resource; - /// - /// The pointer to the mapped resource. - /// - public readonly void* Pointer; + Pointer = pointer; + } - /// - /// Creates a new instance for a given value. - /// - /// The input instance to map. - /// The pointer to the mapped resource. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ID3D12ResourceMap(ID3D12Resource* d3D12Resource, void* pointer) - { - this.d3D12Resource = d3D12Resource; - - Pointer = pointer; - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dispose() - { - this.d3D12Resource->Unmap(); - } + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + this.d3D12Resource->Unmap(); } } diff --git a/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs b/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs index e3d9aaed..eb6d57b0 100644 --- a/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs +++ b/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs @@ -6,47 +6,46 @@ using static TerraFX.Interop.D3D12_DESCRIPTOR_RANGE_FLAGS; #pragma warning disable IDE0052, CS0414 -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// An opaque type describing a captured resource to be used in a shader. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This type is not intended to be used directly by user code")] +public struct ResourceDescriptor { + /// + private D3D12_DESCRIPTOR_RANGE_TYPE RangeType; + + /// + private uint NumDescriptors; + + /// + private uint BaseShaderRegister; + + /// + private uint RegisterSpace; + + /// + private D3D12_DESCRIPTOR_RANGE_FLAGS Flags; + + /// + private uint OffsetInDescriptorsFromTableStart; + /// - /// An opaque type describing a captured resource to be used in a shader. + /// Initializes a new instance. /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This type is not intended to be used directly by user code")] - public struct ResourceDescriptor + /// The type of resource to create the descriptor for. + /// The offset in the resource from the start of the shader mapping. + /// The resulting instance. + public static void Create(int type, uint offset, out ResourceDescriptor descriptor) { - /// - private D3D12_DESCRIPTOR_RANGE_TYPE RangeType; - - /// - private uint NumDescriptors; - - /// - private uint BaseShaderRegister; - - /// - private uint RegisterSpace; - - /// - private D3D12_DESCRIPTOR_RANGE_FLAGS Flags; - - /// - private uint OffsetInDescriptorsFromTableStart; - - /// - /// Initializes a new instance. - /// - /// The type of resource to create the descriptor for. - /// The offset in the resource from the start of the shader mapping. - /// The resulting instance. - public static void Create(int type, uint offset, out ResourceDescriptor descriptor) - { - descriptor.RangeType = (D3D12_DESCRIPTOR_RANGE_TYPE)type; - descriptor.NumDescriptors = 1; - descriptor.BaseShaderRegister = offset; - descriptor.RegisterSpace = 0; - descriptor.Flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE; - descriptor.OffsetInDescriptorsFromTableStart = FX.D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND; - } + descriptor.RangeType = (D3D12_DESCRIPTOR_RANGE_TYPE)type; + descriptor.NumDescriptors = 1; + descriptor.BaseShaderRegister = offset; + descriptor.RegisterSpace = 0; + descriptor.Flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE; + descriptor.OffsetInDescriptorsFromTableStart = FX.D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs index 9670e6c6..9ae4cae3 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs @@ -3,32 +3,31 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed buffer stored on CPU memory, that can be used to transfer back from the GPU. +/// +/// The type of items stored on the buffer. +[DebuggerTypeProxy(typeof(TransferBufferDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadBackBuffer : TransferBuffer + where T : unmanaged { /// - /// A representing a typed buffer stored on CPU memory, that can be used to transfer back from the GPU. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the buffer. - [DebuggerTypeProxy(typeof(TransferBufferDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadBackBuffer : TransferBuffer - where T : unmanaged + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ReadBackBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.ReadBack, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The allocation mode to use for the new resource. - internal ReadBackBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) - : base(device, length, ResourceType.ReadBack, allocationMode) - { - } + } - /// - public override string ToString() - { - return $"ComputeSharp.ReadBackBuffer<{typeof(T)}>[{Length}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackBuffer<{typeof(T)}>[{Length}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs index 211c7f36..5ea12337 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs @@ -3,33 +3,32 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed 2D texture stored on CPU memory, that can be used to transfer back from the GPU. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(TransferTexture2DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadBackTexture2D : TransferTexture2D + where T : unmanaged { /// - /// A representing a typed 2D texture stored on CPU memory, that can be used to transfer back from the GPU. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(TransferTexture2DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadBackTexture2D : TransferTexture2D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadBackTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadBack, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - internal ReadBackTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) - : base(device, width, height, ResourceType.ReadBack, allocationMode) - { - } + } - /// - public override string ToString() - { - return $"ComputeSharp.ReadBackTexture2D<{typeof(T)}>[{Width}, {Height}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackTexture2D<{typeof(T)}>[{Width}, {Height}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs index aeb4a130..2bd68a01 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs @@ -3,34 +3,33 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed 3D texture stored on CPU memory, that can be used to transfer back from the GPU. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadBackTexture3D : TransferTexture3D + where T : unmanaged { /// - /// A representing a typed 3D texture stored on CPU memory, that can be used to transfer back from the GPU. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadBackTexture3D : TransferTexture3D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadBackTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadBack, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - internal ReadBackTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) - : base(device, width, height, depth, ResourceType.ReadBack, allocationMode) - { - } + } - /// - public override string ToString() - { - return $"ComputeSharp.ReadBackTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs index eae751a9..7f5c2cb0 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs @@ -4,39 +4,38 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly buffer stored on GPU memory. +/// +/// The type of items stored on the buffer. +[DebuggerTypeProxy(typeof(BufferDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadOnlyBuffer : StructuredBuffer + where T : unmanaged { /// - /// A representing a typed readonly buffer stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the buffer. - [DebuggerTypeProxy(typeof(BufferDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadOnlyBuffer : StructuredBuffer - where T : unmanaged + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ReadOnlyBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.ReadOnly, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The allocation mode to use for the new resource. - internal ReadOnlyBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) - : base(device, length, ResourceType.ReadOnly, allocationMode) - { - } + } - /// - /// Gets a single value from the current readonly buffer. - /// - /// The index of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public T this[int i] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyBuffer)}[{typeof(int)}]"); + /// + /// Gets a single value from the current readonly buffer. + /// + /// The index of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int i] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyBuffer)}[{typeof(int)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadOnlyBuffer<{typeof(T)}>[{Length}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyBuffer<{typeof(T)}>[{Length}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs index 984ba086..a3a6d81d 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs @@ -8,47 +8,46 @@ using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly 2D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +/// The type of pixels used on the GPU side. +[DebuggerTypeProxy(typeof(Texture2DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadOnlyTexture2D : Texture2D, IReadOnlyTexture2D + where T : unmanaged, IUnorm + where TPixel : unmanaged { /// - /// A representing a typed readonly 2D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - /// The type of pixels used on the GPU side. - [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadOnlyTexture2D : Texture2D, IReadOnlyTexture2D - where T : unmanaged, IUnorm - where TPixel : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) - : base(device, width, height, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D) - { - } + } - /// - public TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(int)}, {typeof(int)}]"); + /// + public TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(int)}, {typeof(int)}]"); - /// - public TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(Int2)}]"); + /// + public TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(Int2)}]"); - /// - public TPixel this[float u, float v] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(float)}, {typeof(float)}]"); + /// + public TPixel this[float u, float v] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(float)}, {typeof(float)}]"); - /// - public TPixel this[Float2 uv] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(Float2)}]"); + /// + public TPixel this[Float2 uv] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(Float2)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadOnlyTexture2D<{typeof(T)}, {typeof(TPixel)}>[{Width}, {Height}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture2D<{typeof(T)}, {typeof(TPixel)}>[{Width}, {Height}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs index a4ee4e15..f2f71afc 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs @@ -5,48 +5,47 @@ using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly 2D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(Texture2DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadOnlyTexture2D : Texture2D + where T : unmanaged { /// - /// A representing a typed readonly 2D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadOnlyTexture2D : Texture2D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) - : base(device, width, height, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D) - { - } + } - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public T this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(int)}, {typeof(int)}]"); + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(int)}, {typeof(int)}]"); - /// - /// Gets a single value from the current readonly texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public T this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(Int2)}]"); + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture2D)}[{typeof(Int2)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadOnlyTexture2D<{typeof(T)}>[{Width}, {Height}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture2D<{typeof(T)}>[{Width}, {Height}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs index f29774ce..a5c64fef 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs @@ -8,48 +8,47 @@ using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly 3D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +/// The type of pixels used on the GPU side. +[DebuggerTypeProxy(typeof(Texture3DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadOnlyTexture3D : Texture3D, IReadOnlyTexture3D + where T : unmanaged, IUnorm + where TPixel : unmanaged { /// - /// A representing a typed readonly 3D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - /// The type of pixels used on the GPU side. - [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadOnlyTexture3D : Texture3D, IReadOnlyTexture3D - where T : unmanaged, IUnorm - where TPixel : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) - : base(device, width, height, depth, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D) - { - } + } - /// - public TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); + /// + public TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); - /// - public TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(Int3)}]"); + /// + public TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(Int3)}]"); - /// - public TPixel this[float u, float v, float w] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(float)}, {typeof(float)}, {typeof(float)}]"); + /// + public TPixel this[float u, float v, float w] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(float)}, {typeof(float)}, {typeof(float)}]"); - /// - public TPixel this[Float3 uvw] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(Float3)}]"); + /// + public TPixel this[Float3 uvw] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(Float3)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadOnlyTexture3D<{typeof(T)}, {nameof(TPixel)}>[{Width}, {Height}, {Depth}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture3D<{typeof(T)}, {nameof(TPixel)}>[{Width}, {Height}, {Depth}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs index 58ff5fe7..2a5fc5a9 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs @@ -5,50 +5,49 @@ using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly 3D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(Texture3DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadOnlyTexture3D : Texture3D + where T : unmanaged { /// - /// A representing a typed readonly 3D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadOnlyTexture3D : Texture3D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) - : base(device, width, height, depth, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D) - { - } + } - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// The depthwise offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); - /// - /// Gets a single value from the current readonly texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public T this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(Int3)}]"); + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadOnlyTexture3D)}[{typeof(Int3)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadOnlyTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs index 92cae114..469669ff 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs @@ -4,39 +4,38 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed read write buffer stored on GPU memory. +/// +/// The type of items stored on the buffer. +[DebuggerTypeProxy(typeof(BufferDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadWriteBuffer : StructuredBuffer + where T : unmanaged { /// - /// A representing a typed read write buffer stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the buffer. - [DebuggerTypeProxy(typeof(BufferDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadWriteBuffer : StructuredBuffer - where T : unmanaged + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ReadWriteBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.ReadWrite, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The allocation mode to use for the new resource. - internal ReadWriteBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) - : base(device, length, ResourceType.ReadWrite, allocationMode) - { - } + } - /// - /// Gets or sets a single value from the current writeable buffer. - /// - /// The index of the value to get or set. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref T this[int i] => throw new InvalidExecutionContextException($"{typeof(ReadWriteBuffer)}[{typeof(int)}]"); + /// + /// Gets or sets a single value from the current writeable buffer. + /// + /// The index of the value to get or set. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[int i] => throw new InvalidExecutionContextException($"{typeof(ReadWriteBuffer)}[{typeof(int)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadWriteBuffer<{typeof(T)}>[{Length}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteBuffer<{typeof(T)}>[{Length}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs index caa6def5..96aadf00 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs @@ -8,41 +8,40 @@ using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed read write 2D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +/// The type of pixels used on the GPU side. +[DebuggerTypeProxy(typeof(Texture2DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadWriteTexture2D : Texture2D, IReadWriteTexture2D + where T : unmanaged, IUnorm + where TPixel : unmanaged { /// - /// A representing a typed read write 2D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - /// The type of pixels used on the GPU side. - [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadWriteTexture2D : Texture2D, IReadWriteTexture2D - where T : unmanaged, IUnorm - where TPixel : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - internal ReadWriteTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) - : base(device, width, height, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) - { - } + } - /// - public ref TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(int)}, {typeof(int)}]"); + /// + public ref TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(int)}, {typeof(int)}]"); - /// - public ref TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(Int2)}]"); + /// + public ref TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(Int2)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadWriteTexture2D<{typeof(T)}, {typeof(TPixel)}>[{Width}, {Height}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture2D<{typeof(T)}, {typeof(TPixel)}>[{Width}, {Height}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs index 50cffd03..617863b5 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs @@ -5,48 +5,47 @@ using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed read write 2D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(Texture2DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadWriteTexture2D : Texture2D + where T : unmanaged { /// - /// A representing a typed read write 2D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadWriteTexture2D : Texture2D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - internal ReadWriteTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) - : base(device, width, height, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) - { - } + } - /// - /// Gets a single value from the current writeable texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref T this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(int)}, {typeof(int)}]"); + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(int)}, {typeof(int)}]"); - /// - /// Gets or sets a single value from the current writeable texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref T this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(Int2)}]"); + /// + /// Gets or sets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture2D)}[{typeof(Int2)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadWriteTexture2D<{typeof(T)}>[{Width}, {Height}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture2D<{typeof(T)}>[{Width}, {Height}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs index 19d2fe45..27d6e2a0 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs @@ -8,42 +8,41 @@ using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; #pragma warning disable CS0618 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly 3D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +/// The type of pixels used on the GPU side. +[DebuggerTypeProxy(typeof(Texture3DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadWriteTexture3D : Texture3D, IReadWriteTexture3D + where T : unmanaged, IUnorm + where TPixel : unmanaged { /// - /// A representing a typed readonly 3D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - /// The type of pixels used on the GPU side. - [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadWriteTexture3D : Texture3D, IReadWriteTexture3D - where T : unmanaged, IUnorm - where TPixel : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) - : base(device, width, height, depth, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) - { - } + } - /// - public ref TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); + /// + public ref TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); - /// - public ref TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(Int3)}]"); + /// + public ref TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(Int3)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadWriteTexture3D<{typeof(T)}, {nameof(TPixel)}>[{Width}, {Height}, {Depth}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture3D<{typeof(T)}, {nameof(TPixel)}>[{Width}, {Height}, {Depth}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs index 0497028a..af759c96 100644 --- a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs @@ -5,50 +5,49 @@ using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed readonly 3D texture stored on GPU memory. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(Texture3DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class ReadWriteTexture3D : Texture3D + where T : unmanaged { /// - /// A representing a typed readonly 3D texture stored on GPU memory. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class ReadWriteTexture3D : Texture3D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) - : base(device, width, height, depth, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) - { - } + } - /// - /// Gets a single value from the current writeable texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// The depthwise offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); - /// - /// Gets a single value from the current writeable texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref T this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(Int3)}]"); + /// + /// Gets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(ReadWriteTexture3D)}[{typeof(Int3)}]"); - /// - public override string ToString() - { - return $"ComputeSharp.ReadWriteTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs index d615a1db..61265ee1 100644 --- a/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs @@ -3,32 +3,31 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed buffer stored on CPU memory, that can be used to transfer data to the GPU. +/// +/// The type of items stored on the buffer. +[DebuggerTypeProxy(typeof(TransferBufferDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class UploadBuffer : TransferBuffer + where T : unmanaged { /// - /// A representing a typed buffer stored on CPU memory, that can be used to transfer data to the GPU. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the buffer. - [DebuggerTypeProxy(typeof(TransferBufferDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class UploadBuffer : TransferBuffer - where T : unmanaged + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal UploadBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.Upload, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The number of items to store in the current buffer. - /// The allocation mode to use for the new resource. - internal UploadBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) - : base(device, length, ResourceType.Upload, allocationMode) - { - } + } - /// - public override string ToString() - { - return $"ComputeSharp.UploadBuffer<{typeof(T)}>[{Length}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.UploadBuffer<{typeof(T)}>[{Length}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs index 1aa426d4..19397908 100644 --- a/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs @@ -3,33 +3,32 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed 2D texture stored on CPU memory, that can be used to transfer data to the GPU. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(TransferTexture2DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class UploadTexture2D : TransferTexture2D + where T : unmanaged { /// - /// A representing a typed 2D texture stored on CPU memory, that can be used to transfer data to the GPU. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(TransferTexture2DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class UploadTexture2D : TransferTexture2D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal UploadTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.Upload, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The allocation mode to use for the new resource. - internal UploadTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) - : base(device, width, height, ResourceType.Upload, allocationMode) - { - } + } - /// - public override string ToString() - { - return $"ComputeSharp.UploadTexture2D<{typeof(T)}>[{Width}, {Height}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.UploadTexture2D<{typeof(T)}>[{Width}, {Height}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs index eacc0862..9bbe844b 100644 --- a/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs @@ -3,34 +3,33 @@ using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// A representing a typed 3D texture stored on CPU memory, that can be used to transfer data to the GPU. +/// +/// The type of items stored on the texture. +[DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] +[DebuggerDisplay("{ToString(),raw}")] +public sealed class UploadTexture3D : TransferTexture3D + where T : unmanaged { /// - /// A representing a typed 3D texture stored on CPU memory, that can be used to transfer data to the GPU. + /// Creates a new instance with the specified parameters. /// - /// The type of items stored on the texture. - [DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] - [DebuggerDisplay("{ToString(),raw}")] - public sealed class UploadTexture3D : TransferTexture3D - where T : unmanaged + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal UploadTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.Upload, allocationMode) { - /// - /// Creates a new instance with the specified parameters. - /// - /// The associated with the current instance. - /// The width of the texture. - /// The height of the texture. - /// The depth of the texture. - /// The allocation mode to use for the new resource. - internal UploadTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) - : base(device, width, height, depth, ResourceType.Upload, allocationMode) - { - } + } - /// - public override string ToString() - { - return $"ComputeSharp.UploadTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; - } + /// + public override string ToString() + { + return $"ComputeSharp.UploadTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; } } diff --git a/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs index 6bea689f..a6556148 100644 --- a/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs @@ -6,394 +6,393 @@ using ComputeSharp.Resources.Views; #pragma warning disable CS0809 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// The type represents a view over a 2D texture allocated on host memory, providing APIs to +/// easily manipulate its contents without having to manually deal with the internal alignment requirements of textures. +/// As such, one key difference with and arrays is that the underlying buffer for a +/// instance might not be contiguous in memory. All this logic is handled internally by the +/// type and it is transparent to the user, but note that working over discontiguous buffers has a performance impact. +/// It is recommended to execute as much computation on the GPU side as possible. +/// +/// The type of items in the current instance. +public readonly unsafe ref partial struct TextureView2D + where T : unmanaged { + // Let's consider a representation of a 2D texture or a generic 2D memory region. + // The data is represented in row-major order as usual, and the 'XX' grid cells + // represent locations that are mapped by a given TextureView2D instance. + // An important aspec to note is that the pitch of each row is calculated in + // bytes, as the texture layout alignment is unrelated to the logical type in use. + // Assuming we a stride that's greater than the logical rows, we might have: + // + // pointer__ _________width_________ + // \/ \ + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | |-height + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // \________________stride_________________________/ + /// - /// The type represents a view over a 2D texture allocated on host memory, providing APIs to - /// easily manipulate its contents without having to manually deal with the internal alignment requirements of textures. - /// As such, one key difference with and arrays is that the underlying buffer for a - /// instance might not be contiguous in memory. All this logic is handled internally by the - /// type and it is transparent to the user, but note that working over discontiguous buffers has a performance impact. - /// It is recommended to execute as much computation on the GPU side as possible. + /// The pointer to the first element of the target 2D region. /// - /// The type of items in the current instance. - public readonly unsafe ref partial struct TextureView2D - where T : unmanaged + private readonly T* pointer; + + /// + /// The width of the specified 2D texture. + /// + private readonly int width; + + /// + /// The height of the specified 2D region. + /// + private readonly int height; + + /// + /// The row pitch of the specified 2D region. + /// + private readonly int pitchInBytes; + + /// + /// Initializes a new instance of the struct with the specified parameters. + /// + /// The pointer to the start of the memory area to map. + /// The width of the 2D memory area to map. + /// The height of the 2D memory area to map. + /// The row pitch in bytes of the 2D memory area to map. + internal TextureView2D(T* pointer, int width, int height, int pitchInBytes) { - // Let's consider a representation of a 2D texture or a generic 2D memory region. - // The data is represented in row-major order as usual, and the 'XX' grid cells - // represent locations that are mapped by a given TextureView2D instance. - // An important aspec to note is that the pitch of each row is calculated in - // bytes, as the texture layout alignment is unrelated to the logical type in use. - // Assuming we a stride that's greater than the logical rows, we might have: - // - // pointer__ _________width_________ - // \/ \ - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | |-height - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // \________________stride_________________________/ + this.pointer = pointer; + this.width = width; + this.height = height; + this.pitchInBytes = pitchInBytes; + } - /// - /// The pointer to the first element of the target 2D region. - /// - private readonly T* pointer; + /// + /// Gets an empty instance. + /// + public static TextureView2D Empty => default; - /// - /// The width of the specified 2D texture. - /// - private readonly int width; - - /// - /// The height of the specified 2D region. - /// - private readonly int height; - - /// - /// The row pitch of the specified 2D region. - /// - private readonly int pitchInBytes; - - /// - /// Initializes a new instance of the struct with the specified parameters. - /// - /// The pointer to the start of the memory area to map. - /// The width of the 2D memory area to map. - /// The height of the 2D memory area to map. - /// The row pitch in bytes of the 2D memory area to map. - internal TextureView2D(T* pointer, int width, int height, int pitchInBytes) - { - this.pointer = pointer; - this.width = width; - this.height = height; - this.pitchInBytes = pitchInBytes; - } - - /// - /// Gets an empty instance. - /// - public static TextureView2D Empty => default; - - /// - /// Gets a value indicating whether the current instance is empty. - /// - public bool IsEmpty - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.width == 0; - } - - /// - /// Gets the total length of the current instance. - /// - public int Length - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.width * this.height; - } - - /// - /// Gets the width of the underlying 2D memory area. - /// - public int Width - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.width; - } - - /// - /// Gets the height of the underlying 2D memory area. - /// - public int Height - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.height; - } - - /// - /// Gets the element at the specified zero-based indices. - /// - /// The target column to get the element from. - /// The target row to get the element from. - /// A reference to the element at the specified indices. - /// - /// Thrown when either or are invalid. - /// - public ref T this[int x, int y] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - if ((uint)x >= (uint)this.width || - (uint)y >= (uint)this.height) - { - ThrowHelper.ThrowIndexOutOfRangeException(); - } - - return ref *((T*)((byte*)this.pointer + (y * this.pitchInBytes)) + x); - } - } - - /// - /// Clears the contents of the current instance. - /// - public void Clear() - { - if (IsEmpty) - { - return; - } - - if (TryGetSpan(out Span span)) - { - span.Clear(); - } - else - { - for (int y = 0; y < this.height; y++) - { - GetRowSpan(y).Clear(); - } - } - } - - /// - /// Copies the contents of this into a destination instance. - /// - /// The destination instance. - /// - /// Thrown when is shorter than the source instance. - /// - public void CopyTo(Span destination) - { - if (IsEmpty) - { - return; - } - - if (TryGetSpan(out Span span)) - { - span.CopyTo(destination); - } - else - { - if (Length > destination.Length) - { - ThrowHelper.ThrowArgumentExceptionForDestinationTooShort(); - } - - for (int y = 0, j = 0; y < this.height; y++, j += this.width) - { - GetRowSpan(y).CopyTo(destination.Slice(j)); - } - } - } - - /// - /// Copies the contents of this into a destination instance. - /// For this API to succeed, the target has to have the same shape as the current one. - /// - /// The destination instance. - /// - /// Thrown when is shorter than the source instance. - /// - public void CopyTo(TextureView2D destination) - { - if (destination.width != this.width || - destination.width != this.height) - { - ThrowHelper.ThrowArgumentException(); - } - - if (IsEmpty) - { - return; - } - - if (destination.TryGetSpan(out Span span)) - { - CopyTo(span); - } - else - { - for (int y = 0; y < this.height; y++) - { - GetRowSpan(y).CopyTo(destination.GetRowSpan(y)); - } - } - } - - /// - /// Attempts to copy the current instance to a destination . - /// - /// The target of the copy operation. - /// Whether or not the operation was successful. - public bool TryCopyTo(Span destination) - { - if (destination.Length >= Length) - { - CopyTo(destination); - - return true; - } - - return false; - } - - /// - /// Attempts to copy the current instance to a destination . - /// - /// The target of the copy operation. - /// Whether or not the operation was successful. - public bool TryCopyTo(TextureView2D destination) - { - if (destination.width == this.width || - destination.height == this.height) - { - CopyTo(destination); - - return true; - } - - return false; - } - - /// - /// Fills the elements of this span with a specified value. - /// - /// The value to assign to each element of the instance. - public void Fill(T value) - { - if (IsEmpty) - { - return; - } - - if (TryGetSpan(out Span span)) - { - span.Fill(value); - } - else - { - for (int y = 0; y < this.height; y++) - { - GetRowSpan(y).Fill(value); - } - } - } - - /// - /// Returns a reference to the first element within the current instance, with no bounds check. - /// - /// A reference to the first element within the current instance. - [Pure] + /// + /// Gets a value indicating whether the current instance is empty. + /// + public bool IsEmpty + { [MethodImpl(MethodImplOptions.AggressiveInlining)] - public T* DangerousGetAddressAndByteStride(out int strideInBytes) - { - strideInBytes = this.pitchInBytes; + get => this.width == 0; + } - return this.pointer; - } + /// + /// Gets the total length of the current instance. + /// + public int Length + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width * this.height; + } - /// - /// Gets a for a specified row. - /// - /// The index of the target row to retrieve. - /// Throw when is out of range. - /// The resulting row . - [Pure] - public Span GetRowSpan(int y) + /// + /// Gets the width of the underlying 2D memory area. + /// + public int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width; + } + + /// + /// Gets the height of the underlying 2D memory area. + /// + public int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.height; + } + + /// + /// Gets the element at the specified zero-based indices. + /// + /// The target column to get the element from. + /// The target row to get the element from. + /// A reference to the element at the specified indices. + /// + /// Thrown when either or are invalid. + /// + public ref T this[int x, int y] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { - if ((uint)y >= (uint)this.height) + if ((uint)x >= (uint)this.width || + (uint)y >= (uint)this.height) { - ThrowHelper.ThrowArgumentOutOfRangeExceptionForRow(); + ThrowHelper.ThrowIndexOutOfRangeException(); } - return new((byte*)this.pointer + (y * this.pitchInBytes), this.width); - } - - /// - /// Tries to get a instance, if the underlying buffer is contiguous and small enough. - /// - /// The resulting , in case of success. - /// Whether or not was correctly assigned. - public bool TryGetSpan(out Span span) - { - if (this.pitchInBytes == this.width) - { - span = new(this.pointer, Length); - - return true; - } - - span = default; - - return false; - } - - /// - /// Copies the contents of the current instance into a new 2D array. - /// - /// A 2D array containing the data in the current instance. - [Pure] - public T[,] ToArray() - { - T[,] array = new T[this.height, this.width]; - - fixed (T* pointer = array) - { - CopyTo(new Span(pointer, Length)); - } - - return array; - } - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] - public override bool Equals(object? obj) - { - throw new NotSupportedException("ComputeSharp.TextureView2D.Equals(object) is not supported"); - } - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("GetHashCode() on Span will always throw an exception.")] - public override int GetHashCode() - { - throw new NotSupportedException("ComputeSharp.TextureView2D.GetHashCode() is not supported"); - } - - /// - public override string ToString() - { - return $"ComputeSharp.TextureView2D<{typeof(T)}>[{Width}, {Height}]"; - } - - /// - /// Checks whether two instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// Whether or not and are equal. - public static bool operator ==(TextureView2D left, TextureView2D right) - { - return left.pointer == right.pointer; - } - - /// - /// Checks whether two instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// Whether or not and are not equal. - public static bool operator !=(TextureView2D left, TextureView2D right) - { - return !(left == right); + return ref *((T*)((byte*)this.pointer + (y * this.pitchInBytes)) + x); } } + + /// + /// Clears the contents of the current instance. + /// + public void Clear() + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Clear(); + } + else + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y).Clear(); + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(Span destination) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.CopyTo(destination); + } + else + { + if (Length > destination.Length) + { + ThrowHelper.ThrowArgumentExceptionForDestinationTooShort(); + } + + for (int y = 0, j = 0; y < this.height; y++, j += this.width) + { + GetRowSpan(y).CopyTo(destination.Slice(j)); + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// For this API to succeed, the target has to have the same shape as the current one. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(TextureView2D destination) + { + if (destination.width != this.width || + destination.width != this.height) + { + ThrowHelper.ThrowArgumentException(); + } + + if (IsEmpty) + { + return; + } + + if (destination.TryGetSpan(out Span span)) + { + CopyTo(span); + } + else + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y).CopyTo(destination.GetRowSpan(y)); + } + } + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(Span destination) + { + if (destination.Length >= Length) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(TextureView2D destination) + { + if (destination.width == this.width || + destination.height == this.height) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Fills the elements of this span with a specified value. + /// + /// The value to assign to each element of the instance. + public void Fill(T value) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Fill(value); + } + else + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y).Fill(value); + } + } + } + + /// + /// Returns a reference to the first element within the current instance, with no bounds check. + /// + /// A reference to the first element within the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public T* DangerousGetAddressAndByteStride(out int strideInBytes) + { + strideInBytes = this.pitchInBytes; + + return this.pointer; + } + + /// + /// Gets a for a specified row. + /// + /// The index of the target row to retrieve. + /// Throw when is out of range. + /// The resulting row . + [Pure] + public Span GetRowSpan(int y) + { + if ((uint)y >= (uint)this.height) + { + ThrowHelper.ThrowArgumentOutOfRangeExceptionForRow(); + } + + return new((byte*)this.pointer + (y * this.pitchInBytes), this.width); + } + + /// + /// Tries to get a instance, if the underlying buffer is contiguous and small enough. + /// + /// The resulting , in case of success. + /// Whether or not was correctly assigned. + public bool TryGetSpan(out Span span) + { + if (this.pitchInBytes == this.width) + { + span = new(this.pointer, Length); + + return true; + } + + span = default; + + return false; + } + + /// + /// Copies the contents of the current instance into a new 2D array. + /// + /// A 2D array containing the data in the current instance. + [Pure] + public T[,] ToArray() + { + T[,] array = new T[this.height, this.width]; + + fixed (T* pointer = array) + { + CopyTo(new Span(pointer, Length)); + } + + return array; + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] + public override bool Equals(object? obj) + { + throw new NotSupportedException("ComputeSharp.TextureView2D.Equals(object) is not supported"); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("GetHashCode() on Span will always throw an exception.")] + public override int GetHashCode() + { + throw new NotSupportedException("ComputeSharp.TextureView2D.GetHashCode() is not supported"); + } + + /// + public override string ToString() + { + return $"ComputeSharp.TextureView2D<{typeof(T)}>[{Width}, {Height}]"; + } + + /// + /// Checks whether two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are equal. + public static bool operator ==(TextureView2D left, TextureView2D right) + { + return left.pointer == right.pointer; + } + + /// + /// Checks whether two instances are not equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are not equal. + public static bool operator !=(TextureView2D left, TextureView2D right) + { + return !(left == right); + } } diff --git a/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs index f203cde8..8ff26a42 100644 --- a/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs @@ -6,435 +6,434 @@ using ComputeSharp.Resources.Views; #pragma warning disable CS0809 -namespace ComputeSharp +namespace ComputeSharp; + +/// +/// The mirrors the type but representing a memory +/// area spanning 3 dimensions. The underlying buffer can be discontiguous across both the height and the depth. +/// It is recommended to execute as much computation on the GPU side as possible. +/// +/// The type of items in the current instance. +public readonly unsafe ref partial struct TextureView3D + where T : unmanaged { + // The internal layout of a 3D texture mapped in memory is the same as that of a + // 3D texture, with different 3D slices being stacked along the depth axis. Each + // slice also has the same padding as the one between rows, which means that if + // rows have no padding, all 3D slices are contiguous in memory as well. + // The memory representation essentially looks like this: + // + // ________________width______________ + // / __pointer \ + // / / \ + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | |-height + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // ` ` ` ` ` ` ` ` ` ` ` + // ` ` ` ` ` ` ` ` ` ` ` + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // \________________stride_________________________/ + // + // Note that the depth stride is omitted after the last 3D slice. + /// - /// The mirrors the type but representing a memory - /// area spanning 3 dimensions. The underlying buffer can be discontiguous across both the height and the depth. - /// It is recommended to execute as much computation on the GPU side as possible. + /// The pointer to the first element of the target 3D region. /// - /// The type of items in the current instance. - public readonly unsafe ref partial struct TextureView3D - where T : unmanaged + private readonly T* pointer; + + /// + /// The width of the specified 3D texture. + /// + private readonly int width; + + /// + /// The height of the specified 3D region. + /// + private readonly int height; + + /// + /// The depth of the specified 3D region. + /// + private readonly int depth; + + /// + /// The stride of the specified 3D region. + /// + private readonly int strideInBytes; + + /// + /// Initializes a new instance of the struct with the specified parameters. + /// + /// The pointer to the start of the memory area to map. + /// The width of the 3D memory area to map. + /// The height of the 3D memory area to map. + /// The depth of the 3D memory area to map. + /// The stride in bytes of the 3D memory area to map. + internal TextureView3D(T* pointer, int width, int height, int depth, int strideInBytes) { - // The internal layout of a 3D texture mapped in memory is the same as that of a - // 3D texture, with different 3D slices being stacked along the depth axis. Each - // slice also has the same padding as the one between rows, which means that if - // rows have no padding, all 3D slices are contiguous in memory as well. - // The memory representation essentially looks like this: - // - // ________________width______________ - // / __pointer \ - // / / \ - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | |-height - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // ` ` ` ` ` ` ` ` ` ` ` - // ` ` ` ` ` ` ` ` ` ` ` - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | - // \________________stride_________________________/ - // - // Note that the depth stride is omitted after the last 3D slice. + this.pointer = pointer; + this.width = width; + this.height = height; + this.depth = depth; + this.strideInBytes = strideInBytes; + } - /// - /// The pointer to the first element of the target 3D region. - /// - private readonly T* pointer; + /// + /// Gets an empty instance. + /// + public static TextureView3D Empty => default; - /// - /// The width of the specified 3D texture. - /// - private readonly int width; - - /// - /// The height of the specified 3D region. - /// - private readonly int height; - - /// - /// The depth of the specified 3D region. - /// - private readonly int depth; - - /// - /// The stride of the specified 3D region. - /// - private readonly int strideInBytes; - - /// - /// Initializes a new instance of the struct with the specified parameters. - /// - /// The pointer to the start of the memory area to map. - /// The width of the 3D memory area to map. - /// The height of the 3D memory area to map. - /// The depth of the 3D memory area to map. - /// The stride in bytes of the 3D memory area to map. - internal TextureView3D(T* pointer, int width, int height, int depth, int strideInBytes) - { - this.pointer = pointer; - this.width = width; - this.height = height; - this.depth = depth; - this.strideInBytes = strideInBytes; - } - - /// - /// Gets an empty instance. - /// - public static TextureView3D Empty => default; - - /// - /// Gets a value indicating whether the current instance is empty. - /// - public bool IsEmpty - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.width == 0; - } - - /// - /// Gets the total length of the current instance. - /// - public int Length - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.width * this.height * this.depth; - } - - /// - /// Gets the width of the underlying 3D memory area. - /// - public int Width - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.width; - } - - /// - /// Gets the height of the underlying 3D memory area. - /// - public int Height - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.height; - } - - /// - /// Gets the depth of the underlying 3D memory area. - /// - public int Depth - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.depth; - } - - /// - /// Gets the element at the specified zero-based indices. - /// - /// The target column to get the element from. - /// The target row to get the element from. - /// The target depth to get the element from. - /// A reference to the element at the specified indices. - /// - /// Thrown when either , or are invalid. - /// - public ref T this[int x, int y, int z] - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - if ((uint)x >= (uint)this.width || - (uint)y >= (uint)this.height || - (uint)z >= (uint)this.depth) - { - ThrowHelper.ThrowIndexOutOfRangeException(); - } - - return ref *((T*)((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes)) + x); - } - } - - /// - /// Clears the contents of the current instance. - /// - public void Clear() - { - if (IsEmpty) - { - return; - } - - if (TryGetSpan(out Span span)) - { - span.Clear(); - } - else - { - for (int z = 0; z < this.depth; z++) - { - for (int y = 0; y < this.height; y++) - { - GetRowSpan(y, z).Clear(); - } - } - } - } - - /// - /// Copies the contents of this into a destination instance. - /// - /// The destination instance. - /// - /// Thrown when is shorter than the source instance. - /// - public void CopyTo(Span destination) - { - if (IsEmpty) - { - return; - } - - if (TryGetSpan(out Span span)) - { - span.CopyTo(destination); - } - else - { - for (int z = 0, j = 0; z < this.depth; z++) - { - for (int y = 0; y < this.height; y++, j += this.width) - { - GetRowSpan(y, z).CopyTo(destination.Slice(j)); - } - } - } - } - - /// - /// Copies the contents of this into a destination instance. - /// For this API to succeed, the target has to have the same shape as the current one. - /// - /// The destination instance. - /// - /// Thrown when is shorter than the source instance. - /// - public void CopyTo(TextureView3D destination) - { - if (destination.width != this.width || - destination.width != this.height) - { - ThrowHelper.ThrowArgumentException(); - } - - if (IsEmpty) - { - return; - } - - if (destination.TryGetSpan(out Span span)) - { - CopyTo(span); - } - else - { - for (int z = 0; z < this.depth; z++) - { - for (int y = 0; y < this.height; y++) - { - GetRowSpan(y, z).CopyTo(destination.GetRowSpan(y, z)); - } - } - } - } - - /// - /// Attempts to copy the current instance to a destination . - /// - /// The target of the copy operation. - /// Whether or not the operation was successful. - public bool TryCopyTo(Span destination) - { - if (destination.Length >= Length) - { - CopyTo(destination); - - return true; - } - - return false; - } - - /// - /// Attempts to copy the current instance to a destination . - /// - /// The target of the copy operation. - /// Whether or not the operation was successful. - public bool TryCopyTo(TextureView3D destination) - { - if (destination.width == this.width || - destination.height == this.height) - { - CopyTo(destination); - - return true; - } - - return false; - } - - /// - /// Fills the elements of this span with a specified value. - /// - /// The value to assign to each element of the instance. - public void Fill(T value) - { - if (IsEmpty) - { - return; - } - - if (TryGetSpan(out Span span)) - { - span.Fill(value); - } - else - { - for (int z = 0; z < this.depth; z++) - { - for (int y = 0; y < this.height; y++) - { - GetRowSpan(y, z).Fill(value); - } - } - } - } - - /// - /// Returns a reference to the first element within the current instance, with no bounds check. - /// - /// A reference to the first element within the current instance. - [Pure] + /// + /// Gets a value indicating whether the current instance is empty. + /// + public bool IsEmpty + { [MethodImpl(MethodImplOptions.AggressiveInlining)] - public T* DangerousGetAddressAndByteStride(out int strideInBytes) - { - strideInBytes = this.strideInBytes; + get => this.width == 0; + } - return this.pointer; - } + /// + /// Gets the total length of the current instance. + /// + public int Length + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width * this.height * this.depth; + } - /// - /// Gets a for a specified row. - /// - /// The index of the target row to retrieve. - /// The depth of the row to retrieve. - /// - /// Throw when either or are out of range. - /// - /// The resulting row . - [Pure] - public Span GetRowSpan(int y, int z) + /// + /// Gets the width of the underlying 3D memory area. + /// + public int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width; + } + + /// + /// Gets the height of the underlying 3D memory area. + /// + public int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.height; + } + + /// + /// Gets the depth of the underlying 3D memory area. + /// + public int Depth + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.depth; + } + + /// + /// Gets the element at the specified zero-based indices. + /// + /// The target column to get the element from. + /// The target row to get the element from. + /// The target depth to get the element from. + /// A reference to the element at the specified indices. + /// + /// Thrown when either , or are invalid. + /// + public ref T this[int x, int y, int z] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { - if ((uint)y >= (uint)this.height) + if ((uint)x >= (uint)this.width || + (uint)y >= (uint)this.height || + (uint)z >= (uint)this.depth) { - ThrowHelper.ThrowArgumentOutOfRangeExceptionForRow(); + ThrowHelper.ThrowIndexOutOfRangeException(); } - if ((uint)z >= (uint)this.depth) - { - ThrowHelper.ThrowArgumentOutOfRangeExceptionForZ(); - } - - return new((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes), this.width); - } - - /// - /// Tries to get a instance, if the underlying buffer is contiguous and small enough. - /// - /// The resulting , in case of success. - /// Whether or not was correctly assigned. - public bool TryGetSpan(out Span span) - { - if (this.strideInBytes == this.width) - { - span = new(this.pointer, Length); - - return true; - } - - span = default; - - return false; - } - - /// - /// Copies the contents of the current instance into a new 3D array. - /// - /// A 3D array containing the data in the current instance. - [Pure] - public T[,,] ToArray() - { - T[,,] array = new T[this.depth, this.height, this.width]; - - fixed (T* pointer = array) - { - CopyTo(new Span(pointer, Length)); - } - - return array; - } - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] - public override bool Equals(object? obj) - { - throw new NotSupportedException("ComputeSharp.TextureView3D.Equals(object) is not supported"); - } - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("GetHashCode() on Span will always throw an exception.")] - public override int GetHashCode() - { - throw new NotSupportedException("ComputeSharp.TextureView3D.GetHashCode() is not supported"); - } - - /// - public override string ToString() - { - return $"ComputeSharp.TextureView3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; - } - - /// - /// Checks whether two instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// Whether or not and are equal. - public static bool operator ==(TextureView3D left, TextureView3D right) - { - return left.pointer == right.pointer; - } - - /// - /// Checks whether two instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// Whether or not and are not equal. - public static bool operator !=(TextureView3D left, TextureView3D right) - { - return !(left == right); + return ref *((T*)((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes)) + x); } } + + /// + /// Clears the contents of the current instance. + /// + public void Clear() + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Clear(); + } + else + { + for (int z = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y, z).Clear(); + } + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(Span destination) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.CopyTo(destination); + } + else + { + for (int z = 0, j = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++, j += this.width) + { + GetRowSpan(y, z).CopyTo(destination.Slice(j)); + } + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// For this API to succeed, the target has to have the same shape as the current one. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(TextureView3D destination) + { + if (destination.width != this.width || + destination.width != this.height) + { + ThrowHelper.ThrowArgumentException(); + } + + if (IsEmpty) + { + return; + } + + if (destination.TryGetSpan(out Span span)) + { + CopyTo(span); + } + else + { + for (int z = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y, z).CopyTo(destination.GetRowSpan(y, z)); + } + } + } + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(Span destination) + { + if (destination.Length >= Length) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(TextureView3D destination) + { + if (destination.width == this.width || + destination.height == this.height) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Fills the elements of this span with a specified value. + /// + /// The value to assign to each element of the instance. + public void Fill(T value) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Fill(value); + } + else + { + for (int z = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y, z).Fill(value); + } + } + } + } + + /// + /// Returns a reference to the first element within the current instance, with no bounds check. + /// + /// A reference to the first element within the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public T* DangerousGetAddressAndByteStride(out int strideInBytes) + { + strideInBytes = this.strideInBytes; + + return this.pointer; + } + + /// + /// Gets a for a specified row. + /// + /// The index of the target row to retrieve. + /// The depth of the row to retrieve. + /// + /// Throw when either or are out of range. + /// + /// The resulting row . + [Pure] + public Span GetRowSpan(int y, int z) + { + if ((uint)y >= (uint)this.height) + { + ThrowHelper.ThrowArgumentOutOfRangeExceptionForRow(); + } + + if ((uint)z >= (uint)this.depth) + { + ThrowHelper.ThrowArgumentOutOfRangeExceptionForZ(); + } + + return new((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes), this.width); + } + + /// + /// Tries to get a instance, if the underlying buffer is contiguous and small enough. + /// + /// The resulting , in case of success. + /// Whether or not was correctly assigned. + public bool TryGetSpan(out Span span) + { + if (this.strideInBytes == this.width) + { + span = new(this.pointer, Length); + + return true; + } + + span = default; + + return false; + } + + /// + /// Copies the contents of the current instance into a new 3D array. + /// + /// A 3D array containing the data in the current instance. + [Pure] + public T[,,] ToArray() + { + T[,,] array = new T[this.depth, this.height, this.width]; + + fixed (T* pointer = array) + { + CopyTo(new Span(pointer, Length)); + } + + return array; + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] + public override bool Equals(object? obj) + { + throw new NotSupportedException("ComputeSharp.TextureView3D.Equals(object) is not supported"); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("GetHashCode() on Span will always throw an exception.")] + public override int GetHashCode() + { + throw new NotSupportedException("ComputeSharp.TextureView3D.GetHashCode() is not supported"); + } + + /// + public override string ToString() + { + return $"ComputeSharp.TextureView3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + + /// + /// Checks whether two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are equal. + public static bool operator ==(TextureView3D left, TextureView3D right) + { + return left.pointer == right.pointer; + } + + /// + /// Checks whether two instances are not equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are not equal. + public static bool operator !=(TextureView3D left, TextureView3D right) + { + return !(left == right); + } } diff --git a/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs b/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs index fb0a67ac..8f9bad1b 100644 --- a/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs +++ b/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs @@ -1,62 +1,61 @@ using System; -namespace ComputeSharp.Resources.Views +namespace ComputeSharp.Resources.Views; + +/// +/// A helper class to throw exceptions for view types. +/// +internal static class ThrowHelper { /// - /// A helper class to throw exceptions for view types. + /// Throws an when the target span is too short. /// - internal static class ThrowHelper + public static void ThrowArgumentExceptionForDestinationTooShort() { - /// - /// Throws an when the target span is too short. - /// - public static void ThrowArgumentExceptionForDestinationTooShort() - { - throw new ArgumentException("The target span is too short to copy all the current items to"); - } + throw new ArgumentException("The target span is too short to copy all the current items to"); + } - /// - /// Throws an when the a given coordinate is invalid. - /// - /// - /// Throwing is technically discouraged in the docs, but - /// we're doing that here for consistency with the official type(s) from the BCL. - /// - public static void ThrowIndexOutOfRangeException() - { - throw new IndexOutOfRangeException(); - } + /// + /// Throws an when the a given coordinate is invalid. + /// + /// + /// Throwing is technically discouraged in the docs, but + /// we're doing that here for consistency with the official type(s) from the BCL. + /// + public static void ThrowIndexOutOfRangeException() + { + throw new IndexOutOfRangeException(); + } - /// - /// Throws an when more than one parameter are invalid. - /// - public static void ThrowArgumentException() - { - throw new ArgumentException("One or more input parameters were invalid"); - } + /// + /// Throws an when more than one parameter are invalid. + /// + public static void ThrowArgumentException() + { + throw new ArgumentException("One or more input parameters were invalid"); + } - /// - /// Throws an when the "row" parameter is invalid. - /// - public static void ThrowArgumentOutOfRangeExceptionForRow() - { - throw new ArgumentOutOfRangeException("row"); - } + /// + /// Throws an when the "row" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForRow() + { + throw new ArgumentOutOfRangeException("row"); + } - /// - /// Throws an when the "column" parameter is invalid. - /// - public static void ThrowArgumentOutOfRangeExceptionForColumn() - { - throw new ArgumentOutOfRangeException("column"); - } + /// + /// Throws an when the "column" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForColumn() + { + throw new ArgumentOutOfRangeException("column"); + } - /// - /// Throws an when the "z" parameter is invalid. - /// - public static void ThrowArgumentOutOfRangeExceptionForZ() - { - throw new ArgumentOutOfRangeException("z"); - } + /// + /// Throws an when the "z" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForZ() + { + throw new ArgumentOutOfRangeException("z"); } } diff --git a/src/ComputeSharp/Shaders/Dispatching/ComputeShaderDispatchDataLoader.cs b/src/ComputeSharp/Shaders/Dispatching/ComputeShaderDispatchDataLoader.cs index 86bc33f6..e7e70812 100644 --- a/src/ComputeSharp/Shaders/Dispatching/ComputeShaderDispatchDataLoader.cs +++ b/src/ComputeSharp/Shaders/Dispatching/ComputeShaderDispatchDataLoader.cs @@ -7,51 +7,50 @@ using System.Runtime.InteropServices; #pragma warning disable CS0618 -namespace ComputeSharp.Shaders.Dispatching +namespace ComputeSharp.Shaders.Dispatching; + +/// +/// A data loader for compute shaders. +/// +internal readonly unsafe struct ComputeShaderDispatchDataLoader : IDispatchDataLoader { /// - /// A data loader for compute shaders. + /// The object in use. /// - internal readonly unsafe struct ComputeShaderDispatchDataLoader : IDispatchDataLoader + private readonly ID3D12GraphicsCommandList* d3D12GraphicsCommandList; + + /// + /// Creates a new instance. + /// + /// The object to use. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal ComputeShaderDispatchDataLoader(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) { - /// - /// The object in use. - /// - private readonly ID3D12GraphicsCommandList* d3D12GraphicsCommandList; + this.d3D12GraphicsCommandList = d3D12GraphicsCommandList; + } - /// - /// Creates a new instance. - /// - /// The object to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal ComputeShaderDispatchDataLoader(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void LoadCapturedValues(ReadOnlySpan data) + { + this.d3D12GraphicsCommandList->SetComputeRoot32BitConstants(data); + } + + /// + public void LoadCapturedResources(ReadOnlySpan data) + { + ID3D12GraphicsCommandList* d3D12GraphicsCommandList = this.d3D12GraphicsCommandList; + ref ulong resourcesRef = ref MemoryMarshal.GetReference(data); + ref D3D12_GPU_DESCRIPTOR_HANDLE startRef = ref Unsafe.As(ref resourcesRef); + ref D3D12_GPU_DESCRIPTOR_HANDLE endRef = ref Unsafe.Add(ref startRef, data.Length); + uint offset = 1; + + while (Unsafe.IsAddressLessThan(ref startRef, ref endRef)) { - this.d3D12GraphicsCommandList = d3D12GraphicsCommandList; - } + d3D12GraphicsCommandList->SetComputeRootDescriptorTable(offset, startRef); - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LoadCapturedValues(ReadOnlySpan data) - { - this.d3D12GraphicsCommandList->SetComputeRoot32BitConstants(data); - } - - /// - public void LoadCapturedResources(ReadOnlySpan data) - { - ID3D12GraphicsCommandList* d3D12GraphicsCommandList = this.d3D12GraphicsCommandList; - ref ulong resourcesRef = ref MemoryMarshal.GetReference(data); - ref D3D12_GPU_DESCRIPTOR_HANDLE startRef = ref Unsafe.As(ref resourcesRef); - ref D3D12_GPU_DESCRIPTOR_HANDLE endRef = ref Unsafe.Add(ref startRef, data.Length); - uint offset = 1; - - while (Unsafe.IsAddressLessThan(ref startRef, ref endRef)) - { - d3D12GraphicsCommandList->SetComputeRootDescriptorTable(offset, startRef); - - startRef = ref Unsafe.Add(ref startRef, 1); - offset++; - } + startRef = ref Unsafe.Add(ref startRef, 1); + offset++; } } } diff --git a/src/ComputeSharp/Shaders/Dispatching/PixelShaderDispatchDataLoader.cs b/src/ComputeSharp/Shaders/Dispatching/PixelShaderDispatchDataLoader.cs index 43fa5455..6bc27fb7 100644 --- a/src/ComputeSharp/Shaders/Dispatching/PixelShaderDispatchDataLoader.cs +++ b/src/ComputeSharp/Shaders/Dispatching/PixelShaderDispatchDataLoader.cs @@ -7,55 +7,54 @@ using System.Runtime.InteropServices; #pragma warning disable CS0618 -namespace ComputeSharp.Shaders.Dispatching +namespace ComputeSharp.Shaders.Dispatching; + +/// +/// A data loader for pixel shaders. +/// +internal readonly unsafe struct PixelShaderDispatchDataLoader : IDispatchDataLoader { /// - /// A data loader for pixel shaders. + /// The object in use. /// - internal readonly unsafe struct PixelShaderDispatchDataLoader : IDispatchDataLoader + private readonly ID3D12GraphicsCommandList* d3D12GraphicsCommandList; + + /// + /// Creates a new instance. + /// + /// The object to use. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal PixelShaderDispatchDataLoader(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) { - /// - /// The object in use. - /// - private readonly ID3D12GraphicsCommandList* d3D12GraphicsCommandList; + this.d3D12GraphicsCommandList = d3D12GraphicsCommandList; + } - /// - /// Creates a new instance. - /// - /// The object to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal PixelShaderDispatchDataLoader(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void LoadCapturedValues(ReadOnlySpan data) + { + this.d3D12GraphicsCommandList->SetComputeRoot32BitConstants(data); + } + + /// + public void LoadCapturedResources(ReadOnlySpan data) + { + ID3D12GraphicsCommandList* d3D12GraphicsCommandList = this.d3D12GraphicsCommandList; + ref ulong resourcesRef = ref MemoryMarshal.GetReference(data); + ref D3D12_GPU_DESCRIPTOR_HANDLE startRef = ref Unsafe.As(ref resourcesRef); + ref D3D12_GPU_DESCRIPTOR_HANDLE endRef = ref Unsafe.Add(ref startRef, data.Length); + uint offset = 2; + + // Skip the first target resource, as that is loaded explicitly by the shader runner using the + // target texture passed in by the user, which is not actually captured by the shader itself. + // The target root descriptor table index is therefore 2 in this case, as it needs to skip not + // only the this implicit texture to draw on, but also the constant buffer with capture values. + while (Unsafe.IsAddressLessThan(ref startRef, ref endRef)) { - this.d3D12GraphicsCommandList = d3D12GraphicsCommandList; - } + d3D12GraphicsCommandList->SetComputeRootDescriptorTable(offset, startRef); - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void LoadCapturedValues(ReadOnlySpan data) - { - this.d3D12GraphicsCommandList->SetComputeRoot32BitConstants(data); - } - - /// - public void LoadCapturedResources(ReadOnlySpan data) - { - ID3D12GraphicsCommandList* d3D12GraphicsCommandList = this.d3D12GraphicsCommandList; - ref ulong resourcesRef = ref MemoryMarshal.GetReference(data); - ref D3D12_GPU_DESCRIPTOR_HANDLE startRef = ref Unsafe.As(ref resourcesRef); - ref D3D12_GPU_DESCRIPTOR_HANDLE endRef = ref Unsafe.Add(ref startRef, data.Length); - uint offset = 2; - - // Skip the first target resource, as that is loaded explicitly by the shader runner using the - // target texture passed in by the user, which is not actually captured by the shader itself. - // The target root descriptor table index is therefore 2 in this case, as it needs to skip not - // only the this implicit texture to draw on, but also the constant buffer with capture values. - while (Unsafe.IsAddressLessThan(ref startRef, ref endRef)) - { - d3D12GraphicsCommandList->SetComputeRootDescriptorTable(offset, startRef); - - startRef = ref Unsafe.Add(ref startRef, 1); - offset++; - } + startRef = ref Unsafe.Add(ref startRef, 1); + offset++; } } } diff --git a/src/ComputeSharp/Shaders/Dispatching/ShaderDispatchMetadataLoader.cs b/src/ComputeSharp/Shaders/Dispatching/ShaderDispatchMetadataLoader.cs index 29986b2c..9f56d2ce 100644 --- a/src/ComputeSharp/Shaders/Dispatching/ShaderDispatchMetadataLoader.cs +++ b/src/ComputeSharp/Shaders/Dispatching/ShaderDispatchMetadataLoader.cs @@ -8,40 +8,39 @@ using TerraFX.Interop; #pragma warning disable CS0618 -namespace ComputeSharp.Shaders.Dispatching +namespace ComputeSharp.Shaders.Dispatching; + +/// +/// A data loader for compute shaders. +/// +internal readonly unsafe struct ShaderDispatchMetadataLoader : IDispatchMetadataLoader { /// - /// A data loader for compute shaders. + /// The object in use. /// - internal readonly unsafe struct ShaderDispatchMetadataLoader : IDispatchMetadataLoader + private readonly ID3D12Device* d3D12Device; + + /// + /// Creates a new instance. + /// + /// The object to use. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal ShaderDispatchMetadataLoader(ID3D12Device* d3D12Device) { - /// - /// The object in use. - /// - private readonly ID3D12Device* d3D12Device; + this.d3D12Device = d3D12Device; + } - /// - /// Creates a new instance. - /// - /// The object to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal ShaderDispatchMetadataLoader(ID3D12Device* d3D12Device) + /// + public unsafe void LoadMetadataHandle(ReadOnlySpan serializedMetadata, ReadOnlySpan resourceDescriptors, out IntPtr result) + { + Guard.HasSizeEqualTo(serializedMetadata, 5, nameof(serializedMetadata)); + + fixed (IntPtr* p = &result) { - this.d3D12Device = d3D12Device; - } - - /// - public unsafe void LoadMetadataHandle(ReadOnlySpan serializedMetadata, ReadOnlySpan resourceDescriptors, out IntPtr result) - { - Guard.HasSizeEqualTo(serializedMetadata, 5, nameof(serializedMetadata)); - - fixed (IntPtr* p = &result) - { - *(ComPtr*)p = this.d3D12Device->CreateRootSignature( - MemoryMarshal.Read(serializedMetadata), - MemoryMarshal.Cast(resourceDescriptors), - MemoryMarshal.Read(serializedMetadata[4..])); - } + *(ComPtr*)p = this.d3D12Device->CreateRootSignature( + MemoryMarshal.Read(serializedMetadata), + MemoryMarshal.Cast(resourceDescriptors), + MemoryMarshal.Read(serializedMetadata[4..])); } } } diff --git a/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs b/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs index 8f312679..04418965 100644 --- a/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs +++ b/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs @@ -2,40 +2,39 @@ using System.Diagnostics.Contracts; using System.Text; -namespace ComputeSharp.Exceptions +namespace ComputeSharp.Exceptions; + +/// +/// A custom type that indicates when a shader compilation with the DXC compiler has failed. +/// +public sealed class HlslCompilationException : Exception { /// - /// A custom type that indicates when a shader compilation with the DXC compiler has failed. + /// Creates a new instance. /// - public sealed class HlslCompilationException : Exception + /// The error message produced by the DXC compiler. + internal HlslCompilationException(string error) + : base(GetExceptionMessage(error)) { - /// - /// Creates a new instance. - /// - /// The error message produced by the DXC compiler. - internal HlslCompilationException(string error) - : base(GetExceptionMessage(error)) - { - } + } - /// - /// Gets a formatted exception message for a given compilation error. - /// - /// The input compilatin error message from the DXC compiler. - /// A formatted error message for a new instance. - [Pure] - private static string GetExceptionMessage(string error) - { - StringBuilder builder = new(512); + /// + /// Gets a formatted exception message for a given compilation error. + /// + /// The input compilatin error message from the DXC compiler. + /// A formatted error message for a new instance. + [Pure] + private static string GetExceptionMessage(string error) + { + StringBuilder builder = new(512); - builder.AppendLine("The DXC compiler encountered one or more errors while trying to compile the shader:"); - builder.AppendLine(); - builder.AppendLine(error.Trim()); - builder.AppendLine(); - builder.AppendLine("Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp."); - builder.Append("If you're sure that your C# shader code is valid, please open an issue an include a working repro and this error message."); + builder.AppendLine("The DXC compiler encountered one or more errors while trying to compile the shader:"); + builder.AppendLine(); + builder.AppendLine(error.Trim()); + builder.AppendLine(); + builder.AppendLine("Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp."); + builder.Append("If you're sure that your C# shader code is valid, please open an issue an include a working repro and this error message."); - return builder.ToString(); - } + return builder.ToString(); } } diff --git a/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs b/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs index dedce974..9caac2df 100644 --- a/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs +++ b/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs @@ -7,115 +7,114 @@ using static TerraFX.Interop.D3D12_PIPELINE_STATE_FLAGS; using static TerraFX.Interop.D3D12_TEXTURE_ADDRESS_MODE; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Shaders.Extensions +namespace ComputeSharp.Shaders.Extensions; + +/// +/// A with extensions for the type. +/// +internal static unsafe class ID3D12DeviceExtensions { /// - /// A with extensions for the type. + /// Creates a new for a given device. /// - internal static unsafe class ID3D12DeviceExtensions + /// The target to use to create the root signature. + /// The number of 32 bit root constants to load. + /// The input descriptor ranges for the signature to create. + /// Indicates whether or not a static sampler is used. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the root signature fails. + public static ComPtr CreateRootSignature( + this ref ID3D12Device d3D12Device, + int d3D12Root32BitConstantsCount, + ReadOnlySpan d3D12DescriptorRanges1, + bool isStaticSamplerUsed) { - /// - /// Creates a new for a given device. - /// - /// The target to use to create the root signature. - /// The number of 32 bit root constants to load. - /// The input descriptor ranges for the signature to create. - /// Indicates whether or not a static sampler is used. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the root signature fails. - public static ComPtr CreateRootSignature( - this ref ID3D12Device d3D12Device, - int d3D12Root32BitConstantsCount, - ReadOnlySpan d3D12DescriptorRanges1, - bool isStaticSamplerUsed) + using ComPtr d3D3Blob = default; + using ComPtr d3D3BlobError = default; + using ComPtr d3D12RootSignature = default; + + fixed (D3D12_DESCRIPTOR_RANGE1* d3D12DescriptorRange1 = d3D12DescriptorRanges1) { - using ComPtr d3D3Blob = default; - using ComPtr d3D3BlobError = default; - using ComPtr d3D12RootSignature = default; + D3D12_ROOT_PARAMETER1* d3D12RootParameters1 = stackalloc D3D12_ROOT_PARAMETER1[d3D12DescriptorRanges1.Length + 1]; - fixed (D3D12_DESCRIPTOR_RANGE1* d3D12DescriptorRange1 = d3D12DescriptorRanges1) + // The initial constant buffer is initialized with 32 bit root constants. + // This avoids having to manage an extra buffer for each shader dispatch. + D3D12_ROOT_PARAMETER1.InitAsConstants(out *d3D12RootParameters1, (uint)d3D12Root32BitConstantsCount, 0); + + // Pack each descriptor range into a root parameter with that single range as content + for (int i = 0; i < d3D12DescriptorRanges1.Length; i++) { - D3D12_ROOT_PARAMETER1* d3D12RootParameters1 = stackalloc D3D12_ROOT_PARAMETER1[d3D12DescriptorRanges1.Length + 1]; - - // The initial constant buffer is initialized with 32 bit root constants. - // This avoids having to manage an extra buffer for each shader dispatch. - D3D12_ROOT_PARAMETER1.InitAsConstants(out *d3D12RootParameters1, (uint)d3D12Root32BitConstantsCount, 0); - - // Pack each descriptor range into a root parameter with that single range as content - for (int i = 0; i < d3D12DescriptorRanges1.Length; i++) - { - D3D12_ROOT_PARAMETER1.InitAsDescriptorTable(out d3D12RootParameters1[i + 1], 1, d3D12DescriptorRange1 + i); - } - - D3D12_STATIC_SAMPLER_DESC d3D12SamplerDescription; - - // Create the linear static sampler if needed - if (isStaticSamplerUsed) - { - D3D12_STATIC_SAMPLER_DESC.Init( - out d3D12SamplerDescription, - shaderRegister: 0, - filter: D3D12_FILTER_MIN_MAG_MIP_LINEAR, - addressU: D3D12_TEXTURE_ADDRESS_MODE_MIRROR, - addressV: D3D12_TEXTURE_ADDRESS_MODE_MIRROR, - addressW: D3D12_TEXTURE_ADDRESS_MODE_MIRROR, - comparisonFunc: D3D12_COMPARISON_FUNC_NEVER); - } - - // Root signature description wrapping the packed collection of root parameters - D3D12_VERSIONED_ROOT_SIGNATURE_DESC.Init_1_1( - out D3D12_VERSIONED_ROOT_SIGNATURE_DESC d3D12VersionedRootSignatureDescription, - numParameters: (uint)d3D12DescriptorRanges1.Length + 1, - _pParameters: d3D12RootParameters1, - numStaticSamplers: isStaticSamplerUsed ? 1u : 0u, - _pStaticSamplers: isStaticSamplerUsed ? &d3D12SamplerDescription : null); - - // Serialize the root signature from the data just computed. When this is done - // we just work with the resulting blobs, so the input data can be unpinned. - FX.D3D12SerializeVersionedRootSignature( - &d3D12VersionedRootSignatureDescription, - d3D3Blob.GetAddressOf(), - d3D3BlobError.GetAddressOf()).Assert(); + D3D12_ROOT_PARAMETER1.InitAsDescriptorTable(out d3D12RootParameters1[i + 1], 1, d3D12DescriptorRange1 + i); } - d3D12Device.CreateRootSignature( - 0, - d3D3Blob.Get()->GetBufferPointer(), - d3D3Blob.Get()->GetBufferSize(), - FX.__uuidof(), - d3D12RootSignature.GetVoidAddressOf()).Assert(); + D3D12_STATIC_SAMPLER_DESC d3D12SamplerDescription; - return d3D12RootSignature.Move(); + // Create the linear static sampler if needed + if (isStaticSamplerUsed) + { + D3D12_STATIC_SAMPLER_DESC.Init( + out d3D12SamplerDescription, + shaderRegister: 0, + filter: D3D12_FILTER_MIN_MAG_MIP_LINEAR, + addressU: D3D12_TEXTURE_ADDRESS_MODE_MIRROR, + addressV: D3D12_TEXTURE_ADDRESS_MODE_MIRROR, + addressW: D3D12_TEXTURE_ADDRESS_MODE_MIRROR, + comparisonFunc: D3D12_COMPARISON_FUNC_NEVER); + } + + // Root signature description wrapping the packed collection of root parameters + D3D12_VERSIONED_ROOT_SIGNATURE_DESC.Init_1_1( + out D3D12_VERSIONED_ROOT_SIGNATURE_DESC d3D12VersionedRootSignatureDescription, + numParameters: (uint)d3D12DescriptorRanges1.Length + 1, + _pParameters: d3D12RootParameters1, + numStaticSamplers: isStaticSamplerUsed ? 1u : 0u, + _pStaticSamplers: isStaticSamplerUsed ? &d3D12SamplerDescription : null); + + // Serialize the root signature from the data just computed. When this is done + // we just work with the resulting blobs, so the input data can be unpinned. + FX.D3D12SerializeVersionedRootSignature( + &d3D12VersionedRootSignatureDescription, + d3D3Blob.GetAddressOf(), + d3D3BlobError.GetAddressOf()).Assert(); } - /// - /// Creates a new for a given device. - /// - /// The target to use to create the pipeline state. - /// The input root signature to use to create the pipeline state. - /// The shader bytecode to use for the pipeline state. - /// A pointer to the newly allocated instance. - /// Thrown when the creation of the pipeline state fails. - public static ComPtr CreateComputePipelineState( - this ref ID3D12Device d3D12Device, - ID3D12RootSignature* d3D12RootSignature, - D3D12_SHADER_BYTECODE d3D12ShaderBytecode) - { - using ComPtr d3D12PipelineState = default; + d3D12Device.CreateRootSignature( + 0, + d3D3Blob.Get()->GetBufferPointer(), + d3D3Blob.Get()->GetBufferSize(), + FX.__uuidof(), + d3D12RootSignature.GetVoidAddressOf()).Assert(); - D3D12_COMPUTE_PIPELINE_STATE_DESC d3D12ComputePipelineStateDescription; - d3D12ComputePipelineStateDescription.pRootSignature = d3D12RootSignature; - d3D12ComputePipelineStateDescription.CS = d3D12ShaderBytecode; - d3D12ComputePipelineStateDescription.NodeMask = 0; - d3D12ComputePipelineStateDescription.CachedPSO = default; - d3D12ComputePipelineStateDescription.Flags = D3D12_PIPELINE_STATE_FLAG_NONE; + return d3D12RootSignature.Move(); + } - d3D12Device.CreateComputePipelineState( - &d3D12ComputePipelineStateDescription, - FX.__uuidof(), - d3D12PipelineState.GetVoidAddressOf()).Assert(); + /// + /// Creates a new for a given device. + /// + /// The target to use to create the pipeline state. + /// The input root signature to use to create the pipeline state. + /// The shader bytecode to use for the pipeline state. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the pipeline state fails. + public static ComPtr CreateComputePipelineState( + this ref ID3D12Device d3D12Device, + ID3D12RootSignature* d3D12RootSignature, + D3D12_SHADER_BYTECODE d3D12ShaderBytecode) + { + using ComPtr d3D12PipelineState = default; - return d3D12PipelineState.Move(); - } + D3D12_COMPUTE_PIPELINE_STATE_DESC d3D12ComputePipelineStateDescription; + d3D12ComputePipelineStateDescription.pRootSignature = d3D12RootSignature; + d3D12ComputePipelineStateDescription.CS = d3D12ShaderBytecode; + d3D12ComputePipelineStateDescription.NodeMask = 0; + d3D12ComputePipelineStateDescription.CachedPSO = default; + d3D12ComputePipelineStateDescription.Flags = D3D12_PIPELINE_STATE_FLAG_NONE; + + d3D12Device.CreateComputePipelineState( + &d3D12ComputePipelineStateDescription, + FX.__uuidof(), + d3D12PipelineState.GetVoidAddressOf()).Assert(); + + return d3D12PipelineState.Move(); } } diff --git a/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs b/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs index 3a385798..4c171fec 100644 --- a/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs +++ b/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs @@ -8,152 +8,151 @@ using FX = TerraFX.Interop.Windows; #pragma warning disable CS0618 -namespace ComputeSharp.Interop +namespace ComputeSharp.Interop; + +/// +/// Provides methods to extract reflection info on compute shaders generated using this library. +/// +public static class ReflectionServices { /// - /// Provides methods to extract reflection info on compute shaders generated using this library. + /// Gets the shader info associated with a given compute shader. + /// + /// This overload can be used for simplicity when the compute shader being inspected does not rely on captured + /// objects to be processed correctly. This is the case when it does not contain any -s. + /// /// - public static class ReflectionServices + /// The type of compute shader to retrieve info for. + /// The resulting instance. + /// + /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to + /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of + /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. + /// + public static void GetShaderInfo(out ShaderInfo shaderInfo) + where T : struct, IComputeShader { - /// - /// Gets the shader info associated with a given compute shader. - /// - /// This overload can be used for simplicity when the compute shader being inspected does not rely on captured - /// objects to be processed correctly. This is the case when it does not contain any -s. - /// - /// - /// The type of compute shader to retrieve info for. - /// The resulting instance. - /// - /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to - /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of - /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. - /// - public static void GetShaderInfo(out ShaderInfo shaderInfo) - where T : struct, IComputeShader - { - GetNonGenericShaderInfo(default(T), out shaderInfo); - } + GetNonGenericShaderInfo(default(T), out shaderInfo); + } - /// - /// Gets the shader info associated with a given compute shader. - /// - /// The type of compute shader to retrieve info for. - /// The input compute shader to retrieve info for. - /// The resulting instance. - /// - /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to - /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of - /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. - /// - public static unsafe void GetShaderInfo(in T shader, out ShaderInfo shaderInfo) - where T : struct, IComputeShader - { - GetNonGenericShaderInfo(in shader, out shaderInfo); - } + /// + /// Gets the shader info associated with a given compute shader. + /// + /// The type of compute shader to retrieve info for. + /// The input compute shader to retrieve info for. + /// The resulting instance. + /// + /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to + /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of + /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. + /// + public static unsafe void GetShaderInfo(in T shader, out ShaderInfo shaderInfo) + where T : struct, IComputeShader + { + GetNonGenericShaderInfo(in shader, out shaderInfo); + } - /// - /// Gets the shader info associated with a given pixel shader. - /// - /// This overload can be used for simplicity when the pixel shader being inspected does not rely on captured - /// objects to be processed correctly. This is the case when it does not contain any -s. - /// - /// - /// The type of pixel shader to retrieve info for. - /// The type of pixels being processed by the shader. - /// The resulting instance. - /// - /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to - /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of - /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. - /// - public static void GetShaderInfo(out ShaderInfo shaderInfo) - where T : struct, IPixelShader - where TPixel : unmanaged - { - GetNonGenericShaderInfo(default(T), out shaderInfo); - } + /// + /// Gets the shader info associated with a given pixel shader. + /// + /// This overload can be used for simplicity when the pixel shader being inspected does not rely on captured + /// objects to be processed correctly. This is the case when it does not contain any -s. + /// + /// + /// The type of pixel shader to retrieve info for. + /// The type of pixels being processed by the shader. + /// The resulting instance. + /// + /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to + /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of + /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. + /// + public static void GetShaderInfo(out ShaderInfo shaderInfo) + where T : struct, IPixelShader + where TPixel : unmanaged + { + GetNonGenericShaderInfo(default(T), out shaderInfo); + } - /// - /// Gets the shader info associated with a given pixel shader. - /// - /// The type of pixel shader to retrieve info for. - /// The type of pixels being processed by the shader. - /// The input pixel shader to retrieve info for. - /// The resulting instance. - /// - /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to - /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of - /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. - /// - public static unsafe void GetShaderInfo(in T shader, out ShaderInfo shaderInfo) - where T : struct, IPixelShader - where TPixel : unmanaged - { - GetNonGenericShaderInfo(in shader, out shaderInfo); - } + /// + /// Gets the shader info associated with a given pixel shader. + /// + /// The type of pixel shader to retrieve info for. + /// The type of pixels being processed by the shader. + /// The input pixel shader to retrieve info for. + /// The resulting instance. + /// + /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to + /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of + /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. + /// + public static unsafe void GetShaderInfo(in T shader, out ShaderInfo shaderInfo) + where T : struct, IPixelShader + where TPixel : unmanaged + { + GetNonGenericShaderInfo(in shader, out shaderInfo); + } - /// - /// Gets the shader info associated with a given shader of any type. - /// - /// The type of shader to retrieve info for. - /// The input shader to retrieve info for. - /// The resulting instance. - private static unsafe void GetNonGenericShaderInfo(in T shader, out ShaderInfo shaderInfo) - where T : struct, IShader - { - Unsafe.AsRef(in shader).BuildHlslString(out ArrayPoolStringBuilder shaderSource, 1, 1, 1); + /// + /// Gets the shader info associated with a given shader of any type. + /// + /// The type of shader to retrieve info for. + /// The input shader to retrieve info for. + /// The resulting instance. + private static unsafe void GetNonGenericShaderInfo(in T shader, out ShaderInfo shaderInfo) + where T : struct, IShader + { + Unsafe.AsRef(in shader).BuildHlslString(out ArrayPoolStringBuilder shaderSource, 1, 1, 1); - using ComPtr dxcBlobBytecode = ShaderCompiler.Instance.CompileShader(shaderSource.WrittenSpan); + using ComPtr dxcBlobBytecode = ShaderCompiler.Instance.CompileShader(shaderSource.WrittenSpan); - shaderSource.Dispose(); + shaderSource.Dispose(); - using ComPtr dxcUtils = default; + using ComPtr dxcUtils = default; - Guid dxcLibraryClsid = FX.CLSID_DxcLibrary; + Guid dxcLibraryClsid = FX.CLSID_DxcLibrary; - FX.DxcCreateInstance(&dxcLibraryClsid, FX.__uuidof(), dxcUtils.GetVoidAddressOf()).Assert(); + FX.DxcCreateInstance(&dxcLibraryClsid, FX.__uuidof(), dxcUtils.GetVoidAddressOf()).Assert(); - using ComPtr d3D12ShaderReflection = default; + using ComPtr d3D12ShaderReflection = default; - DxcBuffer dxcBuffer = default; - dxcBuffer.Ptr = dxcBlobBytecode.Get()->GetBufferPointer(); - dxcBuffer.Size = dxcBlobBytecode.Get()->GetBufferSize(); + DxcBuffer dxcBuffer = default; + dxcBuffer.Ptr = dxcBlobBytecode.Get()->GetBufferPointer(); + dxcBuffer.Size = dxcBlobBytecode.Get()->GetBufferSize(); - dxcUtils.Get()->CreateReflection( - &dxcBuffer, - FX.__uuidof(), - d3D12ShaderReflection.GetVoidAddressOf()).Assert(); + dxcUtils.Get()->CreateReflection( + &dxcBuffer, + FX.__uuidof(), + d3D12ShaderReflection.GetVoidAddressOf()).Assert(); - D3D12_SHADER_DESC d3D12ShaderDescription; + D3D12_SHADER_DESC d3D12ShaderDescription; - d3D12ShaderReflection.Get()->GetDesc(&d3D12ShaderDescription).Assert(); + d3D12ShaderReflection.Get()->GetDesc(&d3D12ShaderDescription).Assert(); - shaderInfo = default; - Unsafe.AsRef(shaderInfo.CompilerVersion) = new string(d3D12ShaderDescription.Creator); - Unsafe.AsRef(shaderInfo.HlslSource) = shaderSource.WrittenSpan.ToString(); - Unsafe.AsRef(shaderInfo.ConstantBufferCount) = d3D12ShaderDescription.ConstantBuffers; - Unsafe.AsRef(shaderInfo.BoundResourceCount) = d3D12ShaderDescription.BoundResources; - Unsafe.AsRef(shaderInfo.InstructionCount) = d3D12ShaderDescription.InstructionCount; - Unsafe.AsRef(shaderInfo.TemporaryRegisterCount) = d3D12ShaderDescription.TempRegisterCount; - Unsafe.AsRef(shaderInfo.TemporaryArrayCount) = d3D12ShaderDescription.TempArrayCount; - Unsafe.AsRef(shaderInfo.ConstantDefineCount) = d3D12ShaderDescription.DefCount; - Unsafe.AsRef(shaderInfo.DeclarationCount) = d3D12ShaderDescription.DclCount; - Unsafe.AsRef(shaderInfo.TextureNormalInstructions) = d3D12ShaderDescription.TextureNormalInstructions; - Unsafe.AsRef(shaderInfo.TextureLoadInstructionCount) = d3D12ShaderDescription.TextureLoadInstructions; - Unsafe.AsRef(shaderInfo.TextureStoreInstructionCount) = d3D12ShaderDescription.cTextureStoreInstructions; - Unsafe.AsRef(shaderInfo.FloatInstructionCount) = d3D12ShaderDescription.FloatInstructionCount; - Unsafe.AsRef(shaderInfo.IntInstructionCount) = d3D12ShaderDescription.IntInstructionCount; - Unsafe.AsRef(shaderInfo.UIntInstructionCount) = d3D12ShaderDescription.UintInstructionCount; - Unsafe.AsRef(shaderInfo.StaticFlowControlInstructionCount) = d3D12ShaderDescription.StaticFlowControlCount; - Unsafe.AsRef(shaderInfo.DynamicFlowControlInstructionCount) = d3D12ShaderDescription.DynamicFlowControlCount; - Unsafe.AsRef(shaderInfo.EmitInstructionCount) = d3D12ShaderDescription.EmitInstructionCount; - Unsafe.AsRef(shaderInfo.BarrierInstructionCount) = d3D12ShaderDescription.cBarrierInstructions; - Unsafe.AsRef(shaderInfo.InterlockedInstructionCount) = d3D12ShaderDescription.cInterlockedInstructions; - Unsafe.AsRef(shaderInfo.BitwiseInstructionCount) = d3D12ShaderReflection.Get()->GetBitwiseInstructionCount(); - Unsafe.AsRef(shaderInfo.MovcInstructionCount) = d3D12ShaderReflection.Get()->GetMovcInstructionCount(); - Unsafe.AsRef(shaderInfo.MovInstructionCount) = d3D12ShaderReflection.Get()->GetMovInstructionCount(); - Unsafe.AsRef(shaderInfo.InterfaceSlotCount) = d3D12ShaderReflection.Get()->GetNumInterfaceSlots(); - } + shaderInfo = default; + Unsafe.AsRef(shaderInfo.CompilerVersion) = new string(d3D12ShaderDescription.Creator); + Unsafe.AsRef(shaderInfo.HlslSource) = shaderSource.WrittenSpan.ToString(); + Unsafe.AsRef(shaderInfo.ConstantBufferCount) = d3D12ShaderDescription.ConstantBuffers; + Unsafe.AsRef(shaderInfo.BoundResourceCount) = d3D12ShaderDescription.BoundResources; + Unsafe.AsRef(shaderInfo.InstructionCount) = d3D12ShaderDescription.InstructionCount; + Unsafe.AsRef(shaderInfo.TemporaryRegisterCount) = d3D12ShaderDescription.TempRegisterCount; + Unsafe.AsRef(shaderInfo.TemporaryArrayCount) = d3D12ShaderDescription.TempArrayCount; + Unsafe.AsRef(shaderInfo.ConstantDefineCount) = d3D12ShaderDescription.DefCount; + Unsafe.AsRef(shaderInfo.DeclarationCount) = d3D12ShaderDescription.DclCount; + Unsafe.AsRef(shaderInfo.TextureNormalInstructions) = d3D12ShaderDescription.TextureNormalInstructions; + Unsafe.AsRef(shaderInfo.TextureLoadInstructionCount) = d3D12ShaderDescription.TextureLoadInstructions; + Unsafe.AsRef(shaderInfo.TextureStoreInstructionCount) = d3D12ShaderDescription.cTextureStoreInstructions; + Unsafe.AsRef(shaderInfo.FloatInstructionCount) = d3D12ShaderDescription.FloatInstructionCount; + Unsafe.AsRef(shaderInfo.IntInstructionCount) = d3D12ShaderDescription.IntInstructionCount; + Unsafe.AsRef(shaderInfo.UIntInstructionCount) = d3D12ShaderDescription.UintInstructionCount; + Unsafe.AsRef(shaderInfo.StaticFlowControlInstructionCount) = d3D12ShaderDescription.StaticFlowControlCount; + Unsafe.AsRef(shaderInfo.DynamicFlowControlInstructionCount) = d3D12ShaderDescription.DynamicFlowControlCount; + Unsafe.AsRef(shaderInfo.EmitInstructionCount) = d3D12ShaderDescription.EmitInstructionCount; + Unsafe.AsRef(shaderInfo.BarrierInstructionCount) = d3D12ShaderDescription.cBarrierInstructions; + Unsafe.AsRef(shaderInfo.InterlockedInstructionCount) = d3D12ShaderDescription.cInterlockedInstructions; + Unsafe.AsRef(shaderInfo.BitwiseInstructionCount) = d3D12ShaderReflection.Get()->GetBitwiseInstructionCount(); + Unsafe.AsRef(shaderInfo.MovcInstructionCount) = d3D12ShaderReflection.Get()->GetMovcInstructionCount(); + Unsafe.AsRef(shaderInfo.MovInstructionCount) = d3D12ShaderReflection.Get()->GetMovInstructionCount(); + Unsafe.AsRef(shaderInfo.InterfaceSlotCount) = d3D12ShaderReflection.Get()->GetNumInterfaceSlots(); } } diff --git a/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs b/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs index fe962fbb..b495f99e 100644 --- a/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs +++ b/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs @@ -1,128 +1,127 @@ -namespace ComputeSharp.Interop +namespace ComputeSharp.Interop; + +/// +/// A model representing reflection info for a given compute shader. +/// +public readonly struct ShaderInfo { /// - /// A model representing reflection info for a given compute shader. + /// The compiler version used to build the shader. /// - public readonly struct ShaderInfo - { - /// - /// The compiler version used to build the shader. - /// - public readonly string CompilerVersion; + public readonly string CompilerVersion; - /// - /// The HLSL source code the shader was built from. - /// - public readonly string HlslSource; + /// + /// The HLSL source code the shader was built from. + /// + public readonly string HlslSource; - /// - /// The number of shader constant buffers. - /// - public readonly uint ConstantBufferCount; + /// + /// The number of shader constant buffers. + /// + public readonly uint ConstantBufferCount; - /// - /// The number of resource (textures and buffers) bound to a shader. - /// - public readonly uint BoundResourceCount; + /// + /// The number of resource (textures and buffers) bound to a shader. + /// + public readonly uint BoundResourceCount; - /// - /// The number of intermediate-language instructions in the compiled shader. - /// - public readonly uint InstructionCount; + /// + /// The number of intermediate-language instructions in the compiled shader. + /// + public readonly uint InstructionCount; - /// - /// The number of temporary registers in the compiled shader. - /// - public readonly uint TemporaryRegisterCount; + /// + /// The number of temporary registers in the compiled shader. + /// + public readonly uint TemporaryRegisterCount; - /// - /// The number of temporary arrays used. - /// - public readonly uint TemporaryArrayCount; + /// + /// The number of temporary arrays used. + /// + public readonly uint TemporaryArrayCount; - /// - /// The number of constant defines. - /// - public readonly uint ConstantDefineCount; + /// + /// The number of constant defines. + /// + public readonly uint ConstantDefineCount; - /// - /// The number of declarations (input + output). - /// - public readonly uint DeclarationCount; + /// + /// The number of declarations (input + output). + /// + public readonly uint DeclarationCount; - /// - /// The number of non-categorized texture instructions. - /// - public readonly uint TextureNormalInstructions; + /// + /// The number of non-categorized texture instructions. + /// + public readonly uint TextureNormalInstructions; - /// - /// The number of texture load instructions. - /// - public readonly uint TextureLoadInstructionCount; + /// + /// The number of texture load instructions. + /// + public readonly uint TextureLoadInstructionCount; - /// - /// The number of texture write instructions. - /// - public readonly uint TextureStoreInstructionCount; + /// + /// The number of texture write instructions. + /// + public readonly uint TextureStoreInstructionCount; - /// - /// The number of floating point arithmetic instructions used. - /// - public readonly uint FloatInstructionCount; + /// + /// The number of floating point arithmetic instructions used. + /// + public readonly uint FloatInstructionCount; - /// - /// The number of signed integer arithmetic instructions used. - /// - public readonly uint IntInstructionCount; + /// + /// The number of signed integer arithmetic instructions used. + /// + public readonly uint IntInstructionCount; - /// - /// The number of unsigned integer arithmetic instructions used. - /// - public readonly uint UIntInstructionCount; + /// + /// The number of unsigned integer arithmetic instructions used. + /// + public readonly uint UIntInstructionCount; - /// - /// The number of static flow control instructions used. - /// - public readonly uint StaticFlowControlInstructionCount; + /// + /// The number of static flow control instructions used. + /// + public readonly uint StaticFlowControlInstructionCount; - /// - /// The number of dynamic flow control instructions used. - /// - public readonly uint DynamicFlowControlInstructionCount; + /// + /// The number of dynamic flow control instructions used. + /// + public readonly uint DynamicFlowControlInstructionCount; - /// - /// The number of emit instructions used. - /// - public readonly uint EmitInstructionCount; + /// + /// The number of emit instructions used. + /// + public readonly uint EmitInstructionCount; - /// - /// The number of barrier instructions used. - /// - public readonly uint BarrierInstructionCount; + /// + /// The number of barrier instructions used. + /// + public readonly uint BarrierInstructionCount; - /// - /// The number of interlocked instructions used. - /// - public readonly uint InterlockedInstructionCount; + /// + /// The number of interlocked instructions used. + /// + public readonly uint InterlockedInstructionCount; - /// - /// The number of bitwise instructions used. - /// - public readonly uint BitwiseInstructionCount; + /// + /// The number of bitwise instructions used. + /// + public readonly uint BitwiseInstructionCount; - /// - /// The number of movc instructions used. - /// - public readonly uint MovcInstructionCount; + /// + /// The number of movc instructions used. + /// + public readonly uint MovcInstructionCount; - /// - /// The number of mov instructions used. - /// - public readonly uint MovInstructionCount; + /// + /// The number of mov instructions used. + /// + public readonly uint MovInstructionCount; - /// - /// The number of interface slots used. - /// - public readonly uint InterfaceSlotCount; - } + /// + /// The number of interface slots used. + /// + public readonly uint InterfaceSlotCount; } diff --git a/src/ComputeSharp/Shaders/ShaderRunner{T}.cs b/src/ComputeSharp/Shaders/ShaderRunner{T}.cs index f56a7a25..e54f3fa8 100644 --- a/src/ComputeSharp/Shaders/ShaderRunner{T}.cs +++ b/src/ComputeSharp/Shaders/ShaderRunner{T}.cs @@ -13,252 +13,251 @@ using FX = TerraFX.Interop.Windows; #pragma warning disable CS0618 -namespace ComputeSharp.Shaders +namespace ComputeSharp.Shaders; + +/// +/// A responsible for performing all the necessary operations to compile and run a compute shader. +/// +/// The type of compute shader to run. +internal static class ShaderRunner + where T : struct, IShader { /// - /// A responsible for performing all the necessary operations to compile and run a compute shader. + /// The mapping used to cache and reuse compiled shaders. /// - /// The type of compute shader to run. - internal static class ShaderRunner - where T : struct, IShader + private static readonly Dictionary ShadersCache = new(); + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The input instance representing the compute shader to run. + public static unsafe void Run(GraphicsDevice device, int x, int y, int z, ref T shader) { - /// - /// The mapping used to cache and reuse compiled shaders. - /// - private static readonly Dictionary ShadersCache = new(); + // Here we calculate the optimized [numthreads] values. Using small thread group sizes leads to the + // best average performance due to better occupancy of the GPU with different shaders, using any + // number of registers and any amount of thread local storage. We use the wave size of the device in + // use for 1D dispatches, otherwise a multiple of 32 that is greater than or equal to 64, which still + // results in an evenly divisible number of waves per thread group on all existing GPU devices. + bool + xIs1 = x == 1, + yIs1 = y == 1, + zIs1 = z == 1; + int + mask = *(byte*)&xIs1 << 2 | *(byte*)&yIs1 << 1 | *(byte*)&zIs1, + threadsX, + threadsY, + threadsZ; - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The to use to run the shader. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The number of iterations to run on the Z axis. - /// The input instance representing the compute shader to run. - public static unsafe void Run(GraphicsDevice device, int x, int y, int z, ref T shader) + switch (mask - 1) { - // Here we calculate the optimized [numthreads] values. Using small thread group sizes leads to the - // best average performance due to better occupancy of the GPU with different shaders, using any - // number of registers and any amount of thread local storage. We use the wave size of the device in - // use for 1D dispatches, otherwise a multiple of 32 that is greater than or equal to 64, which still - // results in an evenly divisible number of waves per thread group on all existing GPU devices. - bool - xIs1 = x == 1, - yIs1 = y == 1, - zIs1 = z == 1; - int - mask = *(byte*)&xIs1 << 2 | *(byte*)&yIs1 << 1 | *(byte*)&zIs1, - threadsX, - threadsY, - threadsZ; + case 0: // (_, _, 1) + threadsX = threadsY = 8; + threadsZ = 1; + break; + case 1: // (_, 1, _) + threadsX = threadsZ = 8; + threadsY = 1; + break; + case 2: // (_, 1, 1) + threadsX = (int)device.WavefrontSize; + threadsY = threadsZ = 1; + break; + case 3: // (1, _, _) + threadsX = 1; + threadsY = threadsZ = 8; + break; + case 4: // (1, _, 1) + threadsX = threadsZ = 1; + threadsY = (int)device.WavefrontSize; + break; + case 5: // (1, 1, _) + threadsX = threadsY = 1; + threadsZ = (int)device.WavefrontSize; + break; + default: // (_, _, _) + threadsX = threadsY = threadsZ = 4; + break; + } - switch (mask - 1) + Run(device, x, y, z, threadsX, threadsY, threadsZ, ref shader); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance representing the compute shader to run. + public static unsafe void Run( + GraphicsDevice device, + int x, + int y, + int z, + int threadsX, + int threadsY, + int threadsZ, + ref T shader) + { + device.ThrowIfDisposed(); + + Guard.IsGreaterThan(x, 0, nameof(x)); + Guard.IsGreaterThan(y, 0, nameof(y)); + Guard.IsGreaterThan(z, 0, nameof(z)); + Guard.IsBetweenOrEqualTo(threadsX, 1, 1024, nameof(threadsX)); + Guard.IsBetweenOrEqualTo(threadsY, 1, 1024, nameof(threadsY)); + Guard.IsBetweenOrEqualTo(threadsZ, 1, 64, nameof(threadsZ)); + Guard.IsLessThanOrEqualTo(threadsX * threadsY * threadsZ, 1024, "threadsXYZ"); + + int + groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1), + groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1), + groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1); + + Guard.IsBetweenOrEqualTo(groupsX, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + Guard.IsBetweenOrEqualTo(groupsY, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + Guard.IsBetweenOrEqualTo(groupsZ, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + + ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, threadsZ); + PipelineData? pipelineData; + + lock (ShadersCache) + { + // Get or preload the shader + if (!ShadersCache.TryGetValue(key, out CachedShader? shaderData)) { - case 0: // (_, _, 1) - threadsX = threadsY = 8; - threadsZ = 1; - break; - case 1: // (_, 1, _) - threadsX = threadsZ = 8; - threadsY = 1; - break; - case 2: // (_, 1, 1) - threadsX = (int)device.WavefrontSize; - threadsY = threadsZ = 1; - break; - case 3: // (1, _, _) - threadsX = 1; - threadsY = threadsZ = 8; - break; - case 4: // (1, _, 1) - threadsX = threadsZ = 1; - threadsY = (int)device.WavefrontSize; - break; - case 5: // (1, 1, _) - threadsX = threadsY = 1; - threadsZ = (int)device.WavefrontSize; - break; - default: // (_, _, _) - threadsX = threadsY = threadsZ = 4; - break; + LoadShader(threadsX, threadsY, threadsZ, ref shader, out shaderData); + + // Cache for later use + ShadersCache.Add(key, shaderData); } - Run(device, x, y, z, threadsX, threadsY, threadsZ, ref shader); + // Create the reusable pipeline state + if (!shaderData.CachedPipelines.TryGetValue(device, out pipelineData)) + { + CreatePipelineData(device, shaderData, out pipelineData); + } } - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The to use to run the shader. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The number of iterations to run on the Z axis. - /// The number of threads in each thread group for the X axis. - /// The number of threads in each thread group for the Y axis. - /// The number of threads in each thread group for the Z axis. - /// The input instance representing the compute shader to run. - public static unsafe void Run( - GraphicsDevice device, - int x, - int y, - int z, - int threadsX, - int threadsY, - int threadsZ, - ref T shader) + using CommandList commandList = new(device, pipelineData.D3D12PipelineState); + + commandList.D3D12GraphicsCommandList->SetComputeRootSignature(pipelineData.D3D12RootSignature); + + ComputeShaderDispatchDataLoader dataLoader = new(commandList.D3D12GraphicsCommandList); + + shader.LoadDispatchData(ref dataLoader, device, x, y, z); + + commandList.D3D12GraphicsCommandList->Dispatch((uint)groupsX, (uint)groupsY, (uint)groupsZ); + commandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The to use to run the shader. + /// The target texture to invoke the pixel shader upon. + /// The input instance representing the pixel shader to run. + public static unsafe void Run(GraphicsDevice device, IReadWriteTexture2D texture, ref T shader) + where TPixel : unmanaged + { + device.ThrowIfDisposed(); + + int + x = texture.Width, + y = texture.Height, + threadsX = 8, + threadsY = 8, + groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1), + groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1); + + Guard.IsBetweenOrEqualTo(groupsX, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + Guard.IsBetweenOrEqualTo(groupsY, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + + ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, 1); + PipelineData? pipelineData; + + lock (ShadersCache) { - device.ThrowIfDisposed(); - - Guard.IsGreaterThan(x, 0, nameof(x)); - Guard.IsGreaterThan(y, 0, nameof(y)); - Guard.IsGreaterThan(z, 0, nameof(z)); - Guard.IsBetweenOrEqualTo(threadsX, 1, 1024, nameof(threadsX)); - Guard.IsBetweenOrEqualTo(threadsY, 1, 1024, nameof(threadsY)); - Guard.IsBetweenOrEqualTo(threadsZ, 1, 64, nameof(threadsZ)); - Guard.IsLessThanOrEqualTo(threadsX * threadsY * threadsZ, 1024, "threadsXYZ"); - - int - groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1), - groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1), - groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1); - - Guard.IsBetweenOrEqualTo(groupsX, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); - Guard.IsBetweenOrEqualTo(groupsY, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); - Guard.IsBetweenOrEqualTo(groupsZ, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); - - ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, threadsZ); - PipelineData? pipelineData; - - lock (ShadersCache) + // Get or preload the shader + if (!ShadersCache.TryGetValue(key, out CachedShader? shaderData)) { - // Get or preload the shader - if (!ShadersCache.TryGetValue(key, out CachedShader? shaderData)) - { - LoadShader(threadsX, threadsY, threadsZ, ref shader, out shaderData); + LoadShader(threadsX, threadsY, 1, ref shader, out shaderData); - // Cache for later use - ShadersCache.Add(key, shaderData); - } - - // Create the reusable pipeline state - if (!shaderData.CachedPipelines.TryGetValue(device, out pipelineData)) - { - CreatePipelineData(device, shaderData, out pipelineData); - } + // Cache for later use + ShadersCache.Add(key, shaderData); } - using CommandList commandList = new(device, pipelineData.D3D12PipelineState); - - commandList.D3D12GraphicsCommandList->SetComputeRootSignature(pipelineData.D3D12RootSignature); - - ComputeShaderDispatchDataLoader dataLoader = new(commandList.D3D12GraphicsCommandList); - - shader.LoadDispatchData(ref dataLoader, device, x, y, z); - - commandList.D3D12GraphicsCommandList->Dispatch((uint)groupsX, (uint)groupsY, (uint)groupsZ); - commandList.ExecuteAndWaitForCompletion(); - } - - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters. - /// - /// The to use to run the shader. - /// The target texture to invoke the pixel shader upon. - /// The input instance representing the pixel shader to run. - public static unsafe void Run(GraphicsDevice device, IReadWriteTexture2D texture, ref T shader) - where TPixel : unmanaged - { - device.ThrowIfDisposed(); - - int - x = texture.Width, - y = texture.Height, - threadsX = 8, - threadsY = 8, - groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1), - groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1); - - Guard.IsBetweenOrEqualTo(groupsX, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); - Guard.IsBetweenOrEqualTo(groupsY, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); - - ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, 1); - PipelineData? pipelineData; - - lock (ShadersCache) + // Create the reusable pipeline state + if (!shaderData.CachedPipelines.TryGetValue(device, out pipelineData)) { - // Get or preload the shader - if (!ShadersCache.TryGetValue(key, out CachedShader? shaderData)) - { - LoadShader(threadsX, threadsY, 1, ref shader, out shaderData); - - // Cache for later use - ShadersCache.Add(key, shaderData); - } - - // Create the reusable pipeline state - if (!shaderData.CachedPipelines.TryGetValue(device, out pipelineData)) - { - CreatePipelineData(device, shaderData, out pipelineData); - } + CreatePipelineData(device, shaderData, out pipelineData); } - - using CommandList commandList = new(device, pipelineData.D3D12PipelineState); - - commandList.D3D12GraphicsCommandList->SetComputeRootSignature(pipelineData.D3D12RootSignature); - - PixelShaderDispatchDataLoader dataLoader = new(commandList.D3D12GraphicsCommandList); - - shader.LoadDispatchData(ref dataLoader, device, x, y, 1); - - // Load the implicit output texture - commandList.D3D12GraphicsCommandList->SetComputeRootDescriptorTable( - 1, - ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuDescriptorHandle(device)); - - commandList.D3D12GraphicsCommandList->Dispatch((uint)groupsX, (uint)groupsY, 1); - commandList.ExecuteAndWaitForCompletion(); } - /// - /// Loads a shader with the specified parameters. - /// - /// The number of threads in each thread group for the X axis. - /// The number of threads in each thread group for the Y axis. - /// The number of threads in each thread group for the Z axis. - /// The input instance representing the compute shader to run. - /// The instance to return with the cached shader data. - [MethodImpl(MethodImplOptions.NoInlining)] - private static unsafe void LoadShader(int threadsX, int threadsY, int threadsZ, ref T shader, out CachedShader shaderData) - { - shader.BuildHlslString(out ArrayPoolStringBuilder builder, threadsX, threadsY, threadsZ); + using CommandList commandList = new(device, pipelineData.D3D12PipelineState); - using ComPtr dxcBlobBytecode = ShaderCompiler.Instance.CompileShader(builder.WrittenSpan); + commandList.D3D12GraphicsCommandList->SetComputeRootSignature(pipelineData.D3D12RootSignature); - builder.Dispose(); + PixelShaderDispatchDataLoader dataLoader = new(commandList.D3D12GraphicsCommandList); - shaderData = new CachedShader(dxcBlobBytecode.Get()); - } + shader.LoadDispatchData(ref dataLoader, device, x, y, 1); - /// - /// Creates and caches a instance for a given shader. - /// - /// The to use to run the shader. - /// The instance with the data on the loaded shader. - /// The resulting instance to use to run the shader. - [MethodImpl(MethodImplOptions.NoInlining)] - private static unsafe void CreatePipelineData(GraphicsDevice device, CachedShader shaderData, out PipelineData pipelineData) - { - using ComPtr d3D12RootSignature = default; + // Load the implicit output texture + commandList.D3D12GraphicsCommandList->SetComputeRootDescriptorTable( + 1, + ((GraphicsResourceHelper.IGraphicsResource)texture).ValidateAndGetGpuDescriptorHandle(device)); - ShaderDispatchMetadataLoader metadataLoader = new(device.D3D12Device); + commandList.D3D12GraphicsCommandList->Dispatch((uint)groupsX, (uint)groupsY, 1); + commandList.ExecuteAndWaitForCompletion(); + } - Unsafe.NullRef().LoadDispatchMetadata(ref metadataLoader, out *(IntPtr*)&d3D12RootSignature); - - using ComPtr d3D12PipelineState = device.D3D12Device->CreateComputePipelineState(d3D12RootSignature.Get(), shaderData.D3D12ShaderBytecode); + /// + /// Loads a shader with the specified parameters. + /// + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance representing the compute shader to run. + /// The instance to return with the cached shader data. + [MethodImpl(MethodImplOptions.NoInlining)] + private static unsafe void LoadShader(int threadsX, int threadsY, int threadsZ, ref T shader, out CachedShader shaderData) + { + shader.BuildHlslString(out ArrayPoolStringBuilder builder, threadsX, threadsY, threadsZ); - pipelineData = new PipelineData(d3D12RootSignature.Get(), d3D12PipelineState.Get()); + using ComPtr dxcBlobBytecode = ShaderCompiler.Instance.CompileShader(builder.WrittenSpan); - shaderData.CachedPipelines.Add(device, pipelineData); - } + builder.Dispose(); + + shaderData = new CachedShader(dxcBlobBytecode.Get()); + } + + /// + /// Creates and caches a instance for a given shader. + /// + /// The to use to run the shader. + /// The instance with the data on the loaded shader. + /// The resulting instance to use to run the shader. + [MethodImpl(MethodImplOptions.NoInlining)] + private static unsafe void CreatePipelineData(GraphicsDevice device, CachedShader shaderData, out PipelineData pipelineData) + { + using ComPtr d3D12RootSignature = default; + + ShaderDispatchMetadataLoader metadataLoader = new(device.D3D12Device); + + Unsafe.NullRef().LoadDispatchMetadata(ref metadataLoader, out *(IntPtr*)&d3D12RootSignature); + + using ComPtr d3D12PipelineState = device.D3D12Device->CreateComputePipelineState(d3D12RootSignature.Get(), shaderData.D3D12ShaderBytecode); + + pipelineData = new PipelineData(d3D12RootSignature.Get(), d3D12PipelineState.Get()); + + shaderData.CachedPipelines.Add(device, pipelineData); } } diff --git a/src/ComputeSharp/Shaders/Translation/Models/CachedShader.cs b/src/ComputeSharp/Shaders/Translation/Models/CachedShader.cs index cf2664f3..1144b691 100644 --- a/src/ComputeSharp/Shaders/Translation/Models/CachedShader.cs +++ b/src/ComputeSharp/Shaders/Translation/Models/CachedShader.cs @@ -3,41 +3,40 @@ using ComputeSharp.Graphics.Commands; using ComputeSharp.Interop; using TerraFX.Interop; -namespace ComputeSharp.Shaders.Translation.Models +namespace ComputeSharp.Shaders.Translation.Models; + +/// +/// A class that contains info on a cached shader. +/// +internal sealed unsafe class CachedShader : NativeObject { /// - /// A class that contains info on a cached shader. + /// The instance currently in use. /// - internal sealed unsafe class CachedShader : NativeObject + private ComPtr dxcBlobBytecode; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The bytecode instance to wrap. + public CachedShader(IDxcBlob* dxcBlobBytecode) { - /// - /// The instance currently in use. - /// - private ComPtr dxcBlobBytecode; + this.dxcBlobBytecode = new ComPtr(dxcBlobBytecode); + } - /// - /// Creates a new instance with the specified parameters. - /// - /// The bytecode instance to wrap. - public CachedShader(IDxcBlob* dxcBlobBytecode) - { - this.dxcBlobBytecode = new ComPtr(dxcBlobBytecode); - } + /// + /// Gets the map of cached instances for each GPU in use. + /// + public ConditionalWeakTable CachedPipelines { get; } = new(); - /// - /// Gets the map of cached instances for each GPU in use. - /// - public ConditionalWeakTable CachedPipelines { get; } = new(); + /// + /// Gets a raw pointer to the instance in use. + /// + public D3D12_SHADER_BYTECODE D3D12ShaderBytecode => new((ID3DBlob*)this.dxcBlobBytecode.Get()); - /// - /// Gets a raw pointer to the instance in use. - /// - public D3D12_SHADER_BYTECODE D3D12ShaderBytecode => new((ID3DBlob*)this.dxcBlobBytecode.Get()); - - /// - protected override void OnDispose() - { - this.dxcBlobBytecode.Dispose(); - } + /// + protected override void OnDispose() + { + this.dxcBlobBytecode.Dispose(); } } diff --git a/src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs b/src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs index cc841752..b9c4cd9c 100644 --- a/src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs +++ b/src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs @@ -1,71 +1,70 @@ using System; using System.Runtime.CompilerServices; -namespace ComputeSharp.Shaders.Translation.Models +namespace ComputeSharp.Shaders.Translation.Models; + +/// +/// A representing a key for a given shader. +/// +internal readonly struct ShaderKey : IEquatable { /// - /// A representing a key for a given shader. + /// The hashcode of the current shader type. /// - internal readonly struct ShaderKey : IEquatable + private readonly int Id; + + /// + /// The number of iterations to run on the X axis. + /// + private readonly int ThreadsX; + + /// + /// The number of iterations to run on the Y axis. + /// + private readonly int ThreadsY; + + /// + /// The number of iterations to run on the Z axis. + /// + private readonly int ThreadsZ; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The hashcode of the current shader type. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ShaderKey(int id, int threadsX, int threadsY, int threadsZ) { - /// - /// The hashcode of the current shader type. - /// - private readonly int Id; + Id = id; + ThreadsX = threadsX; + ThreadsY = threadsY; + ThreadsZ = threadsZ; + } - /// - /// The number of iterations to run on the X axis. - /// - private readonly int ThreadsX; + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ShaderKey other) + { + return + Id == other.Id && + ThreadsX == other.ThreadsX && + ThreadsY == other.ThreadsY && + ThreadsZ == other.ThreadsZ; + } - /// - /// The number of iterations to run on the Y axis. - /// - private readonly int ThreadsY; + /// + public override bool Equals(object? obj) + { + return obj is ShaderKey other && Equals(other); + } - /// - /// The number of iterations to run on the Z axis. - /// - private readonly int ThreadsZ; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The hashcode of the current shader type. - /// The number of iterations to run on the X axis. - /// The number of iterations to run on the Y axis. - /// The number of iterations to run on the Z axis. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ShaderKey(int id, int threadsX, int threadsY, int threadsZ) - { - Id = id; - ThreadsX = threadsX; - ThreadsY = threadsY; - ThreadsZ = threadsZ; - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool Equals(ShaderKey other) - { - return - Id == other.Id && - ThreadsX == other.ThreadsX && - ThreadsY == other.ThreadsY && - ThreadsZ == other.ThreadsZ; - } - - /// - public override bool Equals(object? obj) - { - return obj is ShaderKey other && Equals(other); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public override int GetHashCode() - { - return HashCode.Combine(Id, ThreadsX, ThreadsY, ThreadsZ); - } + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() + { + return HashCode.Combine(Id, ThreadsX, ThreadsY, ThreadsZ); } } diff --git a/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs index 69f140cc..a44d2591 100644 --- a/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs +++ b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs @@ -3,60 +3,59 @@ using System.IO; using System.Runtime.InteropServices; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Shaders.Translation +namespace ComputeSharp.Shaders.Translation; + +/// +internal sealed unsafe partial class ShaderCompiler { - /// - internal sealed unsafe partial class ShaderCompiler + /// + /// Initializes the DLL resolvers for the dxcompiler.dll and dxil.dll libraries. + /// + private static void InitializeDxcLibrariesLoading() { - /// - /// Initializes the DLL resolvers for the dxcompiler.dll and dxil.dll libraries. - /// - private static void InitializeDxcLibrariesLoading() + // Test whether the native libraries are present in the same folder of the executable + // (which is the case when the program was built with a runtime identifier), or whether + // they are in the "runtimes\win-x64\native" folder in the executable directory. + string nugetNativeLibsPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native"); + bool isNuGetRuntimeLibrariesDirectoryPresent = Directory.Exists(nugetNativeLibsPath); + + // Register a custom library resolver for the two DXC libraries. We need to either manually load the two + // libraries from the NuGet directory, if an RID is not in use, or we need to ensure that dxil.dll is + // loaded correctly in case the program was executed with the host being in another directory. + // This happens when doing eg. "dotnet bin\Debug\net5.0\MyApp.dll", which would crash at runtime. + FX.ResolveLibrary += (libraryName, assembly, searchPath) => { - // Test whether the native libraries are present in the same folder of the executable - // (which is the case when the program was built with a runtime identifier), or whether - // they are in the "runtimes\win-x64\native" folder in the executable directory. - string nugetNativeLibsPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native"); - bool isNuGetRuntimeLibrariesDirectoryPresent = Directory.Exists(nugetNativeLibsPath); + if (libraryName is not "dxcompiler") return IntPtr.Zero; - // Register a custom library resolver for the two DXC libraries. We need to either manually load the two - // libraries from the NuGet directory, if an RID is not in use, or we need to ensure that dxil.dll is - // loaded correctly in case the program was executed with the host being in another directory. - // This happens when doing eg. "dotnet bin\Debug\net5.0\MyApp.dll", which would crash at runtime. - FX.ResolveLibrary += (libraryName, assembly, searchPath) => + if (isNuGetRuntimeLibrariesDirectoryPresent) { - if (libraryName is not "dxcompiler") return IntPtr.Zero; + string + dxcompilerPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native\dxcompiler.dll"), + dxilPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native\dxil.dll"); - if (isNuGetRuntimeLibrariesDirectoryPresent) + // Load DXIL first so that DXC doesn't fail to load it, and then DXIL, both from the NuGet path + if (NativeLibrary.TryLoad(dxilPath, out _) && NativeLibrary.TryLoad(dxcompilerPath, out IntPtr handle)) { - string - dxcompilerPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native\dxcompiler.dll"), - dxilPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native\dxil.dll"); - - // Load DXIL first so that DXC doesn't fail to load it, and then DXIL, both from the NuGet path - if (NativeLibrary.TryLoad(dxilPath, out _) && NativeLibrary.TryLoad(dxcompilerPath, out IntPtr handle)) - { - return handle; - } + return handle; } - else + } + else + { + // Even when the two libraries are correctly copied next to the executable in use, we load them + // manually to ensure the operation is successful. This is to avoid failures in cases such as when + // doing "dotnet bin\MyApp.dll", ie. when the host is in another path than the executable in use. + // This is probably because DXIL is a native dependency for DXC, but the way Windows loads these + // libraries doesn't take into account the .NET concepts of "app directory": neither the current "bin" + // directory nor the "process directory", which is "C:\Program Files\dotnet", actually contain the + // native library we need, hence the runtime crash. Manually loading the library this way solves this. + if (NativeLibrary.TryLoad("dxil", assembly, searchPath, out _) && + NativeLibrary.TryLoad("dxcompiler", assembly, searchPath, out IntPtr handle)) { - // Even when the two libraries are correctly copied next to the executable in use, we load them - // manually to ensure the operation is successful. This is to avoid failures in cases such as when - // doing "dotnet bin\MyApp.dll", ie. when the host is in another path than the executable in use. - // This is probably because DXIL is a native dependency for DXC, but the way Windows loads these - // libraries doesn't take into account the .NET concepts of "app directory": neither the current "bin" - // directory nor the "process directory", which is "C:\Program Files\dotnet", actually contain the - // native library we need, hence the runtime crash. Manually loading the library this way solves this. - if (NativeLibrary.TryLoad("dxil", assembly, searchPath, out _) && - NativeLibrary.TryLoad("dxcompiler", assembly, searchPath, out IntPtr handle)) - { - return handle; - } + return handle; } + } - return IntPtr.Zero; - }; - } + return IntPtr.Zero; + }; } } diff --git a/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs index 2bed15a5..8aa46e28 100644 --- a/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs +++ b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs @@ -6,152 +6,151 @@ using ComputeSharp.Exceptions; using TerraFX.Interop; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Shaders.Translation +namespace ComputeSharp.Shaders.Translation; + +/// +/// A that uses the DXC APIs to compile compute shaders. +/// +internal sealed unsafe partial class ShaderCompiler { /// - /// A that uses the DXC APIs to compile compute shaders. + /// The thread local instance. + /// This is necessary because the DXC library is strictly single-threaded. /// - internal sealed unsafe partial class ShaderCompiler + [ThreadStatic] + private static ShaderCompiler? instance; + + /// + /// The instance to use to create the bytecode for HLSL sources. + /// + private readonly ComPtr DxcCompiler; + + /// + /// The instance to use to work with . + /// + private readonly ComPtr DxcLibrary; + + /// + /// The instance used to compile shaders with . + /// + private readonly ComPtr DxcIncludeHandler; + + /// + /// Creates a new instance. + /// + private ShaderCompiler() { - /// - /// The thread local instance. - /// This is necessary because the DXC library is strictly single-threaded. - /// - [ThreadStatic] - private static ShaderCompiler? instance; - - /// - /// The instance to use to create the bytecode for HLSL sources. - /// - private readonly ComPtr DxcCompiler; - - /// - /// The instance to use to work with . - /// - private readonly ComPtr DxcLibrary; - - /// - /// The instance used to compile shaders with . - /// - private readonly ComPtr DxcIncludeHandler; - - /// - /// Creates a new instance. - /// - private ShaderCompiler() + lock(this) { - lock(this) - { - InitializeDxcLibrariesLoading(); - } - - using ComPtr dxcCompiler = default; - using ComPtr dxcLibrary = default; - using ComPtr dxcIncludeHandler = default; - - Guid dxcCompilerCLGuid = FX.CLSID_DxcCompiler; - Guid dxcLibraryCLGuid = FX.CLSID_DxcLibrary; - - FX.DxcCreateInstance(&dxcCompilerCLGuid, FX.__uuidof(), dxcCompiler.GetVoidAddressOf()).Assert(); - FX.DxcCreateInstance(&dxcLibraryCLGuid, FX.__uuidof(), dxcLibrary.GetVoidAddressOf()).Assert(); - - dxcLibrary.Get()->CreateIncludeHandler(dxcIncludeHandler.GetAddressOf()).Assert(); - - DxcCompiler = dxcCompiler.Move(); - DxcLibrary = dxcLibrary.Move(); - DxcIncludeHandler = dxcIncludeHandler.Move(); + InitializeDxcLibrariesLoading(); } - /// - /// Destroys the current instance. - /// - ~ShaderCompiler() + using ComPtr dxcCompiler = default; + using ComPtr dxcLibrary = default; + using ComPtr dxcIncludeHandler = default; + + Guid dxcCompilerCLGuid = FX.CLSID_DxcCompiler; + Guid dxcLibraryCLGuid = FX.CLSID_DxcLibrary; + + FX.DxcCreateInstance(&dxcCompilerCLGuid, FX.__uuidof(), dxcCompiler.GetVoidAddressOf()).Assert(); + FX.DxcCreateInstance(&dxcLibraryCLGuid, FX.__uuidof(), dxcLibrary.GetVoidAddressOf()).Assert(); + + dxcLibrary.Get()->CreateIncludeHandler(dxcIncludeHandler.GetAddressOf()).Assert(); + + DxcCompiler = dxcCompiler.Move(); + DxcLibrary = dxcLibrary.Move(); + DxcIncludeHandler = dxcIncludeHandler.Move(); + } + + /// + /// Destroys the current instance. + /// + ~ShaderCompiler() + { + DxcCompiler.Dispose(); + DxcLibrary.Dispose(); + DxcIncludeHandler.Dispose(); + } + + /// + /// Gets a instance to use. + /// + public static ShaderCompiler Instance => instance ??= new(); + + /// + /// Compiles a new HLSL shader from the input source code. + /// + /// The HLSL source code to compile. + /// The bytecode for the compiled shader. + [Pure] + public ComPtr CompileShader(ReadOnlySpan source) + { + using ComPtr dxcBlobEncoding = default; + using ComPtr dxcOperationResult = default; + using ComPtr dxcBlobBytecode = default; + + // Get the encoded blob from the source code + fixed (char* p = source) { - DxcCompiler.Dispose(); - DxcLibrary.Dispose(); - DxcIncludeHandler.Dispose(); + DxcLibrary.Get()->CreateBlobWithEncodingOnHeapCopy( + p, + (uint)source.Length * 2, + 1200, + dxcBlobEncoding.GetAddressOf()).Assert(); } - /// - /// Gets a instance to use. - /// - public static ShaderCompiler Instance => instance ??= new(); - - /// - /// Compiles a new HLSL shader from the input source code. - /// - /// The HLSL source code to compile. - /// The bytecode for the compiled shader. - [Pure] - public ComPtr CompileShader(ReadOnlySpan source) + // Try to compile the new compute shader + fixed (char* shaderName = "") + fixed (char* entryPoint = nameof(IComputeShader.Execute)) + fixed (char* shaderProfile = "cs_6_0") + fixed (char* optimization = "-O3") + fixed (char* rowMajor = "-Zpr") + fixed (char* warningsAsErrors = "-Werror") { - using ComPtr dxcBlobEncoding = default; - using ComPtr dxcOperationResult = default; - using ComPtr dxcBlobBytecode = default; + char** arguments = stackalloc char*[3] { optimization, rowMajor, warningsAsErrors }; - // Get the encoded blob from the source code - fixed (char* p = source) - { - DxcLibrary.Get()->CreateBlobWithEncodingOnHeapCopy( - p, - (uint)source.Length * 2, - 1200, - dxcBlobEncoding.GetAddressOf()).Assert(); - } - - // Try to compile the new compute shader - fixed (char* shaderName = "") - fixed (char* entryPoint = nameof(IComputeShader.Execute)) - fixed (char* shaderProfile = "cs_6_0") - fixed (char* optimization = "-O3") - fixed (char* rowMajor = "-Zpr") - fixed (char* warningsAsErrors = "-Werror") - { - char** arguments = stackalloc char*[3] { optimization, rowMajor, warningsAsErrors }; - - DxcCompiler.Get()->Compile( - (IDxcBlob*)dxcBlobEncoding.Get(), - (ushort*)shaderName, - (ushort*)entryPoint, - (ushort*)shaderProfile, - (ushort**)arguments, - 3, - null, - 0, - DxcIncludeHandler.Get(), - dxcOperationResult.GetAddressOf()).Assert(); - } - - int status; - - dxcOperationResult.Get()->GetStatus(&status).Assert(); - - // The compilation was successful, so we can extract the shader bytecode - if (status == 0) - { - dxcOperationResult.Get()->GetResult(dxcBlobBytecode.GetAddressOf()).Assert(); - - return dxcBlobBytecode.Move(); - } - - return ThrowHslsCompilationException(dxcOperationResult); + DxcCompiler.Get()->Compile( + (IDxcBlob*)dxcBlobEncoding.Get(), + (ushort*)shaderName, + (ushort*)entryPoint, + (ushort*)shaderProfile, + (ushort**)arguments, + 3, + null, + 0, + DxcIncludeHandler.Get(), + dxcOperationResult.GetAddressOf()).Assert(); } - /// - /// Throws an exception when a shader compilation fails. - /// - /// The input (faulting) operation. - /// This method always throws and never actually returs. - [MethodImpl(MethodImplOptions.NoInlining)] - private static ComPtr ThrowHslsCompilationException(IDxcOperationResult* dxcOperationResult) + int status; + + dxcOperationResult.Get()->GetStatus(&status).Assert(); + + // The compilation was successful, so we can extract the shader bytecode + if (status == 0) { - using ComPtr dxcBlobEncodingError = default; + dxcOperationResult.Get()->GetResult(dxcBlobBytecode.GetAddressOf()).Assert(); - dxcOperationResult->GetErrorBuffer(dxcBlobEncodingError.GetAddressOf()).Assert(); - - string message = new((sbyte*)dxcBlobEncodingError.Get()->GetBufferPointer()); - - throw new HlslCompilationException(message); + return dxcBlobBytecode.Move(); } + + return ThrowHslsCompilationException(dxcOperationResult); + } + + /// + /// Throws an exception when a shader compilation fails. + /// + /// The input (faulting) operation. + /// This method always throws and never actually returs. + [MethodImpl(MethodImplOptions.NoInlining)] + private static ComPtr ThrowHslsCompilationException(IDxcOperationResult* dxcOperationResult) + { + using ComPtr dxcBlobEncodingError = default; + + dxcOperationResult->GetErrorBuffer(dxcBlobEncodingError.GetAddressOf()).Assert(); + + string message = new((sbyte*)dxcBlobEncodingError.Get()->GetBufferPointer()); + + throw new HlslCompilationException(message); } } diff --git a/src/ComputeSharp/Shaders/Translation/__Internals/ArrayPoolStringBuilder.cs b/src/ComputeSharp/Shaders/Translation/__Internals/ArrayPoolStringBuilder.cs index a72d2f1f..d4d7bf69 100644 --- a/src/ComputeSharp/Shaders/Translation/__Internals/ArrayPoolStringBuilder.cs +++ b/src/ComputeSharp/Shaders/Translation/__Internals/ArrayPoolStringBuilder.cs @@ -5,150 +5,149 @@ using System.Diagnostics; using System.Diagnostics.Contracts; using System.Runtime.CompilerServices; -namespace ComputeSharp.__Internals +namespace ComputeSharp.__Internals; + +/// +/// A helper type that implements a pooled buffer writer for values. +/// +[EditorBrowsable(EditorBrowsableState.Never)] +[Obsolete("This type is not intended to be used directly by user code")] +[DebuggerTypeProxy(typeof(DebugView))] +public ref struct ArrayPoolStringBuilder { /// - /// A helper type that implements a pooled buffer writer for values. + /// The underlying array. /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This type is not intended to be used directly by user code")] - [DebuggerTypeProxy(typeof(DebugView))] - public ref struct ArrayPoolStringBuilder + private char[] array; + + /// + /// The starting offset within . + /// + private int index; + + /// + /// Creates a new instance ready to use. + /// + /// The size hint for the internal buffer to allocate. + /// A new instance with default values. + [Pure] + public static ArrayPoolStringBuilder Create(int sizeHint) { - /// - /// The underlying array. - /// - private char[] array; + ArrayPoolStringBuilder builder; - /// - /// The starting offset within . - /// - private int index; + builder.array = ArrayPool.Shared.Rent(sizeHint); + builder.index = 0; - /// - /// Creates a new instance ready to use. - /// - /// The size hint for the internal buffer to allocate. - /// A new instance with default values. - [Pure] - public static ArrayPoolStringBuilder Create(int sizeHint) - { - ArrayPoolStringBuilder builder; + return builder; + } - builder.array = ArrayPool.Shared.Rent(sizeHint); - builder.index = 0; - - return builder; - } - - /// - public ReadOnlySpan WrittenSpan - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => new(this.array, 0, this.index); - } - - /// - /// Appends the input character to the current buffer. - /// - /// The input character to write. - public void Append(char value) - { - EnsureCapacity(1); - - this.array[this.index++] = value; - } - - /// - /// Appends the input sequence of characters to the current buffer. - /// - /// The input characters to write. - public void Append(string value) - { - EnsureCapacity(value.Length); - - value.CopyTo(this.array.AsSpan(this.index)); - - this.index += value.Length; - } - - /// - /// Appends the text representation of the input value to the current buffer. - /// - /// The input value to write. - public void Append(int value) - { - int charsWritten; - - while (!value.TryFormat(this.array.AsSpan(this.index), out charsWritten)) - { - EnsureCapacity(10); - } - - this.index += charsWritten; - } - - /// - /// Ensures that has enough free space to contain a given number of new items. - /// - /// The minimum number of items to ensure space for in . + /// + public ReadOnlySpan WrittenSpan + { [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void EnsureCapacity(int requestedSize) + get => new(this.array, 0, this.index); + } + + /// + /// Appends the input character to the current buffer. + /// + /// The input character to write. + public void Append(char value) + { + EnsureCapacity(1); + + this.array[this.index++] = value; + } + + /// + /// Appends the input sequence of characters to the current buffer. + /// + /// The input characters to write. + public void Append(string value) + { + EnsureCapacity(value.Length); + + value.CopyTo(this.array.AsSpan(this.index)); + + this.index += value.Length; + } + + /// + /// Appends the text representation of the input value to the current buffer. + /// + /// The input value to write. + public void Append(int value) + { + int charsWritten; + + while (!value.TryFormat(this.array.AsSpan(this.index), out charsWritten)) { - if (requestedSize > this.array.Length - this.index) - { - ResizeBuffer(requestedSize); - } + EnsureCapacity(10); } - /// - /// Resizes to ensure it can fit the specified number of new items. - /// - /// The minimum number of items to ensure space for in . - [MethodImpl(MethodImplOptions.NoInlining)] - private void ResizeBuffer(int sizeHint) + this.index += charsWritten; + } + + /// + /// Ensures that has enough free space to contain a given number of new items. + /// + /// The minimum number of items to ensure space for in . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void EnsureCapacity(int requestedSize) + { + if (requestedSize > this.array.Length - this.index) { - int minimumSize = this.index + sizeHint; - - // Rent a new array with the specified size, and copy as many items from the current array - // as possible to the new array. This mirrors the behavior of the Array.Resize API from - // the BCL: if the new size is greater than the length of the current array, copy all the - // items from the original array into the new one. Otherwise, copy as many items as possible, - // until the new array is completely filled, and ignore the remaining items in the first array. - char[] newArray = ArrayPool.Shared.Rent(minimumSize); - int itemsToCopy = Math.Min(this.array.Length, minimumSize); - - Array.Copy(this.array, 0, newArray, 0, itemsToCopy); - - ArrayPool.Shared.Return(array); - - this.array = newArray; - } - - /// - public void Dispose() - { - ArrayPool.Shared.Return(this.array); - } - - /// - /// A debug proxy used for displaying debug info. - /// - internal sealed class DebugView - { - /// - /// Initializes a new instance of the class with the specified parameters. - /// - /// The input instance to display. - public DebugView(ArrayPoolStringBuilder builder) - { - Text = builder.WrittenSpan.ToString(); - } - - /// - /// Gets the text to display for the current instance. - /// - public string Text { get; } + ResizeBuffer(requestedSize); } } + + /// + /// Resizes to ensure it can fit the specified number of new items. + /// + /// The minimum number of items to ensure space for in . + [MethodImpl(MethodImplOptions.NoInlining)] + private void ResizeBuffer(int sizeHint) + { + int minimumSize = this.index + sizeHint; + + // Rent a new array with the specified size, and copy as many items from the current array + // as possible to the new array. This mirrors the behavior of the Array.Resize API from + // the BCL: if the new size is greater than the length of the current array, copy all the + // items from the original array into the new one. Otherwise, copy as many items as possible, + // until the new array is completely filled, and ignore the remaining items in the first array. + char[] newArray = ArrayPool.Shared.Rent(minimumSize); + int itemsToCopy = Math.Min(this.array.Length, minimumSize); + + Array.Copy(this.array, 0, newArray, 0, itemsToCopy); + + ArrayPool.Shared.Return(array); + + this.array = newArray; + } + + /// + public void Dispose() + { + ArrayPool.Shared.Return(this.array); + } + + /// + /// A debug proxy used for displaying debug info. + /// + internal sealed class DebugView + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance to display. + public DebugView(ArrayPoolStringBuilder builder) + { + Text = builder.WrittenSpan.ToString(); + } + + /// + /// Gets the text to display for the current instance. + /// + public string Text { get; } + } } diff --git a/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs b/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs index 9886d70c..05943b6e 100644 --- a/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs +++ b/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs @@ -1,41 +1,40 @@ using ComputeSharp.Core.Helpers; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests.Internals +namespace ComputeSharp.Tests.Internals; + +[TestClass] +[TestCategory("AlignmentHelper")] +public class AlignmentHelperTests { - [TestClass] - [TestCategory("AlignmentHelper")] - public class AlignmentHelperTests + [TestMethod] + [DataRow(1, 16, 16)] + [DataRow(2, 16, 16)] + [DataRow(4, 16, 16)] + [DataRow(8, 16, 16)] + [DataRow(16, 16, 16)] + [DataRow(20, 16, 32)] + [DataRow(40, 16, 48)] + public void Pad(int size, int alignment, int expected) { - [TestMethod] - [DataRow(1, 16, 16)] - [DataRow(2, 16, 16)] - [DataRow(4, 16, 16)] - [DataRow(8, 16, 16)] - [DataRow(16, 16, 16)] - [DataRow(20, 16, 32)] - [DataRow(40, 16, 48)] - public void Pad(int size, int alignment, int expected) - { - int result = AlignmentHelper.Pad(size, alignment); + int result = AlignmentHelper.Pad(size, alignment); - Assert.AreEqual(result, expected); - } + Assert.AreEqual(result, expected); + } - [TestMethod] - [DataRow(0, 4, 16, 0)] - [DataRow(0, 8, 16, 0)] - [DataRow(0, 12, 16, 0)] - [DataRow(0, 16, 16, 0)] - [DataRow(0, 20, 16, 0)] - [DataRow(20, 4, 16, 20)] - [DataRow(20, 16, 16, 32)] - [DataRow(24, 8, 16, 24)] - public void AlignToBoundary(int offset, int size, int alignment, int expected) - { - int result = AlignmentHelper.AlignToBoundary(offset, size, alignment); + [TestMethod] + [DataRow(0, 4, 16, 0)] + [DataRow(0, 8, 16, 0)] + [DataRow(0, 12, 16, 0)] + [DataRow(0, 16, 16, 0)] + [DataRow(0, 20, 16, 0)] + [DataRow(20, 4, 16, 20)] + [DataRow(20, 16, 16, 32)] + [DataRow(24, 8, 16, 24)] + public void AlignToBoundary(int offset, int size, int alignment, int expected) + { + int result = AlignmentHelper.AlignToBoundary(offset, size, alignment); - Assert.AreEqual(result, expected); - } + Assert.AreEqual(result, expected); } } diff --git a/tests/ComputeSharp.Tests.Internals/Helpers/DebugDispatchDataLoader.cs b/tests/ComputeSharp.Tests.Internals/Helpers/DebugDispatchDataLoader.cs index 60d1ded4..8265c682 100644 --- a/tests/ComputeSharp.Tests.Internals/Helpers/DebugDispatchDataLoader.cs +++ b/tests/ComputeSharp.Tests.Internals/Helpers/DebugDispatchDataLoader.cs @@ -5,52 +5,51 @@ using ComputeSharp.__Internals; #pragma warning disable CS0618 -namespace ComputeSharp.Tests.Internals.Helpers +namespace ComputeSharp.Tests.Internals.Helpers; + +/// +/// A debug data loader for generic shaders. +/// +internal readonly unsafe struct DebugDispatchDataLoader : IDispatchDataLoader { /// - /// A debug data loader for generic shaders. + /// The backing, mutable data for and . /// - internal readonly unsafe struct DebugDispatchDataLoader : IDispatchDataLoader + private readonly StrongBox<(uint[] Values, ulong[] Resources)> data; + + /// + /// Gets the captured values. + /// + public uint[] Values => this.data.Value.Values; + + /// + /// Gets the captured resources. + /// + public ulong[] Resources => this.data.Value.Resources; + + /// + /// Creates a new instance. + /// + /// A new instance to use. + [Pure] + public static DebugDispatchDataLoader Create() { - /// - /// The backing, mutable data for and . - /// - private readonly StrongBox<(uint[] Values, ulong[] Resources)> data; + DebugDispatchDataLoader @this = default; - /// - /// Gets the captured values. - /// - public uint[] Values => this.data.Value.Values; + Unsafe.AsRef(in @this.data) = new StrongBox<(uint[], ulong[])>((Array.Empty(), Array.Empty())); - /// - /// Gets the captured resources. - /// - public ulong[] Resources => this.data.Value.Resources; - - /// - /// Creates a new instance. - /// - /// A new instance to use. - [Pure] - public static DebugDispatchDataLoader Create() - { - DebugDispatchDataLoader @this = default; - - Unsafe.AsRef(in @this.data) = new StrongBox<(uint[], ulong[])>((Array.Empty(), Array.Empty())); - - return @this; - } - - /// - public void LoadCapturedValues(ReadOnlySpan data) - { - this.data.Value.Values = data.ToArray(); - } - - /// - public void LoadCapturedResources(ReadOnlySpan data) - { - this.data.Value.Resources = data.ToArray(); - } + return @this; } -} \ No newline at end of file + + /// + public void LoadCapturedValues(ReadOnlySpan data) + { + this.data.Value.Values = data.ToArray(); + } + + /// + public void LoadCapturedResources(ReadOnlySpan data) + { + this.data.Value.Resources = data.ToArray(); + } +} diff --git a/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs index cdf75920..8a38c67a 100644 --- a/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs +++ b/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs @@ -3,44 +3,43 @@ using ComputeSharp.Shaders.Translation; using Microsoft.VisualStudio.TestTools.UnitTesting; using TerraFX.Interop; -namespace ComputeSharp.Tests.Internals +namespace ComputeSharp.Tests.Internals; + +[TestClass] +[TestCategory("ShaderCompiler")] +public class ShaderCompilerTests { - [TestClass] - [TestCategory("ShaderCompiler")] - public class ShaderCompilerTests + private const string ShaderSource = @" + cbuffer _ : register(b0) { - private const string ShaderSource = @" - cbuffer _ : register(b0) + uint __x; + uint __y; + uint __z; + } + + RWStructuredBuffer buffer : register(u0); + + [NumThreads(32, 1, 1)] + void Execute(uint3 ids : SV_DispatchThreadId) + { + if (ids.x < __x && ids.y < __y && ids.z < __z) { - uint __x; - uint __y; - uint __z; + buffer[ids.x] *= 2; } + }"; - RWStructuredBuffer buffer : register(u0); + [TestMethod] + public void CompileTest_Ok() + { + using ComPtr dxcBlob = ShaderCompiler.Instance.CompileShader(ShaderSource); + } - [NumThreads(32, 1, 1)] - void Execute(uint3 ids : SV_DispatchThreadId) - { - if (ids.x < __x && ids.y < __y && ids.z < __z) - { - buffer[ids.x] *= 2; - } - }"; + [TestMethod] + [ExpectedException(typeof(HlslCompilationException))] + public void CompileTest_Fail() + { + var faultyShader = ShaderSource.Replace("ids.x", "ids.X"); - [TestMethod] - public void CompileTest_Ok() - { - using ComPtr dxcBlob = ShaderCompiler.Instance.CompileShader(ShaderSource); - } - - [TestMethod] - [ExpectedException(typeof(HlslCompilationException))] - public void CompileTest_Fail() - { - var faultyShader = ShaderSource.Replace("ids.x", "ids.X"); - - using ComPtr dxcBlob = ShaderCompiler.Instance.CompileShader(faultyShader); - } + using ComPtr dxcBlob = ShaderCompiler.Instance.CompileShader(faultyShader); } } diff --git a/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs index 8c073584..0152e806 100644 --- a/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs +++ b/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs @@ -4,154 +4,234 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; #pragma warning disable CS0618 -namespace ComputeSharp.Tests.Internals +namespace ComputeSharp.Tests.Internals; + +[TestClass] +[TestCategory("ShaderDataLoader")] +public partial class ShaderDataLoaderTests { - [TestClass] - [TestCategory("ShaderDataLoader")] - public partial class ShaderDataLoaderTests + [AutoConstructor] + public partial struct CapturedResourceShader : IComputeShader { - [AutoConstructor] - public partial struct CapturedResourceShader : IComputeShader - { - public ReadWriteBuffer _; + public ReadWriteBuffer _; - public void Execute() - { - } + public void Execute() + { } + } - [TestMethod] - public unsafe void CapturedResource() + [TestMethod] + public unsafe void CapturedResource() + { + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + + ((IShader)new CapturedResourceShader(buffer)).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + + Assert.AreEqual(3, dataLoader.Values.Length); + Assert.AreEqual(1, dataLoader.Resources.Length); + + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); + Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + } + + [AutoConstructor] + public partial struct MultipleResourcesAndPrimitivesShader : IComputeShader + { + public ReadWriteBuffer _0; + public ReadWriteBuffer _1; + public int a; + public int b; + public int c; + + public void Execute() { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); - - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - - ((IShader)new CapturedResourceShader(buffer)).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - - Assert.AreEqual(3, dataLoader.Values.Length); - Assert.AreEqual(1, dataLoader.Resources.Length); - - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); - Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); } + } - [AutoConstructor] - public partial struct MultipleResourcesAndPrimitivesShader : IComputeShader + [TestMethod] + public unsafe void LoadMultipleResourcesAndPrimitives() + { + using ReadWriteBuffer buffer0 = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer buffer1 = Gpu.Default.AllocateReadWriteBuffer(16); + + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + + ((IShader)new MultipleResourcesAndPrimitivesShader(buffer0, buffer1, 1, 22, 77)).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + + Assert.AreEqual(6, dataLoader.Values.Length); + Assert.AreEqual(2, dataLoader.Resources.Length); + + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); + Assert.AreEqual(1, (int)dataLoader.Values[3]); + Assert.AreEqual(22, (int)dataLoader.Values[4]); + Assert.AreEqual(77, (int)dataLoader.Values[5]); + Assert.AreEqual(buffer0.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + Assert.AreEqual(buffer1.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[1]); + } + + [AutoConstructor] + public partial struct ScalarAndVectorTypesShader : IComputeShader + { + public ReadWriteBuffer _; + public float3 f3; + public int a; + public int b; + public double2 d2; + public int c; + public int d; + + public void Execute() { - public ReadWriteBuffer _0; - public ReadWriteBuffer _1; - public int a; - public int b; - public int c; - - public void Execute() - { - } } + } - [TestMethod] - public unsafe void LoadMultipleResourcesAndPrimitives() + [TestMethod] + public unsafe void LoadScalarAndVectorTypes() + { + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + ScalarAndVectorTypesShader shader = new(buffer, new(55, 44, 888), 22, 77, new(3.14, 6.28), 42, 9999); + + ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + + Assert.AreEqual(18, dataLoader.Values.Length); + Assert.AreEqual(1, dataLoader.Resources.Length); + + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); + + Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + + fixed (void* p0 = &dataLoader.Values[0]) { - using ReadWriteBuffer buffer0 = Gpu.Default.AllocateReadWriteBuffer(16); - using ReadWriteBuffer buffer1 = Gpu.Default.AllocateReadWriteBuffer(16); + byte* p1 = (byte*)p0; - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - - ((IShader)new MultipleResourcesAndPrimitivesShader(buffer0, buffer1, 1, 22, 77)).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - - Assert.AreEqual(6, dataLoader.Values.Length); - Assert.AreEqual(2, dataLoader.Resources.Length); - - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); - Assert.AreEqual(1, (int)dataLoader.Values[3]); - Assert.AreEqual(22, (int)dataLoader.Values[4]); - Assert.AreEqual(77, (int)dataLoader.Values[5]); - Assert.AreEqual(buffer0.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); - Assert.AreEqual(buffer1.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[1]); + Assert.AreEqual(55, *(float*)&p1[16]); + Assert.AreEqual(44, *(float*)&p1[20]); + Assert.AreEqual(888, *(float*)&p1[24]); + Assert.AreEqual(22, *(int*)&p1[28]); + Assert.AreEqual(77, *(int*)&p1[32]); + Assert.AreEqual(3.14, *(double*)&p1[48]); + Assert.AreEqual(6.28, *(double*)&p1[56]); + Assert.AreEqual(42, *(int*)&p1[64]); + Assert.AreEqual(9999, *(int*)&p1[68]); } + } - [AutoConstructor] - public partial struct ScalarAndVectorTypesShader : IComputeShader + [AutoConstructor] + public partial struct ScalarVectorAndMatrixTypesShader : IComputeShader + { + public ReadWriteBuffer _; + public float2x3 f2x3; + public int a; + public Int1x3 i1x3; + public double2 d2; + public int c; + public Int1x2 i1x2; + public int2x2 i2x2; + public int d; + + public void Execute() { - public ReadWriteBuffer _; - public float3 f3; - public int a; - public int b; - public double2 d2; - public int c; - public int d; - - public void Execute() - { - } } + } - [TestMethod] - public unsafe void LoadScalarAndVectorTypes() + [TestMethod] + public unsafe void LoadScalarVectorAndMatrixTypes() + { + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + ScalarVectorAndMatrixTypesShader shader = new( + buffer, + f2x3: new(55, 44, 888, 111, 222, 333), + a: 22, + i1x3: new(1, 2, 3), + d2: new(3.14, 6.28), + c: 42, + i1x2: new(111, 222), + i2x2: new(11, 22, 33, 44), + d: 9999); + + ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + + Assert.AreEqual(31, dataLoader.Values.Length); + Assert.AreEqual(1, dataLoader.Resources.Length); + + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); + + Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + + fixed (void* p0 = &dataLoader.Values[0]) { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + byte* p1 = (byte*)p0; - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - ScalarAndVectorTypesShader shader = new(buffer, new(55, 44, 888), 22, 77, new(3.14, 6.28), 42, 9999); - - ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - - Assert.AreEqual(18, dataLoader.Values.Length); - Assert.AreEqual(1, dataLoader.Resources.Length); - - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); - - Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); - - fixed (void* p0 = &dataLoader.Values[0]) - { - byte* p1 = (byte*)p0; - - Assert.AreEqual(55, *(float*)&p1[16]); - Assert.AreEqual(44, *(float*)&p1[20]); - Assert.AreEqual(888, *(float*)&p1[24]); - Assert.AreEqual(22, *(int*)&p1[28]); - Assert.AreEqual(77, *(int*)&p1[32]); - Assert.AreEqual(3.14, *(double*)&p1[48]); - Assert.AreEqual(6.28, *(double*)&p1[56]); - Assert.AreEqual(42, *(int*)&p1[64]); - Assert.AreEqual(9999, *(int*)&p1[68]); - } + Assert.AreEqual(55, *(float*)&p1[16]); + Assert.AreEqual(44, *(float*)&p1[20]); + Assert.AreEqual(888, *(float*)&p1[24]); + Assert.AreEqual(111, *(float*)&p1[32]); + Assert.AreEqual(222, *(float*)&p1[36]); + Assert.AreEqual(333, *(float*)&p1[40]); + Assert.AreEqual(22, *(int*)&p1[44]); + Assert.AreEqual(1, *(int*)&p1[48]); + Assert.AreEqual(2, *(int*)&p1[52]); + Assert.AreEqual(3, *(int*)&p1[56]); + Assert.AreEqual(3.14, *(double*)&p1[64]); + Assert.AreEqual(6.28, *(double*)&p1[72]); + Assert.AreEqual(42, *(int*)&p1[80]); + Assert.AreEqual(111, *(int*)&p1[84]); + Assert.AreEqual(222, *(int*)&p1[88]); + Assert.AreEqual(11, *(int*)&p1[96]); + Assert.AreEqual(22, *(int*)&p1[100]); + Assert.AreEqual(33, *(int*)&p1[112]); + Assert.AreEqual(44, *(int*)&p1[116]); + Assert.AreEqual(9999, *(int*)&p1[120]); } + } - [AutoConstructor] - public partial struct ScalarVectorAndMatrixTypesShader : IComputeShader + [AutoConstructor] + public partial struct SimpleTypes + { + public float2x3 f2x3; + public int a; + public Int1x3 i1x3; + public double2 d2; + public int c; + public Int1x2 i1x2; + public int2x2 i2x2; + public int d; + } + + [AutoConstructor] + public partial struct FlatCustomTypeShader : IComputeShader + { + public ReadWriteBuffer _0; + public SimpleTypes a; + + public void Execute() { - public ReadWriteBuffer _; - public float2x3 f2x3; - public int a; - public Int1x3 i1x3; - public double2 d2; - public int c; - public Int1x2 i1x2; - public int2x2 i2x2; - public int d; - - public void Execute() - { - } } + } - [TestMethod] - public unsafe void LoadScalarVectorAndMatrixTypes() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + [TestMethod] + public unsafe void LoadFlatCustomTypeShader() + { + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - ScalarVectorAndMatrixTypesShader shader = new( - buffer, + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + FlatCustomTypeShader shader = new( + buffer, + new SimpleTypes( f2x3: new(55, 44, 888, 111, 222, 333), a: 22, i1x3: new(1, 2, 3), @@ -159,79 +239,93 @@ namespace ComputeSharp.Tests.Internals c: 42, i1x2: new(111, 222), i2x2: new(11, 22, 33, 44), - d: 9999); + d: 9999)); - ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - Assert.AreEqual(31, dataLoader.Values.Length); - Assert.AreEqual(1, dataLoader.Resources.Length); + Assert.AreEqual(31, dataLoader.Values.Length); + Assert.AreEqual(1, dataLoader.Resources.Length); - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); - Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); - fixed (void* p0 = &dataLoader.Values[0]) - { - byte* p1 = (byte*)p0; - - Assert.AreEqual(55, *(float*)&p1[16]); - Assert.AreEqual(44, *(float*)&p1[20]); - Assert.AreEqual(888, *(float*)&p1[24]); - Assert.AreEqual(111, *(float*)&p1[32]); - Assert.AreEqual(222, *(float*)&p1[36]); - Assert.AreEqual(333, *(float*)&p1[40]); - Assert.AreEqual(22, *(int*)&p1[44]); - Assert.AreEqual(1, *(int*)&p1[48]); - Assert.AreEqual(2, *(int*)&p1[52]); - Assert.AreEqual(3, *(int*)&p1[56]); - Assert.AreEqual(3.14, *(double*)&p1[64]); - Assert.AreEqual(6.28, *(double*)&p1[72]); - Assert.AreEqual(42, *(int*)&p1[80]); - Assert.AreEqual(111, *(int*)&p1[84]); - Assert.AreEqual(222, *(int*)&p1[88]); - Assert.AreEqual(11, *(int*)&p1[96]); - Assert.AreEqual(22, *(int*)&p1[100]); - Assert.AreEqual(33, *(int*)&p1[112]); - Assert.AreEqual(44, *(int*)&p1[116]); - Assert.AreEqual(9999, *(int*)&p1[120]); - } - } - - [AutoConstructor] - public partial struct SimpleTypes + fixed (void* p0 = &dataLoader.Values[0]) { - public float2x3 f2x3; - public int a; - public Int1x3 i1x3; - public double2 d2; - public int c; - public Int1x2 i1x2; - public int2x2 i2x2; - public int d; + byte* p1 = (byte*)p0; + + Assert.AreEqual(55, *(float*)&p1[16]); + Assert.AreEqual(44, *(float*)&p1[20]); + Assert.AreEqual(888, *(float*)&p1[24]); + Assert.AreEqual(111, *(float*)&p1[32]); + Assert.AreEqual(222, *(float*)&p1[36]); + Assert.AreEqual(333, *(float*)&p1[40]); + Assert.AreEqual(22, *(int*)&p1[44]); + Assert.AreEqual(1, *(int*)&p1[48]); + Assert.AreEqual(2, *(int*)&p1[52]); + Assert.AreEqual(3, *(int*)&p1[56]); + Assert.AreEqual(3.14, *(double*)&p1[64]); + Assert.AreEqual(6.28, *(double*)&p1[72]); + Assert.AreEqual(42, *(int*)&p1[80]); + Assert.AreEqual(111, *(int*)&p1[84]); + Assert.AreEqual(222, *(int*)&p1[88]); + Assert.AreEqual(11, *(int*)&p1[96]); + Assert.AreEqual(22, *(int*)&p1[100]); + Assert.AreEqual(33, *(int*)&p1[112]); + Assert.AreEqual(44, *(int*)&p1[116]); + Assert.AreEqual(9999, *(int*)&p1[120]); } + } - [AutoConstructor] - public partial struct FlatCustomTypeShader : IComputeShader + [AutoConstructor] + public partial struct CustomType1 + { + public float3 a; + public SimpleTypes b; + public int c; + public CustomType2 d; + public CustomType3 e; + } + + [AutoConstructor] + public partial struct CustomType2 + { + public int a; + public float2 b; + public CustomType3 c; + } + + [AutoConstructor] + public partial struct CustomType3 + { + public int a; + public float2 b; + } + + [AutoConstructor] + public partial struct NestedCustomTypesShader : IComputeShader + { + public ReadWriteBuffer _0; + public CustomType1 a; + + public void Execute() { - public ReadWriteBuffer _0; - public SimpleTypes a; - - public void Execute() - { - } } + } - [TestMethod] - public unsafe void LoadFlatCustomTypeShader() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + [TestMethod] + public unsafe void LoadNestedCustomTypes() + { + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - FlatCustomTypeShader shader = new( - buffer, - new SimpleTypes( + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + NestedCustomTypesShader shader = new( + buffer, + new CustomType1( + a: new(3.14f, 6.28f, 123.4f), + b: new SimpleTypes( f2x3: new(55, 44, 888, 111, 222, 333), a: 22, i1x3: new(1, 2, 3), @@ -239,210 +333,115 @@ namespace ComputeSharp.Tests.Internals c: 42, i1x2: new(111, 222), i2x2: new(11, 22, 33, 44), - d: 9999)); + d: 9999), + c: 42, + d: new CustomType2( + a: 1234567, + b: new(44.4f, 55.5f), + c: new CustomType3( + a: 7654321, + b: new (111.1f, 222.2f))), + e: new CustomType3( + a: 888888, + b: new(333.3f, 444.4f)))); - ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - Assert.AreEqual(31, dataLoader.Values.Length); - Assert.AreEqual(1, dataLoader.Resources.Length); + Assert.AreEqual(47, dataLoader.Values.Length); + Assert.AreEqual(1, dataLoader.Resources.Length); - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); - Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); - fixed (void* p0 = &dataLoader.Values[0]) - { - byte* p1 = (byte*)p0; - - Assert.AreEqual(55, *(float*)&p1[16]); - Assert.AreEqual(44, *(float*)&p1[20]); - Assert.AreEqual(888, *(float*)&p1[24]); - Assert.AreEqual(111, *(float*)&p1[32]); - Assert.AreEqual(222, *(float*)&p1[36]); - Assert.AreEqual(333, *(float*)&p1[40]); - Assert.AreEqual(22, *(int*)&p1[44]); - Assert.AreEqual(1, *(int*)&p1[48]); - Assert.AreEqual(2, *(int*)&p1[52]); - Assert.AreEqual(3, *(int*)&p1[56]); - Assert.AreEqual(3.14, *(double*)&p1[64]); - Assert.AreEqual(6.28, *(double*)&p1[72]); - Assert.AreEqual(42, *(int*)&p1[80]); - Assert.AreEqual(111, *(int*)&p1[84]); - Assert.AreEqual(222, *(int*)&p1[88]); - Assert.AreEqual(11, *(int*)&p1[96]); - Assert.AreEqual(22, *(int*)&p1[100]); - Assert.AreEqual(33, *(int*)&p1[112]); - Assert.AreEqual(44, *(int*)&p1[116]); - Assert.AreEqual(9999, *(int*)&p1[120]); - } - } - - [AutoConstructor] - public partial struct CustomType1 + fixed (void* p0 = &dataLoader.Values[0]) { - public float3 a; - public SimpleTypes b; - public int c; - public CustomType2 d; - public CustomType3 e; - } + byte* p1 = (byte*)p0; - [AutoConstructor] - public partial struct CustomType2 - { - public int a; - public float2 b; - public CustomType3 c; - } - - [AutoConstructor] - public partial struct CustomType3 - { - public int a; - public float2 b; - } - - [AutoConstructor] - public partial struct NestedCustomTypesShader : IComputeShader - { - public ReadWriteBuffer _0; - public CustomType1 a; - - public void Execute() - { - } - } - - [TestMethod] - public unsafe void LoadNestedCustomTypes() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); - - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - NestedCustomTypesShader shader = new( - buffer, - new CustomType1( - a: new(3.14f, 6.28f, 123.4f), - b: new SimpleTypes( - f2x3: new(55, 44, 888, 111, 222, 333), - a: 22, - i1x3: new(1, 2, 3), - d2: new(3.14, 6.28), - c: 42, - i1x2: new(111, 222), - i2x2: new(11, 22, 33, 44), - d: 9999), - c: 42, - d: new CustomType2( - a: 1234567, - b: new(44.4f, 55.5f), - c: new CustomType3( - a: 7654321, - b: new (111.1f, 222.2f))), - e: new CustomType3( - a: 888888, - b: new(333.3f, 444.4f)))); - - ((IShader)shader).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - - Assert.AreEqual(47, dataLoader.Values.Length); - Assert.AreEqual(1, dataLoader.Resources.Length); - - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); - - Assert.AreEqual(buffer.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); - - fixed (void* p0 = &dataLoader.Values[0]) - { - byte* p1 = (byte*)p0; - - Assert.AreEqual(3.14f, *(float*)&p1[16]); - Assert.AreEqual(6.28f, *(float*)&p1[20]); - Assert.AreEqual(123.4f, *(float*)&p1[24]); - Assert.AreEqual(55, *(float*)&p1[32]); - Assert.AreEqual(44, *(float*)&p1[36]); - Assert.AreEqual(888, *(float*)&p1[40]); - Assert.AreEqual(111, *(float*)&p1[48]); - Assert.AreEqual(222, *(float*)&p1[52]); - Assert.AreEqual(333, *(float*)&p1[56]); - Assert.AreEqual(22, *(int*)&p1[60]); - Assert.AreEqual(1, *(int*)&p1[64]); - Assert.AreEqual(2, *(int*)&p1[68]); - Assert.AreEqual(3, *(int*)&p1[72]); - Assert.AreEqual(3.14, *(double*)&p1[80]); - Assert.AreEqual(6.28, *(double*)&p1[88]); - Assert.AreEqual(42, *(int*)&p1[96]); - Assert.AreEqual(111, *(int*)&p1[100]); - Assert.AreEqual(222, *(int*)&p1[104]); - Assert.AreEqual(11, *(int*)&p1[112]); - Assert.AreEqual(22, *(int*)&p1[116]); - Assert.AreEqual(33, *(int*)&p1[128]); - Assert.AreEqual(44, *(int*)&p1[132]); - Assert.AreEqual(9999, *(int*)&p1[136]); - Assert.AreEqual(42, *(int*)&p1[140]); - Assert.AreEqual(1234567, *(int*)&p1[144]); - Assert.AreEqual(44.4f, *(float*)&p1[148]); - Assert.AreEqual(55.5f, *(float*)&p1[152]); - Assert.AreEqual(7654321, *(int*)&p1[160]); - Assert.AreEqual(111.1f, *(float*)&p1[164]); - Assert.AreEqual(222.2f, *(float*)&p1[168]); - Assert.AreEqual(888888, *(int*)&p1[176]); - Assert.AreEqual(333.3f, *(float*)&p1[180]); - Assert.AreEqual(444.4f, *(float*)&p1[184]); - } - } - - [AutoConstructor] - public partial struct AmbiguousNamesShader : IComputeShader - { - public ReadWriteBuffer a; - public ReadWriteBuffer b; - public ReadWriteBuffer c; - public ReadWriteBuffer x; - public ReadWriteBuffer y; - public ReadWriteBuffer z; - public int dataLoader; - public int device; - public int dummy; - - public void Execute() - { - } - } - - [TestMethod] - public unsafe void AmbiguousNames() - { - using ReadWriteBuffer a = Gpu.Default.AllocateReadWriteBuffer(16); - using ReadWriteBuffer b = Gpu.Default.AllocateReadWriteBuffer(16); - using ReadWriteBuffer c = Gpu.Default.AllocateReadWriteBuffer(16); - using ReadWriteBuffer x = Gpu.Default.AllocateReadWriteBuffer(16); - using ReadWriteBuffer y = Gpu.Default.AllocateReadWriteBuffer(16); - using ReadWriteBuffer z = Gpu.Default.AllocateReadWriteBuffer(16); - - DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); - - ((IShader)new AmbiguousNamesShader(a, b, c, x, y, z, 7777, 8888, 9999)).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); - - Assert.AreEqual(6, dataLoader.Values.Length); - Assert.AreEqual(6, dataLoader.Resources.Length); - - Assert.AreEqual(111, (int)dataLoader.Values[0]); - Assert.AreEqual(222, (int)dataLoader.Values[1]); - Assert.AreEqual(333, (int)dataLoader.Values[2]); - Assert.AreEqual(7777, (int)dataLoader.Values[3]); - Assert.AreEqual(8888, (int)dataLoader.Values[4]); - Assert.AreEqual(9999, (int)dataLoader.Values[5]); - Assert.AreEqual(a.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); - Assert.AreEqual(b.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[1]); - Assert.AreEqual(c.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[2]); - Assert.AreEqual(x.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[3]); - Assert.AreEqual(y.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[4]); - Assert.AreEqual(z.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[5]); + Assert.AreEqual(3.14f, *(float*)&p1[16]); + Assert.AreEqual(6.28f, *(float*)&p1[20]); + Assert.AreEqual(123.4f, *(float*)&p1[24]); + Assert.AreEqual(55, *(float*)&p1[32]); + Assert.AreEqual(44, *(float*)&p1[36]); + Assert.AreEqual(888, *(float*)&p1[40]); + Assert.AreEqual(111, *(float*)&p1[48]); + Assert.AreEqual(222, *(float*)&p1[52]); + Assert.AreEqual(333, *(float*)&p1[56]); + Assert.AreEqual(22, *(int*)&p1[60]); + Assert.AreEqual(1, *(int*)&p1[64]); + Assert.AreEqual(2, *(int*)&p1[68]); + Assert.AreEqual(3, *(int*)&p1[72]); + Assert.AreEqual(3.14, *(double*)&p1[80]); + Assert.AreEqual(6.28, *(double*)&p1[88]); + Assert.AreEqual(42, *(int*)&p1[96]); + Assert.AreEqual(111, *(int*)&p1[100]); + Assert.AreEqual(222, *(int*)&p1[104]); + Assert.AreEqual(11, *(int*)&p1[112]); + Assert.AreEqual(22, *(int*)&p1[116]); + Assert.AreEqual(33, *(int*)&p1[128]); + Assert.AreEqual(44, *(int*)&p1[132]); + Assert.AreEqual(9999, *(int*)&p1[136]); + Assert.AreEqual(42, *(int*)&p1[140]); + Assert.AreEqual(1234567, *(int*)&p1[144]); + Assert.AreEqual(44.4f, *(float*)&p1[148]); + Assert.AreEqual(55.5f, *(float*)&p1[152]); + Assert.AreEqual(7654321, *(int*)&p1[160]); + Assert.AreEqual(111.1f, *(float*)&p1[164]); + Assert.AreEqual(222.2f, *(float*)&p1[168]); + Assert.AreEqual(888888, *(int*)&p1[176]); + Assert.AreEqual(333.3f, *(float*)&p1[180]); + Assert.AreEqual(444.4f, *(float*)&p1[184]); } } + + [AutoConstructor] + public partial struct AmbiguousNamesShader : IComputeShader + { + public ReadWriteBuffer a; + public ReadWriteBuffer b; + public ReadWriteBuffer c; + public ReadWriteBuffer x; + public ReadWriteBuffer y; + public ReadWriteBuffer z; + public int dataLoader; + public int device; + public int dummy; + + public void Execute() + { + } + } + + [TestMethod] + public unsafe void AmbiguousNames() + { + using ReadWriteBuffer a = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer b = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer c = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer x = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer y = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer z = Gpu.Default.AllocateReadWriteBuffer(16); + + DebugDispatchDataLoader dataLoader = DebugDispatchDataLoader.Create(); + + ((IShader)new AmbiguousNamesShader(a, b, c, x, y, z, 7777, 8888, 9999)).LoadDispatchData(ref dataLoader, Gpu.Default, 111, 222, 333); + + Assert.AreEqual(6, dataLoader.Values.Length); + Assert.AreEqual(6, dataLoader.Resources.Length); + + Assert.AreEqual(111, (int)dataLoader.Values[0]); + Assert.AreEqual(222, (int)dataLoader.Values[1]); + Assert.AreEqual(333, (int)dataLoader.Values[2]); + Assert.AreEqual(7777, (int)dataLoader.Values[3]); + Assert.AreEqual(8888, (int)dataLoader.Values[4]); + Assert.AreEqual(9999, (int)dataLoader.Values[5]); + Assert.AreEqual(a.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[0]); + Assert.AreEqual(b.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[1]); + Assert.AreEqual(c.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[2]); + Assert.AreEqual(x.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[3]); + Assert.AreEqual(y.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[4]); + Assert.AreEqual(z.D3D12GpuDescriptorHandle.ptr, dataLoader.Resources[5]); + } } diff --git a/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs index 4ac713a2..1fbf26ba 100644 --- a/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs +++ b/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs @@ -4,78 +4,77 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; #pragma warning disable CS0618 -namespace ComputeSharp.Tests.Internals +namespace ComputeSharp.Tests.Internals; + +[TestClass] +[TestCategory("ShaderHashCode")] +public partial class ShaderHashCodeTests { - [TestClass] - [TestCategory("ShaderHashCode")] - public partial class ShaderHashCodeTests + public partial struct Shader1 : IComputeShader { - public partial struct Shader1 : IComputeShader + public float A; + public ReadWriteBuffer B; + + public void Execute() { - public float A; - public ReadWriteBuffer B; - - public void Execute() - { - B[0] = A; - } - } - - [TestMethod] - public void ShaderWithNoCapturedDelegates() - { - float value = 10; - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - Shader1 shader1 = new() { A = value, B = buffer }; - - int - hash1 = ((IShader)shader1).GetDispatchId(), - hash2 = ((IShader)shader1).GetDispatchId(); - - Assert.IsTrue(hash1 == hash2); - - Shader1 shader2 = new() { A = value, B = buffer }; - - int hash3 = ((IShader)shader2).GetDispatchId(); - - Assert.IsTrue(hash1 == hash3); - } - - public partial struct Shader2 : IComputeShader - { - public float A; - public ReadWriteBuffer B; - public Func F; - - public void Execute() - { - B[0] = F(A); - } - } - - [TestMethod] - public void ShaderWithCapturedDelegates() - { - Func f = static x => x * x; - - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - Shader2 shader1 = new() { A = 1, B = buffer, F = f }; - - int - hash1 = ((IShader)shader1).GetDispatchId(), - hash2 = ((IShader)shader1).GetDispatchId(); - - Assert.IsTrue(hash1 == hash2); - - f = static x => x + 1; - - Shader2 shader2 = new() { A = 1, B = buffer, F = f }; - - int hash3 = ((IShader)shader2).GetDispatchId(); - - Assert.IsFalse(hash1 == hash3); + B[0] = A; } } + + [TestMethod] + public void ShaderWithNoCapturedDelegates() + { + float value = 10; + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); + + Shader1 shader1 = new() { A = value, B = buffer }; + + int + hash1 = ((IShader)shader1).GetDispatchId(), + hash2 = ((IShader)shader1).GetDispatchId(); + + Assert.IsTrue(hash1 == hash2); + + Shader1 shader2 = new() { A = value, B = buffer }; + + int hash3 = ((IShader)shader2).GetDispatchId(); + + Assert.IsTrue(hash1 == hash3); + } + + public partial struct Shader2 : IComputeShader + { + public float A; + public ReadWriteBuffer B; + public Func F; + + public void Execute() + { + B[0] = F(A); + } + } + + [TestMethod] + public void ShaderWithCapturedDelegates() + { + Func f = static x => x * x; + + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); + + Shader2 shader1 = new() { A = 1, B = buffer, F = f }; + + int + hash1 = ((IShader)shader1).GetDispatchId(), + hash2 = ((IShader)shader1).GetDispatchId(); + + Assert.IsTrue(hash1 == hash2); + + f = static x => x + 1; + + Shader2 shader2 = new() { A = 1, B = buffer, F = f }; + + int hash3 = ((IShader)shader2).GetDispatchId(); + + Assert.IsFalse(hash1 == hash3); + } } diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs index 4705f20e..b054d9e9 100644 --- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs @@ -1,290 +1,289 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.ComponentModel; using System.Diagnostics; using System.IO; [assembly: Parallelize(Workers = 0, Scope = ExecutionScope.ClassLevel)] -namespace ComputeSharp.Tests.NativeLibrariesResolver +namespace ComputeSharp.Tests.NativeLibrariesResolver; + +[TestClass] +public class NativeLibrariesResolverTests { - [TestClass] - public class NativeLibrariesResolverTests + /// + /// Performs static initialization for the assembly before any unit tests are run. + /// + /// The for the test runner instance in use. + [AssemblyInitialize] + public static void Initialize(TestContext _) { - /// - /// Performs static initialization for the assembly before any unit tests are run. - /// - /// The for the test runner instance in use. - [AssemblyInitialize] - public static void Initialize(TestContext _) + string path = Path.GetDirectoryName(typeof(NativeLibrariesResolverTests).Assembly.Location)!; + + while (Path.GetFileName(path) is not "ComputeSharp") { - string path = Path.GetDirectoryName(typeof(NativeLibrariesResolverTests).Assembly.Location)!; - - while (Path.GetFileName(path) is not "ComputeSharp") - { - path = Path.GetDirectoryName(path)!; - } - - SampleProjectDirectory = Path.Combine(path, "samples", "ComputeSharp.Sample.NuGet"); - - string packagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.msbuildproj"); - - // Run dotnet pack and on the packaging project, to ensure the local NuGet package is available - Process.Start("dotnet", $"pack {packagingProjectPath} -c Release").WaitForExit(); + path = Path.GetDirectoryName(path)!; } - /// - /// Gets the directory of the ComputeSharp.Sample.NuGet project. - /// - private static string? SampleProjectDirectory { get; set; } + SampleProjectDirectory = Path.Combine(path, "samples", "ComputeSharp.Sample.NuGet"); - [TestMethod] - [DataRow(Configuration.Debug, RID.None)] - [DataRow(Configuration.Debug, RID.Win_x64)] - [DataRow(Configuration.Release, RID.None)] - [DataRow(Configuration.Release, RID.Win_x64)] - public void DotnetRunWorks(Configuration configuration, RID rid) + string packagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.msbuildproj"); + + // Run dotnet pack and on the packaging project, to ensure the local NuGet package is available + Process.Start("dotnet", $"pack {packagingProjectPath} -c Release").WaitForExit(); + } + + /// + /// Gets the directory of the ComputeSharp.Sample.NuGet project. + /// + private static string? SampleProjectDirectory { get; set; } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetRunWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, "dotnet", $"run -c {configuration} {ToOption(rid)}")); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningDotnetHostFromProjectDirectoryWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string realtivePathToDll = Path.Combine("bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}", "ComputeSharp.Sample.NuGet.dll"); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, "dotnet", realtivePathToDll)); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningDotnetHostDirectlyWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string pathToDllDirectory = Path.Combine(SampleProjectDirectory!, "bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}"); + + Assert.AreEqual(0, Exec(pathToDllDirectory, "dotnet", "ComputeSharp.Sample.NuGet.dll")); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningAppHostFromProjectDirectoryWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string relativePathToAppHost = Path.Combine("bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}", "ComputeSharp.Sample.NuGet.exe"); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, relativePathToAppHost, "")); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningAppHostDirectlyWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string pathToAppHostDirectory = Path.Combine(SampleProjectDirectory!, "bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}"); + + Assert.AreEqual(0, Exec(pathToAppHostDirectory, "ComputeSharp.Sample.NuGet.exe", "")); + } + + + [TestMethod] + [DataRow(PublishMode.SelfContained, DeploymentMode.Multiassembly, NativeLibrariesDeploymentMode.NotApplicable)] + [DataRow(PublishMode.FrameworkDependent, DeploymentMode.Multiassembly, NativeLibrariesDeploymentMode.NotApplicable)] + [DataRow(PublishMode.SelfContained, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.CopyToApplicationDirectory)] + [DataRow(PublishMode.SelfContained, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory)] + [DataRow(PublishMode.FrameworkDependent, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.CopyToApplicationDirectory)] + [DataRow(PublishMode.FrameworkDependent, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory)] + public void DotnetPublishWorks(PublishMode publishMode, DeploymentMode deploymentMode, NativeLibrariesDeploymentMode nativeLibsDeploymentMode) + { + // Publishing without specifying a RID is not supported. + // Furthermore, only publishing in Release mode is tested. + CleanSampleProject(Configuration.Release, RID.Win_x64); + + Exec(SampleProjectDirectory!, "dotnet", $"publish -c Release -r win-x64 {ToOption(publishMode)} {ToOption(deploymentMode)} {ToOption(nativeLibsDeploymentMode)} /bl"); + + string pathToAppHost = Path.Combine("bin", $"Release", "net5.0", "win-x64", "publish", "ComputeSharp.Sample.NuGet.exe"); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, pathToAppHost, "")); + } + + /// + /// Cleans the sample project's artifacts for a specific configuration and target runtime. + /// This method is called at the start of each test method to work around bugs around some up-to-date checks + /// Causing certain targets to not run and effectively corrupting the build output. + /// + /// The configuration for which the output is cleaned. + /// The RID for which the output is cleaned. + private static void CleanSampleProject(Configuration configuration, RID rid) + { + Exec(SampleProjectDirectory!, "dotnet", $"clean -c {configuration} {ToOption(rid)}"); + } + + /// + /// Builds the sample project with a specific configuration and target runtime. + /// + /// The configuration to use to build the project. + /// The RID to use to build the project. + private static void BuildSampleProject(Configuration configuration, RID rid) + { + Exec(SampleProjectDirectory!, "dotnet", $"build -c {configuration} {ToOption(rid)}"); + } + + /// + /// Executes a specified process from the command line and returns the exit code. + /// + /// The working directory to execute the process. + /// The target file path for the process to execute. + /// The arguments to invoke the process. + /// The exit code for the executed process. + private static int Exec(string workingDirectory, string filePath, string arguments) + { + ProcessStartInfo startInfo = new() { - CleanSampleProject(configuration, rid); - - Assert.AreEqual(0, Exec(SampleProjectDirectory!, "dotnet", $"run -c {configuration} {ToOption(rid)}")); - } - - [TestMethod] - [DataRow(Configuration.Debug, RID.None)] - [DataRow(Configuration.Debug, RID.Win_x64)] - [DataRow(Configuration.Release, RID.None)] - [DataRow(Configuration.Release, RID.Win_x64)] - public void DotnetBuildWithRunningDotnetHostFromProjectDirectoryWorks(Configuration configuration, RID rid) - { - CleanSampleProject(configuration, rid); - BuildSampleProject(configuration, rid); - - string realtivePathToDll = Path.Combine("bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}", "ComputeSharp.Sample.NuGet.dll"); - - Assert.AreEqual(0, Exec(SampleProjectDirectory!, "dotnet", realtivePathToDll)); - } - - [TestMethod] - [DataRow(Configuration.Debug, RID.None)] - [DataRow(Configuration.Debug, RID.Win_x64)] - [DataRow(Configuration.Release, RID.None)] - [DataRow(Configuration.Release, RID.Win_x64)] - public void DotnetBuildWithRunningDotnetHostDirectlyWorks(Configuration configuration, RID rid) - { - CleanSampleProject(configuration, rid); - BuildSampleProject(configuration, rid); - - string pathToDllDirectory = Path.Combine(SampleProjectDirectory!, "bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}"); - - Assert.AreEqual(0, Exec(pathToDllDirectory, "dotnet", "ComputeSharp.Sample.NuGet.dll")); - } - - [TestMethod] - [DataRow(Configuration.Debug, RID.None)] - [DataRow(Configuration.Debug, RID.Win_x64)] - [DataRow(Configuration.Release, RID.None)] - [DataRow(Configuration.Release, RID.Win_x64)] - public void DotnetBuildWithRunningAppHostFromProjectDirectoryWorks(Configuration configuration, RID rid) - { - CleanSampleProject(configuration, rid); - BuildSampleProject(configuration, rid); - - string relativePathToAppHost = Path.Combine("bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}", "ComputeSharp.Sample.NuGet.exe"); - - Assert.AreEqual(0, Exec(SampleProjectDirectory!, relativePathToAppHost, "")); - } - - [TestMethod] - [DataRow(Configuration.Debug, RID.None)] - [DataRow(Configuration.Debug, RID.Win_x64)] - [DataRow(Configuration.Release, RID.None)] - [DataRow(Configuration.Release, RID.Win_x64)] - public void DotnetBuildWithRunningAppHostDirectlyWorks(Configuration configuration, RID rid) - { - CleanSampleProject(configuration, rid); - BuildSampleProject(configuration, rid); - - string pathToAppHostDirectory = Path.Combine(SampleProjectDirectory!, "bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}"); - - Assert.AreEqual(0, Exec(pathToAppHostDirectory, "ComputeSharp.Sample.NuGet.exe", "")); - } - - - [TestMethod] - [DataRow(PublishMode.SelfContained, DeploymentMode.Multiassembly, NativeLibrariesDeploymentMode.NotApplicable)] - [DataRow(PublishMode.FrameworkDependent, DeploymentMode.Multiassembly, NativeLibrariesDeploymentMode.NotApplicable)] - [DataRow(PublishMode.SelfContained, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.CopyToApplicationDirectory)] - [DataRow(PublishMode.SelfContained, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory)] - [DataRow(PublishMode.FrameworkDependent, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.CopyToApplicationDirectory)] - [DataRow(PublishMode.FrameworkDependent, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory)] - public void DotnetPublishWorks(PublishMode publishMode, DeploymentMode deploymentMode, NativeLibrariesDeploymentMode nativeLibsDeploymentMode) - { - // Publishing without specifying a RID is not supported. - // Furthermore, only publishing in Release mode is tested. - CleanSampleProject(Configuration.Release, RID.Win_x64); - - Exec(SampleProjectDirectory!, "dotnet", $"publish -c Release -r win-x64 {ToOption(publishMode)} {ToOption(deploymentMode)} {ToOption(nativeLibsDeploymentMode)} /bl"); - - string pathToAppHost = Path.Combine("bin", $"Release", "net5.0", "win-x64", "publish", "ComputeSharp.Sample.NuGet.exe"); - - Assert.AreEqual(0, Exec(SampleProjectDirectory!, pathToAppHost, "")); - } - - /// - /// Cleans the sample project's artifacts for a specific configuration and target runtime. - /// This method is called at the start of each test method to work around bugs around some up-to-date checks - /// Causing certain targets to not run and effectively corrupting the build output. - /// - /// The configuration for which the output is cleaned. - /// The RID for which the output is cleaned. - private static void CleanSampleProject(Configuration configuration, RID rid) - { - Exec(SampleProjectDirectory!, "dotnet", $"clean -c {configuration} {ToOption(rid)}"); - } - - /// - /// Builds the sample project with a specific configuration and target runtime. - /// - /// The configuration to use to build the project. - /// The RID to use to build the project. - private static void BuildSampleProject(Configuration configuration, RID rid) - { - Exec(SampleProjectDirectory!, "dotnet", $"build -c {configuration} {ToOption(rid)}"); - } - - /// - /// Executes a specified process from the command line and returns the exit code. - /// - /// The working directory to execute the process. - /// The target file path for the process to execute. - /// The arguments to invoke the process. - /// The exit code for the executed process. - private static int Exec(string workingDirectory, string filePath, string arguments) - { - ProcessStartInfo startInfo = new() - { - UseShellExecute = true, - CreateNoWindow = true, - WindowStyle = ProcessWindowStyle.Hidden, - FileName = filePath, - Arguments = arguments, - WorkingDirectory = workingDirectory - }; - - using Process process = Process.Start(startInfo)!; - - process.WaitForExit(); - - return process.ExitCode; - } - - /// - /// Gets a text representation of the command line argument for the given . - /// - /// The input value. - /// A text representation for . - private static string ToOption(RID rid) => rid switch - { - RID.None => "", - RID.Win_x64 => "-r win-x64", - _ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID)) + UseShellExecute = true, + CreateNoWindow = true, + WindowStyle = ProcessWindowStyle.Hidden, + FileName = filePath, + Arguments = arguments, + WorkingDirectory = workingDirectory }; - /// - /// Gets a text representation of the command line argument for the given . - /// - /// The input value. - /// A text representation for . - private static string ToOption(PublishMode publishMode) => publishMode switch - { - PublishMode.FrameworkDependent => "--self-contained false", - PublishMode.SelfContained => "--self-contained true", - _ => throw new InvalidEnumArgumentException(nameof(publishMode), (int)publishMode, typeof(PublishMode)) - }; + using Process process = Process.Start(startInfo)!; - /// - /// Gets a text representation of the command line argument for the given . - /// - /// The input value. - /// A text representation for . - private static string ToOption(DeploymentMode deploymentMode) => deploymentMode switch - { - DeploymentMode.Multiassembly => "/p:PublishSingleFile=false", - DeploymentMode.SingleFile => "/p:PublishSingleFile=true", - _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(DeploymentMode)) - }; + process.WaitForExit(); - /// - /// Gets a text representation of the command line argument for the given . - /// - /// The input value. - /// A text representation for . - private static string ToOption(NativeLibrariesDeploymentMode deploymentMode) => deploymentMode switch - { - NativeLibrariesDeploymentMode.NotApplicable => "", - NativeLibrariesDeploymentMode.CopyToApplicationDirectory => "/p:IncludeNativeLibrariesForSelfExtract=false", - NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory => "/p:IncludeNativeLibrariesForSelfExtract=true", - _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(NativeLibrariesDeploymentMode)) - }; + return process.ExitCode; + } - /// - /// Gets a text representation of the build folder for the given . - /// - /// The input value. - /// A text representation for . - private static string ToDirectory(RID rid) => rid switch - { - RID.None => "", - RID.Win_x64 => "win-x64", - _ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID)) - }; + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(RID rid) => rid switch + { + RID.None => "", + RID.Win_x64 => "-r win-x64", + _ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID)) + }; - /// - /// A build configuration. - /// - public enum Configuration - { - Debug, - Release - } + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(PublishMode publishMode) => publishMode switch + { + PublishMode.FrameworkDependent => "--self-contained false", + PublishMode.SelfContained => "--self-contained true", + _ => throw new InvalidEnumArgumentException(nameof(publishMode), (int)publishMode, typeof(PublishMode)) + }; - /// - /// A runtime identifier. - /// - public enum RID - { - None, - Win_x64 - } + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(DeploymentMode deploymentMode) => deploymentMode switch + { + DeploymentMode.Multiassembly => "/p:PublishSingleFile=false", + DeploymentMode.SingleFile => "/p:PublishSingleFile=true", + _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(DeploymentMode)) + }; - /// - /// Indicates how should the application carry the framework with itself. - /// - public enum PublishMode - { - FrameworkDependent, - SelfContained - } + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(NativeLibrariesDeploymentMode deploymentMode) => deploymentMode switch + { + NativeLibrariesDeploymentMode.NotApplicable => "", + NativeLibrariesDeploymentMode.CopyToApplicationDirectory => "/p:IncludeNativeLibrariesForSelfExtract=false", + NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory => "/p:IncludeNativeLibrariesForSelfExtract=true", + _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(NativeLibrariesDeploymentMode)) + }; - /// - /// Indicates how should the application be packaged. Notably, these tests employ .NET 5 style SingleFile, - /// aka SuperHost. It does not affect native libraries packaging in .NET 5, but may in the future. - /// - public enum DeploymentMode - { - Multiassembly, - SingleFile - } + /// + /// Gets a text representation of the build folder for the given . + /// + /// The input value. + /// A text representation for . + private static string ToDirectory(RID rid) => rid switch + { + RID.None => "", + RID.Win_x64 => "win-x64", + _ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID)) + }; - /// - /// Indicates the deployment mode for application's native dependencies. - /// Not applicable to multiassembly deployment mode. - /// - public enum NativeLibrariesDeploymentMode - { - NotApplicable, - ExtractToTemporaryDirectory, - CopyToApplicationDirectory - } + /// + /// A build configuration. + /// + public enum Configuration + { + Debug, + Release + } + + /// + /// A runtime identifier. + /// + public enum RID + { + None, + Win_x64 + } + + /// + /// Indicates how should the application carry the framework with itself. + /// + public enum PublishMode + { + FrameworkDependent, + SelfContained + } + + /// + /// Indicates how should the application be packaged. Notably, these tests employ .NET 5 style SingleFile, + /// aka SuperHost. It does not affect native libraries packaging in .NET 5, but may in the future. + /// + public enum DeploymentMode + { + Multiassembly, + SingleFile + } + + /// + /// Indicates the deployment mode for application's native dependencies. + /// Not applicable to multiassembly deployment mode. + /// + public enum NativeLibrariesDeploymentMode + { + NotApplicable, + ExtractToTemporaryDirectory, + CopyToApplicationDirectory } } diff --git a/tests/ComputeSharp.Tests.SourceGenerators/AutoConstructorGeneratorTests.cs b/tests/ComputeSharp.Tests.SourceGenerators/AutoConstructorGeneratorTests.cs index 92a4e006..b991a58c 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/AutoConstructorGeneratorTests.cs +++ b/tests/ComputeSharp.Tests.SourceGenerators/AutoConstructorGeneratorTests.cs @@ -7,105 +7,104 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests.SourceGenerators +namespace ComputeSharp.Tests.SourceGenerators; + +[TestClass] +[TestCategory("AutoConstructorGenerator")] +public class AutoConstructorGeneratorTests { - [TestClass] - [TestCategory("AutoConstructorGenerator")] - public class AutoConstructorGeneratorTests + [TestMethod] + public void GenerateConstructor() { - [TestMethod] - public void GenerateConstructor() + string source = @" + using System.Numerics; + using ComputeSharp; + + namespace ComputeSharp { - string source = @" - using System.Numerics; - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public partial interface IFoo : IFluff - where T : notnull, new() - { - public partial class Foo - { - [AutoConstructor] - public readonly partial struct Test - { - private readonly float a; - private readonly Vector2 b; - public readonly ReadWriteBuffer c; - public readonly ReadWriteBuffer d; - } - } - } - }"; - - string expected = @" - namespace MyFancyApp.Sample - { - public partial interface IFoo - { - public partial class Foo - { - public readonly partial struct Test - { - public Test(float a, System.Numerics.Vector2 b, ComputeSharp.ReadWriteBuffer c, ComputeSharp.ReadWriteBuffer d) - { - this.a = a; - this.b = b; - this.c = c; - this.d = d; - } - } - } - } - }"; - - VerifyGeneratedMethodLines(source, 0, expected); + public class ReadWriteBuffer { } } - /// - /// Verifies the output of a source generator. - /// - /// The generator type to use. - /// The input source to process. - /// The target index to check in the resulting output. - /// The expected body to compare with the generated code. - private static void VerifyGeneratedMethodLines(string source, int index, string expectedBody) - where TGenerator : class, ISourceGenerator, new() + namespace MyFancyApp.Sample { - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); - - IEnumerable references = - from assembly in AppDomain.CurrentDomain.GetAssemblies() - where !assembly.IsDynamic - let reference = MetadataReference.CreateFromFile(assembly.Location) - select reference; - - CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); - - ISourceGenerator generator = new TGenerator(); - - CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator); - - driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray diagnostics); - - string outputBody = outputCompilation.SyntaxTrees.Skip(index + 1).First().ToString(); - - string[] - outputLines = outputBody.Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries), - expectedLines = expectedBody.Replace("\r", "").Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); - - Assert.AreEqual(expectedLines.Length, outputLines.Length); - - for (int i = 0; i < outputLines.Length; i++) + public partial interface IFoo : IFluff + where T : notnull, new() { - Assert.AreEqual(expectedLines[i], outputLines[i]); + public partial class Foo + { + [AutoConstructor] + public readonly partial struct Test + { + private readonly float a; + private readonly Vector2 b; + public readonly ReadWriteBuffer c; + public readonly ReadWriteBuffer d; + } + } } + }"; + + string expected = @" + namespace MyFancyApp.Sample + { + public partial interface IFoo + { + public partial class Foo + { + public readonly partial struct Test + { + public Test(float a, System.Numerics.Vector2 b, ComputeSharp.ReadWriteBuffer c, ComputeSharp.ReadWriteBuffer d) + { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } + } + } + } + }"; + + VerifyGeneratedMethodLines(source, 0, expected); + } + + /// + /// Verifies the output of a source generator. + /// + /// The generator type to use. + /// The input source to process. + /// The target index to check in the resulting output. + /// The expected body to compare with the generated code. + private static void VerifyGeneratedMethodLines(string source, int index, string expectedBody) + where TGenerator : class, ISourceGenerator, new() + { + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); + + IEnumerable references = + from assembly in AppDomain.CurrentDomain.GetAssemblies() + where !assembly.IsDynamic + let reference = MetadataReference.CreateFromFile(assembly.Location) + select reference; + + CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + + ISourceGenerator generator = new TGenerator(); + + CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator); + + driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray diagnostics); + + string outputBody = outputCompilation.SyntaxTrees.Skip(index + 1).First().ToString(); + + string[] + outputLines = outputBody.Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries), + expectedLines = expectedBody.Replace("\r", "").Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); + + Assert.AreEqual(expectedLines.Length, outputLines.Length); + + for (int i = 0; i < outputLines.Length; i++) + { + Assert.AreEqual(expectedLines[i], outputLines[i]); } } -} \ No newline at end of file +} diff --git a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs index 6ffdd3eb..3956f5a1 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs +++ b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs @@ -7,1423 +7,1422 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests.SourceGenerators +namespace ComputeSharp.Tests.SourceGenerators; + +[TestClass] +[TestCategory("Diagnostics")] +public class DiagnosticsTests { - [TestClass] - [TestCategory("Diagnostics")] - public class DiagnosticsTests + [TestMethod] + public void InvalidShaderField() { - [TestMethod] - public void InvalidShaderField() - { - string source = @" - using ComputeSharp; + string source = @" + using ComputeSharp; - namespace ComputeSharp + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader { - public class ReadWriteBuffer { } + public ReadWriteBuffer buffer; + public string text; + + public void Execute() { } } + }"; - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - public string text; - - public void Execute() { } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0001"); - } - - [TestMethod] - public void InvalidShaderFixedField() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public unsafe struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - public fixed int text[16]; - - public void Execute() { } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0001"); - } - - [TestMethod] - public void InvalidGroupSharedFieldType() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - public class GroupSharedAttribute : Attribute { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - [GroupShared] - public static string text; - - public void Execute() { } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0002"); - } - - [TestMethod] - public void InvalidGroupSharedFieldElementType() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - public class GroupSharedAttribute : Attribute { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - [GroupShared] - public static string[] text; - - public void Execute() { } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0003"); - } - - [TestMethod] - public void InvalidGroupSharedFieldDeclaration() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - public class GroupSharedAttribute : Attribute { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - [GroupShared] - public ReadWriteBuffer buffer; - - public void Execute() { } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0004"); - } - - [TestMethod] - public void MissingShaderResources() - { - string source = @" - using ComputeSharp; - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public void Execute() { } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0005"); - } - - [TestMethod] - [DataRow(nameof(ThreadIds), "CMPS0006")] - [DataRow(nameof(GroupIds), "CMPS0007")] - [DataRow(nameof(GroupSize), "CMPS0008")] - [DataRow(nameof(GridIds), "CMPS0009")] - [DataRow(nameof(DispatchSize), "CMPS0044")] - public void InvalidDispatchInfoUsage_LocalFunction(string typeName, string diagnosticsId) - { - string source = $@" - using ComputeSharp; - - namespace ComputeSharp - {{ - public class ReadWriteBuffer {{ }} - public static class {typeName} {{ public static int X => 0; }} - }} - - namespace MyFancyApp.Sample - {{ - public struct MyShader : IComputeShader - {{ - public ReadWriteBuffer buffer; - - public void Execute() - {{ - static int Fail() => {typeName}.X; - - Fail(); - }} - }} - }}"; - - VerifyGeneratedDiagnostics(source, diagnosticsId); - } - - [TestMethod] - [DataRow(nameof(ThreadIds), "CMPS0006")] - [DataRow(nameof(GroupIds), "CMPS0007")] - [DataRow(nameof(GroupSize), "CMPS0008")] - [DataRow(nameof(GridIds), "CMPS0009")] - [DataRow(nameof(DispatchSize), "CMPS0044")] - public void InvalidDispatchInfoUsage_StaticMethod(string typeName, string diagnosticsId) - { - string source = $@" - using ComputeSharp; - - namespace ComputeSharp - {{ - public class ReadWriteBuffer {{ }} - public static class {typeName} {{ public static int X => 0; }} - }} - - namespace MyFancyApp.Sample - {{ - public struct MyShader : IComputeShader - {{ - public ReadWriteBuffer buffer; - - public static int Fail() => {typeName}.X; - - public void Execute() => Fail(); - }} - }}"; - - VerifyGeneratedDiagnostics(source, diagnosticsId); - } - - [TestMethod] - public void InvalidThreadIdsNormalizedUsage() - { - string source = $@" - using ComputeSharp; - - namespace ComputeSharp - {{ - public class ReadWriteBuffer {{ }} - public static class ThreadIds {{ public static class Normalized {{ public static int X => 0; }} }} - }} - - namespace MyFancyApp.Sample - {{ - public struct MyShader : IComputeShader - {{ - public ReadWriteBuffer buffer; - - public static int Fail() => ThreadIds.Normalized.X; - - public void Execute() - {{ - buffer[0] = Fail(); - }} - }} - }}"; - - VerifyGeneratedDiagnostics(source, "CMPS0006"); - } - - [TestMethod] - public void InvalidObjectCreationExpression_Explicit() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - object o = new object(); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0010", "CMPS0031"); - } - - [TestMethod] - public void InvalidObjectCreationExpression_Implicit() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - object o = new(); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0010", "CMPS0031"); - } - - [TestMethod] - public void AnonymousObjectCreationExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - var o = new { Age = 12 }; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0011", "CMPS0031"); - } - - [TestMethod] - public void AsyncModifierOnMethodOrFunction_LocalFunction() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - static async void Fail() { } - - Fail(); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0012"); - } - - [TestMethod] - public void AsyncModifierOnMethodOrFunction_StaticMethod() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public static async void Fail() { } - - public void Execute() => Fail(); - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0012"); - } - - [TestMethod] - public void AwaitExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public async void Execute() - { - await null; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0012", "CMPS0013"); - } - - [TestMethod] - [DataRow("checked")] - [DataRow("unchecked")] - public void CheckedExpression(string text) - { - string source = $@" - using ComputeSharp; - - namespace ComputeSharp - {{ - public class ReadWriteBuffer {{ }} - }} - - namespace MyFancyApp.Sample - {{ - public struct MyShader : IComputeShader - {{ - public ReadWriteBuffer buffer; - - public void Execute() - {{ - int a = {text}(1 + 1); - }} - }} - }}"; - - VerifyGeneratedDiagnostics(source, "CMPS0014"); - } - - [TestMethod] - [DataRow("checked")] - [DataRow("unchecked")] - public void CheckedStatement(string text) - { - string source = $@" - using ComputeSharp; - - namespace ComputeSharp - {{ - public class ReadWriteBuffer {{ }} - }} - - namespace MyFancyApp.Sample - {{ - public struct MyShader : IComputeShader - {{ - public ReadWriteBuffer buffer; - - public void Execute() - {{ - {text} - {{ - int a = 1 + 1; - }} - }} - }} - }}"; - - VerifyGeneratedDiagnostics(source, "CMPS0015"); - } - - [TestMethod] - public void FixedStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public int[] Data; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - fixed (void* p = buffer.Data) - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0016", "CMPS0032"); - } - - [TestMethod] - public void ForEachStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public int[] Data; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - foreach (int i in buffer.Data) - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0017"); - } - - [TestMethod] - public void LockStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - lock (buffer) - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0018"); - } - - [TestMethod] - public void QueryExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public int[] Data; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - _ = from x in buffer.Data select x; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0019"); - } - - [TestMethod] - public void RangeExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public int[] Data; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - _ = buffer.Data[1..]; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0020"); - } - - [TestMethod] - public void RecursivePattern() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public object Data; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - if (buffer.Data is int[] { Length: 50 } foo) - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0021"); - } - - [TestMethod] - public void RefType() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public ref T this[int x] => throw null; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - ref float x = ref buffer[0]; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0022"); - } - - [TestMethod] - public void RelationalPattern() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer - { - public int Data; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - if (buffer.Data is > 0 and < 10) - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0023"); - } - - [TestMethod] - public void SizeOfExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - _ = sizeof(float); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0024"); - } - - [TestMethod] - public void StackAllocArrayCreationExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - int* p = stackalloc int[10]; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0032", "CMPS0025"); - } - - [TestMethod] - public void ThrowExpressionOrStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - throw null; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0026"); - } - - [TestMethod] - public void TryStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - try - { - } - catch - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0027"); - } - - [TestMethod] - public void TupleType() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - (int, float) foo; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0028"); - } - - [TestMethod] - public void UsingDeclaration() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - using IDisposable foo = null - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0029", "CMPS0031"); - } - - [TestMethod] - public void UsingStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - using (IDisposable foo = null) - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0029", "CMPS0031"); - } - - [TestMethod] - public void YieldStatement() - { - string source = @" - using System.Collections.Generic; - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public static IEnumerable Fail() - { - yield return 3.14f; - } - - public void Execute() - { - Fail(); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0030"); - } - - [TestMethod] - public void InvalidObjectDeclaration() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - string bar; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0031"); - } - - [TestMethod] - public void PointerType() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - int* p; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0032"); - } - - [TestMethod] - public void FunctionPointer() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - delegate* f; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0033"); - } - - [TestMethod] - public void UnsafeStatement() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - unsafe - { - } - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0034"); - } - - [TestMethod] - public void UnsafeModifier_LocalFunction() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - static unsafe void Fail() { } - - Fail(); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0035"); - } - - [TestMethod] - public void UnsafeModifier_StaticMethod() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public static unsafe void Fail() { } - - public ReadWriteBuffer buffer; - - public void Execute() - { - Fail(); - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0035"); - } - - [TestMethod] - public void StringLiteralExpression() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - _ = ""Hello world""; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0036"); - } - - [TestMethod] - public void NonConstantMatrixSwizzledIndex() - { - string source = @" - using ComputeSharp; - using static ComputeSharp.MatrixIndex; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - public enum MatrixIndex - { - M11, - M12, - M13 - }, - public struct float4 { } - public struct float4x4 - { - public float4 this[MatrixIndex m0, MatrixIndex m1, MatrixIndex m2, MatrixIndex m3] => default; - } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - public void Execute() - { - float4x4 m = default; - MatrixIndex index = M12; - float4 = m[M11, index, M13, M11]; - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0042"); - } - - [TestMethod] - public void InvalidShaderStaticFieldType() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - private static string Pi = ""Hello""; - - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0043"); - } - - [TestMethod] - public void PropertyDeclaration_AutoProp() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - private static float Pi { get; } = 3.14f; - - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0045"); - } - - [TestMethod] - public void PropertyDeclaration_GetterBlock() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - private static float Pi - { - get => 3.14f; - } - - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0045"); - } - - [TestMethod] - public void StaticPropertyDeclaration() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - private static float Pi { get; set; } = 3.14f; - - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0045"); - } - - [TestMethod] - public void InstancePropertyDeclaration() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public ReadWriteBuffer buffer; - - private float Pi => 3.14f; - - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0045"); - } - - [TestMethod] - public void ShaderDispatchDataSizeExceeded() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public class ReadWriteBuffer { } - public struct double4x4 { } - public struct float4 { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; - public readonly double4x4 a; - public readonly double4x4 b; - public readonly int c; - public readonly float4 d; - - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0046"); - } - - [TestMethod] - public void MultipleShaderTypes() - { - string source = @" - using ComputeSharp; - - namespace ComputeSharp - { - public interface IComputeShader { } - public interface IPixelShader { } - } - - namespace MyFancyApp.Sample - { - public struct MyShader : IComputeShader, IPixelShader - { - public void Execute() - { - } - } - }"; - - VerifyGeneratedDiagnostics(source, "CMPS0047"); - } - - /// - /// Verifies the output of a source generator. - /// - /// The generator type to use. - /// The input source to process. - /// The target index to check in the resulting output. - /// The expected body to compare with the generated code. - private static void VerifyGeneratedDiagnostics(string source, params string[] diagnosticsIds) - where TGenerator : class, ISourceGenerator, new() - { - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); - - IEnumerable references = - from assembly in AppDomain.CurrentDomain.GetAssemblies() - where !assembly.IsDynamic - let reference = MetadataReference.CreateFromFile(assembly.Location) - select reference; - - CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); - - ISourceGenerator generator = new TGenerator(); - - CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator); - - driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray diagnostics); - - HashSet resultingIds = diagnostics.Select(diagnostic => diagnostic.Id).ToHashSet(); - - Assert.IsTrue(resultingIds.SetEquals(diagnosticsIds)); - } + VerifyGeneratedDiagnostics(source, "CMPS0001"); } -} \ No newline at end of file + + [TestMethod] + public void InvalidShaderFixedField() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public unsafe struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + public fixed int text[16]; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0001"); + } + + [TestMethod] + public void InvalidGroupSharedFieldType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public class GroupSharedAttribute : Attribute { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + [GroupShared] + public static string text; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0002"); + } + + [TestMethod] + public void InvalidGroupSharedFieldElementType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public class GroupSharedAttribute : Attribute { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + [GroupShared] + public static string[] text; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0003"); + } + + [TestMethod] + public void InvalidGroupSharedFieldDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public class GroupSharedAttribute : Attribute { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + [GroupShared] + public ReadWriteBuffer buffer; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0004"); + } + + [TestMethod] + public void MissingShaderResources() + { + string source = @" + using ComputeSharp; + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0005"); + } + + [TestMethod] + [DataRow(nameof(ThreadIds), "CMPS0006")] + [DataRow(nameof(GroupIds), "CMPS0007")] + [DataRow(nameof(GroupSize), "CMPS0008")] + [DataRow(nameof(GridIds), "CMPS0009")] + [DataRow(nameof(DispatchSize), "CMPS0044")] + public void InvalidDispatchInfoUsage_LocalFunction(string typeName, string diagnosticsId) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + public static class {typeName} {{ public static int X => 0; }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public void Execute() + {{ + static int Fail() => {typeName}.X; + + Fail(); + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, diagnosticsId); + } + + [TestMethod] + [DataRow(nameof(ThreadIds), "CMPS0006")] + [DataRow(nameof(GroupIds), "CMPS0007")] + [DataRow(nameof(GroupSize), "CMPS0008")] + [DataRow(nameof(GridIds), "CMPS0009")] + [DataRow(nameof(DispatchSize), "CMPS0044")] + public void InvalidDispatchInfoUsage_StaticMethod(string typeName, string diagnosticsId) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + public static class {typeName} {{ public static int X => 0; }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public static int Fail() => {typeName}.X; + + public void Execute() => Fail(); + }} + }}"; + + VerifyGeneratedDiagnostics(source, diagnosticsId); + } + + [TestMethod] + public void InvalidThreadIdsNormalizedUsage() + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + public static class ThreadIds {{ public static class Normalized {{ public static int X => 0; }} }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public static int Fail() => ThreadIds.Normalized.X; + + public void Execute() + {{ + buffer[0] = Fail(); + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, "CMPS0006"); + } + + [TestMethod] + public void InvalidObjectCreationExpression_Explicit() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + object o = new object(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0010", "CMPS0031"); + } + + [TestMethod] + public void InvalidObjectCreationExpression_Implicit() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + object o = new(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0010", "CMPS0031"); + } + + [TestMethod] + public void AnonymousObjectCreationExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + var o = new { Age = 12 }; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0011", "CMPS0031"); + } + + [TestMethod] + public void AsyncModifierOnMethodOrFunction_LocalFunction() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + static async void Fail() { } + + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0012"); + } + + [TestMethod] + public void AsyncModifierOnMethodOrFunction_StaticMethod() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public static async void Fail() { } + + public void Execute() => Fail(); + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0012"); + } + + [TestMethod] + public void AwaitExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public async void Execute() + { + await null; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0012", "CMPS0013"); + } + + [TestMethod] + [DataRow("checked")] + [DataRow("unchecked")] + public void CheckedExpression(string text) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public void Execute() + {{ + int a = {text}(1 + 1); + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, "CMPS0014"); + } + + [TestMethod] + [DataRow("checked")] + [DataRow("unchecked")] + public void CheckedStatement(string text) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public void Execute() + {{ + {text} + {{ + int a = 1 + 1; + }} + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, "CMPS0015"); + } + + [TestMethod] + public void FixedStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + fixed (void* p = buffer.Data) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0016", "CMPS0032"); + } + + [TestMethod] + public void ForEachStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + foreach (int i in buffer.Data) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0017"); + } + + [TestMethod] + public void LockStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + lock (buffer) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0018"); + } + + [TestMethod] + public void QueryExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = from x in buffer.Data select x; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0019"); + } + + [TestMethod] + public void RangeExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = buffer.Data[1..]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0020"); + } + + [TestMethod] + public void RecursivePattern() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public object Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + if (buffer.Data is int[] { Length: 50 } foo) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0021"); + } + + [TestMethod] + public void RefType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public ref T this[int x] => throw null; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + ref float x = ref buffer[0]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0022"); + } + + [TestMethod] + public void RelationalPattern() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + if (buffer.Data is > 0 and < 10) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0023"); + } + + [TestMethod] + public void SizeOfExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = sizeof(float); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0024"); + } + + [TestMethod] + public void StackAllocArrayCreationExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + int* p = stackalloc int[10]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0032", "CMPS0025"); + } + + [TestMethod] + public void ThrowExpressionOrStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + throw null; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0026"); + } + + [TestMethod] + public void TryStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + try + { + } + catch + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0027"); + } + + [TestMethod] + public void TupleType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + (int, float) foo; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0028"); + } + + [TestMethod] + public void UsingDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + using IDisposable foo = null + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0029", "CMPS0031"); + } + + [TestMethod] + public void UsingStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + using (IDisposable foo = null) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0029", "CMPS0031"); + } + + [TestMethod] + public void YieldStatement() + { + string source = @" + using System.Collections.Generic; + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public static IEnumerable Fail() + { + yield return 3.14f; + } + + public void Execute() + { + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0030"); + } + + [TestMethod] + public void InvalidObjectDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + string bar; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0031"); + } + + [TestMethod] + public void PointerType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + int* p; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0032"); + } + + [TestMethod] + public void FunctionPointer() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + delegate* f; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0033"); + } + + [TestMethod] + public void UnsafeStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + unsafe + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0034"); + } + + [TestMethod] + public void UnsafeModifier_LocalFunction() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + static unsafe void Fail() { } + + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0035"); + } + + [TestMethod] + public void UnsafeModifier_StaticMethod() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public static unsafe void Fail() { } + + public ReadWriteBuffer buffer; + + public void Execute() + { + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0035"); + } + + [TestMethod] + public void StringLiteralExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = ""Hello world""; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0036"); + } + + [TestMethod] + public void NonConstantMatrixSwizzledIndex() + { + string source = @" + using ComputeSharp; + using static ComputeSharp.MatrixIndex; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public enum MatrixIndex + { + M11, + M12, + M13 + }, + public struct float4 { } + public struct float4x4 + { + public float4 this[MatrixIndex m0, MatrixIndex m1, MatrixIndex m2, MatrixIndex m3] => default; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + float4x4 m = default; + MatrixIndex index = M12; + float4 = m[M11, index, M13, M11]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0042"); + } + + [TestMethod] + public void InvalidShaderStaticFieldType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + private static string Pi = ""Hello""; + + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0043"); + } + + [TestMethod] + public void PropertyDeclaration_AutoProp() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + private static float Pi { get; } = 3.14f; + + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0045"); + } + + [TestMethod] + public void PropertyDeclaration_GetterBlock() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + private static float Pi + { + get => 3.14f; + } + + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0045"); + } + + [TestMethod] + public void StaticPropertyDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + private static float Pi { get; set; } = 3.14f; + + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0045"); + } + + [TestMethod] + public void InstancePropertyDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + private float Pi => 3.14f; + + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0045"); + } + + [TestMethod] + public void ShaderDispatchDataSizeExceeded() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public struct double4x4 { } + public struct float4 { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + public readonly double4x4 a; + public readonly double4x4 b; + public readonly int c; + public readonly float4 d; + + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0046"); + } + + [TestMethod] + public void MultipleShaderTypes() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public interface IComputeShader { } + public interface IPixelShader { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader, IPixelShader + { + public void Execute() + { + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0047"); + } + + /// + /// Verifies the output of a source generator. + /// + /// The generator type to use. + /// The input source to process. + /// The target index to check in the resulting output. + /// The expected body to compare with the generated code. + private static void VerifyGeneratedDiagnostics(string source, params string[] diagnosticsIds) + where TGenerator : class, ISourceGenerator, new() + { + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); + + IEnumerable references = + from assembly in AppDomain.CurrentDomain.GetAssemblies() + where !assembly.IsDynamic + let reference = MetadataReference.CreateFromFile(assembly.Location) + select reference; + + CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + + ISourceGenerator generator = new TGenerator(); + + CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator); + + driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray diagnostics); + + HashSet resultingIds = diagnostics.Select(diagnostic => diagnostic.Id).ToHashSet(); + + Assert.IsTrue(resultingIds.SetEquals(diagnosticsIds)); + } +} diff --git a/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs b/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs index 54550319..9976dc66 100644 --- a/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs @@ -1,12 +1,11 @@ using System; -namespace ComputeSharp.Tests.Attributes +namespace ComputeSharp.Tests.Attributes; + +/// +/// An attribute to use with targeting all supported devices. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public sealed class AllDevicesAttribute : Attribute { - /// - /// An attribute to use with targeting all supported devices. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public sealed class AllDevicesAttribute : Attribute - { - } } diff --git a/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs b/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs index ff68a4aa..53dd4561 100644 --- a/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs @@ -5,114 +5,113 @@ using System.Reflection; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests.Attributes +namespace ComputeSharp.Tests.Attributes; + +/// +/// A custom implementation that also acts as a combinatorial +/// instance. It has dedicated paths for target devices and resource types, and arbitrary inputs for the test methods. +/// +/// +/// Use this attribute in combination with , , +/// or , not other existing MSTest attributes. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public sealed class CombinatorialTestMethodAttribute : TestMethodAttribute, ITestDataSource { - /// - /// A custom implementation that also acts as a combinatorial - /// instance. It has dedicated paths for target devices and resource types, and arbitrary inputs for the test methods. - /// - /// - /// Use this attribute in combination with , , - /// or , not other existing MSTest attributes. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public sealed class CombinatorialTestMethodAttribute : TestMethodAttribute, ITestDataSource + /// + IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) { - /// - IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) + Device[] devices; + + if (methodInfo.GetCustomAttribute() is not null) { - Device[] devices; + devices = Enum.GetValues(); + } + else if (methodInfo.GetCustomAttributes().ToArray() is { Length: > 0 } values) + { + devices = values.Select(static value => value.Device).ToArray(); + } + else + { + devices = Array.Empty(); + } - if (methodInfo.GetCustomAttribute() is not null) - { - devices = Enum.GetValues(); - } - else if (methodInfo.GetCustomAttributes().ToArray() is { Length: > 0 } values) - { - devices = values.Select(static value => value.Device).ToArray(); - } - else - { - devices = Array.Empty(); - } + Type[] resources = methodInfo.GetCustomAttributes().Select(static value => value.Type).ToArray(); + object[][] data = methodInfo.GetCustomAttributes().Select(static value => value.Data).ToArray(); - Type[] resources = methodInfo.GetCustomAttributes().Select(static value => value.Type).ToArray(); - object[][] data = methodInfo.GetCustomAttributes().Select(static value => value.Data).ToArray(); - - if (devices.Length > 0) + if (devices.Length > 0) + { + foreach (Device device in devices) { - foreach (Device device in devices) + if (resources.Length > 0) { - if (resources.Length > 0) - { - foreach (Type type in resources) - { - if (data.Length == 0) - { - yield return new object[] { device, type }; - } - else - { - foreach (object[] items in data) - { - yield return new object[] { device, type }.Concat(items).ToArray(); - } - } - } - } - else + foreach (Type type in resources) { if (data.Length == 0) { - yield return new object[] { device }; + yield return new object[] { device, type }; } else { foreach (object[] items in data) { - yield return new object[] { device }.Concat(items).ToArray(); + yield return new object[] { device, type }.Concat(items).ToArray(); } } } } - } - else if (resources.Length > 0) - { - foreach (Type type in resources) + else { if (data.Length == 0) { - yield return new object[] { type }; + yield return new object[] { device }; } else { foreach (object[] items in data) { - yield return new object[] { type }.Concat(items).ToArray(); + yield return new object[] { device }.Concat(items).ToArray(); } } } } - else + } + else if (resources.Length > 0) + { + foreach (Type type in resources) { if (data.Length == 0) { - yield return Array.Empty(); + yield return new object[] { type }; } else { foreach (object[] items in data) { - yield return items; + yield return new object[] { type }.Concat(items).ToArray(); } } } } - - /// - string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + else { - return $"{methodInfo.Name} ({string.Join(", ", data)})"; + if (data.Length == 0) + { + yield return Array.Empty(); + } + else + { + foreach (object[] items in data) + { + yield return items; + } + } } } + + /// + string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + { + return $"{methodInfo.Name} ({string.Join(", ", data)})"; + } } diff --git a/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs b/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs index fa99504e..806263ab 100644 --- a/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs @@ -1,21 +1,20 @@ using System; -namespace ComputeSharp.Tests.Attributes -{ - /// - /// An attribute to use with adding arbitrary input data. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] - public sealed class DataAttribute : Attribute - { - public DataAttribute(params object[] data) - { - Data = data; - } +namespace ComputeSharp.Tests.Attributes; - /// - /// Gets the input data for the current attribute. - /// - public object[] Data { get; } +/// +/// An attribute to use with adding arbitrary input data. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] +public sealed class DataAttribute : Attribute +{ + public DataAttribute(params object[] data) + { + Data = data; } + + /// + /// Gets the input data for the current attribute. + /// + public object[] Data { get; } } diff --git a/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs index ce13a6a1..aa100468 100644 --- a/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs @@ -1,22 +1,21 @@ using System; using ComputeSharp.Tests.Extensions; -namespace ComputeSharp.Tests.Attributes -{ - /// - /// An attribute to use with adding a specific input. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public sealed class DeviceAttribute : Attribute - { - public DeviceAttribute(Device device) - { - Device = device; - } +namespace ComputeSharp.Tests.Attributes; - /// - /// Gets the target to use. - /// - public Device Device { get; } +/// +/// An attribute to use with adding a specific input. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public sealed class DeviceAttribute : Attribute +{ + public DeviceAttribute(Device device) + { + Device = device; } + + /// + /// Gets the target to use. + /// + public Device Device { get; } } diff --git a/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs index afdff7fd..2cd0d476 100644 --- a/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs +++ b/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs @@ -1,18 +1,17 @@ using System; -namespace ComputeSharp.Tests.Attributes -{ - /// - /// An attribute to use with targeting a specific resource type. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] - public sealed class ResourceAttribute : Attribute - { - public ResourceAttribute(Type type) - { - Type = type; - } +namespace ComputeSharp.Tests.Attributes; - public Type Type { get; } +/// +/// An attribute to use with targeting a specific resource type. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] +public sealed class ResourceAttribute : Attribute +{ + public ResourceAttribute(Type type) + { + Type = type; } + + public Type Type { get; } } diff --git a/tests/ComputeSharp.Tests/AutoConstructorAttributeTests.cs b/tests/ComputeSharp.Tests/AutoConstructorAttributeTests.cs index a61384b9..15ce06c5 100644 --- a/tests/ComputeSharp.Tests/AutoConstructorAttributeTests.cs +++ b/tests/ComputeSharp.Tests/AutoConstructorAttributeTests.cs @@ -1,30 +1,29 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("AutoConstructorAttribute")] +public unsafe partial class AutoConstructorAttributeTests { - [TestClass] - [TestCategory("AutoConstructorAttribute")] - public unsafe partial class AutoConstructorAttributeTests + [AutoConstructor] + public partial struct StructWithFixedField { - [AutoConstructor] - public partial struct StructWithFixedField - { - public int a; - public float b; - public byte* c; - public fixed byte d[16]; - } + public int a; + public float b; + public byte* c; + public fixed byte d[16]; + } - [TestMethod] - public void GenerateConstructorWithInheritedUnsafeContextAndIgnoredFixedField() - { - byte c = 123; + [TestMethod] + public void GenerateConstructorWithInheritedUnsafeContextAndIgnoredFixedField() + { + byte c = 123; - StructWithFixedField instance = new(42, 3.14f, &c); + StructWithFixedField instance = new(42, 3.14f, &c); - Assert.AreEqual(instance.a, 42); - Assert.AreEqual(instance.b, 3.14f); - Assert.IsTrue(instance.c == &c); - } + Assert.AreEqual(instance.a, 42); + Assert.AreEqual(instance.b, 3.14f); + Assert.IsTrue(instance.c == &c); } } diff --git a/tests/ComputeSharp.Tests/BufferTests.cs b/tests/ComputeSharp.Tests/BufferTests.cs index bebf29b8..ebdc8dfe 100644 --- a/tests/ComputeSharp.Tests/BufferTests.cs +++ b/tests/ComputeSharp.Tests/BufferTests.cs @@ -1,310 +1,309 @@ -using System; +using System; using System.Linq; using ComputeSharp.Resources; using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Buffer")] +public partial class BufferTests { - [TestClass] - [TestCategory("Buffer")] - public partial class BufferTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(AllocationMode.Default)] + [Data(AllocationMode.Clear)] + public void Allocate_Uninitialized_Ok(Device device, Type bufferType, AllocationMode allocationMode) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(AllocationMode.Default)] - [Data(AllocationMode.Clear)] - public void Allocate_Uninitialized_Ok(Device device, Type bufferType, AllocationMode allocationMode) + using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128, allocationMode); + + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Length, 128); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); + + if (allocationMode == AllocationMode.Clear) { - using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128, allocationMode); - - Assert.IsNotNull(buffer); - Assert.AreEqual(buffer.Length, 128); - Assert.AreSame(buffer.GraphicsDevice, device.Get()); - - if (allocationMode == AllocationMode.Clear) + foreach (float x in buffer.ToArray()) { - foreach (float x in buffer.ToArray()) - { - Assert.AreEqual(x, 0f); - } - } - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(-247824)] - [Data(-1)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int length) - { - using Buffer buffer = device.Get().AllocateBuffer(bufferType, length); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - public void Allocate_FromArray(Device device, Type bufferType) - { - float[] data = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray(); - - using Buffer buffer = device.Get().AllocateBuffer(bufferType, data); - - Assert.IsNotNull(buffer); - Assert.AreEqual(buffer.Length, 128); - Assert.AreSame(buffer.GraphicsDevice, device.Get()); - - float[] result = buffer.ToArray(); - - Assert.IsNotNull(result); - Assert.AreEqual(data.Length, result.Length); - Assert.IsTrue(data.SequenceEqual(result)); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(typeof(ConstantBuffer<>))] - [Data(typeof(ReadOnlyBuffer<>))] - [Data(typeof(ReadWriteBuffer<>))] - public void Allocate_FromBuffer(Device device, Type sourceType, Type destinationType) - { - float[] data = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray(); - - using Buffer source = device.Get().AllocateBuffer(sourceType, data); - using Buffer destination = device.Get().AllocateBuffer(destinationType, source); - - Assert.IsNotNull(destination); - Assert.AreEqual(destination.Length, 128); - Assert.AreSame(destination.GraphicsDevice, device.Get()); - - float[] result = destination.ToArray(); - - Assert.IsNotNull(result); - Assert.AreEqual(data.Length, result.Length); - Assert.IsTrue(data.SequenceEqual(result)); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [ExpectedException(typeof(ObjectDisposedException))] - public void UsageAfterDispose(Device device, Type bufferType) - { - using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128); - - buffer.Dispose(); - - _ = buffer.ToArray(); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - public void DisposeAfterDevice(Device device, Type bufferType) - { - GraphicsDevice? gpu = device switch - { - Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), - Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => throw new ArgumentException(nameof(device)) - }; - - if (gpu is null) - { - Assert.Inconclusive(); - - return; - } - - Buffer buffer = gpu.AllocateBuffer(bufferType, 128); - - gpu.Dispose(); - buffer.Dispose(); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(0, 4096)] - [Data(128, 512)] - [Data(2048, 2048)] - public void CopyTo_RangeToArray_Ok(Device device, Type bufferType, int offset, int count) - { - float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - - using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - - float[] result = buffer.ToArray(offset, count); - - Assert.IsNotNull(result); - Assert.AreEqual(result.Length, count); - Assert.IsTrue(array.AsSpan(offset, count).SequenceEqual(result)); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(-1, 128)] - [Data(8192, 128)] - [Data(512, 4096)] - [Data(512, -128)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void CopyTo_RangeToArray_Fail(Device device, Type bufferType, int offset, int count) - { - float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - - using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - - _ = buffer.ToArray(offset, count); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(0, 0, 4096)] - [Data(512, 0, 2048)] - [Data(0, 512, 2048)] - [Data(127, 1024, 587)] - public void CopyTo_RangeToVoid_Ok(Device device, Type bufferType, int destinationOffset, int bufferOffset, int count) - { - float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - - using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - - float[] result = new float[4096]; - - buffer.CopyTo(result, destinationOffset, bufferOffset, count); - - Assert.IsTrue(array.AsSpan(bufferOffset, count).SequenceEqual(result.AsSpan(destinationOffset, count))); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - [Data(0, 0, 8196)] - [Data(-12, 0, 1024)] - [Data(0, -56, 1024)] - [Data(512, 0, 4096)] - [Data(12, 1024, 3600)] - [Data(12, 1024, -2096)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void CopyTo_RangeToVoid_Fail(Device device, Type bufferType, int destinationOffset, int bufferOffset, int count) - { - float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - - using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - - float[] result = new float[4096]; - - buffer.CopyTo(result, destinationOffset, bufferOffset, count); - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ConstantBuffer(Device device) - { - int[] data = Enumerable.Range(0, 1024).ToArray(); - - using ConstantBuffer source = device.Get().AllocateConstantBuffer(data); - using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); - - device.Get().For(source.Length, new ConstantBufferKernel(source, destination)); - - int[] result = destination.ToArray(); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ConstantBufferKernel : IComputeShader - { - public readonly ConstantBuffer source; - public readonly ReadWriteBuffer destination; - - public void Execute() - { - destination[ThreadIds.X] = source[ThreadIds.X]; - } - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ReadOnlyBuffer(Device device) - { - int[] data = Enumerable.Range(0, 1024).ToArray(); - - using ReadOnlyBuffer source = device.Get().AllocateReadOnlyBuffer(data); - using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); - - device.Get().For(source.Length, new ReadOnlyBufferKernel(source, destination)); - - int[] result = destination.ToArray(); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ReadOnlyBufferKernel : IComputeShader - { - public readonly ReadOnlyBuffer source; - public readonly ReadWriteBuffer destination; - - public void Execute() - { - destination[ThreadIds.X] = source[ThreadIds.X]; - } - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ReadWriteBuffer(Device device) - { - int[] data = Enumerable.Range(0, 1024).ToArray(); - - using ReadWriteBuffer source = device.Get().AllocateReadWriteBuffer(data); - using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); - - device.Get().For(source.Length, new ReadWriteBufferKernel(source, destination)); - - int[] result = destination.ToArray(); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ReadWriteBufferKernel : IComputeShader - { - public readonly ReadWriteBuffer source; - public readonly ReadWriteBuffer destination; - - public void Execute() - { - destination[ThreadIds.X] = source[ThreadIds.X]; + Assert.AreEqual(x, 0f); } } } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(-247824)] + [Data(-1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int length) + { + using Buffer buffer = device.Get().AllocateBuffer(bufferType, length); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + public void Allocate_FromArray(Device device, Type bufferType) + { + float[] data = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray(); + + using Buffer buffer = device.Get().AllocateBuffer(bufferType, data); + + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Length, 128); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); + + float[] result = buffer.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result)); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(typeof(ConstantBuffer<>))] + [Data(typeof(ReadOnlyBuffer<>))] + [Data(typeof(ReadWriteBuffer<>))] + public void Allocate_FromBuffer(Device device, Type sourceType, Type destinationType) + { + float[] data = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray(); + + using Buffer source = device.Get().AllocateBuffer(sourceType, data); + using Buffer destination = device.Get().AllocateBuffer(destinationType, source); + + Assert.IsNotNull(destination); + Assert.AreEqual(destination.Length, 128); + Assert.AreSame(destination.GraphicsDevice, device.Get()); + + float[] result = destination.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result)); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type bufferType) + { + using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128); + + buffer.Dispose(); + + _ = buffer.ToArray(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + public void DisposeAfterDevice(Device device, Type bufferType) + { + GraphicsDevice? gpu = device switch + { + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), + _ => throw new ArgumentException(nameof(device)) + }; + + if (gpu is null) + { + Assert.Inconclusive(); + + return; + } + + Buffer buffer = gpu.AllocateBuffer(bufferType, 128); + + gpu.Dispose(); + buffer.Dispose(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(0, 4096)] + [Data(128, 512)] + [Data(2048, 2048)] + public void CopyTo_RangeToArray_Ok(Device device, Type bufferType, int offset, int count) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); + + float[] result = buffer.ToArray(offset, count); + + Assert.IsNotNull(result); + Assert.AreEqual(result.Length, count); + Assert.IsTrue(array.AsSpan(offset, count).SequenceEqual(result)); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(-1, 128)] + [Data(8192, 128)] + [Data(512, 4096)] + [Data(512, -128)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void CopyTo_RangeToArray_Fail(Device device, Type bufferType, int offset, int count) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); + + _ = buffer.ToArray(offset, count); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(0, 0, 4096)] + [Data(512, 0, 2048)] + [Data(0, 512, 2048)] + [Data(127, 1024, 587)] + public void CopyTo_RangeToVoid_Ok(Device device, Type bufferType, int destinationOffset, int bufferOffset, int count) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); + + float[] result = new float[4096]; + + buffer.CopyTo(result, destinationOffset, bufferOffset, count); + + Assert.IsTrue(array.AsSpan(bufferOffset, count).SequenceEqual(result.AsSpan(destinationOffset, count))); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(0, 0, 8196)] + [Data(-12, 0, 1024)] + [Data(0, -56, 1024)] + [Data(512, 0, 4096)] + [Data(12, 1024, 3600)] + [Data(12, 1024, -2096)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void CopyTo_RangeToVoid_Fail(Device device, Type bufferType, int destinationOffset, int bufferOffset, int count) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); + + float[] result = new float[4096]; + + buffer.CopyTo(result, destinationOffset, bufferOffset, count); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ConstantBuffer(Device device) + { + int[] data = Enumerable.Range(0, 1024).ToArray(); + + using ConstantBuffer source = device.Get().AllocateConstantBuffer(data); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Length, new ConstantBufferKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ConstantBufferKernel : IComputeShader + { + public readonly ConstantBuffer source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.X] = source[ThreadIds.X]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadOnlyBuffer(Device device) + { + int[] data = Enumerable.Range(0, 1024).ToArray(); + + using ReadOnlyBuffer source = device.Get().AllocateReadOnlyBuffer(data); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Length, new ReadOnlyBufferKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadOnlyBufferKernel : IComputeShader + { + public readonly ReadOnlyBuffer source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.X] = source[ThreadIds.X]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadWriteBuffer(Device device) + { + int[] data = Enumerable.Range(0, 1024).ToArray(); + + using ReadWriteBuffer source = device.Get().AllocateReadWriteBuffer(data); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Length, new ReadWriteBufferKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadWriteBufferKernel : IComputeShader + { + public readonly ReadWriteBuffer source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.X] = source[ThreadIds.X]; + } + } } diff --git a/tests/ComputeSharp.Tests/DispatchTests.cs b/tests/ComputeSharp.Tests/DispatchTests.cs index 70cfcabb..df57f287 100644 --- a/tests/ComputeSharp.Tests/DispatchTests.cs +++ b/tests/ComputeSharp.Tests/DispatchTests.cs @@ -1,302 +1,301 @@ -using System; +using System; using ComputeSharp.Interop; using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Dispatch")] +public partial class DispatchTests { - [TestClass] - [TestCategory("Dispatch")] - public partial class DispatchTests + [CombinatorialTestMethod] + [AllDevices] + public unsafe void Verify_ThreadIds(Device device) { - [CombinatorialTestMethod] - [AllDevices] - public unsafe void Verify_ThreadIds(Device device) + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, new ThreadIdsShader(buffer)); + + int4[,,] data = buffer.ToArray(); + int* value = stackalloc int[4]; + + for (int z = 0; z < 50; z++) { - using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); - - device.Get().For(buffer.Width, buffer.Height, buffer.Depth, new ThreadIdsShader(buffer)); - - int4[,,] data = buffer.ToArray(); - int* value = stackalloc int[4]; - - for (int z = 0; z < 50; z++) + for (int x = 0; x < 50; x++) { - for (int x = 0; x < 50; x++) + for (int y = 0; y < 50; y++) { - for (int y = 0; y < 50; y++) - { - *(int4*)value = data[z, y, x]; + *(int4*)value = data[z, y, x]; - Assert.AreEqual(x, value[0]); - Assert.AreEqual(y, value[1]); - Assert.AreEqual(z, value[2]); - } + Assert.AreEqual(x, value[0]); + Assert.AreEqual(y, value[1]); + Assert.AreEqual(z, value[2]); } } } - - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 8, 8)] - [Data(8, 0, 8)] - [Data(8, 8, 0)] - [Data(8, -3, 16)] - [Data(-1, -1, -1)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Verify_ThreadIds_OutOfRange(Device device, int x, int y, int z) + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 8, 8)] + [Data(8, 0, 8)] + [Data(8, 8, 0)] + [Data(8, -3, 16)] + [Data(-1, -1, -1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Verify_ThreadIds_OutOfRange(Device device, int x, int y, int z) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(x, y, z, new ThreadIdsShader(buffer)); + + Assert.Fail(); + } + + [AutoConstructor] + internal readonly partial struct ThreadIdsShader : IComputeShader + { + public readonly ReadWriteTexture3D buffer; + + public void Execute() { - using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + buffer[ThreadIds.XYZ].XYZ = ThreadIds.XYZ; + } + } - device.Get().For(x, y, z, new ThreadIdsShader(buffer)); + [CombinatorialTestMethod] + [AllDevices] + public unsafe void Verify_ThreadIdsNormalized(Device device) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(10, 20, 30); - Assert.Fail(); - } + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, new ThreadIdsNormalizedShader(buffer)); - [AutoConstructor] - internal readonly partial struct ThreadIdsShader : IComputeShader - { - public readonly ReadWriteTexture3D buffer; - - public void Execute() - { - buffer[ThreadIds.XYZ].XYZ = ThreadIds.XYZ; - } - } + float4[,,] data = buffer.ToArray(); + float* value = stackalloc float[4]; - [CombinatorialTestMethod] - [AllDevices] - public unsafe void Verify_ThreadIdsNormalized(Device device) + for (int z = 0; z < 30; z++) { - using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(10, 20, 30); - - device.Get().For(buffer.Width, buffer.Height, buffer.Depth, new ThreadIdsNormalizedShader(buffer)); - - float4[,,] data = buffer.ToArray(); - float* value = stackalloc float[4]; - - for (int z = 0; z < 30; z++) + for (int x = 0; x < 10; x++) { - for (int x = 0; x < 10; x++) + for (int y = 0; y < 20; y++) { - for (int y = 0; y < 20; y++) - { - *(float4*)value = data[z, y, x]; - - Assert.AreEqual(x / (float)buffer.Width, value[0], 0.000001f); - Assert.AreEqual(y / (float)buffer.Height, value[1], 0.000001f); - Assert.AreEqual(z / (float)buffer.Depth, value[2], 0.000001f); - Assert.AreEqual(x / (float)buffer.Width, value[3], 0.000001f); - } + *(float4*)value = data[z, y, x]; + + Assert.AreEqual(x / (float)buffer.Width, value[0], 0.000001f); + Assert.AreEqual(y / (float)buffer.Height, value[1], 0.000001f); + Assert.AreEqual(z / (float)buffer.Depth, value[2], 0.000001f); + Assert.AreEqual(x / (float)buffer.Width, value[3], 0.000001f); } } } + } + + [AutoConstructor] + internal readonly partial struct ThreadIdsNormalizedShader : IComputeShader + { + public readonly ReadWriteTexture3D buffer; - [AutoConstructor] - internal readonly partial struct ThreadIdsNormalizedShader : IComputeShader + public void Execute() { - public readonly ReadWriteTexture3D buffer; - - public void Execute() - { - buffer[ThreadIds.XYZ].XYZ = ThreadIds.Normalized.XYZ; - buffer[ThreadIds.XYZ].XY = ThreadIds.Normalized.XY; - buffer[ThreadIds.XYZ].W = ThreadIds.Normalized.X; - } + buffer[ThreadIds.XYZ].XYZ = ThreadIds.Normalized.XYZ; + buffer[ThreadIds.XYZ].XY = ThreadIds.Normalized.XY; + buffer[ThreadIds.XYZ].W = ThreadIds.Normalized.X; } + } - [CombinatorialTestMethod] - [AllDevices] - public unsafe void Verify_GroupIds(Device device) - { - using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + [CombinatorialTestMethod] + [AllDevices] + public unsafe void Verify_GroupIds(Device device) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); - device.Get().For(buffer.Width, buffer.Height, buffer.Depth, 4, 4, 4, new GroupIdsShader(buffer)); + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, 4, 4, 4, new GroupIdsShader(buffer)); - int4[,,] data = buffer.ToArray(); - int* value = stackalloc int[4]; + int4[,,] data = buffer.ToArray(); + int* value = stackalloc int[4]; - for (int z = 0; z < 50; z++) + for (int z = 0; z < 50; z++) + { + for (int x = 0; x < 50; x++) { - for (int x = 0; x < 50; x++) + for (int y = 0; y < 50; y++) { - for (int y = 0; y < 50; y++) - { - *(int4*)value = data[z, y, x]; - - Assert.AreEqual(x % 4, value[0]); - Assert.AreEqual(y % 4, value[1]); - Assert.AreEqual(z % 4, value[2]); - Assert.AreEqual(value[2] * 4 * 4 + value[1] * 4 + value[0], value[3]); - } + *(int4*)value = data[z, y, x]; + + Assert.AreEqual(x % 4, value[0]); + Assert.AreEqual(y % 4, value[1]); + Assert.AreEqual(z % 4, value[2]); + Assert.AreEqual(value[2] * 4 * 4 + value[1] * 4 + value[0], value[3]); } } } - - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 8, 8)] - [Data(8, 0, 8)] - [Data(8, 8, 0)] - [Data(1025, 8, 8)] - [Data(8, 2000, 8)] - [Data(8, 8, 70)] - [Data(8, -1, 8)] - [Data(8, 15, 16)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Verify_GroupIds_OutOfRange(Device device, int x, int y, int z) + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 8, 8)] + [Data(8, 0, 8)] + [Data(8, 8, 0)] + [Data(1025, 8, 8)] + [Data(8, 2000, 8)] + [Data(8, 8, 70)] + [Data(8, -1, 8)] + [Data(8, 15, 16)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Verify_GroupIds_OutOfRange(Device device, int x, int y, int z) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, x, y, z, new GroupIdsShader(buffer)); + + Assert.Fail(); + } + + [AutoConstructor] + internal readonly partial struct GroupIdsShader : IComputeShader + { + public readonly ReadWriteTexture3D buffer; + + public void Execute() { - using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); - - device.Get().For(buffer.Width, buffer.Height, buffer.Depth, x, y, z, new GroupIdsShader(buffer)); - - Assert.Fail(); + buffer[ThreadIds.XYZ].XYZ = GroupIds.XYZ; + buffer[ThreadIds.XYZ].W = GroupIds.Index; } - - [AutoConstructor] - internal readonly partial struct GroupIdsShader : IComputeShader + } + + [CombinatorialTestMethod] + [AllDevices] + public void Verify_GroupSize(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(32); + + device.Get().For(1, 1, 1, 4, 15, 7, new GroupSizeShader(buffer)); + + int[] data = buffer.ToArray(); + + Assert.AreEqual(4, data[0]); + Assert.AreEqual(15, data[1]); + Assert.AreEqual(7, data[2]); + Assert.AreEqual(4 * 15 * 7, data[3]); + Assert.AreEqual(4 + 15, data[4]); + Assert.AreEqual(4 + 15 + 7, data[5]); + } + + [AutoConstructor] + internal readonly partial struct GroupSizeShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + public void Execute() { - public readonly ReadWriteTexture3D buffer; - - public void Execute() - { - buffer[ThreadIds.XYZ].XYZ = GroupIds.XYZ; - buffer[ThreadIds.XYZ].W = GroupIds.Index; - } + buffer[0] = GroupSize.X; + buffer[1] = GroupSize.Y; + buffer[2] = GroupSize.Z; + buffer[3] = GroupSize.Count; + buffer[4] = (int)Hlsl.Dot(GroupSize.XY, float2.One); + buffer[5] = (int)Hlsl.Dot(GroupSize.XYZ, float3.One); } + } - [CombinatorialTestMethod] - [AllDevices] - public void Verify_GroupSize(Device device) - { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(32); - - device.Get().For(1, 1, 1, 4, 15, 7, new GroupSizeShader(buffer)); - - int[] data = buffer.ToArray(); - - Assert.AreEqual(4, data[0]); - Assert.AreEqual(15, data[1]); - Assert.AreEqual(7, data[2]); - Assert.AreEqual(4 * 15 * 7, data[3]); - Assert.AreEqual(4 + 15, data[4]); - Assert.AreEqual(4 + 15 + 7, data[5]); - } + [CombinatorialTestMethod] + [AllDevices] + public void Verify_GridIds(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(256); - [AutoConstructor] - internal readonly partial struct GroupSizeShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; + device.Get().For(256, 1, 1, 32, 1, 1, new GridIdsShader(buffer)); - public void Execute() - { - buffer[0] = GroupSize.X; - buffer[1] = GroupSize.Y; - buffer[2] = GroupSize.Z; - buffer[3] = GroupSize.Count; - buffer[4] = (int)Hlsl.Dot(GroupSize.XY, float2.One); - buffer[5] = (int)Hlsl.Dot(GroupSize.XYZ, float3.One); - } - } + int[] data = buffer.ToArray(); - [CombinatorialTestMethod] - [AllDevices] - public void Verify_GridIds(Device device) + for (int i = 0; i < data.Length; i++) { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(256); + Assert.AreEqual(data[i], i / 32); + } + } - device.Get().For(256, 1, 1, 32, 1, 1, new GridIdsShader(buffer)); + [AutoConstructor] + internal readonly partial struct GridIdsShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; - int[] data = buffer.ToArray(); - - for (int i = 0; i < data.Length; i++) - { - Assert.AreEqual(data[i], i / 32); - } + public void Execute() + { + buffer[ThreadIds.X] = GridIds.X; } + } - [AutoConstructor] - internal readonly partial struct GridIdsShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; - - public void Execute() - { - buffer[ThreadIds.X] = GridIds.X; - } - } + [CombinatorialTestMethod] + [AllDevices] + public void Verify_DispatchSize(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(6); - [CombinatorialTestMethod] - [AllDevices] - public void Verify_DispatchSize(Device device) - { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(6); + device.Get().For(11, 22, 3, new DispatchSizeShader(buffer)); - device.Get().For(11, 22, 3, new DispatchSizeShader(buffer)); + ReflectionServices.GetShaderInfo(out var info); - ReflectionServices.GetShaderInfo(out var info); + int[] data = buffer.ToArray(); - int[] data = buffer.ToArray(); + Assert.AreEqual(data[0], 11 * 22 * 3); + Assert.AreEqual(data[1], 11); + Assert.AreEqual(data[2], 22); + Assert.AreEqual(data[3], 3); + Assert.AreEqual(data[4], 11 + 22); + Assert.AreEqual(data[5], 11 + 22 + 3); + } - Assert.AreEqual(data[0], 11 * 22 * 3); - Assert.AreEqual(data[1], 11); - Assert.AreEqual(data[2], 22); - Assert.AreEqual(data[3], 3); - Assert.AreEqual(data[4], 11 + 22); - Assert.AreEqual(data[5], 11 + 22 + 3); - } + [AutoConstructor] + internal readonly partial struct DispatchSizeShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; - [AutoConstructor] - internal readonly partial struct DispatchSizeShader : IComputeShader + public void Execute() { - public readonly ReadWriteBuffer buffer; - - public void Execute() - { - buffer[0] = DispatchSize.Count; - buffer[1] = DispatchSize.X; - buffer[2] = DispatchSize.Y; - buffer[3] = DispatchSize.Z; - buffer[4] = (int)Hlsl.Dot(DispatchSize.XY, float2.One); - buffer[5] = (int)Hlsl.Dot(DispatchSize.XYZ, float3.One); - } + buffer[0] = DispatchSize.Count; + buffer[1] = DispatchSize.X; + buffer[2] = DispatchSize.Y; + buffer[3] = DispatchSize.Z; + buffer[4] = (int)Hlsl.Dot(DispatchSize.XY, float2.One); + buffer[5] = (int)Hlsl.Dot(DispatchSize.XYZ, float3.One); } + } - [CombinatorialTestMethod] - [AllDevices] - public void Verify_DispatchAsPixelShader(Device device) - { - using ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(256, 256); + [CombinatorialTestMethod] + [AllDevices] + public void Verify_DispatchAsPixelShader(Device device) + { + using ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(256, 256); - device.Get().ForEach(texture); + device.Get().ForEach(texture); - Rgba32[,] data = texture.ToArray(); + Rgba32[,] data = texture.ToArray(); - for (int y = 0; y < texture.Height; y++) + for (int y = 0; y < texture.Height; y++) + { + for (int x = 0; x < texture.Width; x++) { - for (int x = 0; x < texture.Width; x++) - { - Rgba32 pixel = data[y, x]; + Rgba32 pixel = data[y, x]; - Assert.AreEqual((float)pixel.R / 255, (float)x / texture.Width, 0.1f); - Assert.AreEqual((float)pixel.G / 255, (float)y / texture.Height, 0.1f); - Assert.AreEqual(pixel.B, 255); - Assert.AreEqual(pixel.A, 255); - } + Assert.AreEqual((float)pixel.R / 255, (float)x / texture.Width, 0.1f); + Assert.AreEqual((float)pixel.G / 255, (float)y / texture.Height, 0.1f); + Assert.AreEqual(pixel.B, 255); + Assert.AreEqual(pixel.A, 255); } } + } - internal readonly partial struct DispatchPixelShader : IPixelShader + internal readonly partial struct DispatchPixelShader : IPixelShader + { + public float4 Execute() { - public float4 Execute() - { - return new( - (float)ThreadIds.X / DispatchSize.X, - (float)ThreadIds.Y / DispatchSize.Y, - 1, - 1); - } + return new( + (float)ThreadIds.X / DispatchSize.X, + (float)ThreadIds.Y / DispatchSize.Y, + 1, + 1); } } } diff --git a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs index 0b4d44c5..3a521eb2 100644 --- a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs @@ -2,79 +2,78 @@ using Microsoft.Toolkit.Diagnostics; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests.Extensions +namespace ComputeSharp.Tests.Extensions; + +/// +/// A helper class for testing APIs. +/// +public static class DeviceExtensions { /// - /// A helper class for testing APIs. + /// The instance for the default discrete device. /// - public static class DeviceExtensions + private static readonly GraphicsDevice? DiscreteDevice; + + /// + /// The instance for the WARP device. + /// + private static readonly GraphicsDevice WarpDevice; + + /// + /// Initializes and . + /// + static DeviceExtensions() { - /// - /// The instance for the default discrete device. - /// - private static readonly GraphicsDevice? DiscreteDevice; + GraphicsDevice defaultDevice = Gpu.Default; - /// - /// The instance for the WARP device. - /// - private static readonly GraphicsDevice WarpDevice; - - /// - /// Initializes and . - /// - static DeviceExtensions() + if (defaultDevice.IsHardwareAccelerated) { - GraphicsDevice defaultDevice = Gpu.Default; - - if (defaultDevice.IsHardwareAccelerated) - { - DiscreteDevice = defaultDevice; - WarpDevice = Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(); - } - else - { - DiscreteDevice = null; - WarpDevice = defaultDevice; - } + DiscreteDevice = defaultDevice; + WarpDevice = Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(); } - - /// - /// Gets a instance matching a specified type. - /// - /// The device to retrieve. - /// The device of the requested type. - /// Thrown when the requested device is not present. - public static GraphicsDevice Get(this Device type) + else { - GraphicsDevice? device = type switch - { - Device.Discrete => DiscreteDevice, - Device.Warp => WarpDevice, - _ => ThrowHelper.ThrowArgumentException("Invalid device") - }; - - if (device is null) - { - Assert.Inconclusive(); - } - - return device!; + DiscreteDevice = null; + WarpDevice = defaultDevice; } } /// - /// Indicates a specific compute device. + /// Gets a instance matching a specified type. /// - public enum Device + /// The device to retrieve. + /// The device of the requested type. + /// Thrown when the requested device is not present. + public static GraphicsDevice Get(this Device type) { - /// - /// A discrete device. - /// - Discrete, + GraphicsDevice? device = type switch + { + Device.Discrete => DiscreteDevice, + Device.Warp => WarpDevice, + _ => ThrowHelper.ThrowArgumentException("Invalid device") + }; - /// - /// A WARP device (software fallback). - /// - Warp + if (device is null) + { + Assert.Inconclusive(); + } + + return device!; } } + +/// +/// Indicates a specific compute device. +/// +public enum Device +{ + /// + /// A discrete device. + /// + Discrete, + + /// + /// A WARP device (software fallback). + /// + Warp +} diff --git a/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs index b9736eb0..bd2c2c39 100644 --- a/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs @@ -5,299 +5,298 @@ using ComputeSharp.Resources; #pragma warning disable CS0618 -namespace ComputeSharp.Tests.Extensions +namespace ComputeSharp.Tests.Extensions; + +/// +/// A helper class for testing resource types. +/// +public static class GraphicsDeviceExtensions { /// - /// A helper class for testing resource types. + /// Allocates a new instance of the specified type. /// - public static class GraphicsDeviceExtensions + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The length of the buffer to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged { - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the buffer. - /// The target instance to allocate the buffer for. - /// The type of buffer to allocate. - /// The length of the buffer to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged + return type switch { - return type switch - { - _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(length, allocationMode), - _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(length, allocationMode), - _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(length, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(length, allocationMode), + _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(length, allocationMode), + _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(length, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The target instance to allocate the texture for. - /// The type of texture to allocate. - /// The width of the texture to create. - /// The height of the texture to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture2D<>) => device.AllocateReadOnlyTexture2D(width, height, allocationMode), - _ when type == typeof(ReadWriteTexture2D<>) => device.AllocateReadWriteTexture2D(width, height, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture2D<>) => device.AllocateReadOnlyTexture2D(width, height, allocationMode), + _ when type == typeof(ReadWriteTexture2D<>) => device.AllocateReadWriteTexture2D(width, height, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The type of pixels used on the GPU side. - /// The target instance to allocate the texture for. - /// The type of texture to allocate. - /// The width of the texture to create. - /// The height of the texture to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged, IUnorm - where TPixel : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The type of pixels used on the GPU side. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture2D<,>) => device.AllocateReadOnlyTexture2D(width, height, allocationMode), - _ when type == typeof(ReadWriteTexture2D<,>) => device.AllocateReadWriteTexture2D(width, height, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture2D<,>) => device.AllocateReadOnlyTexture2D(width, height, allocationMode), + _ when type == typeof(ReadWriteTexture2D<,>) => device.AllocateReadWriteTexture2D(width, height, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The target instance to allocate the texture for. - /// The type of texture to allocate. - /// The width of the texture to create. - /// The height of the texture to create. - /// The depth of the texture to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(width, height, depth, allocationMode), - _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(width, height, depth, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(width, height, depth, allocationMode), + _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(width, height, depth, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The type of pixels used on the GPU side. - /// The target instance to allocate the texture for. - /// The type of texture to allocate. - /// The width of the texture to create. - /// The height of the texture to create. - /// The depth of the texture to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged, IUnorm - where TPixel : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The type of pixels used on the GPU side. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture3D<,>) => device.AllocateReadOnlyTexture3D(width, height, depth, allocationMode), - _ when type == typeof(ReadWriteTexture3D<,>) => device.AllocateReadWriteTexture3D(width, height, depth, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture3D<,>) => device.AllocateReadOnlyTexture3D(width, height, depth, allocationMode), + _ when type == typeof(ReadWriteTexture3D<,>) => device.AllocateReadWriteTexture3D(width, height, depth, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the buffer. - /// The target instance to allocate the buffer for. - /// The type of buffer to allocate. - /// The length of the buffer to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static TransferBuffer AllocateTransferBuffer(this GraphicsDevice device, Type type, int length, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The length of the buffer to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static TransferBuffer AllocateTransferBuffer(this GraphicsDevice device, Type type, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(UploadBuffer<>) => device.AllocateUploadBuffer(length, allocationMode), - _ when type == typeof(ReadBackBuffer<>) => device.AllocateReadBackBuffer(length, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(UploadBuffer<>) => device.AllocateUploadBuffer(length, allocationMode), + _ when type == typeof(ReadBackBuffer<>) => device.AllocateReadBackBuffer(length, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the buffer. - /// The target instance to allocate the buffer for. - /// The type of buffer to allocate. - /// The width of the texture to create. - /// The height of the texture to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static TransferTexture2D AllocateTransferTexture2D(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static TransferTexture2D AllocateTransferTexture2D(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(UploadTexture2D<>) => device.AllocateUploadTexture2D(width, height, allocationMode), - _ when type == typeof(ReadBackTexture2D<>) => device.AllocateReadBackTexture2D(width, height, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(UploadTexture2D<>) => device.AllocateUploadTexture2D(width, height, allocationMode), + _ when type == typeof(ReadBackTexture2D<>) => device.AllocateReadBackTexture2D(width, height, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the buffer. - /// The target instance to allocate the buffer for. - /// The type of buffer to allocate. - /// The width of the texture to create. - /// The height of the texture to create. - /// The depth of the texture to create. - /// The allocation mode to use for the new resource. - /// A instance of the requested size. - [Pure] - public static TransferTexture3D AllocateTransferTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// The allocation mode to use for the new resource. + /// A instance of the requested size. + [Pure] + public static TransferTexture3D AllocateTransferTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(UploadTexture3D<>) => device.AllocateUploadTexture3D(width, height, depth, allocationMode), - _ when type == typeof(ReadBackTexture3D<>) => device.AllocateReadBackTexture3D(width, height, depth, allocationMode), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(UploadTexture3D<>) => device.AllocateUploadTexture3D(width, height, depth, allocationMode), + _ when type == typeof(ReadBackTexture3D<>) => device.AllocateReadBackTexture3D(width, height, depth, allocationMode), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the buffer. - /// The target instance to allocate the buffer for. - /// The type of buffer to allocate. - /// The data to load on the buffer. - /// A instance of the requested type. - [Pure] - public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, T[] data) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The data to load on the buffer. + /// A instance of the requested type. + [Pure] + public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, T[] data) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(data), - _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(data), - _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(data), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(data), + _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(data), + _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(data), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The target instance to allocate the texture for. - /// The type of buffer to allocate. - /// The data to load on the texture. - /// The width of the texture to create. - /// The height of the texture to create. - /// A instance of the requested type. - [Pure] - public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, T[] data, int width, int height) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of buffer to allocate. + /// The data to load on the texture. + /// The width of the texture to create. + /// The height of the texture to create. + /// A instance of the requested type. + [Pure] + public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, T[] data, int width, int height) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture2D<>) => device.AllocateReadOnlyTexture2D(data, width, height), - _ when type == typeof(ReadWriteTexture2D<>) => device.AllocateReadWriteTexture2D(data, width, height), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture2D<>) => device.AllocateReadOnlyTexture2D(data, width, height), + _ when type == typeof(ReadWriteTexture2D<>) => device.AllocateReadWriteTexture2D(data, width, height), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The target instance to allocate the texture for. - /// The type of buffer to allocate. - /// The data to load on the texture. - /// The width of the texture to create. - /// The height of the texture to create. - /// The depth of the texture to create. - /// A instance of the requested type. - [Pure] - public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[] data, int width, int height, int depth) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of buffer to allocate. + /// The data to load on the texture. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// A instance of the requested type. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[] data, int width, int height, int depth) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(data, width, height, depth), - _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(data, width, height, depth), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(data, width, height, depth), + _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(data, width, height, depth), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the texture. - /// The target instance to allocate the texture for. - /// The type of texture to allocate. - /// A instance of the requested size. - [Pure] - public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[,,] data) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// A instance of the requested size. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[,,] data) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(data), - _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(data), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(data), + _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(data), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } - /// - /// Allocates a new instance of the specified type. - /// - /// The type of items in the buffer. - /// The target instance to allocate the buffer for. - /// The type of buffer to allocate. - /// The data to load on the buffer. - /// A instance of the requested type. - [Pure] - public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, Buffer data) - where T : unmanaged + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The data to load on the buffer. + /// A instance of the requested type. + [Pure] + public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, Buffer data) + where T : unmanaged + { + return type switch { - return type switch - { - _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(data), - _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(data), - _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(data), - _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) - }; - } + _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(data), + _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(data), + _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(data), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; } } diff --git a/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs b/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs index 7babea3d..2b79f68a 100644 --- a/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs +++ b/tests/ComputeSharp.Tests/Extensions/ImagingExtensions.cs @@ -7,36 +7,35 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; -namespace ComputeSharp.Tests.Extensions +namespace ComputeSharp.Tests.Extensions; + +/// +/// A helper class for loading images into resources. +/// +public static class ImagingExtensions { /// - /// A helper class for loading images into resources. + /// Creates a new instance with the specified texture data. /// - public static class ImagingExtensions + /// The input pixel format used in the texture. + /// The target pixel format for the returned image. + /// The source instance to read data from. + /// An image with the data from the input texture. + [Pure] + public static unsafe Image ToImage(this Texture2D texture) + where TFrom : unmanaged + where TTo : unmanaged, IPixel { - /// - /// Creates a new instance with the specified texture data. - /// - /// The input pixel format used in the texture. - /// The target pixel format for the returned image. - /// The source instance to read data from. - /// An image with the data from the input texture. - [Pure] - public static unsafe Image ToImage(this Texture2D texture) - where TFrom : unmanaged - where TTo : unmanaged, IPixel - { - Guard.IsEqualTo(sizeof(TTo), sizeof(TFrom), nameof(TTo)); + Guard.IsEqualTo(sizeof(TTo), sizeof(TFrom), nameof(TTo)); - Image image = new(texture.Width, texture.Height); + Image image = new(texture.Width, texture.Height); - Assert.IsTrue(image.TryGetSinglePixelSpan(out Span span)); + Assert.IsTrue(image.TryGetSinglePixelSpan(out Span span)); - Span pixels = MemoryMarshal.Cast(span); + Span pixels = MemoryMarshal.Cast(span); - texture.CopyTo(pixels); + texture.CopyTo(pixels); - return image; - } + return image; } } diff --git a/tests/ComputeSharp.Tests/GlobalUsingDirectivesTests.cs b/tests/ComputeSharp.Tests/GlobalUsingDirectivesTests.cs index 2b6c19be..90add557 100644 --- a/tests/ComputeSharp.Tests/GlobalUsingDirectivesTests.cs +++ b/tests/ComputeSharp.Tests/GlobalUsingDirectivesTests.cs @@ -1,113 +1,112 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("GlobalUsingDirectives")] +public unsafe partial class GlobalUsingDirectivesTests { - [TestClass] - [TestCategory("GlobalUsingDirectives")] - public unsafe partial class GlobalUsingDirectivesTests + [TestMethod] + public void EnsureGlobalUsingDirectivesArePresent() { - [TestMethod] - public void EnsureGlobalUsingDirectivesArePresent() - { - Assert.AreEqual(typeof(bool2), typeof(Bool2)); - Assert.AreEqual(typeof(bool3), typeof(Bool3)); - Assert.AreEqual(typeof(bool4), typeof(Bool4)); - Assert.AreEqual(typeof(bool1x1), typeof(Bool1x1)); - Assert.AreEqual(typeof(bool1x2), typeof(Bool1x2)); - Assert.AreEqual(typeof(bool1x3), typeof(Bool1x3)); - Assert.AreEqual(typeof(bool1x4), typeof(Bool1x4)); - Assert.AreEqual(typeof(bool2x1), typeof(Bool2x1)); - Assert.AreEqual(typeof(bool2x2), typeof(Bool2x2)); - Assert.AreEqual(typeof(bool2x3), typeof(Bool2x3)); - Assert.AreEqual(typeof(bool2x4), typeof(Bool2x4)); - Assert.AreEqual(typeof(bool3x1), typeof(Bool3x1)); - Assert.AreEqual(typeof(bool3x2), typeof(Bool3x2)); - Assert.AreEqual(typeof(bool3x3), typeof(Bool3x3)); - Assert.AreEqual(typeof(bool3x4), typeof(Bool3x4)); - Assert.AreEqual(typeof(bool4x1), typeof(Bool4x1)); - Assert.AreEqual(typeof(bool4x2), typeof(Bool4x2)); - Assert.AreEqual(typeof(bool4x3), typeof(Bool4x3)); - Assert.AreEqual(typeof(bool4x4), typeof(Bool4x4)); + Assert.AreEqual(typeof(bool2), typeof(Bool2)); + Assert.AreEqual(typeof(bool3), typeof(Bool3)); + Assert.AreEqual(typeof(bool4), typeof(Bool4)); + Assert.AreEqual(typeof(bool1x1), typeof(Bool1x1)); + Assert.AreEqual(typeof(bool1x2), typeof(Bool1x2)); + Assert.AreEqual(typeof(bool1x3), typeof(Bool1x3)); + Assert.AreEqual(typeof(bool1x4), typeof(Bool1x4)); + Assert.AreEqual(typeof(bool2x1), typeof(Bool2x1)); + Assert.AreEqual(typeof(bool2x2), typeof(Bool2x2)); + Assert.AreEqual(typeof(bool2x3), typeof(Bool2x3)); + Assert.AreEqual(typeof(bool2x4), typeof(Bool2x4)); + Assert.AreEqual(typeof(bool3x1), typeof(Bool3x1)); + Assert.AreEqual(typeof(bool3x2), typeof(Bool3x2)); + Assert.AreEqual(typeof(bool3x3), typeof(Bool3x3)); + Assert.AreEqual(typeof(bool3x4), typeof(Bool3x4)); + Assert.AreEqual(typeof(bool4x1), typeof(Bool4x1)); + Assert.AreEqual(typeof(bool4x2), typeof(Bool4x2)); + Assert.AreEqual(typeof(bool4x3), typeof(Bool4x3)); + Assert.AreEqual(typeof(bool4x4), typeof(Bool4x4)); - Assert.AreEqual(typeof(double2), typeof(Double2)); - Assert.AreEqual(typeof(double3), typeof(Double3)); - Assert.AreEqual(typeof(double4), typeof(Double4)); - Assert.AreEqual(typeof(double1x1), typeof(Double1x1)); - Assert.AreEqual(typeof(double1x2), typeof(Double1x2)); - Assert.AreEqual(typeof(double1x3), typeof(Double1x3)); - Assert.AreEqual(typeof(double1x4), typeof(Double1x4)); - Assert.AreEqual(typeof(double2x1), typeof(Double2x1)); - Assert.AreEqual(typeof(double2x2), typeof(Double2x2)); - Assert.AreEqual(typeof(double2x3), typeof(Double2x3)); - Assert.AreEqual(typeof(double2x4), typeof(Double2x4)); - Assert.AreEqual(typeof(double3x1), typeof(Double3x1)); - Assert.AreEqual(typeof(double3x2), typeof(Double3x2)); - Assert.AreEqual(typeof(double3x3), typeof(Double3x3)); - Assert.AreEqual(typeof(double3x4), typeof(Double3x4)); - Assert.AreEqual(typeof(double4x1), typeof(Double4x1)); - Assert.AreEqual(typeof(double4x2), typeof(Double4x2)); - Assert.AreEqual(typeof(double4x3), typeof(Double4x3)); - Assert.AreEqual(typeof(double4x4), typeof(Double4x4)); + Assert.AreEqual(typeof(double2), typeof(Double2)); + Assert.AreEqual(typeof(double3), typeof(Double3)); + Assert.AreEqual(typeof(double4), typeof(Double4)); + Assert.AreEqual(typeof(double1x1), typeof(Double1x1)); + Assert.AreEqual(typeof(double1x2), typeof(Double1x2)); + Assert.AreEqual(typeof(double1x3), typeof(Double1x3)); + Assert.AreEqual(typeof(double1x4), typeof(Double1x4)); + Assert.AreEqual(typeof(double2x1), typeof(Double2x1)); + Assert.AreEqual(typeof(double2x2), typeof(Double2x2)); + Assert.AreEqual(typeof(double2x3), typeof(Double2x3)); + Assert.AreEqual(typeof(double2x4), typeof(Double2x4)); + Assert.AreEqual(typeof(double3x1), typeof(Double3x1)); + Assert.AreEqual(typeof(double3x2), typeof(Double3x2)); + Assert.AreEqual(typeof(double3x3), typeof(Double3x3)); + Assert.AreEqual(typeof(double3x4), typeof(Double3x4)); + Assert.AreEqual(typeof(double4x1), typeof(Double4x1)); + Assert.AreEqual(typeof(double4x2), typeof(Double4x2)); + Assert.AreEqual(typeof(double4x3), typeof(Double4x3)); + Assert.AreEqual(typeof(double4x4), typeof(Double4x4)); - Assert.AreEqual(typeof(float2), typeof(Float2)); - Assert.AreEqual(typeof(float3), typeof(Float3)); - Assert.AreEqual(typeof(float4), typeof(Float4)); - Assert.AreEqual(typeof(float1x1), typeof(Float1x1)); - Assert.AreEqual(typeof(float1x2), typeof(Float1x2)); - Assert.AreEqual(typeof(float1x3), typeof(Float1x3)); - Assert.AreEqual(typeof(float1x4), typeof(Float1x4)); - Assert.AreEqual(typeof(float2x1), typeof(Float2x1)); - Assert.AreEqual(typeof(float2x2), typeof(Float2x2)); - Assert.AreEqual(typeof(float2x3), typeof(Float2x3)); - Assert.AreEqual(typeof(float2x4), typeof(Float2x4)); - Assert.AreEqual(typeof(float3x1), typeof(Float3x1)); - Assert.AreEqual(typeof(float3x2), typeof(Float3x2)); - Assert.AreEqual(typeof(float3x3), typeof(Float3x3)); - Assert.AreEqual(typeof(float3x4), typeof(Float3x4)); - Assert.AreEqual(typeof(float4x1), typeof(Float4x1)); - Assert.AreEqual(typeof(float4x2), typeof(Float4x2)); - Assert.AreEqual(typeof(float4x3), typeof(Float4x3)); - Assert.AreEqual(typeof(float4x4), typeof(Float4x4)); + Assert.AreEqual(typeof(float2), typeof(Float2)); + Assert.AreEqual(typeof(float3), typeof(Float3)); + Assert.AreEqual(typeof(float4), typeof(Float4)); + Assert.AreEqual(typeof(float1x1), typeof(Float1x1)); + Assert.AreEqual(typeof(float1x2), typeof(Float1x2)); + Assert.AreEqual(typeof(float1x3), typeof(Float1x3)); + Assert.AreEqual(typeof(float1x4), typeof(Float1x4)); + Assert.AreEqual(typeof(float2x1), typeof(Float2x1)); + Assert.AreEqual(typeof(float2x2), typeof(Float2x2)); + Assert.AreEqual(typeof(float2x3), typeof(Float2x3)); + Assert.AreEqual(typeof(float2x4), typeof(Float2x4)); + Assert.AreEqual(typeof(float3x1), typeof(Float3x1)); + Assert.AreEqual(typeof(float3x2), typeof(Float3x2)); + Assert.AreEqual(typeof(float3x3), typeof(Float3x3)); + Assert.AreEqual(typeof(float3x4), typeof(Float3x4)); + Assert.AreEqual(typeof(float4x1), typeof(Float4x1)); + Assert.AreEqual(typeof(float4x2), typeof(Float4x2)); + Assert.AreEqual(typeof(float4x3), typeof(Float4x3)); + Assert.AreEqual(typeof(float4x4), typeof(Float4x4)); - Assert.AreEqual(typeof(int2), typeof(Int2)); - Assert.AreEqual(typeof(int3), typeof(Int3)); - Assert.AreEqual(typeof(int4), typeof(Int4)); - Assert.AreEqual(typeof(int1x1), typeof(Int1x1)); - Assert.AreEqual(typeof(int1x2), typeof(Int1x2)); - Assert.AreEqual(typeof(int1x3), typeof(Int1x3)); - Assert.AreEqual(typeof(int1x4), typeof(Int1x4)); - Assert.AreEqual(typeof(int2x1), typeof(Int2x1)); - Assert.AreEqual(typeof(int2x2), typeof(Int2x2)); - Assert.AreEqual(typeof(int2x3), typeof(Int2x3)); - Assert.AreEqual(typeof(int2x4), typeof(Int2x4)); - Assert.AreEqual(typeof(int3x1), typeof(Int3x1)); - Assert.AreEqual(typeof(int3x2), typeof(Int3x2)); - Assert.AreEqual(typeof(int3x3), typeof(Int3x3)); - Assert.AreEqual(typeof(int3x4), typeof(Int3x4)); - Assert.AreEqual(typeof(int4x1), typeof(Int4x1)); - Assert.AreEqual(typeof(int4x2), typeof(Int4x2)); - Assert.AreEqual(typeof(int4x3), typeof(Int4x3)); - Assert.AreEqual(typeof(int4x4), typeof(Int4x4)); + Assert.AreEqual(typeof(int2), typeof(Int2)); + Assert.AreEqual(typeof(int3), typeof(Int3)); + Assert.AreEqual(typeof(int4), typeof(Int4)); + Assert.AreEqual(typeof(int1x1), typeof(Int1x1)); + Assert.AreEqual(typeof(int1x2), typeof(Int1x2)); + Assert.AreEqual(typeof(int1x3), typeof(Int1x3)); + Assert.AreEqual(typeof(int1x4), typeof(Int1x4)); + Assert.AreEqual(typeof(int2x1), typeof(Int2x1)); + Assert.AreEqual(typeof(int2x2), typeof(Int2x2)); + Assert.AreEqual(typeof(int2x3), typeof(Int2x3)); + Assert.AreEqual(typeof(int2x4), typeof(Int2x4)); + Assert.AreEqual(typeof(int3x1), typeof(Int3x1)); + Assert.AreEqual(typeof(int3x2), typeof(Int3x2)); + Assert.AreEqual(typeof(int3x3), typeof(Int3x3)); + Assert.AreEqual(typeof(int3x4), typeof(Int3x4)); + Assert.AreEqual(typeof(int4x1), typeof(Int4x1)); + Assert.AreEqual(typeof(int4x2), typeof(Int4x2)); + Assert.AreEqual(typeof(int4x3), typeof(Int4x3)); + Assert.AreEqual(typeof(int4x4), typeof(Int4x4)); - Assert.AreEqual(typeof(uint2), typeof(UInt2)); - Assert.AreEqual(typeof(uint3), typeof(UInt3)); - Assert.AreEqual(typeof(uint4), typeof(UInt4)); - Assert.AreEqual(typeof(uint1x1), typeof(UInt1x1)); - Assert.AreEqual(typeof(uint1x2), typeof(UInt1x2)); - Assert.AreEqual(typeof(uint1x3), typeof(UInt1x3)); - Assert.AreEqual(typeof(uint1x4), typeof(UInt1x4)); - Assert.AreEqual(typeof(uint2x1), typeof(UInt2x1)); - Assert.AreEqual(typeof(uint2x2), typeof(UInt2x2)); - Assert.AreEqual(typeof(uint2x3), typeof(UInt2x3)); - Assert.AreEqual(typeof(uint2x4), typeof(UInt2x4)); - Assert.AreEqual(typeof(uint3x1), typeof(UInt3x1)); - Assert.AreEqual(typeof(uint3x2), typeof(UInt3x2)); - Assert.AreEqual(typeof(uint3x3), typeof(UInt3x3)); - Assert.AreEqual(typeof(uint3x4), typeof(UInt3x4)); - Assert.AreEqual(typeof(uint4x1), typeof(UInt4x1)); - Assert.AreEqual(typeof(uint4x2), typeof(UInt4x2)); - Assert.AreEqual(typeof(uint4x3), typeof(UInt4x3)); - Assert.AreEqual(typeof(uint4x4), typeof(UInt4x4)); - } + Assert.AreEqual(typeof(uint2), typeof(UInt2)); + Assert.AreEqual(typeof(uint3), typeof(UInt3)); + Assert.AreEqual(typeof(uint4), typeof(UInt4)); + Assert.AreEqual(typeof(uint1x1), typeof(UInt1x1)); + Assert.AreEqual(typeof(uint1x2), typeof(UInt1x2)); + Assert.AreEqual(typeof(uint1x3), typeof(UInt1x3)); + Assert.AreEqual(typeof(uint1x4), typeof(UInt1x4)); + Assert.AreEqual(typeof(uint2x1), typeof(UInt2x1)); + Assert.AreEqual(typeof(uint2x2), typeof(UInt2x2)); + Assert.AreEqual(typeof(uint2x3), typeof(UInt2x3)); + Assert.AreEqual(typeof(uint2x4), typeof(UInt2x4)); + Assert.AreEqual(typeof(uint3x1), typeof(UInt3x1)); + Assert.AreEqual(typeof(uint3x2), typeof(UInt3x2)); + Assert.AreEqual(typeof(uint3x3), typeof(UInt3x3)); + Assert.AreEqual(typeof(uint3x4), typeof(UInt3x4)); + Assert.AreEqual(typeof(uint4x1), typeof(UInt4x1)); + Assert.AreEqual(typeof(uint4x2), typeof(UInt4x2)); + Assert.AreEqual(typeof(uint4x3), typeof(UInt4x3)); + Assert.AreEqual(typeof(uint4x4), typeof(UInt4x4)); } } diff --git a/tests/ComputeSharp.Tests/ImageProcessingTests.cs b/tests/ComputeSharp.Tests/ImageProcessingTests.cs index 2d5c4eaf..0f1e971f 100644 --- a/tests/ComputeSharp.Tests/ImageProcessingTests.cs +++ b/tests/ComputeSharp.Tests/ImageProcessingTests.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Reflection; using ComputeSharp.BokehBlur.Processors; using ComputeSharp.Tests.Attributes; @@ -8,62 +8,61 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("ImageProcessing")] +public class ImageProcessingTests { - [TestClass] - [TestCategory("ImageProcessing")] - public class ImageProcessingTests + [CombinatorialTestMethod] + [AllDevices] + public void BokehBlur(Device device) { - [CombinatorialTestMethod] - [AllDevices] - public void BokehBlur(Device device) - { - // Early test to ensure the device is available. This saves time when running the - // unit test if the target device is not available, as we skip the preprocessing. - _ = device.Get(); + // Early test to ensure the device is available. This saves time when running the + // unit test if the target device is not available, as we skip the preprocessing. + _ = device.Get(); - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); - using var original = Image.Load(Path.Combine(path, "city.jpg")); - - original.Mutate(c => c.Resize(1920, 1080)); + using var original = Image.Load(Path.Combine(path, "city.jpg")); + + original.Mutate(c => c.Resize(1920, 1080)); - using var cpu = original.Clone(c => c.BokehBlur(40, 2, 3)); - using var gpu = original.Clone(c => c.ApplyProcessor(new HlslBokehBlurProcessor(device.Get(), 40, 2))); + using var cpu = original.Clone(c => c.BokehBlur(40, 2, 3)); + using var gpu = original.Clone(c => c.ApplyProcessor(new HlslBokehBlurProcessor(device.Get(), 40, 2))); - string - expectedPath = Path.Combine(path, "city_bokeh_cpu.jpg"), - actualPath = Path.Combine(path, "city_bokeh_gpu.jpg"); + string + expectedPath = Path.Combine(path, "city_bokeh_cpu.jpg"), + actualPath = Path.Combine(path, "city_bokeh_gpu.jpg"); - cpu.Save(expectedPath); - gpu.Save(actualPath); + cpu.Save(expectedPath); + gpu.Save(actualPath); - ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.000009f); - } + ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.000009f); + } - [CombinatorialTestMethod] - [AllDevices] - public void GaussianBlur(Device device) - { - _ = device.Get(); + [CombinatorialTestMethod] + [AllDevices] + public void GaussianBlur(Device device) + { + _ = device.Get(); - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); - using var original = Image.Load(Path.Combine(path, "city.jpg")); + using var original = Image.Load(Path.Combine(path, "city.jpg")); - original.Mutate(c => c.Resize(1920, 1080)); + original.Mutate(c => c.Resize(1920, 1080)); - using var cpu = original.Clone(c => c.GaussianBlur(30f)); - using var gpu = original.Clone(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(device.Get(), 90))); + using var cpu = original.Clone(c => c.GaussianBlur(30f)); + using var gpu = original.Clone(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(device.Get(), 90))); - string - expectedPath = Path.Combine(path, "city_gaussian_cpu.jpg"), - actualPath = Path.Combine(path, "city_gaussian_gpu.jpg"); + string + expectedPath = Path.Combine(path, "city_gaussian_cpu.jpg"), + actualPath = Path.Combine(path, "city_gaussian_gpu.jpg"); - cpu.Save(expectedPath); - gpu.Save(actualPath); + cpu.Save(expectedPath); + gpu.Save(actualPath); - ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.0000046f); - } + ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.0000046f); } } diff --git a/tests/ComputeSharp.Tests/ImagingTests.cs b/tests/ComputeSharp.Tests/ImagingTests.cs index 91984007..6b68880e 100644 --- a/tests/ComputeSharp.Tests/ImagingTests.cs +++ b/tests/ComputeSharp.Tests/ImagingTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Reflection; @@ -14,267 +14,266 @@ using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; using ImageSharpBgra32 = SixLabors.ImageSharp.PixelFormats.Bgra32; using ImageSharpL8 = SixLabors.ImageSharp.PixelFormats.L8; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Imaging")] +public class ImagingTests { - [TestClass] - [TestCategory("Imaging")] - public class ImagingTests + [CombinatorialTestMethod] + [AllDevices] + public void LoadAsRgba32FromFile(Device device) { - [CombinatorialTestMethod] - [AllDevices] - public void LoadAsRgba32FromFile(Device device) + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); + + using Image loaded = texture.ToImage(); + using Image original = Image.Load(path); + + TolerantImageComparer.AssertEqual(original, loaded, 0.0000032f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void LoadAsBgra32FromFile(Device device) + { + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); + + using Image loaded = texture.ToImage(); + using Image original = Image.Load(path); + + TolerantImageComparer.AssertEqual(original, loaded, 0.00000132f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void LoadAsBgra32FromFileWithSameFormat(Device device) + { + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", "CityAfter1024x1024Sampling.png"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); + + using Image loaded = texture.ToImage(); + using Image original = Image.Load(path); + + TolerantImageComparer.AssertEqual(original, loaded, 0.00000132f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void LoadAsR8FromFile(Device device) + { + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); + + using Image loaded = texture.ToImage(); + using Image original = Image.Load(path); + + TolerantImageComparer.AssertEqual(original, loaded, 0.000039f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void LoadAsRgba32FromBuffer(Device device) + { + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + + byte[] buffer = File.ReadAllBytes(path); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(buffer); + + using Image loaded = texture.ToImage(); + using Image original = Image.Load(path); + + TolerantImageComparer.AssertEqual(original, loaded, 0.0000032f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void SaveRgba32AsJpeg(Device device) + { + string + path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"), + expectedPath = Path.Combine(path, "city.jpg"), + actualPath = Path.Combine(path, "city_rgba32_saved.jpg"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(expectedPath); + + texture.Save(actualPath); + + TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00001023f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void SaveBgra32AsJpeg(Device device) + { + string + path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"), + expectedPath = Path.Combine(path, "city.jpg"), + actualPath = Path.Combine(path, "city_bgra32_saved.jpg"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(expectedPath); + + texture.Save(actualPath); + + TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00001023f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void SaveR8AsJpeg(Device device) + { + string + path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"), + sourcePath = Path.Combine(path, "city.jpg"), + expectedPath = Path.Combine(path, "city_r8_reference.jpg"), + actualPath = Path.Combine(path, "city_r8_saved.jpg"); + + using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(sourcePath); + + texture.Save(actualPath); + + using Image original = Image.Load(sourcePath); + + original.Save(expectedPath); + + TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00004037f); + } + + /// + /// An tolerant image comparer type, from ImageSharp. + /// + internal static class TolerantImageComparer + { + /// + /// Asserts that two images are equal. + /// + /// The path to the reference image. + /// The path to the expected image. + /// The allowed difference threshold for the normalized delta. + public static void AssertEqual(string expectedPath, string actualPath, float threshold) { - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + using var expected = Image.Load(expectedPath); + using var actual = Image.Load(actualPath); - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); - - using Image loaded = texture.ToImage(); - using Image original = Image.Load(path); - - TolerantImageComparer.AssertEqual(original, loaded, 0.0000032f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void LoadAsBgra32FromFile(Device device) - { - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); - - using Image loaded = texture.ToImage(); - using Image original = Image.Load(path); - - TolerantImageComparer.AssertEqual(original, loaded, 0.00000132f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void LoadAsBgra32FromFileWithSameFormat(Device device) - { - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", "CityAfter1024x1024Sampling.png"); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); - - using Image loaded = texture.ToImage(); - using Image original = Image.Load(path); - - TolerantImageComparer.AssertEqual(original, loaded, 0.00000132f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void LoadAsR8FromFile(Device device) - { - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(path); - - using Image loaded = texture.ToImage(); - using Image original = Image.Load(path); - - TolerantImageComparer.AssertEqual(original, loaded, 0.000039f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void LoadAsRgba32FromBuffer(Device device) - { - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); - - byte[] buffer = File.ReadAllBytes(path); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(buffer); - - using Image loaded = texture.ToImage(); - using Image original = Image.Load(path); - - TolerantImageComparer.AssertEqual(original, loaded, 0.0000032f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void SaveRgba32AsJpeg(Device device) - { - string - path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"), - expectedPath = Path.Combine(path, "city.jpg"), - actualPath = Path.Combine(path, "city_rgba32_saved.jpg"); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(expectedPath); - - texture.Save(actualPath); - - TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00001023f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void SaveBgra32AsJpeg(Device device) - { - string - path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"), - expectedPath = Path.Combine(path, "city.jpg"), - actualPath = Path.Combine(path, "city_bgra32_saved.jpg"); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(expectedPath); - - texture.Save(actualPath); - - TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00001023f); - } - - [CombinatorialTestMethod] - [AllDevices] - public void SaveR8AsJpeg(Device device) - { - string - path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"), - sourcePath = Path.Combine(path, "city.jpg"), - expectedPath = Path.Combine(path, "city_r8_reference.jpg"), - actualPath = Path.Combine(path, "city_r8_saved.jpg"); - - using ReadOnlyTexture2D texture = device.Get().LoadReadOnlyTexture2D(sourcePath); - - texture.Save(actualPath); - - using Image original = Image.Load(sourcePath); - - original.Save(expectedPath); - - TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00004037f); + AssertEqual(expected, actual, threshold); } /// - /// An tolerant image comparer type, from ImageSharp. + /// Asserts that two images are equal. /// - internal static class TolerantImageComparer + /// The type of image pixels to analyze. + /// The reference image. + /// The expected image. + /// The allowed difference threshold for the normalized delta. + public static void AssertEqual(Image expected, Image actual, float threshold) + where TPixel : unmanaged, IPixel { - /// - /// Asserts that two images are equal. - /// - /// The path to the reference image. - /// The path to the expected image. - /// The allowed difference threshold for the normalized delta. - public static void AssertEqual(string expectedPath, string actualPath, float threshold) + if (expected.Size() != actual.Size()) { - using var expected = Image.Load(expectedPath); - using var actual = Image.Load(actualPath); - - AssertEqual(expected, actual, threshold); + Assert.Fail($"The input images have different sizes: {expected.Size()} and {actual.Size()}"); } - /// - /// Asserts that two images are equal. - /// - /// The type of image pixels to analyze. - /// The reference image. - /// The expected image. - /// The allowed difference threshold for the normalized delta. - public static void AssertEqual(Image expected, Image actual, float threshold) - where TPixel : unmanaged, IPixel + if (expected.Frames.Count != actual.Frames.Count || + expected.Frames.Count != 1 || + actual.Frames.Count != 1) { - if (expected.Size() != actual.Size()) + Assert.Fail("The two input images must have 1 frame each"); + } + + int width = actual.Width; + + float totalDifference = 0F; + + var differences = new List(20); + Span aBuffer = new ImageSharpRgba32[actual.Width]; + Span bBuffer = new ImageSharpRgba32[actual.Width]; + + for (int y = 0; y < actual.Height; y++) + { + Span aSpan = expected.GetPixelRowSpan(y); + Span bSpan = actual.GetPixelRowSpan(y); + + PixelOperations.Instance.ToRgba32(actual.GetConfiguration(), aSpan, aBuffer); + PixelOperations.Instance.ToRgba32(actual.GetConfiguration(), bSpan, bBuffer); + + for (int x = 0; x < width; x++) { - Assert.Fail($"The input images have different sizes: {expected.Size()} and {actual.Size()}"); - } - - if (expected.Frames.Count != actual.Frames.Count || - expected.Frames.Count != 1 || - actual.Frames.Count != 1) - { - Assert.Fail("The two input images must have 1 frame each"); - } - - int width = actual.Width; - - float totalDifference = 0F; - - var differences = new List(20); - Span aBuffer = new ImageSharpRgba32[actual.Width]; - Span bBuffer = new ImageSharpRgba32[actual.Width]; - - for (int y = 0; y < actual.Height; y++) - { - Span aSpan = expected.GetPixelRowSpan(y); - Span bSpan = actual.GetPixelRowSpan(y); - - PixelOperations.Instance.ToRgba32(actual.GetConfiguration(), aSpan, aBuffer); - PixelOperations.Instance.ToRgba32(actual.GetConfiguration(), bSpan, bBuffer); - - for (int x = 0; x < width; x++) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static int GetManhattanDistanceInRgbaSpace(ref ImageSharpRgba32 a, ref ImageSharpRgba32 b) { [MethodImpl(MethodImplOptions.AggressiveInlining)] - static int GetManhattanDistanceInRgbaSpace(ref ImageSharpRgba32 a, ref ImageSharpRgba32 b) - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - static int Diff(ushort a, ushort b) => Math.Abs(a - b); + static int Diff(ushort a, ushort b) => Math.Abs(a - b); - return Diff(a.R, b.R) + Diff(a.G, b.G) + Diff(a.B, b.B) + Diff(a.A, b.A); - } - - int d = GetManhattanDistanceInRgbaSpace(ref aBuffer[x], ref bBuffer[x]); - - if (d > 0) - { - if (differences.Count < 20) - { - var diff = new PixelDifference(new Point(x, y), aBuffer[x], bBuffer[x]); - differences.Add(diff); - } - - totalDifference += d; - } + return Diff(a.R, b.R) + Diff(a.G, b.G) + Diff(a.B, b.B) + Diff(a.A, b.A); } - } - float normalizedDifference = totalDifference / (actual.Width * (float)actual.Height); - normalizedDifference /= 4F * 65535F; + int d = GetManhattanDistanceInRgbaSpace(ref aBuffer[x], ref bBuffer[x]); - if (normalizedDifference > threshold) - { - StringBuilder builder = new(); - builder.AppendLine($"The input images don't match. Normalized delta: {normalizedDifference}%"); - builder.AppendLine($"First {differences.Count} pixel deltas:"); - - foreach (var delta in differences) + if (d > 0) { - builder.AppendLine(delta.ToString()); - } + if (differences.Count < 20) + { + var diff = new PixelDifference(new Point(x, y), aBuffer[x], bBuffer[x]); + differences.Add(diff); + } - Assert.Fail(builder.ToString()); + totalDifference += d; + } } } - /// - /// A simple model repressenting info about a difference between two pixels. - /// - private readonly struct PixelDifference + float normalizedDifference = totalDifference / (actual.Width * (float)actual.Height); + normalizedDifference /= 4F * 65535F; + + if (normalizedDifference > threshold) { - public PixelDifference(Point position, ImageSharpRgba32 expected, ImageSharpRgba32 actual) + StringBuilder builder = new(); + builder.AppendLine($"The input images don't match. Normalized delta: {normalizedDifference}%"); + builder.AppendLine($"First {differences.Count} pixel deltas:"); + + foreach (var delta in differences) { - this.Position = position; - this.RedDifference = actual.R - expected.R; - this.GreenDifference = actual.G - expected.G; - this.BlueDifference = actual.B - expected.B; - this.AlphaDifference = actual.A - expected.A; + builder.AppendLine(delta.ToString()); } - public readonly Point Position; + Assert.Fail(builder.ToString()); + } + } - public readonly int RedDifference; + /// + /// A simple model repressenting info about a difference between two pixels. + /// + private readonly struct PixelDifference + { + public PixelDifference(Point position, ImageSharpRgba32 expected, ImageSharpRgba32 actual) + { + this.Position = position; + this.RedDifference = actual.R - expected.R; + this.GreenDifference = actual.G - expected.G; + this.BlueDifference = actual.B - expected.B; + this.AlphaDifference = actual.A - expected.A; + } - public readonly int GreenDifference; + public readonly Point Position; - public readonly int BlueDifference; + public readonly int RedDifference; - public readonly int AlphaDifference; + public readonly int GreenDifference; - /// - public override string ToString() - { - return $"[delta({RedDifference},{GreenDifference},{BlueDifference},{AlphaDifference}) @ ({Position.X},{Position.Y})]"; - } + public readonly int BlueDifference; + + public readonly int AlphaDifference; + + /// + public override string ToString() + { + return $"[delta({RedDifference},{GreenDifference},{BlueDifference},{AlphaDifference}) @ ({Position.X},{Position.Y})]"; } } } diff --git a/tests/ComputeSharp.Tests/InitializationTests.cs b/tests/ComputeSharp.Tests/InitializationTests.cs index af7e8448..2ed05bdb 100644 --- a/tests/ComputeSharp.Tests/InitializationTests.cs +++ b/tests/ComputeSharp.Tests/InitializationTests.cs @@ -4,87 +4,86 @@ using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Initialization")] +public partial class InitializationTests { - [TestClass] - [TestCategory("Initialization")] - public partial class InitializationTests + [TestMethod] + public void IsSupported() { - [TestMethod] - public void IsSupported() + Assert.IsTrue(Gpu.Default is not null); + } + + [CombinatorialTestMethod] + [AllDevices] + public void DeviceInfo(Device device) + { + GraphicsDevice gpu = device.Get(); + + Assert.IsTrue(gpu.Luid != default); + Assert.IsTrue(gpu.Name is { Length: > 0 }); + Assert.IsTrue(gpu.ComputeUnits != 0); + Assert.IsTrue(gpu.WavefrontSize != 0); + } + + [TestMethod] + public void DisposeDefault() + { + using var before = Gpu.Default.AllocateReadOnlyBuffer(128); + + Gpu.Default.Dispose(); + + using var after = Gpu.Default.AllocateReadOnlyBuffer(128); + } + + [TestMethod] + public void EnumerateDevices() + { + int i = 0; + + foreach (GraphicsDevice device in Gpu.EnumerateDevices()) { - Assert.IsTrue(Gpu.Default is not null); + if (i++ == 0) Assert.AreSame(Gpu.Default, device); + + using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(128); + + device.For(128, new SampleShader(buffer)); + + int[] data = buffer.ToArray(); + + Assert.IsTrue(data.SequenceEqual(Enumerable.Range(0, 128))); } + } - [CombinatorialTestMethod] - [AllDevices] - public void DeviceInfo(Device device) + [TestMethod] + public void QueryDevices() + { + int i = 0; + + foreach (GraphicsDevice device in Gpu.QueryDevices(info => info.DedicatedMemorySize >= 1024)) { - GraphicsDevice gpu = device.Get(); + if (i++ == 0) Assert.AreSame(Gpu.Default, device); - Assert.IsTrue(gpu.Luid != default); - Assert.IsTrue(gpu.Name is { Length: > 0 }); - Assert.IsTrue(gpu.ComputeUnits != 0); - Assert.IsTrue(gpu.WavefrontSize != 0); + using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(128); + + device.For(128, new SampleShader(buffer)); + + int[] data = buffer.ToArray(); + + Assert.IsTrue(data.SequenceEqual(Enumerable.Range(0, 128))); } + } - [TestMethod] - public void DisposeDefault() + [AutoConstructor] + internal readonly partial struct SampleShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + public void Execute() { - using var before = Gpu.Default.AllocateReadOnlyBuffer(128); - - Gpu.Default.Dispose(); - - using var after = Gpu.Default.AllocateReadOnlyBuffer(128); - } - - [TestMethod] - public void EnumerateDevices() - { - int i = 0; - - foreach (GraphicsDevice device in Gpu.EnumerateDevices()) - { - if (i++ == 0) Assert.AreSame(Gpu.Default, device); - - using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(128); - - device.For(128, new SampleShader(buffer)); - - int[] data = buffer.ToArray(); - - Assert.IsTrue(data.SequenceEqual(Enumerable.Range(0, 128))); - } - } - - [TestMethod] - public void QueryDevices() - { - int i = 0; - - foreach (GraphicsDevice device in Gpu.QueryDevices(info => info.DedicatedMemorySize >= 1024)) - { - if (i++ == 0) Assert.AreSame(Gpu.Default, device); - - using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(128); - - device.For(128, new SampleShader(buffer)); - - int[] data = buffer.ToArray(); - - Assert.IsTrue(data.SequenceEqual(Enumerable.Range(0, 128))); - } - } - - [AutoConstructor] - internal readonly partial struct SampleShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; - - public void Execute() - { - buffer[ThreadIds.X] = ThreadIds.X; - } + buffer[ThreadIds.X] = ThreadIds.X; } } } diff --git a/tests/ComputeSharp.Tests/InteropServicesTests.cs b/tests/ComputeSharp.Tests/InteropServicesTests.cs index b1362427..8009f899 100644 --- a/tests/ComputeSharp.Tests/InteropServicesTests.cs +++ b/tests/ComputeSharp.Tests/InteropServicesTests.cs @@ -8,181 +8,180 @@ using TerraFX.Interop; using FX = TerraFX.Interop.Windows; using static TerraFX.Interop.D3D12_RESOURCE_DIMENSION; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("InteropServices")] +public unsafe partial class InteropServicesTests { - [TestClass] - [TestCategory("InteropServices")] - public unsafe partial class InteropServicesTests + [CombinatorialTestMethod] + [AllDevices] + public void GetDevice(Device device) { - [CombinatorialTestMethod] - [AllDevices] - public void GetDevice(Device device) - { - using ComPtr d3D12Device = default; + using ComPtr d3D12Device = default; - InteropServices.GetID3D12Device(device.Get(), FX.__uuidof(), (void**)d3D12Device.GetAddressOf()); + InteropServices.GetID3D12Device(device.Get(), FX.__uuidof(), (void**)d3D12Device.GetAddressOf()); - Assert.IsTrue(d3D12Device.Get() != null); + Assert.IsTrue(d3D12Device.Get() != null); - LUID luid = d3D12Device.Get()->GetAdapterLuid(); + LUID luid = d3D12Device.Get()->GetAdapterLuid(); - Assert.IsTrue(*(ulong*)&luid != 0); + Assert.IsTrue(*(ulong*)&luid != 0); - d3D12Device.Dispose(); + d3D12Device.Dispose(); - int hResult = InteropServices.TryGetID3D12Device(device.Get(), FX.__uuidof(), (void**)d3D12Device.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Device(device.Get(), FX.__uuidof(), (void**)d3D12Device.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Device.Get() != null); + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Device.Get() != null); - luid = d3D12Device.Get()->GetAdapterLuid(); + luid = d3D12Device.Get()->GetAdapterLuid(); - Assert.IsTrue(*(ulong*)&luid != 0); - } + Assert.IsTrue(*(ulong*)&luid != 0); + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ConstantBuffer<>))] - [Resource(typeof(ReadOnlyBuffer<>))] - [Resource(typeof(ReadWriteBuffer<>))] - public void ResourceFromBuffer(Device device, Type bufferType) - { - using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128); + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + public void ResourceFromBuffer(Device device, Type bufferType) + { + using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128); - using ComPtr d3D12Resource = default; + using ComPtr d3D12Resource = default; - InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - d3D12Resource.Dispose(); + d3D12Resource.Dispose(); - int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - } + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - public void ResourceFromTexture2D(Device device, Type bufferType) - { - using Texture2D buffer = device.Get().AllocateTexture2D(bufferType, 16, 16); + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + public void ResourceFromTexture2D(Device device, Type bufferType) + { + using Texture2D buffer = device.Get().AllocateTexture2D(bufferType, 16, 16); - using ComPtr d3D12Resource = default; + using ComPtr d3D12Resource = default; - InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE2D); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE2D); - d3D12Resource.Dispose(); + d3D12Resource.Dispose(); - int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE2D); - } + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE2D); + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - public void ResourceFromTexture3D(Device device, Type bufferType) - { - using Texture3D buffer = device.Get().AllocateTexture3D(bufferType, 16, 16, 4); + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + public void ResourceFromTexture3D(Device device, Type bufferType) + { + using Texture3D buffer = device.Get().AllocateTexture3D(bufferType, 16, 16, 4); - using ComPtr d3D12Resource = default; + using ComPtr d3D12Resource = default; - InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE3D); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE3D); - d3D12Resource.Dispose(); + d3D12Resource.Dispose(); - int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE3D); - } + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_TEXTURE3D); + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadBuffer<>))] - [Resource(typeof(ReadBackBuffer<>))] - public void ResourceFromTransferBuffer(Device device, Type bufferType) - { - using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128); + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + public void ResourceFromTransferBuffer(Device device, Type bufferType) + { + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128); - using ComPtr d3D12Resource = default; + using ComPtr d3D12Resource = default; - InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - d3D12Resource.Dispose(); + d3D12Resource.Dispose(); - int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - } + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture2D<>))] - [Resource(typeof(ReadBackTexture2D<>))] - public void ResourceFromTransferTexture2D(Device device, Type bufferType) - { - using TransferTexture2D buffer = device.Get().AllocateTransferTexture2D(bufferType, 16, 16); + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + public void ResourceFromTransferTexture2D(Device device, Type bufferType) + { + using TransferTexture2D buffer = device.Get().AllocateTransferTexture2D(bufferType, 16, 16); - using ComPtr d3D12Resource = default; + using ComPtr d3D12Resource = default; - InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - d3D12Resource.Dispose(); + d3D12Resource.Dispose(); - int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - } + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture3D<>))] - [Resource(typeof(ReadBackTexture3D<>))] - public void ResourceFromTransferTexture3D(Device device, Type bufferType) - { - using TransferTexture3D buffer = device.Get().AllocateTransferTexture3D(bufferType, 16, 16, 4); + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + public void ResourceFromTransferTexture3D(Device device, Type bufferType) + { + using TransferTexture3D buffer = device.Get().AllocateTransferTexture3D(bufferType, 16, 16, 4); - using ComPtr d3D12Resource = default; + using ComPtr d3D12Resource = default; - InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + InteropServices.GetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - d3D12Resource.Dispose(); + d3D12Resource.Dispose(); - int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + int hResult = InteropServices.TryGetID3D12Resource(buffer, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - Assert.AreEqual(hResult, FX.S_OK); - Assert.IsTrue(d3D12Resource.Get() != null); - Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); - } + Assert.AreEqual(hResult, FX.S_OK); + Assert.IsTrue(d3D12Resource.Get() != null); + Assert.AreEqual(d3D12Resource.Get()->GetDesc().Dimension, D3D12_RESOURCE_DIMENSION_BUFFER); } } diff --git a/tests/ComputeSharp.Tests/MetaprogrammingTests.cs b/tests/ComputeSharp.Tests/MetaprogrammingTests.cs index 70bb9d22..624f6b30 100644 --- a/tests/ComputeSharp.Tests/MetaprogrammingTests.cs +++ b/tests/ComputeSharp.Tests/MetaprogrammingTests.cs @@ -1,240 +1,239 @@ -using System; +using System; using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; #pragma warning disable IDE0062 -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Metaprogramming")] +public partial class MetaprogrammingTests { - [TestClass] - [TestCategory("Metaprogramming")] - public partial class MetaprogrammingTests + [AutoConstructor] + internal readonly partial struct ActivationWithDelegateShader : IComputeShader { - [AutoConstructor] - internal readonly partial struct ActivationWithDelegateShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; - public readonly Func activation; + public readonly ReadWriteBuffer buffer; + public readonly Func activation; - public void Execute() - { - buffer[ThreadIds.X] = activation(ThreadIds.X); - } + public void Execute() + { + buffer[ThreadIds.X] = activation(ThreadIds.X); + } + } + + public static class Activations + { + [ShaderMethod] + public static int Square(int x) => x * x; + + [ShaderMethod] + public static int AddOne(int x) => x + 1; + + // Missing attribute + public static int Identity(int x) => x; + + [ShaderMethod] + public static int FunctionWithConstants(int x) => (int)(x + FourAndAHalf); + + [ShaderMethod] + public static Position FunctionWithTypes(int x) + { + Point point = default; + point.A = x; + point.B = x * x; + + Position position = default; + position.X = point.A; + position.Y = point.B; + + return position; } - public static class Activations + public struct Point { - [ShaderMethod] - public static int Square(int x) => x * x; - - [ShaderMethod] - public static int AddOne(int x) => x + 1; - - // Missing attribute - public static int Identity(int x) => x; - - [ShaderMethod] - public static int FunctionWithConstants(int x) => (int)(x + FourAndAHalf); - - [ShaderMethod] - public static Position FunctionWithTypes(int x) - { - Point point = default; - point.A = x; - point.B = x * x; - - Position position = default; - position.X = point.A; - position.Y = point.B; - - return position; - } - - public struct Point - { - public int A; - public int B; - } - - [ShaderMethod] - public static int FunctionWithLocalFunctionAndStaticMethod(int x) - { - static int AddTwo(int x) => x + 2; - - return Square(3 + AddOne(x) + AddTwo(x)); - } + public int A; + public int B; } - [CombinatorialTestMethod] - [AllDevices] - public unsafe void ActivationWithDelegate(Device device) + [ShaderMethod] + public static int FunctionWithLocalFunctionAndStaticMethod(int x) { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + static int AddTwo(int x) => x + 2; - device.Get().For(100, new ActivationWithDelegateShader(buffer, Activations.Square)); + return Square(3 + AddOne(x) + AddTwo(x)); + } + } - int[] result = buffer.ToArray(); + [CombinatorialTestMethod] + [AllDevices] + public unsafe void ActivationWithDelegate(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - for (int i = 0; i < 100; i++) - { - Assert.AreEqual(result[i], Activations.Square(i)); - } + device.Get().For(100, new ActivationWithDelegateShader(buffer, Activations.Square)); - device.Get().For(100, new ActivationWithDelegateShader(buffer, Activations.AddOne)); + int[] result = buffer.ToArray(); - result = buffer.ToArray(); - - for (int i = 0; i < 100; i++) - { - Assert.AreEqual(result[i], Activations.AddOne(i)); - } + for (int i = 0; i < 100; i++) + { + Assert.AreEqual(result[i], Activations.Square(i)); } - [CombinatorialTestMethod] - [AllDevices] - [ExpectedException(typeof(ArgumentException))] - public unsafe void DelegateWithMissingAttributeOnMethod(Device device) - { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + device.Get().For(100, new ActivationWithDelegateShader(buffer, Activations.AddOne)); - device.Get().For(100, new ActivationWithDelegateShader(buffer, Activations.Identity)); + result = buffer.ToArray(); + + for (int i = 0; i < 100; i++) + { + Assert.AreEqual(result[i], Activations.AddOne(i)); } + } - [CombinatorialTestMethod] - [AllDevices] - [ExpectedException(typeof(ArgumentException))] - public unsafe void DelegateWrappingNonStaticMethod(Device device) + [CombinatorialTestMethod] + [AllDevices] + [ExpectedException(typeof(ArgumentException))] + public unsafe void DelegateWithMissingAttributeOnMethod(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + + device.Get().For(100, new ActivationWithDelegateShader(buffer, Activations.Identity)); + } + + [CombinatorialTestMethod] + [AllDevices] + [ExpectedException(typeof(ArgumentException))] + public unsafe void DelegateWrappingNonStaticMethod(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + + [ShaderMethod] + int Dummy(int x) => x; + + device.Get().For(100, new ActivationWithDelegateShader(buffer, Dummy)); + } + + [AutoConstructor] + internal readonly partial struct ActivationWithMultipleDelegatesShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + public readonly Func f1; + public readonly Func f2; + + public void Execute() { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - - [ShaderMethod] - int Dummy(int x) => x; - - device.Get().For(100, new ActivationWithDelegateShader(buffer, Dummy)); + buffer[ThreadIds.X] = f2(f1(ThreadIds.X)); } + } - [AutoConstructor] - internal readonly partial struct ActivationWithMultipleDelegatesShader : IComputeShader + [CombinatorialTestMethod] + [AllDevices] + public unsafe void ActivationWithMultipleDelegates(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + + device.Get().For(100, new ActivationWithMultipleDelegatesShader(buffer, Activations.Square, Activations.AddOne)); + + int[] result = buffer.ToArray(); + + for (int i = 0; i < 100; i++) { - public readonly ReadWriteBuffer buffer; - public readonly Func f1; - public readonly Func f2; - - public void Execute() - { - buffer[ThreadIds.X] = f2(f1(ThreadIds.X)); - } + Assert.AreEqual(result[i], Activations.AddOne(Activations.Square(i))); } + } - [CombinatorialTestMethod] - [AllDevices] - public unsafe void ActivationWithMultipleDelegates(Device device) + public const float FourAndAHalf = 4.5f; + public const int MagicNumber = 42; + + [AutoConstructor] + internal readonly partial struct DelegateWithConstantsShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + public readonly Func activation; + + public void Execute() { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - - device.Get().For(100, new ActivationWithMultipleDelegatesShader(buffer, Activations.Square, Activations.AddOne)); - - int[] result = buffer.ToArray(); - - for (int i = 0; i < 100; i++) - { - Assert.AreEqual(result[i], Activations.AddOne(Activations.Square(i))); - } + buffer[ThreadIds.X] = MagicNumber + activation(ThreadIds.X); } + } - public const float FourAndAHalf = 4.5f; - public const int MagicNumber = 42; + [CombinatorialTestMethod] + [AllDevices] + public unsafe void DelegateWithConstants(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - [AutoConstructor] - internal readonly partial struct DelegateWithConstantsShader : IComputeShader + device.Get().For(100, new DelegateWithConstantsShader(buffer, Activations.FunctionWithConstants)); + + int[] result = buffer.ToArray(); + + for (int i = 0; i < 100; i++) { - public readonly ReadWriteBuffer buffer; - public readonly Func activation; - - public void Execute() - { - buffer[ThreadIds.X] = MagicNumber + activation(ThreadIds.X); - } + Assert.AreEqual(result[i], MagicNumber + Activations.FunctionWithConstants(i)); } + } - [CombinatorialTestMethod] - [AllDevices] - public unsafe void DelegateWithConstants(Device device) + public struct Position + { + public int X; + public int Y; + } + + [AutoConstructor] + internal readonly partial struct DelegateWithTypesShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + public readonly Func activation; + + public void Execute() { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - - device.Get().For(100, new DelegateWithConstantsShader(buffer, Activations.FunctionWithConstants)); - - int[] result = buffer.ToArray(); - - for (int i = 0; i < 100; i++) - { - Assert.AreEqual(result[i], MagicNumber + Activations.FunctionWithConstants(i)); - } + buffer[ThreadIds.X] = activation(ThreadIds.X); } + } - public struct Position + [CombinatorialTestMethod] + [AllDevices] + public unsafe void DelegateWithTypes(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + + device.Get().For(100, new DelegateWithTypesShader(buffer, Activations.FunctionWithTypes)); + + Position[] result = buffer.ToArray(); + + for (int i = 0; i < 100; i++) { - public int X; - public int Y; + Assert.AreEqual(result[i].X, Activations.FunctionWithTypes(i).X); + Assert.AreEqual(result[i].Y, Activations.FunctionWithTypes(i).Y); } + } - [AutoConstructor] - internal readonly partial struct DelegateWithTypesShader : IComputeShader + [AutoConstructor] + internal readonly partial struct DelegateWithLocalFunctionsAndStaticMethodsShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + public readonly Func activation; + + public void Execute() { - public readonly ReadWriteBuffer buffer; - public readonly Func activation; - - public void Execute() - { - buffer[ThreadIds.X] = activation(ThreadIds.X); - } + buffer[ThreadIds.X] = Activations.AddOne(ThreadIds.X) + activation(ThreadIds.X); } + } - [CombinatorialTestMethod] - [AllDevices] - public unsafe void DelegateWithTypes(Device device) + [CombinatorialTestMethod] + [AllDevices] + public unsafe void DelegateWithLocalFunctionsAndStaticMethods(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); + + device.Get().For(100, new DelegateWithLocalFunctionsAndStaticMethodsShader(buffer, Activations.FunctionWithLocalFunctionAndStaticMethod)); + + int[] result = buffer.ToArray(); + + for (int i = 0; i < 100; i++) { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - - device.Get().For(100, new DelegateWithTypesShader(buffer, Activations.FunctionWithTypes)); - - Position[] result = buffer.ToArray(); - - for (int i = 0; i < 100; i++) - { - Assert.AreEqual(result[i].X, Activations.FunctionWithTypes(i).X); - Assert.AreEqual(result[i].Y, Activations.FunctionWithTypes(i).Y); - } - } - - [AutoConstructor] - internal readonly partial struct DelegateWithLocalFunctionsAndStaticMethodsShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; - public readonly Func activation; - - public void Execute() - { - buffer[ThreadIds.X] = Activations.AddOne(ThreadIds.X) + activation(ThreadIds.X); - } - } - - [CombinatorialTestMethod] - [AllDevices] - public unsafe void DelegateWithLocalFunctionsAndStaticMethods(Device device) - { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(100); - - device.Get().For(100, new DelegateWithLocalFunctionsAndStaticMethodsShader(buffer, Activations.FunctionWithLocalFunctionAndStaticMethod)); - - int[] result = buffer.ToArray(); - - for (int i = 0; i < 100; i++) - { - Assert.AreEqual(result[i], Activations.AddOne(i) + Activations.FunctionWithLocalFunctionAndStaticMethod(i)); - } + Assert.AreEqual(result[i], Activations.AddOne(i) + Activations.FunctionWithLocalFunctionAndStaticMethod(i)); } } } diff --git a/tests/ComputeSharp.Tests/Misc/ExternalStructType.cs b/tests/ComputeSharp.Tests/Misc/ExternalStructType.cs index 960d6475..b01444fd 100644 --- a/tests/ComputeSharp.Tests/Misc/ExternalStructType.cs +++ b/tests/ComputeSharp.Tests/Misc/ExternalStructType.cs @@ -1,25 +1,24 @@ -namespace ComputeSharp.Tests.Misc +namespace ComputeSharp.Tests.Misc; + +/// +/// An internal custom struct used to test semantic model information coming from different files (different syntax trees). +/// +internal struct ExternalStructType { - /// - /// An internal custom struct used to test semantic model information coming from different files (different syntax trees). - /// - internal struct ExternalStructType + public int A; + public float B; + + public static ExternalStructType New(int a, float b) { - public int A; - public float B; + ExternalStructType value; + value.A = a; + value.B = b; - public static ExternalStructType New(int a, float b) - { - ExternalStructType value; - value.A = a; - value.B = b; + return value; + } - return value; - } - - public static float Sum(ExternalStructType value) - { - return value.A + value.B; - } + public static float Sum(ExternalStructType value) + { + return value.A + value.B; } } diff --git a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs index d7712f9a..09cc75fa 100644 --- a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs +++ b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs @@ -1,4 +1,4 @@ -using ComputeSharp; +using ComputeSharp; using ComputeSharp.Interop; using ComputeSharp.Tests.Misc; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/tests/ComputeSharp.Tests/ShaderMembersTests.cs b/tests/ComputeSharp.Tests/ShaderMembersTests.cs index f1457dda..9960f410 100644 --- a/tests/ComputeSharp.Tests/ShaderMembersTests.cs +++ b/tests/ComputeSharp.Tests/ShaderMembersTests.cs @@ -1,87 +1,86 @@ -using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("ShaderMembers")] +public partial class ShaderMembersTests { - [TestClass] - [TestCategory("ShaderMembers")] - public partial class ShaderMembersTests + [CombinatorialTestMethod] + [AllDevices] + public void StaticConstants(Device device) { - [CombinatorialTestMethod] - [AllDevices] - public void StaticConstants(Device device) + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(8); + + device.Get().For(1, new StaticConstantsShader(buffer)); + + float[] results = buffer.ToArray(); + + Assert.AreEqual(3.14f, results[0], 0.00001f); + Assert.AreEqual(results[1], results[2], 0.00001f); + Assert.AreEqual(1, results[3], 0.00001f); + Assert.AreEqual(2, results[4], 0.00001f); + Assert.AreEqual(3, results[5], 0.00001f); + Assert.AreEqual(4, results[6], 0.00001f); + Assert.AreEqual(3.14f, results[7], 0.00001f); + } + + [AutoConstructor] + internal readonly partial struct StaticConstantsShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + static readonly float Pi = 3.14f; + static readonly float SinPi = Hlsl.Sin(Pi); + static readonly int2x2 Mat = new(1, 2, 3, 4); + static readonly float Combo = Hlsl.Abs(Hlsl.Clamp(Hlsl.Min(Hlsl.Max(3.14f, 2), 10), 0, 42)); + + public void Execute() { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(8); - - device.Get().For(1, new StaticConstantsShader(buffer)); - - float[] results = buffer.ToArray(); - - Assert.AreEqual(3.14f, results[0], 0.00001f); - Assert.AreEqual(results[1], results[2], 0.00001f); - Assert.AreEqual(1, results[3], 0.00001f); - Assert.AreEqual(2, results[4], 0.00001f); - Assert.AreEqual(3, results[5], 0.00001f); - Assert.AreEqual(4, results[6], 0.00001f); - Assert.AreEqual(3.14f, results[7], 0.00001f); + buffer[0] = Pi; + buffer[1] = SinPi; + buffer[2] = Hlsl.Sin(3.14f); + buffer[3] = Mat.M11; + buffer[4] = Mat.M12; + buffer[5] = Mat.M21; + buffer[6] = Mat.M22; + buffer[7] = Combo; } + } - [AutoConstructor] - internal readonly partial struct StaticConstantsShader : IComputeShader + [CombinatorialTestMethod] + [AllDevices] + public void GlobalVariable(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(32); + + device.Get().For(32, new GlobalVariableShader(buffer)); + + int[] results = buffer.ToArray(); + + for (int i = 0; i < results.Length; i++) { - public readonly ReadWriteBuffer buffer; - - static readonly float Pi = 3.14f; - static readonly float SinPi = Hlsl.Sin(Pi); - static readonly int2x2 Mat = new(1, 2, 3, 4); - static readonly float Combo = Hlsl.Abs(Hlsl.Clamp(Hlsl.Min(Hlsl.Max(3.14f, 2), 10), 0, 42)); - - public void Execute() - { - buffer[0] = Pi; - buffer[1] = SinPi; - buffer[2] = Hlsl.Sin(3.14f); - buffer[3] = Mat.M11; - buffer[4] = Mat.M12; - buffer[5] = Mat.M21; - buffer[6] = Mat.M22; - buffer[7] = Combo; - } + Assert.AreEqual(results[i], i); } + } - [CombinatorialTestMethod] - [AllDevices] - public void GlobalVariable(Device device) + [AutoConstructor] + internal readonly partial struct GlobalVariableShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + static int total; + + public void Execute() { - using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(32); - - device.Get().For(32, new GlobalVariableShader(buffer)); - - int[] results = buffer.ToArray(); - - for (int i = 0; i < results.Length; i++) + for (int i = 0; i < ThreadIds.X; i++) { - Assert.AreEqual(results[i], i); + total++; } - } - [AutoConstructor] - internal readonly partial struct GlobalVariableShader : IComputeShader - { - public readonly ReadWriteBuffer buffer; - - static int total; - - public void Execute() - { - for (int i = 0; i < ThreadIds.X; i++) - { - total++; - } - - buffer[ThreadIds.X] = total; - } + buffer[ThreadIds.X] = total; } } } diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs index 2e50beb9..166a29c4 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs @@ -1,76 +1,75 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// A shader creating an abstract and colorful animation. +/// Ported from . +/// Created by Benoit Marini. +/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +/// +[AutoConstructor] +internal readonly partial struct ColorfulInfinity : IComputeShader { /// - /// A shader creating an abstract and colorful animation. - /// Ported from . - /// Created by Benoit Marini. - /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct ColorfulInfinity : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + /// The total number of layers for the final animation. + /// + private const float NumberOfLayers = 16.0f; + + /// + /// The number of iterations to calculate a texel value. + /// + private const int NumberOfIterations = 23; + + /// + /// Makes some magic happen. + /// + private float4 Tex(float3 p) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float t = time + 78.0f; + float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f)); + float4 dec = + new float4(1.0f, 0.9f, 0.1f, 0.15f) + + new float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f)); - /// - /// The current time since the start of the application. - /// - public readonly float time; - - /// - /// The total number of layers for the final animation. - /// - private const float NumberOfLayers = 16.0f; - - /// - /// The number of iterations to calculate a texel value. - /// - private const int NumberOfIterations = 23; - - /// - /// Makes some magic happen. - /// - private float4 Tex(float3 p) + for (int i = 0; i++ < NumberOfIterations;) { - float t = time + 78.0f; - float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f)); - float4 dec = - new float4(1.0f, 0.9f, 0.1f, 0.15f) + - new float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f)); - - for (int i = 0; i++ < NumberOfIterations;) - { - o.XZYW = Hlsl.Abs(o / Hlsl.Dot(o, o) - dec); - } - - return o; + o.XZYW = Hlsl.Abs(o / Hlsl.Dot(o, o) - dec); } - /// - public void Execute() - { - float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; - float3 col = 0; - float t = time * 0.3f; - - for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers) - { - float d = Hlsl.Frac(i + t); - float s = Hlsl.Lerp(5.0f, 0.5f, d); - float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d); - - col += Tex(new float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f; - } - - col /= NumberOfLayers; - col *= new float3(2, 1.0f, 2.0f); - col = Hlsl.Pow(col, 0.5f); - - float4 color = new(col.X, col.Y, col.Z, 1.0f); - - texture[ThreadIds.XY] = color; - } + return o; } -} \ No newline at end of file + + /// + public void Execute() + { + float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; + float3 col = 0; + float t = time * 0.3f; + + for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers) + { + float d = Hlsl.Frac(i + t); + float s = Hlsl.Lerp(5.0f, 0.5f, d); + float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d); + + col += Tex(new float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f; + } + + col /= NumberOfLayers; + col *= new float3(2, 1.0f, 2.0f); + col = Hlsl.Pow(col, 0.5f); + + float4 color = new(col.X, col.Y, col.Z, 1.0f); + + texture[ThreadIds.XY] = color; + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs index d9770ac3..0748d2e5 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs @@ -1,202 +1,201 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// Constructing some concise contoured layers, then applying various edge and shading effects to produce some faux depth. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct ContouredLayers : IComputeShader { /// - /// Constructing some concise contoured layers, then applying various edge and shading effects to produce some faux depth. - /// Ported from . - /// Created by Shane. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct ContouredLayers : IComputeShader + public readonly IReadWriteTexture2D destination; + + /// + /// The current time Hlsl.Since the start of the application. + /// + public readonly float time; + + /// + /// The sampling texture. + /// + public readonly IReadOnlyTexture2D texture; + + // float3 to float hash. + private static float Hash21(float2 p) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D destination; + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))) * 45758.5453f); + } - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; + // float2 to float2 hash. + private float2 Hash22(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(1, 113))); - /// - /// The sampling texture. - /// - public readonly IReadOnlyTexture2D texture; + p = Hlsl.Frac(new float2(262144, 32768) * n); - // float3 to float hash. - private static float Hash21(float2 p) + return Hlsl.Sin(p * 6.2831853f + time); + } + + // float2 to float2 hash. + private static float2 Hash22B(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + + return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; + } + + // Smooth 2D noise + private static float Noise2D(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22B(i), p); + v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); + + p = p * p * (3.0f - 2.0f * p); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + // Based on IQ's gradient noise formula. + private float Noise2D3G(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22(i), p); + v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); + + p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + // Map function with noise layers + private float MapNoise(float3 p, float i) + { + return Noise2D3G(p.XY * 3.0f) * 0.66f + Noise2D3G(p.XY * 6.0f) * 0.34f + i / 10.0f * 1.0f - 0.15f; + } + + // 2D derivative function. + private float3 GetNormal(in float3 p, float m, float i) + { + float2 e = new(0.001f, 0); + + return new float3(m - MapNoise(p - e.XYY, i), m - MapNoise(p - e.YXY, i), 0.0f) / e.X * 1.4142f; + } + + // The map layer and its derivative + private float4 MapLayer(in float3 p, float i) + { + float4 d = default; + + d.X = MapNoise(p, i); + d.YZW = GetNormal(p, d.X, i); + + return d; + } + + // Layer color. Based on the shade, layer number and smoothing factor. + private float3 GetColor(float2 p, float sh, float fi) + { + float3 tx = texture[p + Hash21(new float2(sh, fi))].XYZ; + + tx *= tx; + + float3 col; + + col = (float3)1.0 * (1.0f - 0.75f / (1.0f + sh * sh * 2.0f)); + col = Hlsl.Min(col * tx * 3.0f, 1.0f); + + return col; + } + + // A hatch-like algorithm, or a stipple... or some kind of textured pattern. + private float Hatch(float2 p, float res) + { + p *= res / 16.0f; + + float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); + + float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); + if (hRnd > 0.66f) hatch = hRnd; + + hatch = hatch * 0.75f + 0.5f; + + return hatch; + } + + /// + public void Execute() + { + float2 fragCoord = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float res = Hlsl.Min(DispatchSize.Y, 700.0f); + float2 uv = (fragCoord - (float2)DispatchSize.XY * 0.5f) / res; + float sf = 1.0f / DispatchSize.Y; + float3 col = GetColor(uv, 0.0f, 0.0f); + float pL = 0.0f; + float hatch = Hatch(uv, res); + + col *= hatch; + + const int lNum = 5; + float flNum = lNum; + + for (int i = 0; i < lNum; i++) { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))) * 45758.5453f); + float fi = i; + + hatch = Hatch(uv + Hlsl.Sin(new float2(41.0f, 289.0f) * (fi + 1.0f)), res); + + float4 c = MapLayer(new float3(uv, 1.0f), fi); + float4 cSh = MapLayer(new float3(uv - new float2(0.03f, -0.03f) * ((flNum - fi) / flNum * 0.5f + 0.5f), 1.0f), fi); + float sh = (fi + 1.0f) / (flNum); + float3 lCol = GetColor(uv, sh, fi + 1.0f); + float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f)); + float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW); + float diff = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f); + + diff *= 2.5f; + + float3 eCol = lCol * (diff + 1.0f); + float sfL = sf * Hlsl.Length(c.YZX) * 2.0f; + float sfLSh = sf * Hlsl.Length(cSh.YZX) * 6.0f; + const float shF = 0.5f; + + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f); + col = Hlsl.Lerp(col, eCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.003f))); + col = Hlsl.Lerp(col, lCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.006f))); + + pL = c.X; } - // float2 to float2 hash. - private float2 Hash22(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(1, 113))); + col *= Hlsl.Lerp(new float3(1.8f, 1, 0.7f).ZYX, new float3(1.8f, 1, 0.7f).XZY, Noise2D(uv * 2.0f)); - p = Hlsl.Frac(new float2(262144, 32768) * n); + float3 rn3 = Noise2D(uv * DispatchSize.Y / 1.0f + 1.7f) - Noise2D(uv * DispatchSize.Y / 1.0f + 3.4f); - return Hlsl.Sin(p * 6.2831853f + time); - } + col *= 0.93f + 0.07f * rn3.XYZ + 0.07f * Hlsl.Dot(rn3, new float3(0.299f, 0.587f, 0.114f)); - // float2 to float2 hash. - private static float2 Hash22B(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + uv = fragCoord / DispatchSize.XY; - return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; - } + col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f); - // Smooth 2D noise - private static float Noise2D(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22B(i), p); - v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); - - p = p * p * (3.0f - 2.0f * p); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Based on IQ's gradient noise formula. - private float Noise2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22(i), p); - v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); - - p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Map function with noise layers - private float MapNoise(float3 p, float i) - { - return Noise2D3G(p.XY * 3.0f) * 0.66f + Noise2D3G(p.XY * 6.0f) * 0.34f + i / 10.0f * 1.0f - 0.15f; - } - - // 2D derivative function. - private float3 GetNormal(in float3 p, float m, float i) - { - float2 e = new(0.001f, 0); - - return new float3(m - MapNoise(p - e.XYY, i), m - MapNoise(p - e.YXY, i), 0.0f) / e.X * 1.4142f; - } - - // The map layer and its derivative - private float4 MapLayer(in float3 p, float i) - { - float4 d = default; - - d.X = MapNoise(p, i); - d.YZW = GetNormal(p, d.X, i); - - return d; - } - - // Layer color. Based on the shade, layer number and smoothing factor. - private float3 GetColor(float2 p, float sh, float fi) - { - float3 tx = texture[p + Hash21(new float2(sh, fi))].XYZ; - - tx *= tx; - - float3 col; - - col = (float3)1.0 * (1.0f - 0.75f / (1.0f + sh * sh * 2.0f)); - col = Hlsl.Min(col * tx * 3.0f, 1.0f); - - return col; - } - - // A hatch-like algorithm, or a stipple... or some kind of textured pattern. - private float Hatch(float2 p, float res) - { - p *= res / 16.0f; - - float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); - - float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); - if (hRnd > 0.66f) hatch = hRnd; - - hatch = hatch * 0.75f + 0.5f; - - return hatch; - } - - /// - public void Execute() - { - float2 fragCoord = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float res = Hlsl.Min(DispatchSize.Y, 700.0f); - float2 uv = (fragCoord - (float2)DispatchSize.XY * 0.5f) / res; - float sf = 1.0f / DispatchSize.Y; - float3 col = GetColor(uv, 0.0f, 0.0f); - float pL = 0.0f; - float hatch = Hatch(uv, res); - - col *= hatch; - - const int lNum = 5; - float flNum = lNum; - - for (int i = 0; i < lNum; i++) - { - float fi = i; - - hatch = Hatch(uv + Hlsl.Sin(new float2(41.0f, 289.0f) * (fi + 1.0f)), res); - - float4 c = MapLayer(new float3(uv, 1.0f), fi); - float4 cSh = MapLayer(new float3(uv - new float2(0.03f, -0.03f) * ((flNum - fi) / flNum * 0.5f + 0.5f), 1.0f), fi); - float sh = (fi + 1.0f) / (flNum); - float3 lCol = GetColor(uv, sh, fi + 1.0f); - float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f)); - float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW); - float diff = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f); - - diff *= 2.5f; - - float3 eCol = lCol * (diff + 1.0f); - float sfL = sf * Hlsl.Length(c.YZX) * 2.0f; - float sfLSh = sf * Hlsl.Length(cSh.YZX) * 6.0f; - const float shF = 0.5f; - - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f); - col = Hlsl.Lerp(col, eCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.003f))); - col = Hlsl.Lerp(col, lCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + Hlsl.Length(c.YZX) * 0.006f))); - - pL = c.X; - } - - col *= Hlsl.Lerp(new float3(1.8f, 1, 0.7f).ZYX, new float3(1.8f, 1, 0.7f).XZY, Noise2D(uv * 2.0f)); - - float3 rn3 = Noise2D(uv * DispatchSize.Y / 1.0f + 1.7f) - Noise2D(uv * DispatchSize.Y / 1.0f + 3.4f); - - col *= 0.93f + 0.07f * rn3.XYZ + 0.07f * Hlsl.Dot(rn3, new float3(0.299f, 0.587f, 0.114f)); - - uv = fragCoord / DispatchSize.XY; - - col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f); - - destination[ThreadIds.XY] = new float4(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } + destination[ThreadIds.XY] = new float4(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); } } diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs index 63abb9c4..577be909 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs @@ -1,298 +1,297 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// A basic extruded square grid-based blobby Truchet pattern. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct ExtrudedTruchetPattern : IComputeShader { /// - /// A basic extruded square grid-based blobby Truchet pattern. - /// Ported from . - /// Created by Shane. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct ExtrudedTruchetPattern : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + /// Curve shape - Round: 0, Semi-round: 1, Octagonal: 2, Superellipse: 3, Straight: 4. + /// + private static readonly int SHAPE = 0; + + /// + /// Object ID: Either the back plane or the metaballs. + /// + private static int objID; + + // Standard 2D rotation formula. + private static float2x2 Rotate2x2(float a) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - /// - /// The current time since the start of the application. - /// - public readonly float time; + return new(c, -s, s, c); + } - /// - /// Curve shape - Round: 0, Semi-round: 1, Octagonal: 2, Superellipse: 3, Straight: 4. - /// - private static readonly int SHAPE = 0; + // IQ's float2 to float hash. + private static float Hash21(float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); + } - /// - /// Object ID: Either the back plane or the metaballs. - /// - private static int objID; - - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(float a) + // Various distance metrics. + private static float Distance(float2 p) + { + if (SHAPE == 0) { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, -s, s, c); + return Hlsl.Length(p); } + else p = Hlsl.Abs(p); - // IQ's float2 to float hash. - private static float Hash21(float2 p) + switch (SHAPE) { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // Various distance metrics. - private static float Distance(float2 p) - { - if (SHAPE == 0) - { - return Hlsl.Length(p); - } - else p = Hlsl.Abs(p); - - switch (SHAPE) - { - case 1: return Hlsl.Max(Hlsl.Length(p), (p.X + p.Y) * 0.7071f + 0.015f); - case 2: return Hlsl.Max((p.X + p.Y) * 0.7071f, Hlsl.Max(p.X, p.Y)); - case 3: return Hlsl.Pow(Hlsl.Dot(Hlsl.Pow(p, 3), 1), 1.0f / 3.0f); - default: return (p.X + p.Y) * 0.7071f; - } - } - - // GLSL's mod function - private static float Mod(float x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - // A standard square grid 2D blobby Truchet routine: Render circles - // in opposite corners of a tile, reverse the pattern on alternate - // checker tiles, and randomly rotate. - private static float Truchet(float2 p) - { - const float sc = 0.5f; - float2 ip = Hlsl.Floor(p / sc) + 0.5f; - - p -= ip * sc; - - float rnd = Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(ip, new float2(1, 113))) * 45758.5453f); - - if (rnd < .5) p.Y = -p.Y; - - float d = Hlsl.Min(Distance(p - 0.5f * sc), Distance(p + 0.5f * sc)) - 0.5f * sc; - - if (SHAPE == 4) - { - d += (0.5f - 0.5f / Hlsl.Sqrt(2.0f)) * sc; - } - - if (rnd < 0.5f) d = -d; - if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) d = -d; - - return d - 0.03f; - } - - // The scene's distance function: There'd be faster ways to do this, but it's - // more readable this way. Plus, this is a pretty simple scene, so it's - // efficient enough. - private static float M(float3 p) - { - float fl = -p.Z; - float obj = Truchet(p.XY); - - obj = Hlsl.Max(obj, Hlsl.Abs(p.Z) - 0.125f) - Hlsl.SmoothStep(0.03f, 0.25f, -obj) * 0.1f; - - float studs = 1e5f; - const float sc = 0.5f; - float2 q = p.XY + 0.5f * sc; - float2 iq = Hlsl.Floor(q / sc) + 0.5f; - - q -= iq * sc; - - if (Mod(iq.X + iq.Y, 2.0f) > 0.5f) - { - studs = Hlsl.Max(Hlsl.Length(q) - 0.1f * sc - 0.02f, Hlsl.Abs(p.Z) - 0.26f); - } - - objID = fl < obj && fl < studs ? 0 : obj < studs ? 1 : 2; - - return Hlsl.Min(Hlsl.Min(fl, obj), studs); - } - - // Cheap shadows are hard. In fact, I'd almost say, shadowing particular scenes with limited - // iterations is impossible... However, I'd be very grateful if someone could prove me wrong. :) - private static float SoftShadow(float3 ro, float3 lp, float3 n, float k) - { - const int iter = 24; - - ro += n * 0.0015f; - - float3 rd = lp - ro; - float shade = 1.0f; - float t = 0; - float end = Hlsl.Max(Hlsl.Length(rd), 0.0001f); - - rd /= end; - - for (int i = 0; i < iter; i++) - { - float d = M(ro + rd * t); - - shade = Hlsl.Min(shade, k * d / t); - t += Hlsl.Clamp(d, 0.01f, 0.25f); - - if (d < 0.0f || t > end) break; - } - - return Hlsl.Max(shade, 0.0f); - } - - - // I keep a collection of occlusion routines... OK, that sounded really nerdy. :) - // Anyway, I like this one. I'm assuHlsl.Ming it's based on IQ's original. - private float CalculateAO(in float3 p, in float3 n) - { - float sca = 2.0f, occ = 0.0f; - - for (int i = (int)Hlsl.Min(time, 0f); i < 5; i++) - { - float hr = (i + 1f) * 0.15f / 5.0f; - float d = M(p + n * hr); - occ += (hr - d) * sca; - sca *= 0.7f; - - if (sca > 1e5f) break; - } - - return Hlsl.Clamp(1.0f - occ, 0.0f, 1.0f); - } - - // Standard normal function. - private static float3 Normal(in float3 p) - { - float2 e = new(0.001f, 0); - - return Hlsl.Normalize(new float3( - M(p + e.XYY) - M(p - e.XYY), - M(p + e.YXY) - M(p - e.YXY), - M(p + e.YYX) - M(p - e.YYX))); - } - - /// - public void Execute() - { - int2 coords = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float2 u = (coords - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; - float3 - r = Hlsl.Normalize(new float3(u, 1)), - o = new(0, time / 2.0f, -3), - l = o + new float3(0.25f, 0.25f, 2.0f); - - r.YZ = Hlsl.Mul(Rotate2x2(0.15f), r.YZ); - r.XZ = Hlsl.Mul(Rotate2x2(-Hlsl.Cos(time * 3.14159f / 32.0f) / 8.0f), r.XZ); - r.XY = Hlsl.Mul(Rotate2x2(Hlsl.Sin(time * 3.14159f / 32.0f) / 8.0f), r.XY); - - float d, t = Hash21(r.XY * 57.0f + Hlsl.Frac(time)) * 0.5f, glow = 0; - - for (int i = 0; i < 96; i++) - { - d = M(o + r * t); - - if (Hlsl.Abs(d) < .001) break; - - t += d * 0.7f; - glow += 0.2f / (1.0f + Hlsl.Abs(d) * 5.0f); - } - - int gObjID = objID; - float3 p = o + r * t, n = Normal(p); - float2 uv = p.XY; - float sc = 0.5f; - float2 iuv = Hlsl.Floor(uv / sc) + 0.5f; - - uv -= iuv * sc; - - float2 uv2 = p.XY + 0.5f * sc; - float2 iuv2 = Hlsl.Floor(uv2 / sc) + 0.5f; - - uv2 -= iuv2 * sc; - - float bord = Hlsl.Max(Hlsl.Abs(uv.X), Hlsl.Abs(uv.Y)) - 0.5f * sc; - - bord = Hlsl.Abs(bord) - 0.002f; - d = Truchet(p.XY); - - float lSc = 20.0f; - float pat = (Hlsl.Abs(Hlsl.Frac((uv.X - uv.Y) * lSc - 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; - float pat2 = (Hlsl.Abs(Hlsl.Frac((uv.X + uv.Y) * lSc + 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; - float sf = Hlsl.Dot(Hlsl.Sin(p.XY - Hlsl.Cos(p.YX * 2.0f)), 0.5f); - float sf2 = Hlsl.Dot(Hlsl.Sin(p.XY * 1.5f - Hlsl.Cos(p.YX * 3.0f)), 0.5f); - float4 col1 = Hlsl.Lerp(new float4(1, 0.75f, 0.6f, 0), new float4(1, 0.85f, 0.65f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf)); - float4 col2 = Hlsl.Lerp(new float4(0.4f, 0.7f, 1, 0), new float4(0.3f, 0.85f, 0.95f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf2) * 0.5f); - - col1 = Hlsl.Pow(col1, 1.6f); - col2 = Hlsl.Lerp(col1.ZYXW, Hlsl.Pow(col2, 1.4f), 0.666f); - - float4 oCol; - - if (gObjID == 0) - { - oCol = Hlsl.Lerp(col2, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat2)) * 0.35f); - oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); - - if (Mod(iuv.X + iuv.Y, 2.0f) > 0.5f) oCol *= 0.8f; - - oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, d - 0.015f)) * 0.8f); - } - else if (gObjID == 1) - { - oCol = Hlsl.Lerp(1, 0, 1.0f - Hlsl.SmoothStep(0, 0.01f, d + 0.05f)); - float4 fCol = Hlsl.Lerp(col1, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat)) * 0.35f); - fCol = Hlsl.Lerp(fCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); - - if (Mod(iuv.X + iuv.Y, 2.0f) < 0.5f) fCol *= 0.8f; - - oCol = Hlsl.Lerp(oCol, fCol, 1 - Hlsl.SmoothStep(0, 0.01f, d + 0.08f)); - oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, Hlsl.Length(uv2) - 0.08f)) * 0.8f); - } - else - { - oCol = col1; - - float ht = 0.26f; - - if (Mod(iuv2.X + iuv2.Y + 1.0f, 2.0f) > 0.5f) - { - float tmp = pat; pat = pat2; pat2 = tmp; - - oCol = col2; - ht = 0.05f; - } - - float mark = Hlsl.Length(uv2); - float markRim = Hlsl.Max(Hlsl.Abs(mark - 0.07f), Hlsl.Abs(p.Z + ht)) - 0.003f; - - oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, markRim)) * 0.8f); - oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, mark - 0.015f)) * 0.8f); - } - - float3 ld = l - p; - float lDist = Hlsl.Length(ld); - - ld /= lDist; - - float at = 1.0f / (1.0f + lDist * lDist * 0.125f); - float sh = SoftShadow(p, l, n, 8); - float ao = CalculateAO(p, n); - float df = Hlsl.Max(Hlsl.Dot(n, ld), 0); - float sp = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(r, n), ld), 0), 32); - - float4 c = oCol * (df * sh + sp * sh + 0.5f) * at * ao; - - c = Hlsl.Sqrt(Hlsl.Max(c, 0)); - - texture[ThreadIds.XY] = c; + case 1: return Hlsl.Max(Hlsl.Length(p), (p.X + p.Y) * 0.7071f + 0.015f); + case 2: return Hlsl.Max((p.X + p.Y) * 0.7071f, Hlsl.Max(p.X, p.Y)); + case 3: return Hlsl.Pow(Hlsl.Dot(Hlsl.Pow(p, 3), 1), 1.0f / 3.0f); + default: return (p.X + p.Y) * 0.7071f; } } -} \ No newline at end of file + + // GLSL's mod function + private static float Mod(float x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + // A standard square grid 2D blobby Truchet routine: Render circles + // in opposite corners of a tile, reverse the pattern on alternate + // checker tiles, and randomly rotate. + private static float Truchet(float2 p) + { + const float sc = 0.5f; + float2 ip = Hlsl.Floor(p / sc) + 0.5f; + + p -= ip * sc; + + float rnd = Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(ip, new float2(1, 113))) * 45758.5453f); + + if (rnd < .5) p.Y = -p.Y; + + float d = Hlsl.Min(Distance(p - 0.5f * sc), Distance(p + 0.5f * sc)) - 0.5f * sc; + + if (SHAPE == 4) + { + d += (0.5f - 0.5f / Hlsl.Sqrt(2.0f)) * sc; + } + + if (rnd < 0.5f) d = -d; + if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) d = -d; + + return d - 0.03f; + } + + // The scene's distance function: There'd be faster ways to do this, but it's + // more readable this way. Plus, this is a pretty simple scene, so it's + // efficient enough. + private static float M(float3 p) + { + float fl = -p.Z; + float obj = Truchet(p.XY); + + obj = Hlsl.Max(obj, Hlsl.Abs(p.Z) - 0.125f) - Hlsl.SmoothStep(0.03f, 0.25f, -obj) * 0.1f; + + float studs = 1e5f; + const float sc = 0.5f; + float2 q = p.XY + 0.5f * sc; + float2 iq = Hlsl.Floor(q / sc) + 0.5f; + + q -= iq * sc; + + if (Mod(iq.X + iq.Y, 2.0f) > 0.5f) + { + studs = Hlsl.Max(Hlsl.Length(q) - 0.1f * sc - 0.02f, Hlsl.Abs(p.Z) - 0.26f); + } + + objID = fl < obj && fl < studs ? 0 : obj < studs ? 1 : 2; + + return Hlsl.Min(Hlsl.Min(fl, obj), studs); + } + + // Cheap shadows are hard. In fact, I'd almost say, shadowing particular scenes with limited + // iterations is impossible... However, I'd be very grateful if someone could prove me wrong. :) + private static float SoftShadow(float3 ro, float3 lp, float3 n, float k) + { + const int iter = 24; + + ro += n * 0.0015f; + + float3 rd = lp - ro; + float shade = 1.0f; + float t = 0; + float end = Hlsl.Max(Hlsl.Length(rd), 0.0001f); + + rd /= end; + + for (int i = 0; i < iter; i++) + { + float d = M(ro + rd * t); + + shade = Hlsl.Min(shade, k * d / t); + t += Hlsl.Clamp(d, 0.01f, 0.25f); + + if (d < 0.0f || t > end) break; + } + + return Hlsl.Max(shade, 0.0f); + } + + + // I keep a collection of occlusion routines... OK, that sounded really nerdy. :) + // Anyway, I like this one. I'm assuHlsl.Ming it's based on IQ's original. + private float CalculateAO(in float3 p, in float3 n) + { + float sca = 2.0f, occ = 0.0f; + + for (int i = (int)Hlsl.Min(time, 0f); i < 5; i++) + { + float hr = (i + 1f) * 0.15f / 5.0f; + float d = M(p + n * hr); + occ += (hr - d) * sca; + sca *= 0.7f; + + if (sca > 1e5f) break; + } + + return Hlsl.Clamp(1.0f - occ, 0.0f, 1.0f); + } + + // Standard normal function. + private static float3 Normal(in float3 p) + { + float2 e = new(0.001f, 0); + + return Hlsl.Normalize(new float3( + M(p + e.XYY) - M(p - e.XYY), + M(p + e.YXY) - M(p - e.YXY), + M(p + e.YYX) - M(p - e.YYX))); + } + + /// + public void Execute() + { + int2 coords = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float2 u = (coords - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; + float3 + r = Hlsl.Normalize(new float3(u, 1)), + o = new(0, time / 2.0f, -3), + l = o + new float3(0.25f, 0.25f, 2.0f); + + r.YZ = Hlsl.Mul(Rotate2x2(0.15f), r.YZ); + r.XZ = Hlsl.Mul(Rotate2x2(-Hlsl.Cos(time * 3.14159f / 32.0f) / 8.0f), r.XZ); + r.XY = Hlsl.Mul(Rotate2x2(Hlsl.Sin(time * 3.14159f / 32.0f) / 8.0f), r.XY); + + float d, t = Hash21(r.XY * 57.0f + Hlsl.Frac(time)) * 0.5f, glow = 0; + + for (int i = 0; i < 96; i++) + { + d = M(o + r * t); + + if (Hlsl.Abs(d) < .001) break; + + t += d * 0.7f; + glow += 0.2f / (1.0f + Hlsl.Abs(d) * 5.0f); + } + + int gObjID = objID; + float3 p = o + r * t, n = Normal(p); + float2 uv = p.XY; + float sc = 0.5f; + float2 iuv = Hlsl.Floor(uv / sc) + 0.5f; + + uv -= iuv * sc; + + float2 uv2 = p.XY + 0.5f * sc; + float2 iuv2 = Hlsl.Floor(uv2 / sc) + 0.5f; + + uv2 -= iuv2 * sc; + + float bord = Hlsl.Max(Hlsl.Abs(uv.X), Hlsl.Abs(uv.Y)) - 0.5f * sc; + + bord = Hlsl.Abs(bord) - 0.002f; + d = Truchet(p.XY); + + float lSc = 20.0f; + float pat = (Hlsl.Abs(Hlsl.Frac((uv.X - uv.Y) * lSc - 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; + float pat2 = (Hlsl.Abs(Hlsl.Frac((uv.X + uv.Y) * lSc + 0.5f) - 0.5f) * 2.0f - 0.5f) / lSc; + float sf = Hlsl.Dot(Hlsl.Sin(p.XY - Hlsl.Cos(p.YX * 2.0f)), 0.5f); + float sf2 = Hlsl.Dot(Hlsl.Sin(p.XY * 1.5f - Hlsl.Cos(p.YX * 3.0f)), 0.5f); + float4 col1 = Hlsl.Lerp(new float4(1, 0.75f, 0.6f, 0), new float4(1, 0.85f, 0.65f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf)); + float4 col2 = Hlsl.Lerp(new float4(0.4f, 0.7f, 1, 0), new float4(0.3f, 0.85f, 0.95f, 0), Hlsl.SmoothStep(-0.5f, 0.5f, sf2) * 0.5f); + + col1 = Hlsl.Pow(col1, 1.6f); + col2 = Hlsl.Lerp(col1.ZYXW, Hlsl.Pow(col2, 1.4f), 0.666f); + + float4 oCol; + + if (gObjID == 0) + { + oCol = Hlsl.Lerp(col2, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat2)) * 0.35f); + oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); + + if (Mod(iuv.X + iuv.Y, 2.0f) > 0.5f) oCol *= 0.8f; + + oCol = Hlsl.Lerp(oCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, d - 0.015f)) * 0.8f); + } + else if (gObjID == 1) + { + oCol = Hlsl.Lerp(1, 0, 1.0f - Hlsl.SmoothStep(0, 0.01f, d + 0.05f)); + float4 fCol = Hlsl.Lerp(col1, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, pat)) * 0.35f); + fCol = Hlsl.Lerp(fCol, 0, (1.0f - Hlsl.SmoothStep(0, 0.01f, bord)) * 0.8f); + + if (Mod(iuv.X + iuv.Y, 2.0f) < 0.5f) fCol *= 0.8f; + + oCol = Hlsl.Lerp(oCol, fCol, 1 - Hlsl.SmoothStep(0, 0.01f, d + 0.08f)); + oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, Hlsl.Length(uv2) - 0.08f)) * 0.8f); + } + else + { + oCol = col1; + + float ht = 0.26f; + + if (Mod(iuv2.X + iuv2.Y + 1.0f, 2.0f) > 0.5f) + { + float tmp = pat; pat = pat2; pat2 = tmp; + + oCol = col2; + ht = 0.05f; + } + + float mark = Hlsl.Length(uv2); + float markRim = Hlsl.Max(Hlsl.Abs(mark - 0.07f), Hlsl.Abs(p.Z + ht)) - 0.003f; + + oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, markRim)) * 0.8f); + oCol = Hlsl.Lerp(oCol, 0, (1 - Hlsl.SmoothStep(0, 0.01f, mark - 0.015f)) * 0.8f); + } + + float3 ld = l - p; + float lDist = Hlsl.Length(ld); + + ld /= lDist; + + float at = 1.0f / (1.0f + lDist * lDist * 0.125f); + float sh = SoftShadow(p, l, n, 8); + float ao = CalculateAO(p, n); + float df = Hlsl.Max(Hlsl.Dot(n, ld), 0); + float sp = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(r, n), ld), 0), 32); + + float4 c = oCol * (df * sh + sp * sh + 0.5f) * at * ao; + + c = Hlsl.Sqrt(Hlsl.Max(c, 0)); + + texture[ThreadIds.XY] = c; + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs b/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs index fb156208..6ee58518 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs @@ -1,51 +1,50 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// A shader creating a fractal tiling animation. +/// Ported from . +/// Created by Inigo Quilez. +/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +/// +[AutoConstructor] +internal readonly partial struct FractalTiling : IComputeShader { /// - /// A shader creating a fractal tiling animation. - /// Ported from . - /// Created by Inigo Quilez. - /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct FractalTiling : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + public void Execute() { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float2 position = ((float2)(256 * ThreadIds.XY)) / DispatchSize.X + time; + float4 color = 0; - /// - /// The current time since the start of the application. - /// - public readonly float time; - - /// - public void Execute() + for (int i = 0; i < 6; i++) { - float2 position = ((float2)(256 * ThreadIds.XY)) / DispatchSize.X + time; - float4 color = 0; + float2 a = Hlsl.Floor(position); + float2 b = Hlsl.Frac(position); + float4 w = Hlsl.Frac( + (Hlsl.Sin(a.X * 7 + 31.0f * a.Y + 0.01f * time) + + new float4(0.035f, 0.01f, 0, 0.7f)) + * 13.545317f); - for (int i = 0; i < 6; i++) - { - float2 a = Hlsl.Floor(position); - float2 b = Hlsl.Frac(position); - float4 w = Hlsl.Frac( - (Hlsl.Sin(a.X * 7 + 31.0f * a.Y + 0.01f * time) + - new float4(0.035f, 0.01f, 0, 0.7f)) - * 13.545317f); + color.XYZ += w.XYZ * + 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) * + Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y)); - color.XYZ += w.XYZ * - 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) * - Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y)); - - position /= 2.0f; - color /= 2.0f; - } - - color.XYZ = Hlsl.Pow(color.XYZ, new float3(0.7f, 0.8f, 0.5f)); - color.W = 1.0f; - - texture[ThreadIds.XY] = color; + position /= 2.0f; + color /= 2.0f; } + + color.XYZ = Hlsl.Pow(color.XYZ, new float3(0.7f, 0.8f, 0.5f)); + color.W = 1.0f; + + texture[ThreadIds.XY] = color; } -} \ No newline at end of file +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs b/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs index 593d68b7..bc54d018 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs @@ -1,175 +1,174 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// A shader creating a flythrough in a Menger system. +/// Ported from . +/// Created by Syntopia. +/// +[AutoConstructor] +internal readonly partial struct MengerJourney : IComputeShader { /// - /// A shader creating a flythrough in a Menger system. - /// Ported from . - /// Created by Syntopia. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct MengerJourney : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + private const int MaxSteps = 30; + private const float MinimumDistance = 0.0009f; + private const float NormalDistance = 0.0002f; + private const int Iterations = 7; + private const float Scale = 3.0f; + private const float FieldOfView = 1.0f; + private const float Jitter = 0.05f; + private const float FudgeFactor = 0.7f; + private const float NonLinearPerspective = 2.0f; + private const float Ambient = 0.32184f; + private const float Diffuse = 0.5f; + + private static readonly float3 LightDir = 1.0f; + private static readonly float3 LightColor = new(1.0f, 1.0f, 0.858824f); + private static readonly float3 LightDir2 = new(1.0f, -1.0f, 1.0f); + private static readonly float3 LightColor2 = new(0, 0.333333f, 1.0f); + private static readonly float3 Offset = new(0.92858f, 0.92858f, 0.32858f); + + /// + /// Rotates a given value by a specified amount. + /// + private static float2 Rotate(float2 v, float a) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; - - /// - /// The current time since the start of the application. - /// - public readonly float time; - - private const int MaxSteps = 30; - private const float MinimumDistance = 0.0009f; - private const float NormalDistance = 0.0002f; - private const int Iterations = 7; - private const float Scale = 3.0f; - private const float FieldOfView = 1.0f; - private const float Jitter = 0.05f; - private const float FudgeFactor = 0.7f; - private const float NonLinearPerspective = 2.0f; - private const float Ambient = 0.32184f; - private const float Diffuse = 0.5f; - - private static readonly float3 LightDir = 1.0f; - private static readonly float3 LightColor = new(1.0f, 1.0f, 0.858824f); - private static readonly float3 LightDir2 = new(1.0f, -1.0f, 1.0f); - private static readonly float3 LightColor2 = new(0, 0.333333f, 1.0f); - private static readonly float3 Offset = new(0.92858f, 0.92858f, 0.32858f); - - /// - /// Rotates a given value by a specified amount. - /// - private static float2 Rotate(float2 v, float a) - { - return new(Hlsl.Cos(a) * v.X + Hlsl.Sin(a) * v.Y, -Hlsl.Sin(a) * v.X + Hlsl.Cos(a) * v.Y); - } - - /// - /// Calculates the light at a specified normal and starting color. - /// Uses two light sources and no specular lights. - /// - private static float3 GetLight(in float3 color, in float3 normal) - { - float3 lightDir = Hlsl.Normalize(LightDir); - float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir)); - - float3 lightDir2 = Hlsl.Normalize(LightDir2); - float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2)); - - return - (diffuse * Diffuse) * (LightColor * color) + - (diffuse2 * Diffuse) * (LightColor2 * color); - } - - /// - /// DE: Infinitely tiled Menger IFS. - /// For more info on KIFS, see - /// - private float DE(float3 z) - { - // Performs the GLSL mod function. - static float3 Mod(float3 x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - z = Hlsl.Abs(1.0f - Mod(z, 2.0f)); - - float d = 1000.0f; - - for (int n = 0; n < Iterations; n++) - { - z.XY = Rotate(z.XY, 4.0f + 2.0f * Hlsl.Cos(time / 8.0f)); - z = Hlsl.Abs(z); - - if (z.X < z.Y) { z.XY = z.YX; } - if (z.X < z.Z) { z.XZ = z.ZX; } - if (z.Y < z.Z) { z.YZ = z.ZY; } - - z = Scale * z - Offset * (Scale - 1.0f); - - if (z.Z < -0.5f * Offset.Z * (Scale - 1.0)) - { - z.Z += Offset.Z * (Scale - 1.0f); - } - - d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f)); - } - - return d - 0.001f; - } - - /// - /// Calculates the finite difference normal at a given position. - /// - private float3 getNormal(in float3 pos) - { - float3 e = new(0.0f, NormalDistance, 0.0f); - - return Hlsl.Normalize(new float3( - DE(pos + e.YXX) - DE(pos - e.YXX), - DE(pos + e.XYX) - DE(pos - e.XYX), - DE(pos + e.XXY) - DE(pos - e.XXY))); - } - - /// - /// Performs a ray march operation on a specific position. - /// - private float4 RayMarch(in float3 from, float3 dir, in float2 fragCoord) - { - // Computes a pseudo-random number - static float Rand(float2 co) - { - return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new float2(4.898f, 7.23f))) * 23421.631f); - } - - float totalDistance = Jitter * Rand(fragCoord.XY + time); - float3 dir2 = dir; - float distance = 0; - int steps = 0; - float3 pos = 0; - - for (int i = 0; i < MaxSteps; i++) - { - dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective); - pos = from + totalDistance * dir; - distance = DE(pos) * FudgeFactor; - totalDistance += distance; - - if (distance < MinimumDistance) break; - - steps = i; - } - - float smoothStep = steps + distance / MinimumDistance; - float ao = 1.1f - smoothStep / MaxSteps; - float3 normal = getNormal(pos - dir * NormalDistance * 3.0f); - float3 color = 1.0f; - float3 light = GetLight(color, normal); - - color = (color * Ambient + light) * ao; - - return new(color.X, color.Y, color.Z, 1.0f); - } - - /// - public void Execute() - { - float3 camPos = 0.5f * time * new float3(1.0f, 0.0f, 0.0f); - float3 target = camPos + new float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time)); - float3 camDir = Hlsl.Normalize(target - camPos); - float3 camUp = new(0.0f, 1.0f, 0.0f); - - camUp = Hlsl.Normalize(camUp - Hlsl.Dot(camDir, camUp) * camDir); - - float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp)); - float2 coord = -1.0f + 2.0f * (float2)ThreadIds.XY / DispatchSize.XY; - - coord.X *= (float)DispatchSize.X / DispatchSize.Y; - - float3 rayDir = Hlsl.Normalize(camDir + (coord.X * camRight + coord.Y * camUp) * FieldOfView); - - texture[ThreadIds.XY] = RayMarch(camPos, rayDir, ThreadIds.XY); - } + return new(Hlsl.Cos(a) * v.X + Hlsl.Sin(a) * v.Y, -Hlsl.Sin(a) * v.X + Hlsl.Cos(a) * v.Y); } -} \ No newline at end of file + + /// + /// Calculates the light at a specified normal and starting color. + /// Uses two light sources and no specular lights. + /// + private static float3 GetLight(in float3 color, in float3 normal) + { + float3 lightDir = Hlsl.Normalize(LightDir); + float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir)); + + float3 lightDir2 = Hlsl.Normalize(LightDir2); + float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2)); + + return + (diffuse * Diffuse) * (LightColor * color) + + (diffuse2 * Diffuse) * (LightColor2 * color); + } + + /// + /// DE: Infinitely tiled Menger IFS. + /// For more info on KIFS, see + /// + private float DE(float3 z) + { + // Performs the GLSL mod function. + static float3 Mod(float3 x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + z = Hlsl.Abs(1.0f - Mod(z, 2.0f)); + + float d = 1000.0f; + + for (int n = 0; n < Iterations; n++) + { + z.XY = Rotate(z.XY, 4.0f + 2.0f * Hlsl.Cos(time / 8.0f)); + z = Hlsl.Abs(z); + + if (z.X < z.Y) { z.XY = z.YX; } + if (z.X < z.Z) { z.XZ = z.ZX; } + if (z.Y < z.Z) { z.YZ = z.ZY; } + + z = Scale * z - Offset * (Scale - 1.0f); + + if (z.Z < -0.5f * Offset.Z * (Scale - 1.0)) + { + z.Z += Offset.Z * (Scale - 1.0f); + } + + d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f)); + } + + return d - 0.001f; + } + + /// + /// Calculates the finite difference normal at a given position. + /// + private float3 getNormal(in float3 pos) + { + float3 e = new(0.0f, NormalDistance, 0.0f); + + return Hlsl.Normalize(new float3( + DE(pos + e.YXX) - DE(pos - e.YXX), + DE(pos + e.XYX) - DE(pos - e.XYX), + DE(pos + e.XXY) - DE(pos - e.XXY))); + } + + /// + /// Performs a ray march operation on a specific position. + /// + private float4 RayMarch(in float3 from, float3 dir, in float2 fragCoord) + { + // Computes a pseudo-random number + static float Rand(float2 co) + { + return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new float2(4.898f, 7.23f))) * 23421.631f); + } + + float totalDistance = Jitter * Rand(fragCoord.XY + time); + float3 dir2 = dir; + float distance = 0; + int steps = 0; + float3 pos = 0; + + for (int i = 0; i < MaxSteps; i++) + { + dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective); + pos = from + totalDistance * dir; + distance = DE(pos) * FudgeFactor; + totalDistance += distance; + + if (distance < MinimumDistance) break; + + steps = i; + } + + float smoothStep = steps + distance / MinimumDistance; + float ao = 1.1f - smoothStep / MaxSteps; + float3 normal = getNormal(pos - dir * NormalDistance * 3.0f); + float3 color = 1.0f; + float3 light = GetLight(color, normal); + + color = (color * Ambient + light) * ao; + + return new(color.X, color.Y, color.Z, 1.0f); + } + + /// + public void Execute() + { + float3 camPos = 0.5f * time * new float3(1.0f, 0.0f, 0.0f); + float3 target = camPos + new float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time)); + float3 camDir = Hlsl.Normalize(target - camPos); + float3 camUp = new(0.0f, 1.0f, 0.0f); + + camUp = Hlsl.Normalize(camUp - Hlsl.Dot(camDir, camUp) * camDir); + + float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp)); + float2 coord = -1.0f + 2.0f * (float2)ThreadIds.XY / DispatchSize.XY; + + coord.X *= (float)DispatchSize.X / DispatchSize.Y; + + float3 rayDir = Hlsl.Normalize(camDir + (coord.X * camRight + coord.Y * camUp) * FieldOfView); + + texture[ThreadIds.XY] = RayMarch(camPos, rayDir, ThreadIds.XY); + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs b/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs index 1fd5141c..a3da394a 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs @@ -1,128 +1,127 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// A shader creating an octagram animation, inspired by arabesque. +/// Ported from . +/// Created by whisky_shusuky. +/// +[AutoConstructor] +internal readonly partial struct Octagrams : IComputeShader { /// - /// A shader creating an octagram animation, inspired by arabesque. - /// Ported from . - /// Created by whisky_shusuky. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct Octagrams : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + private static float2x2 Rotate(float a) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - /// - /// The current time since the start of the application. - /// - public readonly float time; - - private static float2x2 Rotate(float a) - { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, s, -s, c); - } - - private static float Box(float3 pos, float scale) - { - static float SDBox(float3 p, float3 b) - { - float3 q = Hlsl.Abs(p) - b; - - return Hlsl.Length(Hlsl.Max(q, 0.0f)) + - Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f); - } - - pos *= scale; - - float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f; - - pos.XY *= 5.0f; - pos.Y -= 3.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f)); - - return -b; - } - - private static float BoxSet(float3 pos, float gTime) - { - float3 pos_origin = pos; - - pos = pos_origin; - pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box1 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box2 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box3 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box4 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); - - pos = pos_origin; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box5 = Box(pos, 0.5f) * 6.0f; - - pos = pos_origin; - - float box6 = Box(pos, 0.5f) * 6.0f; - float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6); - - return result; - } - - /// - public void Execute() - { - float2 p = ((float2)ThreadIds.XY * 2.0f - DispatchSize.XY) / Hlsl.Min(DispatchSize.X, DispatchSize.Y); - float3 ro = new(0.0f, -0.2f, time * 4.0f); - float3 ray = Hlsl.Normalize(new float3(p, 1.5f)); - - ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f)); - ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f)); - - float t = 0.1f; - float ac = 0.0f; - - for (int i = 0; i < 99; i++) - { - static float3 Mod(float3 x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - float3 pos = ro + ray * t; - - pos = Mod(pos - 2.0f, 4.0f) - 2.0f; - - float gTime = time - i * 0.01f; - float d = BoxSet(pos, gTime); - - d = Hlsl.Max(Hlsl.Abs(d), 0.01f); - ac += Hlsl.Exp(-d * 23.0f); - t += d * 0.55f; - } - - float3 col = ac * 0.02f + new float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + Hlsl.Sin(time) * 0.2f); - float4 color = new(col, 1.0f - t * (0.02f + 0.02f * Hlsl.Sin(time))); - - texture[ThreadIds.XY] = color; - } + return new(c, s, -s, c); } -} \ No newline at end of file + + private static float Box(float3 pos, float scale) + { + static float SDBox(float3 p, float3 b) + { + float3 q = Hlsl.Abs(p) - b; + + return Hlsl.Length(Hlsl.Max(q, 0.0f)) + + Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f); + } + + pos *= scale; + + float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f; + + pos.XY *= 5.0f; + pos.Y -= 3.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f)); + + return -b; + } + + private static float BoxSet(float3 pos, float gTime) + { + float3 pos_origin = pos; + + pos = pos_origin; + pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box1 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box2 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box3 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box4 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box5 = Box(pos, 0.5f) * 6.0f; + + pos = pos_origin; + + float box6 = Box(pos, 0.5f) * 6.0f; + float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6); + + return result; + } + + /// + public void Execute() + { + float2 p = ((float2)ThreadIds.XY * 2.0f - DispatchSize.XY) / Hlsl.Min(DispatchSize.X, DispatchSize.Y); + float3 ro = new(0.0f, -0.2f, time * 4.0f); + float3 ray = Hlsl.Normalize(new float3(p, 1.5f)); + + ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f)); + ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f)); + + float t = 0.1f; + float ac = 0.0f; + + for (int i = 0; i < 99; i++) + { + static float3 Mod(float3 x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + float3 pos = ro + ray * t; + + pos = Mod(pos - 2.0f, 4.0f) - 2.0f; + + float gTime = time - i * 0.01f; + float d = BoxSet(pos, gTime); + + d = Hlsl.Max(Hlsl.Abs(d), 0.01f); + ac += Hlsl.Exp(-d * 23.0f); + t += d * 0.55f; + } + + float3 col = ac * 0.02f + new float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + Hlsl.Sin(time) * 0.2f); + float4 color = new(col, 1.0f - t * (0.02f + 0.02f * Hlsl.Sin(time))); + + texture[ThreadIds.XY] = color; + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs index dc76041e..eddb54ce 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs @@ -1,173 +1,172 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// Fully procedural 3D animated volume with three evaluations per step (for shading). +/// Ported from . +/// Created by nimitz (twitter: @stormoid). +/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. +/// +[AutoConstructor] +internal readonly partial struct ProteanClouds : IComputeShader { /// - /// Fully procedural 3D animated volume with three evaluations per step (for shading). - /// Ported from . - /// Created by nimitz (twitter: @stormoid). - /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct ProteanClouds : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time Hlsl.Since the start of the application. + /// + public readonly float time; + + private static readonly float3x3 m3 = new float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f; + + private static float2x2 Rotate(in float a) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; - - private static readonly float3x3 m3 = new float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f; - - private static float2x2 Rotate(in float a) - { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, s, -s, c); - } - - private static float LinStep(in float mn, in float mx, in float x) - { - return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f); - } - - private static float2 Disp(float t) - { - return new float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f; - } - - private float2 Map(float3 p, float prm1, float2 bsMo) - { - float3 p2 = p; - - p2.XY -= Disp(p.Z).XY; - p.XY = Hlsl.Mul(p.XY, Rotate(Hlsl.Sin(p.Z + time) * (0.1f + prm1 * 0.05f) + time * 0.09f)); - - float cl = Hlsl.Dot(p2.XY, p2.XY); - float d = 0.0f; - - p *= 0.61f; - - float z = 1.0f; - float trk = 1.0f; - float dspAmp = 0.1f + prm1 * 0.2f; - - for (int i = 0; i < 5; i++) - { - p += Hlsl.Sin(p.ZXY * 0.75f * trk + time * trk * 0.8f) * dspAmp; - d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z); - z *= 0.57f; - trk *= 1.4f; - - p = Hlsl.Mul(p, m3); - } - - d = Hlsl.Abs(d + prm1 * 3.0f) + prm1 * 0.3f - 2.5f + bsMo.Y; - - return new float2(d + cl * 0.2f + 0.25f, cl); - } - - private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo) - { - float4 rez = 0; - float t = 1.5f; - float fogT = 0; - - for (int i = 0; i < 130; i++) - { - if (rez.A > 0.99f) break; - - float3 pos = ro + t * rd; - float2 mpv = Map(pos, prm1, bsMo); - float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f; - float dn = Hlsl.Clamp((mpv.X + 2.0f), 0.0f, 3.0f); - float4 col = 0f; - - if (mpv.X > 0.6f) - { - - col = new float4(Hlsl.Sin(new float3(5.0f, 0.4f, 0.2f) + mpv.Y * 0.1f + Hlsl.Sin(pos.Z * 0.4f) * 0.5f + 1.8f) * 0.5f + 0.5f, 0.08f); - col *= den * den * den; - col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f; - - float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f); - - dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f); - col.XYZ *= den * (new float3(0.005f, 0.045f, 0.075f) + 1.5f * new float3(0.033f, 0.07f, 0.03f) * dif); - } - - float fogC = Hlsl.Exp(t * 0.2f - 2.2f); - - col += new float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f); - fogT = fogC; - rez += col * (1.0f - rez.A); - t += Hlsl.Clamp(0.5f - dn * dn * 0.05f, 0.09f, 0.3f); - } - - return Hlsl.Clamp(rez, 0.0f, 1.0f); - } - - private static float GetSaturation(float3 c) - { - float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z); - float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z); - - return (ma - mi) / (ma + (float)1e-7); - } - - private static float3 ILerp(in float3 a, in float3 b, in float x) - { - float3 ic = Hlsl.Lerp(a, b, x) + new float3((float)1e-6, 0.0f, 0.0f); - float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x)); - float3 dir = Hlsl.Normalize(new float3(2.0f * ic.X - ic.Y - ic.Z, 2.0f * ic.Y - ic.X - ic.Z, 2.0f * ic.Z - ic.Y - ic.X)); - float lgt = Hlsl.Dot(1.0f, ic); - float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic)); - - ic += 1.5f * dir * sd * ff * lgt; - - return Hlsl.Clamp(ic, 0.0f, 1.0f); - } - - /// - public void Execute() - { - float2 q = (float2)ThreadIds.XY / DispatchSize.XY; - float2 p = (ThreadIds.XY - 0.5f * (float2)DispatchSize.XY) / DispatchSize.Y; - float2 bsMo = -0.5f * (float2)DispatchSize.XY / DispatchSize.Y; - float scaledTime = time * 3.0f; - float3 ro = new(0, 0, scaledTime); - - ro += new float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0); - - float dspAmp = 0.85f; - - ro.XY += Disp(ro.Z) * dspAmp; - - float tgtDst = 3.5f; - float3 target = Hlsl.Normalize(ro - new float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst)); - - ro.X -= bsMo.X * 2.0f; - - float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new float3(0, 1, 0))); - float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target)); - - rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target)); - - float3 rd = Hlsl.Normalize((p.X * rightdir + p.Y * updir) * 1.0f - target); - - rd.XY = Hlsl.Mul(rd.XY, Rotate(-Disp(scaledTime + 3.5f).X * 0.2f + bsMo.X)); - - float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f)); - float4 scn = Render(ro, rd, scaledTime, prm1, bsMo); - float3 col = scn.RGB; - - col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f)); - col = Hlsl.Pow(col, new float3(0.55f, 0.65f, 0.6f)) * new float3(1.0f, 0.97f, 0.9f); - col *= Hlsl.Pow(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y), 0.12f) * 0.7f + 0.3f; - - texture[ThreadIds.XY] = new float4(col, 1.0f); - } + return new(c, s, -s, c); } -} \ No newline at end of file + + private static float LinStep(in float mn, in float mx, in float x) + { + return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f); + } + + private static float2 Disp(float t) + { + return new float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f; + } + + private float2 Map(float3 p, float prm1, float2 bsMo) + { + float3 p2 = p; + + p2.XY -= Disp(p.Z).XY; + p.XY = Hlsl.Mul(p.XY, Rotate(Hlsl.Sin(p.Z + time) * (0.1f + prm1 * 0.05f) + time * 0.09f)); + + float cl = Hlsl.Dot(p2.XY, p2.XY); + float d = 0.0f; + + p *= 0.61f; + + float z = 1.0f; + float trk = 1.0f; + float dspAmp = 0.1f + prm1 * 0.2f; + + for (int i = 0; i < 5; i++) + { + p += Hlsl.Sin(p.ZXY * 0.75f * trk + time * trk * 0.8f) * dspAmp; + d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z); + z *= 0.57f; + trk *= 1.4f; + + p = Hlsl.Mul(p, m3); + } + + d = Hlsl.Abs(d + prm1 * 3.0f) + prm1 * 0.3f - 2.5f + bsMo.Y; + + return new float2(d + cl * 0.2f + 0.25f, cl); + } + + private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo) + { + float4 rez = 0; + float t = 1.5f; + float fogT = 0; + + for (int i = 0; i < 130; i++) + { + if (rez.A > 0.99f) break; + + float3 pos = ro + t * rd; + float2 mpv = Map(pos, prm1, bsMo); + float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f; + float dn = Hlsl.Clamp((mpv.X + 2.0f), 0.0f, 3.0f); + float4 col = 0f; + + if (mpv.X > 0.6f) + { + + col = new float4(Hlsl.Sin(new float3(5.0f, 0.4f, 0.2f) + mpv.Y * 0.1f + Hlsl.Sin(pos.Z * 0.4f) * 0.5f + 1.8f) * 0.5f + 0.5f, 0.08f); + col *= den * den * den; + col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f; + + float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f); + + dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f); + col.XYZ *= den * (new float3(0.005f, 0.045f, 0.075f) + 1.5f * new float3(0.033f, 0.07f, 0.03f) * dif); + } + + float fogC = Hlsl.Exp(t * 0.2f - 2.2f); + + col += new float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f); + fogT = fogC; + rez += col * (1.0f - rez.A); + t += Hlsl.Clamp(0.5f - dn * dn * 0.05f, 0.09f, 0.3f); + } + + return Hlsl.Clamp(rez, 0.0f, 1.0f); + } + + private static float GetSaturation(float3 c) + { + float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z); + float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z); + + return (ma - mi) / (ma + (float)1e-7); + } + + private static float3 ILerp(in float3 a, in float3 b, in float x) + { + float3 ic = Hlsl.Lerp(a, b, x) + new float3((float)1e-6, 0.0f, 0.0f); + float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x)); + float3 dir = Hlsl.Normalize(new float3(2.0f * ic.X - ic.Y - ic.Z, 2.0f * ic.Y - ic.X - ic.Z, 2.0f * ic.Z - ic.Y - ic.X)); + float lgt = Hlsl.Dot(1.0f, ic); + float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic)); + + ic += 1.5f * dir * sd * ff * lgt; + + return Hlsl.Clamp(ic, 0.0f, 1.0f); + } + + /// + public void Execute() + { + float2 q = (float2)ThreadIds.XY / DispatchSize.XY; + float2 p = (ThreadIds.XY - 0.5f * (float2)DispatchSize.XY) / DispatchSize.Y; + float2 bsMo = -0.5f * (float2)DispatchSize.XY / DispatchSize.Y; + float scaledTime = time * 3.0f; + float3 ro = new(0, 0, scaledTime); + + ro += new float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0); + + float dspAmp = 0.85f; + + ro.XY += Disp(ro.Z) * dspAmp; + + float tgtDst = 3.5f; + float3 target = Hlsl.Normalize(ro - new float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst)); + + ro.X -= bsMo.X * 2.0f; + + float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new float3(0, 1, 0))); + float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target)); + + rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target)); + + float3 rd = Hlsl.Normalize((p.X * rightdir + p.Y * updir) * 1.0f - target); + + rd.XY = Hlsl.Mul(rd.XY, Rotate(-Disp(scaledTime + 3.5f).X * 0.2f + bsMo.X)); + + float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f)); + float4 scn = Render(ro, rd, scaledTime, prm1, bsMo); + float3 col = scn.RGB; + + col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f)); + col = Hlsl.Pow(col, new float3(0.55f, 0.65f, 0.6f)) * new float3(1.0f, 0.97f, 0.9f); + col *= Hlsl.Pow(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y), 0.12f) * 0.7f + 0.3f; + + texture[ThreadIds.XY] = new float4(col, 1.0f); + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs b/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs index a122758f..e8308f06 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs @@ -1,183 +1,182 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// An offset grid of square-based pyramids whose tips have been offset according to an underlying directional noise field. +/// The faux lighting is provided via bump mapping. No raymarching was harmed during the making of this example. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct PyramidPattern : IComputeShader { /// - /// An offset grid of square-based pyramids whose tips have been offset according to an underlying directional noise field. - /// The faux lighting is provided via bump mapping. No raymarching was harmed during the making of this example. - /// Ported from . - /// Created by Shane. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct PyramidPattern : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time Hlsl.Since the start of the application. + /// + public readonly float time; + + // Standard 2D rotation formula. + private static float2x2 Rotate2x2(in float a) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; - - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(in float a) - { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, -s, s, c); - } - - // IQ's float2 to float hash. - private static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // float2 to float2 hash. - private static float2 Hash22B(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); - - return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; - } - - // Based on IQ's gradient noise formula. - private static float N2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22B(i), p); - v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); - - p = p * p * (3.0f - 2.0f * p); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Two layers of noise. - private static float FBM(float2 p) - { - return N2D3G(p) * 0.66f + N2D3G(p * 2.0f) * 0.34f; - } - - // HLSL mod from GLSL - private static float Mod(float x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - private float BMap(float2 p) - { - p = Hlsl.Mul(p, Rotate2x2(-3.14159f / 5.0f)); - - if (Mod(Hlsl.Floor(p.Y), 2.0f) < 0.5f) - { - p.X += 0.5f; - } - - float2 ip = Hlsl.Floor(p); - - p -= ip + 0.5f; - - float ang = -3.14159f * 3.0f / 5.0f + (FBM(ip / 8.0f + time / 3.0f)) * 6.2831f * 2.0f; - - float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f; - - if (p.X < offs.X) p.X = 1.0f - (p.X + 0.5f) / Hlsl.Abs(offs.X + 0.5f); - else p.X = (p.X - offs.X) / (0.5f - offs.X); - - if (p.Y < offs.Y) p.Y = 1.0f - (p.Y + 0.5f) / Hlsl.Abs(offs.Y + 0.5f); - else p.Y = (p.Y - offs.Y) / (0.5f - offs.Y); - - return 1.0f - Hlsl.Max(p.X, p.Y); - } - - - // Standard function-based bump mapping function, with an edge value included for good measure - private float3 DoBumpMap(in float2 p, in float3 n, float bumpfactor, ref float edge) - { - float2 e = new(0.025f, 0); - - float f = BMap(p); - float fx = BMap(p - e.XY); - float fy = BMap(p - e.YX); - float fx2 = BMap(p + e.XY); - float fy2 = BMap(p + e.YX); - - float3 grad = (new float3(fx - fx2, fy - fx2, 0)) / e.X / 2.0f; - - edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - f * 2.0f); - edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X); - - grad -= n * Hlsl.Dot(n, grad); - - return Hlsl.Normalize(n + grad * bumpfactor); - } - - - // A hatch-like algorithm, or a stipple... or some kind of textured pattern - private float DoHatch(float2 p, float res) - { - p *= res / 16.0f; - - float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); - - float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); - if (hRnd > 0.66f) hatch = hRnd; - - return hatch; - } - - /// - public void Execute() - { - int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float iRes = Hlsl.Min(DispatchSize.Y, 800.0f); - float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / iRes; - float3 rd = Hlsl.Normalize(new float3(uv, 0.5f)); - const float gSc = 10.0f; - float2 p = uv * gSc + new float2(0, time / 2.0f); - float2 oP = p; - float m = BMap(p); - float3 n = new(0, 0, -1); - float - edge = 0.0f, - bumpFactor = 0.25f; - - n = DoBumpMap(p, n, bumpFactor, ref edge); - - float3 lp = new float3(-0.0f + Hlsl.Sin(time) * 0.3f, 0.0f + Hlsl.Cos(time * 1.3f) * 0.3f, -1) - new float3(uv, 0); - float lDist = Hlsl.Max(Hlsl.Length(lp), 0.001f); - float3 ld = lp / lDist; - float diff = Hlsl.Max(Hlsl.Dot(n, ld), 0.0f); - - diff = Hlsl.Pow(diff, 4.0f); - - float spec = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(-ld, n), -rd), 0.0f), 16.0f); - float fre = Hlsl.Min(Hlsl.Pow(Hlsl.Max(1.0f + Hlsl.Dot(n, rd), 0.0f), 4.0f), 3.0f); - float3 col = 0.15f * (diff + 0.251f + spec * new float3(1, 0.7f, 0.3f) * 9.0f + fre * new float3(0.1f, 0.3f, 1) * 12.0f); - float rf = Hlsl.SmoothStep(0.0f, 0.35f, BMap(Hlsl.Reflect(rd, n).XY * 2.0f) * FBM(Hlsl.Reflect(rd, n).XY * 3.0f) + 0.1f); - - col += col * col * rf * rf * new float3(1, 0.1f, 0.1f) * 15.0f; - - float shade = m * 0.83f + 0.17f; - - col *= shade; - col *= 1.0f - edge * 0.8f; - - float hatch = DoHatch(oP / gSc, iRes); - - col *= hatch * 0.5f + 0.7f; - - float4 color = new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - - texture[ThreadIds.XY] = color; - } + return new(c, -s, s, c); } -} \ No newline at end of file + + // IQ's float2 to float hash. + private static float Hash21(float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); + } + + // float2 to float2 hash. + private static float2 Hash22B(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + + return Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f - 1.0f; + } + + // Based on IQ's gradient noise formula. + private static float N2D3G(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22B(i), p); + v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); + + p = p * p * (3.0f - 2.0f * p); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + // Two layers of noise. + private static float FBM(float2 p) + { + return N2D3G(p) * 0.66f + N2D3G(p * 2.0f) * 0.34f; + } + + // HLSL mod from GLSL + private static float Mod(float x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + private float BMap(float2 p) + { + p = Hlsl.Mul(p, Rotate2x2(-3.14159f / 5.0f)); + + if (Mod(Hlsl.Floor(p.Y), 2.0f) < 0.5f) + { + p.X += 0.5f; + } + + float2 ip = Hlsl.Floor(p); + + p -= ip + 0.5f; + + float ang = -3.14159f * 3.0f / 5.0f + (FBM(ip / 8.0f + time / 3.0f)) * 6.2831f * 2.0f; + + float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f; + + if (p.X < offs.X) p.X = 1.0f - (p.X + 0.5f) / Hlsl.Abs(offs.X + 0.5f); + else p.X = (p.X - offs.X) / (0.5f - offs.X); + + if (p.Y < offs.Y) p.Y = 1.0f - (p.Y + 0.5f) / Hlsl.Abs(offs.Y + 0.5f); + else p.Y = (p.Y - offs.Y) / (0.5f - offs.Y); + + return 1.0f - Hlsl.Max(p.X, p.Y); + } + + + // Standard function-based bump mapping function, with an edge value included for good measure + private float3 DoBumpMap(in float2 p, in float3 n, float bumpfactor, ref float edge) + { + float2 e = new(0.025f, 0); + + float f = BMap(p); + float fx = BMap(p - e.XY); + float fy = BMap(p - e.YX); + float fx2 = BMap(p + e.XY); + float fy2 = BMap(p + e.YX); + + float3 grad = (new float3(fx - fx2, fy - fx2, 0)) / e.X / 2.0f; + + edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - f * 2.0f); + edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X); + + grad -= n * Hlsl.Dot(n, grad); + + return Hlsl.Normalize(n + grad * bumpfactor); + } + + + // A hatch-like algorithm, or a stipple... or some kind of textured pattern + private float DoHatch(float2 p, float res) + { + p *= res / 16.0f; + + float hatch = Hlsl.Clamp(Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f + 0.5f, 0.0f, 1.0f); + + float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); + if (hRnd > 0.66f) hatch = hRnd; + + return hatch; + } + + /// + public void Execute() + { + int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float iRes = Hlsl.Min(DispatchSize.Y, 800.0f); + float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / iRes; + float3 rd = Hlsl.Normalize(new float3(uv, 0.5f)); + const float gSc = 10.0f; + float2 p = uv * gSc + new float2(0, time / 2.0f); + float2 oP = p; + float m = BMap(p); + float3 n = new(0, 0, -1); + float + edge = 0.0f, + bumpFactor = 0.25f; + + n = DoBumpMap(p, n, bumpFactor, ref edge); + + float3 lp = new float3(-0.0f + Hlsl.Sin(time) * 0.3f, 0.0f + Hlsl.Cos(time * 1.3f) * 0.3f, -1) - new float3(uv, 0); + float lDist = Hlsl.Max(Hlsl.Length(lp), 0.001f); + float3 ld = lp / lDist; + float diff = Hlsl.Max(Hlsl.Dot(n, ld), 0.0f); + + diff = Hlsl.Pow(diff, 4.0f); + + float spec = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(-ld, n), -rd), 0.0f), 16.0f); + float fre = Hlsl.Min(Hlsl.Pow(Hlsl.Max(1.0f + Hlsl.Dot(n, rd), 0.0f), 4.0f), 3.0f); + float3 col = 0.15f * (diff + 0.251f + spec * new float3(1, 0.7f, 0.3f) * 9.0f + fre * new float3(0.1f, 0.3f, 1) * 12.0f); + float rf = Hlsl.SmoothStep(0.0f, 0.35f, BMap(Hlsl.Reflect(rd, n).XY * 2.0f) * FBM(Hlsl.Reflect(rd, n).XY * 3.0f) + 0.1f); + + col += col * col * rf * rf * new float3(1, 0.1f, 0.1f) * 15.0f; + + float shade = m * 0.83f + 0.17f; + + col *= shade; + col *= 1.0f - edge * 0.8f; + + float hatch = DoHatch(oP / gSc, iRes); + + col *= hatch * 0.5f + 0.7f; + + float4 color = new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); + + texture[ThreadIds.XY] = color; + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs b/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs index 48e36975..f85e21ff 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs @@ -1,286 +1,285 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// Utilizing a 2D simplex grid to construct the isolines of a noise function. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct TriangleGridContouring : IComputeShader { /// - /// Utilizing a 2D simplex grid to construct the isolines of a noise function. - /// Ported from . - /// Created by Shane. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct TriangleGridContouring : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time Hlsl.Since the start of the application. + /// + public readonly float time; + + // Standard 2D rotation formula. + private static float2x2 Rotate2x2(in float a) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - /// - /// The current time Hlsl.Since the start of the application. - /// - public readonly float time; - - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(in float a) - { - float c = Hlsl.Cos(a), s = Hlsl.Sin(a); - - return new(c, -s, s, c); - } - - // IQ's float2 to float hash. - private static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // float2 to float2 hash. - private float2 Hash22(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); - - p = Hlsl.Frac(new float2(262144, 32768) * n); - - return Hlsl.Sin(p * 6.2831853f + time); - } - - // Based on IQ's gradient noise formula. - private float N2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22(i), p); - v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); - - p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - - // The isofunction. Just a Hlsl.Single noise function, but it can be more elaborate. - private float IsoFunction(in float2 p) - { - return N2D3G(p / 4.0f + 0.07f); - } - - // Unsigned distance to the segment joining "a" and "b". - private static float DistLine(float2 a, float2 b) - { - b = a - b; - - float h = Hlsl.Clamp(Hlsl.Dot(a, b) / Hlsl.Dot(b, b), 0.0f, 1.0f); - - return Hlsl.Length(a - b * h); - } - - // Based on IQ's signed distance to the segment joining "a" and "b". - private static float distEdge(float2 a, float2 b) - { - return Hlsl.Dot((a + b) * 0.5f, Hlsl.Normalize((b - a).YX * new float2(-1, 1))); - } - - // Interpolating along the edge connecting vertices v1 and v2 with respect to the isovalue. - private static float2 Interpolate(in float2 p1, in float2 p2, float v1, float v2, float isovalue) - { - return Hlsl.Lerp(p1, p2, (isovalue - v1) / (v2 - v1) * 0.75f + 0.25f / 2.0f); - } - - // Isoline function. - private static int IsoLine( - float3 n3, - float2 ip0, - float2 ip1, - float2 ip2, - float isovalue, - float i, - ref float2 p0, - ref float2 p1) - { - p0 = 1e5f; - p1 = 1e5f; - - int iTh = 0; - - if (n3.X > isovalue) iTh += 4; - if (n3.Y > isovalue) iTh += 2; - if (n3.Z > isovalue) iTh += 1; - - if (iTh == 1 || iTh == 6) - { - p0 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); - p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); - - } - else if (iTh == 2 || iTh == 5) - { - p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); - p1 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); - - } - else if (iTh == 3 || iTh == 4) - { - p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); - p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); - } - - if (iTh >= 4 && iTh <= 6) - { - float2 tmp = p0; - - p0 = p1; - p1 = tmp; - } - - if (i == 0.0f) - { - float2 tmp = p0; - - p0 = p1; - p1 = tmp; - } - - return iTh; - } - - private float3 SimplexContour(float2 p) - { - const float gSc = 8.0f; - - p *= gSc; - - float2 oP = p; - - p += new float2(N2D3G(p * 3.5f), N2D3G(p * 3.5f + 7.3f)) * 0.015f; - - float2 s = Hlsl.Floor(p + (p.X + p.Y) * 0.36602540378f); - - p -= s - (s.X + s.Y) * 0.211324865f; - - float i = p.X < p.Y ? 1.0f : 0.0f; - float2 - ioffs = new(1.0f - i, i), - ip0 = 0, - ip1 = ioffs - 0.2113248654f, - ip2 = 0.577350269f, - ctr = (ip0 + ip1 + ip2) / 3.0f; - - ip0 -= ctr; - ip1 -= ctr; - ip2 -= ctr; - p -= ctr; - - float3 n3 = default; - - n3.X = IsoFunction(s); - n3.Y = IsoFunction(s + ioffs); - n3.Z = IsoFunction(s + 1.0f); - - float - d = 1e5f, - d2 = 1e5f, - d3 = 1e5f, - d4 = 1e5f, - d5 = 1e5f; - - float isovalue = 0; - float2 p0 = default, p1 = default; - int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); - - d = Hlsl.Min(d, distEdge(p - p0, p - p1)); - - if (iTh == 7) - { - d = 0; - } - - d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); - d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - - float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0)); - - d5 = Hlsl.Min(d5, tri); - d5 = Hlsl.Min(d5, Hlsl.Length(p) - 0.02f); - isovalue = -0.15f; - - int iTh2 = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); - - d2 = Hlsl.Min(d2, distEdge(p - p0, p - p1)); - - float oldD2 = d2; - - if (iTh2 == 7) d2 = 0.0f; - if (iTh == 7) d2 = 1e5f; - - d2 = Hlsl.Max(d2, -d); - d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); - d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - d4 -= 0.075f; - d3 -= 0.0125f; - d /= gSc; - d2 /= gSc; - d3 /= gSc; - d4 /= gSc; - d5 /= gSc; - - float3 col = new(1, 0.85f, 0.6f); - float sf = 0.004f; - - if (d > 0.0f && d2 > 0.0f) col = new float3(1, 1.8f, 3) * 0.45f; - if (d > 0.0f) col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f))); - - col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), (1.0f - Hlsl.SmoothStep(0.0f, sf, d2))); - col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f))); - col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d))); - - if (d2 > 0.0f) col *= (Hlsl.Abs(Hlsl.Dot(n3, float3.One)) * 1.25f + 1.25f) / 2.0f; - else col *= Hlsl.Max(2.0f - (Hlsl.Dot(n3, float3.One) + 1.45f) / 1.25f, 0.0f); - - float pat = Hlsl.Abs(Hlsl.Frac(tri * 12.5f + 0.4f) - 0.5f) * 2.0f; - - col *= pat * 0.425f + 0.75f; - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d3))); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4))); - col = Hlsl.Lerp(col, float3.One, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f))); - - float2 q = oP * 1.5f; - - col = Hlsl.Min(col, 1.0f); - - float gr = Hlsl.Sqrt(Hlsl.Dot(col, new float3(0.299f, 0.587f, 0.114f))) * 1.25f; - float ns = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; - - ns = gr - ns; - q = Hlsl.Mul(q, Rotate2x2(3.14159f / 3.0f)); - - float ns2 = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; - - ns2 = gr - ns2; - ns = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Min(ns, ns2)); - col = Hlsl.Lerp(col, col * (ns + 0.35f), 0.4f); - - return col; - } - - /// - public void Execute() - { - int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); - float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / Hlsl.Min(650.0f, DispatchSize.Y); - float2 p = Hlsl.Mul(Rotate2x2(3.14159f / 12.0f), uv) + new float2(0.8660254f, 0.5f) * time / 16.0f; - float3 col = SimplexContour(p); - - uv = coordinate / (float2)DispatchSize.XY; - col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f) + 0.1f; - - float4 color = new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - - texture[ThreadIds.XY] = color; - } + return new(c, -s, s, c); } -} \ No newline at end of file + + // IQ's float2 to float hash. + private static float Hash21(float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); + } + + // float2 to float2 hash. + private float2 Hash22(float2 p) + { + float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); + + p = Hlsl.Frac(new float2(262144, 32768) * n); + + return Hlsl.Sin(p * 6.2831853f + time); + } + + // Based on IQ's gradient noise formula. + private float N2D3G(float2 p) + { + float2 i = Hlsl.Floor(p); + + p -= i; + + float4 v = default; + + v.X = Hlsl.Dot(Hash22(i), p); + v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); + v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); + v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); + + p = p * p * p * (p * (p * 6.0f - 15.0f) + 10.0f); + + return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); + } + + + // The isofunction. Just a Hlsl.Single noise function, but it can be more elaborate. + private float IsoFunction(in float2 p) + { + return N2D3G(p / 4.0f + 0.07f); + } + + // Unsigned distance to the segment joining "a" and "b". + private static float DistLine(float2 a, float2 b) + { + b = a - b; + + float h = Hlsl.Clamp(Hlsl.Dot(a, b) / Hlsl.Dot(b, b), 0.0f, 1.0f); + + return Hlsl.Length(a - b * h); + } + + // Based on IQ's signed distance to the segment joining "a" and "b". + private static float distEdge(float2 a, float2 b) + { + return Hlsl.Dot((a + b) * 0.5f, Hlsl.Normalize((b - a).YX * new float2(-1, 1))); + } + + // Interpolating along the edge connecting vertices v1 and v2 with respect to the isovalue. + private static float2 Interpolate(in float2 p1, in float2 p2, float v1, float v2, float isovalue) + { + return Hlsl.Lerp(p1, p2, (isovalue - v1) / (v2 - v1) * 0.75f + 0.25f / 2.0f); + } + + // Isoline function. + private static int IsoLine( + float3 n3, + float2 ip0, + float2 ip1, + float2 ip2, + float isovalue, + float i, + ref float2 p0, + ref float2 p1) + { + p0 = 1e5f; + p1 = 1e5f; + + int iTh = 0; + + if (n3.X > isovalue) iTh += 4; + if (n3.Y > isovalue) iTh += 2; + if (n3.Z > isovalue) iTh += 1; + + if (iTh == 1 || iTh == 6) + { + p0 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); + p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); + + } + else if (iTh == 2 || iTh == 5) + { + p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); + p1 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); + + } + else if (iTh == 3 || iTh == 4) + { + p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); + p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); + } + + if (iTh >= 4 && iTh <= 6) + { + float2 tmp = p0; + + p0 = p1; + p1 = tmp; + } + + if (i == 0.0f) + { + float2 tmp = p0; + + p0 = p1; + p1 = tmp; + } + + return iTh; + } + + private float3 SimplexContour(float2 p) + { + const float gSc = 8.0f; + + p *= gSc; + + float2 oP = p; + + p += new float2(N2D3G(p * 3.5f), N2D3G(p * 3.5f + 7.3f)) * 0.015f; + + float2 s = Hlsl.Floor(p + (p.X + p.Y) * 0.36602540378f); + + p -= s - (s.X + s.Y) * 0.211324865f; + + float i = p.X < p.Y ? 1.0f : 0.0f; + float2 + ioffs = new(1.0f - i, i), + ip0 = 0, + ip1 = ioffs - 0.2113248654f, + ip2 = 0.577350269f, + ctr = (ip0 + ip1 + ip2) / 3.0f; + + ip0 -= ctr; + ip1 -= ctr; + ip2 -= ctr; + p -= ctr; + + float3 n3 = default; + + n3.X = IsoFunction(s); + n3.Y = IsoFunction(s + ioffs); + n3.Z = IsoFunction(s + 1.0f); + + float + d = 1e5f, + d2 = 1e5f, + d3 = 1e5f, + d4 = 1e5f, + d5 = 1e5f; + + float isovalue = 0; + float2 p0 = default, p1 = default; + int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); + + d = Hlsl.Min(d, distEdge(p - p0, p - p1)); + + if (iTh == 7) + { + d = 0; + } + + d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); + d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); + + float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0)); + + d5 = Hlsl.Min(d5, tri); + d5 = Hlsl.Min(d5, Hlsl.Length(p) - 0.02f); + isovalue = -0.15f; + + int iTh2 = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); + + d2 = Hlsl.Min(d2, distEdge(p - p0, p - p1)); + + float oldD2 = d2; + + if (iTh2 == 7) d2 = 0.0f; + if (iTh == 7) d2 = 1e5f; + + d2 = Hlsl.Max(d2, -d); + d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1))); + d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); + d4 -= 0.075f; + d3 -= 0.0125f; + d /= gSc; + d2 /= gSc; + d3 /= gSc; + d4 /= gSc; + d5 /= gSc; + + float3 col = new(1, 0.85f, 0.6f); + float sf = 0.004f; + + if (d > 0.0f && d2 > 0.0f) col = new float3(1, 1.8f, 3) * 0.45f; + if (d > 0.0f) col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f))); + + col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), (1.0f - Hlsl.SmoothStep(0.0f, sf, d2))); + col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f))); + col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d))); + + if (d2 > 0.0f) col *= (Hlsl.Abs(Hlsl.Dot(n3, float3.One)) * 1.25f + 1.25f) / 2.0f; + else col *= Hlsl.Max(2.0f - (Hlsl.Dot(n3, float3.One) + 1.45f) / 1.25f, 0.0f); + + float pat = Hlsl.Abs(Hlsl.Frac(tri * 12.5f + 0.4f) - 0.5f) * 2.0f; + + col *= pat * 0.425f + 0.75f; + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d3))); + col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4))); + col = Hlsl.Lerp(col, float3.One, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f))); + + float2 q = oP * 1.5f; + + col = Hlsl.Min(col, 1.0f); + + float gr = Hlsl.Sqrt(Hlsl.Dot(col, new float3(0.299f, 0.587f, 0.114f))) * 1.25f; + float ns = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; + + ns = gr - ns; + q = Hlsl.Mul(q, Rotate2x2(3.14159f / 3.0f)); + + float ns2 = (N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f + N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f) * 0.5f + 0.5f; + + ns2 = gr - ns2; + ns = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Min(ns, ns2)); + col = Hlsl.Lerp(col, col * (ns + 0.35f), 0.4f); + + return col; + } + + /// + public void Execute() + { + int2 coordinate = new(ThreadIds.X, DispatchSize.Y - ThreadIds.Y); + float2 uv = (coordinate - (float2)DispatchSize.XY * 0.5f) / Hlsl.Min(650.0f, DispatchSize.Y); + float2 p = Hlsl.Mul(Rotate2x2(3.14159f / 12.0f), uv) + new float2(0.8660254f, 0.5f) * time / 16.0f; + float3 col = SimplexContour(p); + + uv = coordinate / (float2)DispatchSize.XY; + col *= Hlsl.Pow(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y), 0.0625f) + 0.1f; + + float4 color = new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); + + texture[ThreadIds.XY] = color; + } +} diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs b/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs index b47c2133..878f54a7 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs @@ -1,149 +1,148 @@ -namespace ComputeSharp.SwapChain.Shaders.Compute +namespace ComputeSharp.SwapChain.Shaders.Compute; + +/// +/// A shader creating an animated two-tiles Truchet arrangement. +/// Ported from . +/// Created by Shane. +/// +[AutoConstructor] +internal readonly partial struct TwoTiledTruchet : IComputeShader { /// - /// A shader creating an animated two-tiles Truchet arrangement. - /// Ported from . - /// Created by Shane. + /// The target texture. /// - [AutoConstructor] - internal readonly partial struct TwoTiledTruchet : IComputeShader + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + /// Calculates the Truchet distance field. + /// + /// The input value to compute the distance field for. + /// The resulting Truchet angle. + /// The distance field for the input value. + private float2 DistanceField(float2 p, out float2 ang) { - /// - /// The target texture. - /// - public readonly IReadWriteTexture2D texture; - - /// - /// The current time since the start of the application. - /// - public readonly float time; - - /// - /// Calculates the Truchet distance field. - /// - /// The input value to compute the distance field for. - /// The resulting Truchet angle. - /// The distance field for the input value. - private float2 DistanceField(float2 p, out float2 ang) + // Fast hash for a pair of floats + static float Hash21(float2 p) { - // Fast hash for a pair of floats - static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // HLSL's port of the GLSL mod intrinsic - static float Mod(float x, float y) - { - return x - y * Hlsl.Floor(x / y); - } - - float2 ip2 = Hlsl.Floor(p / 2.0f); - float2 ip = Hlsl.Floor(p); - float rnd = Hash21(ip); - float rnd3 = Hash21(ip + 0.57f); - float2 d = 1e5f; - - p -= ip + 0.5f; - - if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f) - { - d = Hlsl.Abs(p); - ang = p.YX; - - if (Mod(ip.X + 1.0f, 2.0f) < 0.5f) - { - ang.X *= -1.0f; - - } - - if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f) - { - ang.Y *= -1.0f; - } - - if (rnd3 < .5) - { - d = d.YX; - ang = ang.YX; - } - - ang += 0.5f; - ang *= 3.0f; - - } - else - { - if (rnd < .5) - { - p = p.YX * new float2(1, -1); - } - - d.X = Hlsl.Length(p - 0.5f) - 0.5f; - d.Y = Hlsl.Length(p + 0.5f) - 0.5f; - - d = Hlsl.Abs(d); - - ang = 0; - ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f)); - ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f)); - - if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) - { - ang *= -1.0f; - } - - if (rnd < 0.5f) - { - ang *= -1.0f; - } - - if (rnd3 < 0.5f) - { - d = d.YX; - ang = ang.YX; - } - - ang *= 4.0f / 6.2831853f; - ang *= 2.0f; - } - - ang = Hlsl.Frac(ang + time / 4.0f); - - return d; + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); } - /// - public void Execute() + // HLSL's port of the GLSL mod intrinsic + static float Mod(float x, float y) { - float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; - float gSc = 7.0f; - float2 p = uv * gSc - new float2(-1, -0.5f) * time / 2.0f; - float sf = 2.0f / DispatchSize.Y * gSc; - float lSc = 6.0f; - float lw = 1.0f / lSc / gSc; - float2 d = DistanceField(p, out float2 ang) - 2.5f / lSc; - float3 col = new(1.0f, 0.9f, 0.8f); + return x - y * Hlsl.Floor(x / y); + } - for (int i = 0; i < 2; i++) + float2 ip2 = Hlsl.Floor(p / 2.0f); + float2 ip = Hlsl.Floor(p); + float rnd = Hash21(ip); + float rnd3 = Hash21(ip + 0.57f); + float2 d = 1e5f; + + p -= ip + 0.5f; + + if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f) + { + d = Hlsl.Abs(p); + ang = p.YX; + + if (Mod(ip.X + 1.0f, 2.0f) < 0.5f) { - float di = d[i] - lw / 4.0f; - float tracks = Hlsl.Clamp(Hlsl.Sin(ang[i] * 6.2831f + time * 6.0f) * 4.0f, 0.0f, 1.0f); - float gap = 1.0f + lw; + ang.X *= -1.0f; - col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di)); - col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + lw * 2.0f)); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc)); - col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc + lw)); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc)); - col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc + lw)); } - float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f)); - float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f); + if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f) + { + ang.Y *= -1.0f; + } + + if (rnd3 < .5) + { + d = d.YX; + ang = ang.YX; + } + + ang += 0.5f; + ang *= 3.0f; - texture[ThreadIds.XY] = color; } + else + { + if (rnd < .5) + { + p = p.YX * new float2(1, -1); + } + + d.X = Hlsl.Length(p - 0.5f) - 0.5f; + d.Y = Hlsl.Length(p + 0.5f) - 0.5f; + + d = Hlsl.Abs(d); + + ang = 0; + ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f)); + ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f)); + + if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) + { + ang *= -1.0f; + } + + if (rnd < 0.5f) + { + ang *= -1.0f; + } + + if (rnd3 < 0.5f) + { + d = d.YX; + ang = ang.YX; + } + + ang *= 4.0f / 6.2831853f; + ang *= 2.0f; + } + + ang = Hlsl.Frac(ang + time / 4.0f); + + return d; } -} \ No newline at end of file + + /// + public void Execute() + { + float2 uv = (ThreadIds.XY - (float2)DispatchSize.XY * 0.5f) / DispatchSize.Y; + float gSc = 7.0f; + float2 p = uv * gSc - new float2(-1, -0.5f) * time / 2.0f; + float sf = 2.0f / DispatchSize.Y * gSc; + float lSc = 6.0f; + float lw = 1.0f / lSc / gSc; + float2 d = DistanceField(p, out float2 ang) - 2.5f / lSc; + float3 col = new(1.0f, 0.9f, 0.8f); + + for (int i = 0; i < 2; i++) + { + float di = d[i] - lw / 4.0f; + float tracks = Hlsl.Clamp(Hlsl.Sin(ang[i] * 6.2831f + time * 6.0f) * 4.0f, 0.0f, 1.0f); + float gap = 1.0f + lw; + + col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di)); + col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + lw * 2.0f)); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc)); + col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc + lw)); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc)); + col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc + lw)); + } + + float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f)); + float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f); + + texture[ThreadIds.XY] = color; + } +} diff --git a/tests/ComputeSharp.Tests/ShadersTests.cs b/tests/ComputeSharp.Tests/ShadersTests.cs index 2e89e204..41460107 100644 --- a/tests/ComputeSharp.Tests/ShadersTests.cs +++ b/tests/ComputeSharp.Tests/ShadersTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Reflection; using System.Runtime.InteropServices; @@ -10,231 +10,230 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.Formats.Png; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Shaders")] +public class ShadersTests { - [TestClass] - [TestCategory("Shaders")] - public class ShadersTests + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(HelloWorld))] + [Data(typeof(SwapChain.Shaders.Compute.HelloWorld))] + public void HelloWorld(Device device, Type shaderType) { - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(HelloWorld))] - [Data(typeof(SwapChain.Shaders.Compute.HelloWorld))] - public void HelloWorld(Device device, Type shaderType) + RunAndCompareShader(device, shaderType, 0.0000004f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(ColorfulInfinity))] + [Data(typeof(SwapChain.Shaders.Compute.ColorfulInfinity))] + public void ColorfulInfinity(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.0000004f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(FractalTiling))] + [Data(typeof(SwapChain.Shaders.Compute.FractalTiling))] + public void FractalTiling(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.0000005f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(MengerJourney))] + [Data(typeof(SwapChain.Shaders.Compute.MengerJourney))] + public void MengerJourney(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.000011f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(TwoTiledTruchet))] + [Data(typeof(SwapChain.Shaders.Compute.TwoTiledTruchet))] + public void TwoTiledTruchet(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.00032f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(Octagrams))] + [Data(typeof(SwapChain.Shaders.Compute.Octagrams))] + public void Octagrams(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.0000006f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(ProteanClouds))] + [Data(typeof(SwapChain.Shaders.Compute.ProteanClouds))] + public void ProteanClouds(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.0000004f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(ExtrudedTruchetPattern))] + [Data(typeof(SwapChain.Shaders.Compute.ExtrudedTruchetPattern))] + public void ExtrudedTruchetPattern(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.00011f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(PyramidPattern))] + [Data(typeof(SwapChain.Shaders.Compute.PyramidPattern))] + public void PyramidPattern(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.00021f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(TriangleGridContouring))] + [Data(typeof(SwapChain.Shaders.Compute.TriangleGridContouring))] + public void TriangleGridContouring(Device device, Type shaderType) + { + RunAndCompareShader(device, shaderType, 0.0006f); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(ContouredLayers))] + [Data(typeof(SwapChain.Shaders.Compute.ContouredLayers))] + public void ContouredLayers(Device device, Type shaderType) + { + string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", "Textures", "RustyMetal.png"); + + using ReadOnlyTexture2D background = device.Get().LoadReadOnlyTexture2D(filename); + + RunAndCompareShader( + device, + shaderType, + texture => new SwapChain.Shaders.Compute.ContouredLayers(texture, 0, background), + texture => new ContouredLayers(0, background), + 0.000703f); + } + + /// + /// Executes a given test for a specified shader. + /// + /// The type of shader to test. + /// The device to use. + /// The type of shader being executed. + /// The comparison delta. + private static void RunAndCompareShader(Device device, Type shaderType, float delta) + { + _ = device.Get(); + + string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{shaderType.Name}.png"); + + IImageInfo imageInfo = Image.Identify(expectedPath); + + using Image image = new(imageInfo.Width, imageInfo.Height); + + using (ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(imageInfo.Width, imageInfo.Height)) { - RunAndCompareShader(device, shaderType, 0.0000004f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(ColorfulInfinity))] - [Data(typeof(SwapChain.Shaders.Compute.ColorfulInfinity))] - public void ColorfulInfinity(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.0000004f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(FractalTiling))] - [Data(typeof(SwapChain.Shaders.Compute.FractalTiling))] - public void FractalTiling(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.0000005f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(MengerJourney))] - [Data(typeof(SwapChain.Shaders.Compute.MengerJourney))] - public void MengerJourney(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.000011f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(TwoTiledTruchet))] - [Data(typeof(SwapChain.Shaders.Compute.TwoTiledTruchet))] - public void TwoTiledTruchet(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.00032f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(Octagrams))] - [Data(typeof(SwapChain.Shaders.Compute.Octagrams))] - public void Octagrams(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.0000006f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(ProteanClouds))] - [Data(typeof(SwapChain.Shaders.Compute.ProteanClouds))] - public void ProteanClouds(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.0000004f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(ExtrudedTruchetPattern))] - [Data(typeof(SwapChain.Shaders.Compute.ExtrudedTruchetPattern))] - public void ExtrudedTruchetPattern(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.00011f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(PyramidPattern))] - [Data(typeof(SwapChain.Shaders.Compute.PyramidPattern))] - public void PyramidPattern(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.00021f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(TriangleGridContouring))] - [Data(typeof(SwapChain.Shaders.Compute.TriangleGridContouring))] - public void TriangleGridContouring(Device device, Type shaderType) - { - RunAndCompareShader(device, shaderType, 0.0006f); - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(ContouredLayers))] - [Data(typeof(SwapChain.Shaders.Compute.ContouredLayers))] - public void ContouredLayers(Device device, Type shaderType) - { - string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", "Textures", "RustyMetal.png"); - - using ReadOnlyTexture2D background = device.Get().LoadReadOnlyTexture2D(filename); - - RunAndCompareShader( - device, - shaderType, - texture => new SwapChain.Shaders.Compute.ContouredLayers(texture, 0, background), - texture => new ContouredLayers(0, background), - 0.000703f); - } - - /// - /// Executes a given test for a specified shader. - /// - /// The type of shader to test. - /// The device to use. - /// The type of shader being executed. - /// The comparison delta. - private static void RunAndCompareShader(Device device, Type shaderType, float delta) - { - _ = device.Get(); - - string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{shaderType.Name}.png"); - - IImageInfo imageInfo = Image.Identify(expectedPath); - - using Image image = new(imageInfo.Width, imageInfo.Height); - - using (ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(imageInfo.Width, imageInfo.Height)) + if (shaderType.IsAssignableTo(typeof(IComputeShader))) { - if (shaderType.IsAssignableTo(typeof(IComputeShader))) + static void RunComputeShader(ReadWriteTexture2D texture) + where T : struct, IComputeShader { - static void RunComputeShader(ReadWriteTexture2D texture) - where T : struct, IComputeShader - { - texture.GraphicsDevice.For(texture.Width, texture.Height, (T)Activator.CreateInstance(typeof(T), texture, 0f)!); - } - - var action = new Action>(RunComputeShader); - - action.Method.GetGenericMethodDefinition().MakeGenericMethod(shaderType).Invoke(null, new[] { texture }); - } - else - { - static void RunPixelShader(ReadWriteTexture2D texture) - where T : struct, IPixelShader - { - texture.GraphicsDevice.ForEach(texture, (T)Activator.CreateInstance(typeof(T), 0f)!); - } - - var action = new Action>(RunPixelShader); - - action.Method.GetGenericMethodDefinition().MakeGenericMethod(shaderType).Invoke(null, new[] { texture }); + texture.GraphicsDevice.For(texture.Width, texture.Height, (T)Activator.CreateInstance(typeof(T), texture, 0f)!); } - _ = image.TryGetSinglePixelSpan(out Span span); + var action = new Action>(RunComputeShader); - texture.CopyTo(MemoryMarshal.Cast(span)); + action.Method.GetGenericMethodDefinition().MakeGenericMethod(shaderType).Invoke(null, new[] { texture }); + } + else + { + static void RunPixelShader(ReadWriteTexture2D texture) + where T : struct, IPixelShader + { + texture.GraphicsDevice.ForEach(texture, (T)Activator.CreateInstance(typeof(T), 0f)!); + } + + var action = new Action>(RunPixelShader); + + action.Method.GetGenericMethodDefinition().MakeGenericMethod(shaderType).Invoke(null, new[] { texture }); } - string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{shaderType.Name}.png"); + _ = image.TryGetSinglePixelSpan(out Span span); - _ = Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); - - image.SaveAsPng(actualPath, new PngEncoder() { CompressionLevel = PngCompressionLevel.BestCompression, ColorType = PngColorType.Rgb }); - - ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, delta); + texture.CopyTo(MemoryMarshal.Cast(span)); } - /// - /// Executes a given test for a specified shader. - /// - /// The type of shader to test. - /// The device to use. - /// The type of shader being executed. - /// The factory of compute shaders. - /// The factory of pixel shaders. - /// The comparison delta. - private static void RunAndCompareShader( - Device device, - Type shaderType, - Func, TCompute> computeFactory, - Func, TPixel> pixelFactory, - float delta) - where TCompute : struct, IComputeShader - where TPixel : struct, IPixelShader + string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{shaderType.Name}.png"); + + _ = Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); + + image.SaveAsPng(actualPath, new PngEncoder() { CompressionLevel = PngCompressionLevel.BestCompression, ColorType = PngColorType.Rgb }); + + ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, delta); + } + + /// + /// Executes a given test for a specified shader. + /// + /// The type of shader to test. + /// The device to use. + /// The type of shader being executed. + /// The factory of compute shaders. + /// The factory of pixel shaders. + /// The comparison delta. + private static void RunAndCompareShader( + Device device, + Type shaderType, + Func, TCompute> computeFactory, + Func, TPixel> pixelFactory, + float delta) + where TCompute : struct, IComputeShader + where TPixel : struct, IPixelShader + { + _ = device.Get(); + + string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{shaderType.Name}.png"); + + IImageInfo imageInfo = Image.Identify(expectedPath); + + using Image image = new(imageInfo.Width, imageInfo.Height); + + using (ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(imageInfo.Width, imageInfo.Height)) { - _ = device.Get(); - - string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{shaderType.Name}.png"); - - IImageInfo imageInfo = Image.Identify(expectedPath); - - using Image image = new(imageInfo.Width, imageInfo.Height); - - using (ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(imageInfo.Width, imageInfo.Height)) + if (shaderType.IsAssignableTo(typeof(IComputeShader))) { - if (shaderType.IsAssignableTo(typeof(IComputeShader))) - { - Assert.AreEqual(typeof(TCompute), shaderType); + Assert.AreEqual(typeof(TCompute), shaderType); - texture.GraphicsDevice.For(texture.Width, texture.Height, computeFactory(texture)); - } - else - { - Assert.AreEqual(typeof(TPixel), shaderType); + texture.GraphicsDevice.For(texture.Width, texture.Height, computeFactory(texture)); + } + else + { + Assert.AreEqual(typeof(TPixel), shaderType); - texture.GraphicsDevice.ForEach(texture, pixelFactory(texture)); - } - - _ = image.TryGetSinglePixelSpan(out Span span); - - texture.CopyTo(MemoryMarshal.Cast(span)); + texture.GraphicsDevice.ForEach(texture, pixelFactory(texture)); } - string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{shaderType.Name}.png"); + _ = image.TryGetSinglePixelSpan(out Span span); - _ = Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); - - image.SaveAsPng(actualPath, new PngEncoder() { CompressionLevel = PngCompressionLevel.BestCompression, ColorType = PngColorType.Rgb }); - - ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, delta); + texture.CopyTo(MemoryMarshal.Cast(span)); } + + string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{shaderType.Name}.png"); + + _ = Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); + + image.SaveAsPng(actualPath, new PngEncoder() { CompressionLevel = PngCompressionLevel.BestCompression, ColorType = PngColorType.Rgb }); + + ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, delta); } } diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs index 27b1486b..c4103d96 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Numerics; using System.Reflection; @@ -12,122 +12,121 @@ using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; #pragma warning disable CS0618 -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +public partial class Texture2DTests { - public partial class Texture2DTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<,>))] + [Resource(typeof(ReadWriteTexture2D<,>))] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(float4))] + public void Allocate_Uninitialized_Pixel_Ok(Device device, Type textureType, Type t, Type tPixel) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<,>))] - [Resource(typeof(ReadWriteTexture2D<,>))] - [Data(typeof(Bgra32), typeof(Vector4))] - [Data(typeof(Bgra32), typeof(float4))] - [Data(typeof(R16), typeof(float))] - [Data(typeof(R8), typeof(float))] - [Data(typeof(Rg16), typeof(Vector2))] - [Data(typeof(Rg16), typeof(float2))] - [Data(typeof(Rg32), typeof(Vector2))] - [Data(typeof(Rg32), typeof(float2))] - [Data(typeof(Rgba32), typeof(Vector4))] - [Data(typeof(Rgba32), typeof(float4))] - [Data(typeof(Rgba64), typeof(Vector4))] - [Data(typeof(Rgba64), typeof(float4))] - public void Allocate_Uninitialized_Pixel_Ok(Device device, Type textureType, Type t, Type tPixel) + static void Test(Device device, Type textureType) + where T : unmanaged, IUnorm + where TPixel : unmanaged { - static void Test(Device device, Type textureType) - where T : unmanaged, IUnorm - where TPixel : unmanaged + using Texture2D texture = device.Get().AllocateTexture2D(textureType, 128, 128); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (textureType == typeof(ReadOnlyTexture2D<,>)) { - using Texture2D texture = device.Get().AllocateTexture2D(textureType, 128, 128); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 128); - Assert.AreEqual(texture.Height, 128); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - if (textureType == typeof(ReadOnlyTexture2D<,>)) - { - Assert.IsTrue(texture is ReadOnlyTexture2D); - } - else - { - Assert.IsTrue(texture is ReadWriteTexture2D); - } + Assert.IsTrue(texture is ReadOnlyTexture2D); } - - try + else { - new Action(Test).Method.GetGenericMethodDefinition().MakeGenericMethod(t, tPixel).Invoke(null, new object[] { device, textureType }); - } - catch (TargetInvocationException e) when (e.InnerException is not null) - { - throw e.InnerException; + Assert.IsTrue(texture is ReadWriteTexture2D); } } - [CombinatorialTestMethod] - [AllDevices] - public void SampleFromSourceTexture_ComputeShader(Device device) + try { - _ = device.Get(); - - string imagingPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); - string assetsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets"); - - using var sampled = Image.Load(Path.Combine(assetsPath, "CityAfter1024x1024Sampling.png")); - - using ReadOnlyTexture2D source = device.Get().LoadReadOnlyTexture2D(Path.Combine(imagingPath, "city.jpg")); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(sampled.Width, sampled.Height); - - device.Get().For(sampled.Width, sampled.Height, new SamplingComputeShader(source, destination)); - - using var processed = destination.ToImage(); - - ImagingTests.TolerantImageComparer.AssertEqual(sampled, processed, 0.0000017f); + new Action(Test).Method.GetGenericMethodDefinition().MakeGenericMethod(t, tPixel).Invoke(null, new object[] { device, textureType }); } - - [AutoConstructor] - public readonly partial struct SamplingComputeShader : IComputeShader + catch (TargetInvocationException e) when (e.InnerException is not null) { - public readonly IReadOnlyTexture2D source; - public readonly IReadWriteTexture2D destination; - - public void Execute() - { - destination[ThreadIds.XY] = source[ThreadIds.Normalized.XY]; - } + throw e.InnerException; } + } - [CombinatorialTestMethod] - [AllDevices] - public void SampleFromSourceTexture_PixelShader(Device device) + [CombinatorialTestMethod] + [AllDevices] + public void SampleFromSourceTexture_ComputeShader(Device device) + { + _ = device.Get(); + + string imagingPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); + string assetsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets"); + + using var sampled = Image.Load(Path.Combine(assetsPath, "CityAfter1024x1024Sampling.png")); + + using ReadOnlyTexture2D source = device.Get().LoadReadOnlyTexture2D(Path.Combine(imagingPath, "city.jpg")); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(sampled.Width, sampled.Height); + + device.Get().For(sampled.Width, sampled.Height, new SamplingComputeShader(source, destination)); + + using var processed = destination.ToImage(); + + ImagingTests.TolerantImageComparer.AssertEqual(sampled, processed, 0.0000017f); + } + + [AutoConstructor] + public readonly partial struct SamplingComputeShader : IComputeShader + { + public readonly IReadOnlyTexture2D source; + public readonly IReadWriteTexture2D destination; + + public void Execute() { - _ = device.Get(); - - string imagingPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); - string assetsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets"); - - using var sampled = Image.Load(Path.Combine(assetsPath, "CityAfter1024x1024Sampling.png")); - - using ReadOnlyTexture2D source = device.Get().LoadReadOnlyTexture2D(Path.Combine(imagingPath, "city.jpg")); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(sampled.Width, sampled.Height); - - device.Get().ForEach(destination, new SamplingPixelShader(source)); - - using var processed = destination.ToImage(); - - ImagingTests.TolerantImageComparer.AssertEqual(sampled, processed, 0.0000017f); + destination[ThreadIds.XY] = source[ThreadIds.Normalized.XY]; } + } - [AutoConstructor] - public readonly partial struct SamplingPixelShader : IPixelShader + [CombinatorialTestMethod] + [AllDevices] + public void SampleFromSourceTexture_PixelShader(Device device) + { + _ = device.Get(); + + string imagingPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); + string assetsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets"); + + using var sampled = Image.Load(Path.Combine(assetsPath, "CityAfter1024x1024Sampling.png")); + + using ReadOnlyTexture2D source = device.Get().LoadReadOnlyTexture2D(Path.Combine(imagingPath, "city.jpg")); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(sampled.Width, sampled.Height); + + device.Get().ForEach(destination, new SamplingPixelShader(source)); + + using var processed = destination.ToImage(); + + ImagingTests.TolerantImageComparer.AssertEqual(sampled, processed, 0.0000017f); + } + + [AutoConstructor] + public readonly partial struct SamplingPixelShader : IPixelShader + { + public readonly IReadOnlyTexture2D texture; + + public float4 Execute() { - public readonly IReadOnlyTexture2D texture; - - public float4 Execute() - { - return texture[ThreadIds.Normalized.XY]; - } + return texture[ThreadIds.Normalized.XY]; } } } diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs index 9b9f7295..b7ca519a 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs @@ -3,254 +3,253 @@ using System.Numerics; using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +public partial class Texture2DTests { - public partial class Texture2DTests + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(Float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(Float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(Float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(Float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(Float4))] + public void Dispatch_NormalizedTexture2D(Device device, Type t, Type tPixel) { - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(Bgra32), typeof(Vector4))] - [Data(typeof(Bgra32), typeof(Float4))] - [Data(typeof(R16), typeof(float))] - [Data(typeof(R8), typeof(float))] - [Data(typeof(Rg16), typeof(Vector2))] - [Data(typeof(Rg16), typeof(Float2))] - [Data(typeof(Rg32), typeof(Vector2))] - [Data(typeof(Rg32), typeof(Float2))] - [Data(typeof(Rgba32), typeof(Vector4))] - [Data(typeof(Rgba32), typeof(Float4))] - [Data(typeof(Rgba64), typeof(Vector4))] - [Data(typeof(Rgba64), typeof(Float4))] - public void Dispatch_NormalizedTexture2D(Device device, Type t, Type tPixel) + if (t == typeof(Bgra32) && tPixel == typeof(Vector4)) { - if (t == typeof(Bgra32) && tPixel == typeof(Vector4)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - device.Get().For(128, 128, new Shader_Unorm_Bgra32_Vector4(source, destination)); - } - if (t == typeof(Bgra32) && tPixel == typeof(Float4)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Bgra32_Float4(source, destination)); - } - if (t == typeof(R16) && tPixel == typeof(float)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_R16_float(source, destination)); - } - if (t == typeof(R8) && tPixel == typeof(float)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_R8_float(source, destination)); - } - if (t == typeof(Rg16) && tPixel == typeof(Vector2)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rg16_Vector2(source, destination)); - } - if (t == typeof(Rg16) && tPixel == typeof(Float2)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rg16_Float2(source, destination)); - } - if (t == typeof(Rg32) && tPixel == typeof(Vector2)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rg32_Vector2(source, destination)); - } - if (t == typeof(Rg32) && tPixel == typeof(Float2)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rg32_Float2(source, destination)); - } - if (t == typeof(Rgba32) && tPixel == typeof(Vector4)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rgba32_Vector4(source, destination)); - } - if (t == typeof(Rgba32) && tPixel == typeof(Float4)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rgba32_Float4(source, destination)); - } - if (t == typeof(Rgba64) && tPixel == typeof(Vector4)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rgba64_Vector4(source, destination)); - } - if (t == typeof(Rgba64) && tPixel == typeof(Float4)) - { - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - - device.Get().For(128, 128, new Shader_Unorm_Rgba64_Float4(source, destination)); - } + device.Get().For(128, 128, new Shader_Unorm_Bgra32_Vector4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Bgra32_Vector4 : IComputeShader + if (t == typeof(Bgra32) && tPixel == typeof(Float4)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Bgra32_Float4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader + if (t == typeof(R16) && tPixel == typeof(float)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_R16_float(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_R16_float : IComputeShader + if (t == typeof(R8) && tPixel == typeof(float)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_R8_float(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_R8_float : IComputeShader + if (t == typeof(Rg16) && tPixel == typeof(Vector2)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rg16_Vector2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader + if (t == typeof(Rg16) && tPixel == typeof(Float2)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rg16_Float2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader + if (t == typeof(Rg32) && tPixel == typeof(Vector2)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rg32_Vector2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader + if (t == typeof(Rg32) && tPixel == typeof(Float2)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rg32_Float2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader + if (t == typeof(Rgba32) && tPixel == typeof(Vector4)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rgba32_Vector4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader + if (t == typeof(Rgba32) && tPixel == typeof(Float4)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rgba32_Float4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader + if (t == typeof(Rgba64) && tPixel == typeof(Vector4)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rgba64_Vector4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader + if (t == typeof(Rgba64) && tPixel == typeof(Float4)) { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } - } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader - { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteTexture2D destination; - - public void Execute() - { - destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; - } + device.Get().For(128, 128, new Shader_Unorm_Rgba64_Float4(source, destination)); } } -} \ No newline at end of file + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R16_float : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R8_float : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } +} diff --git a/tests/ComputeSharp.Tests/Texture2DTests.cs b/tests/ComputeSharp.Tests/Texture2DTests.cs index 3f54caef..3171c83d 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.cs +++ b/tests/ComputeSharp.Tests/Texture2DTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using ComputeSharp.Resources; using ComputeSharp.Tests.Attributes; @@ -6,222 +6,221 @@ using ComputeSharp.Tests.Extensions; using Microsoft.Toolkit.HighPerformance; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Texture2D")] +public partial class Texture2DTests { - [TestClass] - [TestCategory("Texture2D")] - public partial class Texture2DTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(AllocationMode.Default)] + [Data(AllocationMode.Clear)] + public void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - [Data(AllocationMode.Default)] - [Data(AllocationMode.Clear)] - public void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) + using Texture2D texture = device.Get().AllocateTexture2D(textureType, 128, 128, allocationMode); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (allocationMode == AllocationMode.Clear) { - using Texture2D texture = device.Get().AllocateTexture2D(textureType, 128, 128, allocationMode); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 128); - Assert.AreEqual(texture.Height, 128); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - if (allocationMode == AllocationMode.Clear) + foreach (float x in texture.ToArray()) { - foreach (float x in texture.ToArray()) - { - Assert.AreEqual(x, 0f); - } - } - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - [Data(128, -14253)] - [Data(128, -1)] - [Data(0, -4314)] - [Data(-14, -53)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height) - { - using Texture2D texture = device.Get().AllocateTexture2D(textureType, width, height); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - public void Allocate_FromArray(Device device, Type textureType) - { - float[] data = Enumerable.Range(0, 128 * 128).Select(static i => (float)i).ToArray(); - - using Texture2D texture = device.Get().AllocateTexture2D(textureType, data, 128, 128); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 128); - Assert.AreEqual(texture.Height, 128); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - float[,] result = texture.ToArray(); - - Assert.IsNotNull(result); - Assert.AreEqual(data.Length, result.Length); - Assert.IsTrue(data.SequenceEqual(result.Cast())); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - [ExpectedException(typeof(ObjectDisposedException))] - public void UsageAfterDispose(Device device, Type textureType) - { - using Texture2D texture = device.Get().AllocateTexture2D(textureType, 10, 10); - - texture.Dispose(); - - _ = texture.ToArray(); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - public void DisposeAfterDevice(Device device, Type textureType) - { - GraphicsDevice? gpu = device switch - { - Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), - Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => throw new ArgumentException(nameof(device)) - }; - - if (gpu is null) - { - Assert.Inconclusive(); - - return; - } - - Texture2D texture = gpu.AllocateTexture2D(textureType, 10, 10); - - gpu.Dispose(); - texture.Dispose(); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - [Data(0, 0, 64, 64)] - [Data(0, 14, 64, 50)] - [Data(14, 0, 50, 64)] - [Data(10, 10, 54, 54)] - [Data(20, 20, 32, 27)] - [Data(60, 0, 4, 64)] - [Data(0, 60, 64, 4)] - [Data(63, 2, 1, 60)] - [Data(2, 63, 60, 1)] - public void GetData_RangeToVoid_Ok(Device device, Type textureType, int x, int y, int width, int height) - { - float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - - using Texture2D texture = device.Get().AllocateTexture2D(textureType, array, 64, 64); - - float[] result = new float[width * height]; - - texture.CopyTo(result, x, y, width, height); - - Span2D - expected = new Span2D(array, 64, 64).Slice(y, x, height, width), - data = new(result, height, width); - - CollectionAssert.AreEqual(expected.ToArray(), data.ToArray()); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture2D<>))] - [Resource(typeof(ReadWriteTexture2D<>))] - [Data(0, -1, 50, 50)] - [Data(-1, 0, 50, 50)] - [Data(12, 0, -1, 50)] - [Data(12, 0, 20, -1)] - [Data(12, 20, 20, 50)] - [Data(12, 20, 60, 20)] - [Data(80, 20, 40, 20)] - [Data(0, 80, 40, 20)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void GetData_RangeToVoid_Fail(Device device, Type textureType, int x, int y, int width, int height) - { - float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - - using Texture2D texture = device.Get().AllocateTexture2D(textureType, array, 64, 64); - - float[] result = new float[4096]; - - texture.CopyTo(result, x, y, width, height); - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ReadOnlyTexture2D(Device device) - { - int[] data = Enumerable.Range(0, 32 * 32).ToArray(); - - using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(data, 32, 32); - using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); - - device.Get().For(source.Width, source.Height, new ReadOnlyTexture2DKernel(source, destination)); - - int[] result = destination.ToArray(); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ReadOnlyTexture2DKernel : IComputeShader - { - public readonly ReadOnlyTexture2D source; - public readonly ReadWriteBuffer destination; - - public void Execute() - { - destination[ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XY]; - } - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ReadWriteTexture2D(Device device) - { - int[] data = Enumerable.Range(0, 32 * 32).ToArray(); - - using ReadWriteTexture2D source = device.Get().AllocateReadWriteTexture2D(data, 32, 32); - using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(32, 32); - - device.Get().For(source.Width, source.Height, new ReadWriteTexture2DKernel(source, destination)); - - int[] result = new int[data.Length]; - - destination.CopyTo(result); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ReadWriteTexture2DKernel : IComputeShader - { - public readonly ReadWriteTexture2D source; - public readonly ReadWriteTexture2D destination; - - public void Execute() - { - destination[ThreadIds.XY] = source[ThreadIds.XY]; + Assert.AreEqual(x, 0f); } } } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(128, -14253)] + [Data(128, -1)] + [Data(0, -4314)] + [Data(-14, -53)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height) + { + using Texture2D texture = device.Get().AllocateTexture2D(textureType, width, height); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + public void Allocate_FromArray(Device device, Type textureType) + { + float[] data = Enumerable.Range(0, 128 * 128).Select(static i => (float)i).ToArray(); + + using Texture2D texture = device.Get().AllocateTexture2D(textureType, data, 128, 128); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + float[,] result = texture.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result.Cast())); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type textureType) + { + using Texture2D texture = device.Get().AllocateTexture2D(textureType, 10, 10); + + texture.Dispose(); + + _ = texture.ToArray(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + public void DisposeAfterDevice(Device device, Type textureType) + { + GraphicsDevice? gpu = device switch + { + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), + _ => throw new ArgumentException(nameof(device)) + }; + + if (gpu is null) + { + Assert.Inconclusive(); + + return; + } + + Texture2D texture = gpu.AllocateTexture2D(textureType, 10, 10); + + gpu.Dispose(); + texture.Dispose(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(0, 0, 64, 64)] + [Data(0, 14, 64, 50)] + [Data(14, 0, 50, 64)] + [Data(10, 10, 54, 54)] + [Data(20, 20, 32, 27)] + [Data(60, 0, 4, 64)] + [Data(0, 60, 64, 4)] + [Data(63, 2, 1, 60)] + [Data(2, 63, 60, 1)] + public void GetData_RangeToVoid_Ok(Device device, Type textureType, int x, int y, int width, int height) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Texture2D texture = device.Get().AllocateTexture2D(textureType, array, 64, 64); + + float[] result = new float[width * height]; + + texture.CopyTo(result, x, y, width, height); + + Span2D + expected = new Span2D(array, 64, 64).Slice(y, x, height, width), + data = new(result, height, width); + + CollectionAssert.AreEqual(expected.ToArray(), data.ToArray()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(0, -1, 50, 50)] + [Data(-1, 0, 50, 50)] + [Data(12, 0, -1, 50)] + [Data(12, 0, 20, -1)] + [Data(12, 20, 20, 50)] + [Data(12, 20, 60, 20)] + [Data(80, 20, 40, 20)] + [Data(0, 80, 40, 20)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void GetData_RangeToVoid_Fail(Device device, Type textureType, int x, int y, int width, int height) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Texture2D texture = device.Get().AllocateTexture2D(textureType, array, 64, 64); + + float[] result = new float[4096]; + + texture.CopyTo(result, x, y, width, height); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadOnlyTexture2D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32).ToArray(); + + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(data, 32, 32); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Width, source.Height, new ReadOnlyTexture2DKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadOnlyTexture2DKernel : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XY]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadWriteTexture2D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32).ToArray(); + + using ReadWriteTexture2D source = device.Get().AllocateReadWriteTexture2D(data, 32, 32); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(32, 32); + + device.Get().For(source.Width, source.Height, new ReadWriteTexture2DKernel(source, destination)); + + int[] result = new int[data.Length]; + + destination.CopyTo(result); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadWriteTexture2DKernel : IComputeShader + { + public readonly ReadWriteTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = source[ThreadIds.XY]; + } + } } diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs index 56b9f16e..4d18fe94 100644 --- a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Numerics; using System.Reflection; using ComputeSharp.__Internals; @@ -9,58 +9,57 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; #pragma warning disable CS0618 -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +public partial class Texture3DTests { - public partial class Texture3DTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<,>))] + [Resource(typeof(ReadWriteTexture3D<,>))] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(float4))] + public void Allocate_Uninitialized_Pixel_Ok(Device device, Type textureType, Type t, Type tPixel) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<,>))] - [Resource(typeof(ReadWriteTexture3D<,>))] - [Data(typeof(Bgra32), typeof(Vector4))] - [Data(typeof(Bgra32), typeof(float4))] - [Data(typeof(R16), typeof(float))] - [Data(typeof(R8), typeof(float))] - [Data(typeof(Rg16), typeof(Vector2))] - [Data(typeof(Rg16), typeof(float2))] - [Data(typeof(Rg32), typeof(Vector2))] - [Data(typeof(Rg32), typeof(float2))] - [Data(typeof(Rgba32), typeof(Vector4))] - [Data(typeof(Rgba32), typeof(float4))] - [Data(typeof(Rgba64), typeof(Vector4))] - [Data(typeof(Rgba64), typeof(float4))] - public void Allocate_Uninitialized_Pixel_Ok(Device device, Type textureType, Type t, Type tPixel) + static void Test(Device device, Type textureType) + where T : unmanaged, IUnorm + where TPixel : unmanaged { - static void Test(Device device, Type textureType) - where T : unmanaged, IUnorm - where TPixel : unmanaged - { - using Texture3D texture = device.Get().AllocateTexture3D(textureType, 128, 128, 2); + using Texture3D texture = device.Get().AllocateTexture3D(textureType, 128, 128, 2); - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 128); - Assert.AreEqual(texture.Height, 128); - Assert.AreEqual(texture.Depth, 2); - Assert.AreSame(texture.GraphicsDevice, device.Get()); + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreEqual(texture.Depth, 2); + Assert.AreSame(texture.GraphicsDevice, device.Get()); - if (textureType == typeof(ReadOnlyTexture3D<,>)) - { - Assert.IsTrue(texture is ReadOnlyTexture3D); - } - else - { - Assert.IsTrue(texture is ReadWriteTexture3D); - } + if (textureType == typeof(ReadOnlyTexture3D<,>)) + { + Assert.IsTrue(texture is ReadOnlyTexture3D); } + else + { + Assert.IsTrue(texture is ReadWriteTexture3D); + } + } - try - { - new Action(Test).Method.GetGenericMethodDefinition().MakeGenericMethod(t, tPixel).Invoke(null, new object[] { device, textureType }); - } - catch (TargetInvocationException e) when (e.InnerException is not null) - { - throw e.InnerException; - } + try + { + new Action(Test).Method.GetGenericMethodDefinition().MakeGenericMethod(t, tPixel).Invoke(null, new object[] { device, textureType }); + } + catch (TargetInvocationException e) when (e.InnerException is not null) + { + throw e.InnerException; } } } diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs index 134a4ef4..23a9d4c5 100644 --- a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs @@ -3,254 +3,253 @@ using System.Numerics; using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +public partial class Texture3DTests { - public partial class Texture3DTests + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(Float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(Float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(Float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(Float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(Float4))] + public void Dispatch_NormalizedTexture3D(Device device, Type t, Type tPixel) { - [CombinatorialTestMethod] - [AllDevices] - [Data(typeof(Bgra32), typeof(Vector4))] - [Data(typeof(Bgra32), typeof(Float4))] - [Data(typeof(R16), typeof(float))] - [Data(typeof(R8), typeof(float))] - [Data(typeof(Rg16), typeof(Vector2))] - [Data(typeof(Rg16), typeof(Float2))] - [Data(typeof(Rg32), typeof(Vector2))] - [Data(typeof(Rg32), typeof(Float2))] - [Data(typeof(Rgba32), typeof(Vector4))] - [Data(typeof(Rgba32), typeof(Float4))] - [Data(typeof(Rgba64), typeof(Vector4))] - [Data(typeof(Rgba64), typeof(Float4))] - public void Dispatch_NormalizedTexture3D(Device device, Type t, Type tPixel) + if (t == typeof(Bgra32) && tPixel == typeof(Vector4)) { - if (t == typeof(Bgra32) && tPixel == typeof(Vector4)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - device.Get().For(128, 128, 2, new Shader_Unorm_Bgra32_Vector4(source, destination)); - } - if (t == typeof(Bgra32) && tPixel == typeof(Float4)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Bgra32_Float4(source, destination)); - } - if (t == typeof(R16) && tPixel == typeof(float)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_R16_float(source, destination)); - } - if (t == typeof(R8) && tPixel == typeof(float)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_R8_float(source, destination)); - } - if (t == typeof(Rg16) && tPixel == typeof(Vector2)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rg16_Vector2(source, destination)); - } - if (t == typeof(Rg16) && tPixel == typeof(Float2)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rg16_Float2(source, destination)); - } - if (t == typeof(Rg32) && tPixel == typeof(Vector2)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rg32_Vector2(source, destination)); - } - if (t == typeof(Rg32) && tPixel == typeof(Float2)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rg32_Float2(source, destination)); - } - if (t == typeof(Rgba32) && tPixel == typeof(Vector4)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rgba32_Vector4(source, destination)); - } - if (t == typeof(Rgba32) && tPixel == typeof(Float4)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rgba32_Float4(source, destination)); - } - if (t == typeof(Rgba64) && tPixel == typeof(Vector4)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rgba64_Vector4(source, destination)); - } - if (t == typeof(Rgba64) && tPixel == typeof(Float4)) - { - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - - device.Get().For(128, 128, 2, new Shader_Unorm_Rgba64_Float4(source, destination)); - } + device.Get().For(128, 128, 2, new Shader_Unorm_Bgra32_Vector4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Bgra32_Vector4 : IComputeShader + if (t == typeof(Bgra32) && tPixel == typeof(Float4)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Bgra32_Float4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader + if (t == typeof(R16) && tPixel == typeof(float)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_R16_float(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_R16_float : IComputeShader + if (t == typeof(R8) && tPixel == typeof(float)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_R8_float(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_R8_float : IComputeShader + if (t == typeof(Rg16) && tPixel == typeof(Vector2)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rg16_Vector2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader + if (t == typeof(Rg16) && tPixel == typeof(Float2)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rg16_Float2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader + if (t == typeof(Rg32) && tPixel == typeof(Vector2)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rg32_Vector2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader + if (t == typeof(Rg32) && tPixel == typeof(Float2)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rg32_Float2(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader + if (t == typeof(Rgba32) && tPixel == typeof(Vector4)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba32_Vector4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader + if (t == typeof(Rgba32) && tPixel == typeof(Float4)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba32_Float4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader + if (t == typeof(Rgba64) && tPixel == typeof(Vector4)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba64_Vector4(source, destination)); } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader + if (t == typeof(Rgba64) && tPixel == typeof(Float4)) { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } - } - - [AutoConstructor] - internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader - { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteTexture3D destination; - - public void Execute() - { - destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; - } + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba64_Float4(source, destination)); } } -} \ No newline at end of file + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R16_float : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R8_float : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } +} diff --git a/tests/ComputeSharp.Tests/Texture3DTests.cs b/tests/ComputeSharp.Tests/Texture3DTests.cs index c860d70f..377fdf2d 100644 --- a/tests/ComputeSharp.Tests/Texture3DTests.cs +++ b/tests/ComputeSharp.Tests/Texture3DTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using ComputeSharp.Resources; using ComputeSharp.Tests.Attributes; @@ -6,249 +6,248 @@ using ComputeSharp.Tests.Extensions; using Microsoft.Toolkit.HighPerformance; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("Texture3D")] +public partial class Texture3DTests { - [TestClass] - [TestCategory("Texture3D")] - public partial class Texture3DTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(AllocationMode.Default)] + [Data(AllocationMode.Clear)] + public void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - [Data(AllocationMode.Default)] - [Data(AllocationMode.Clear)] - public void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) + using Texture3D texture = device.Get().AllocateTexture3D(textureType, 64, 64, 12, allocationMode); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 64); + Assert.AreEqual(texture.Height, 64); + Assert.AreEqual(texture.Depth, 12); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (allocationMode == AllocationMode.Clear) { - using Texture3D texture = device.Get().AllocateTexture3D(textureType, 64, 64, 12, allocationMode); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 64); - Assert.AreEqual(texture.Height, 64); - Assert.AreEqual(texture.Depth, 12); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - if (allocationMode == AllocationMode.Clear) + foreach (float x in texture.ToArray()) { - foreach (float x in texture.ToArray()) - { - Assert.AreEqual(x, 0f); - } - } - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - [Data(128, -14253, 4)] - [Data(128, -1, 4)] - [Data(0, -4314, 4)] - [Data(-14, -53, 4)] - [Data(12, 12, -1)] - [Data(2, 4, ushort.MaxValue + 1)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height, int depth) - { - using Texture3D texture = device.Get().AllocateTexture3D(textureType, width, height, depth); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - [Data(12, 12, 4)] - [Data(2, 12, 4)] - [Data(64, 64, 1)] - [Data(64, 27, 3)] - public void Allocate_FromArray(Device device, Type textureType, int width, int height, int depth) - { - float[] data = Enumerable.Range(0, width * height * depth).Select(static i => (float)i).ToArray(); - - using Texture3D texture = device.Get().AllocateTexture3D(textureType, data, width, height, depth); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, width); - Assert.AreEqual(texture.Height, height); - Assert.AreEqual(texture.Depth, depth); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - float[,,] result = texture.ToArray(); - - Assert.IsNotNull(result); - Assert.AreEqual(result.GetLength(0), depth); - Assert.AreEqual(result.GetLength(1), height); - Assert.AreEqual(result.GetLength(2), width); - Assert.AreEqual(data.Length, result.Length); - Assert.IsTrue(data.SequenceEqual(result.Cast())); - - Array.Clear(result, 0, result.Length); - - float[] flat = new float[result.Length]; - - texture.CopyTo(flat); - - CollectionAssert.AreEqual(flat, data); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - [ExpectedException(typeof(ObjectDisposedException))] - public void UsageAfterDispose(Device device, Type textureType) - { - using Texture3D texture = device.Get().AllocateTexture3D(textureType, 10, 10, 4); - - texture.Dispose(); - - _ = texture.ToArray(); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - public void DisposeAfterDevice(Device device, Type textureType) - { - GraphicsDevice? gpu = device switch - { - Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), - Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => throw new ArgumentException(nameof(device)) - }; - - if (gpu is null) - { - Assert.Inconclusive(); - - return; - } - - Texture3D texture = gpu.AllocateTexture3D(textureType, 10, 10, 4); - - gpu.Dispose(); - texture.Dispose(); - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - [Data(0, 0, 0, 64, 64, 3)] - [Data(0, 14, 0, 64, 50, 3)] - [Data(0, 14, 1, 64, 50, 2)] - [Data(14, 0, 1, 50, 64, 2)] - [Data(10, 10, 2, 54, 54, 1)] - [Data(20, 20, 0, 32, 27, 3)] - [Data(60, 0, 0, 4, 64, 3)] - [Data(0, 60, 2, 64, 4, 1)] - [Data(63, 2, 0, 1, 60, 2)] - [Data(2, 63, 1, 60, 1, 2)] - public void GetData_RangeToVoid_Ok(Device device, Type textureType, int x, int y, int z, int width, int height, int depth) - { - int[,,] array = new int[3, 64, 64]; - - foreach (var item in array.AsSpan().Enumerate()) - item.Value = item.Index; - - using Texture3D texture = device.Get().AllocateTexture3D(textureType, array); - - int[,,] result = new int[depth, height, width]; - - texture.CopyTo(result.AsSpan(), x, y, z, width, height, depth); - - for (int k = 0; k < depth; k++) - { - Span2D - source = array.AsSpan2D(z + k).Slice(y, x, height, width), - destination = result.AsSpan2D(k); - - CollectionAssert.AreEqual(source.ToArray(), destination.ToArray()); - } - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(ReadOnlyTexture3D<>))] - [Resource(typeof(ReadWriteTexture3D<>))] - [Data(0, -1, 0, 50, 50, 2)] - [Data(-1, 0, 0, 50, 50, 3)] - [Data(12, 0, 0, -1, 50, 1)] - [Data(12, 0, 0, 20, 50, 0)] - [Data(12, 0, 1, 20, -1, 2)] - [Data(12, 20, 2, 20, 50, 1)] - [Data(12, 20, 0, 60, 20, 3)] - [Data(80, 20, 2, 40, 20, 1)] - [Data(0, 80, 2, 40, 20, 1)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void GetData_RangeToVoid_Fail(Device device, Type textureType, int x, int y, int z, int width, int height, int depth) - { - float[] array = Enumerable.Range(0, 64 * 64 * 3).Select(static i => (float)i).ToArray(); - - using Texture3D texture = device.Get().AllocateTexture3D(textureType, array, 64, 64, 3); - - float[] result = new float[array.Length]; - - texture.CopyTo(result, x, y, z, width, height, depth); - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ReadOnlyTexture3D(Device device) - { - int[] data = Enumerable.Range(0, 32 * 32 * 3).ToArray(); - - using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(data, 32, 32, 3); - using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); - - device.Get().For(source.Width, source.Height, source.Depth, new ReadOnlyTexture3DKernel(source, destination)); - - int[] result = destination.ToArray(); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ReadOnlyTexture3DKernel : IComputeShader - { - public readonly ReadOnlyTexture3D source; - public readonly ReadWriteBuffer destination; - - public void Execute() - { - destination[ThreadIds.Z * 32 * 32 + ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XYZ]; - } - } - - [CombinatorialTestMethod] - [AllDevices] - public void Dispatch_ReadWriteTexture2D(Device device) - { - int[] data = Enumerable.Range(0, 32 * 32 * 3).ToArray(); - - using ReadWriteTexture3D source = device.Get().AllocateReadWriteTexture3D(data, 32, 32, 3); - using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(32, 32, 3); - - device.Get().For(source.Width, source.Height, source.Depth, new ReadWriteTexture3DKernel(source, destination)); - - int[] result = new int[data.Length]; - - destination.CopyTo(result); - - CollectionAssert.AreEqual(data, result); - } - - [AutoConstructor] - internal readonly partial struct ReadWriteTexture3DKernel : IComputeShader - { - public readonly ReadWriteTexture3D source; - public readonly ReadWriteTexture3D destination; - - public void Execute() - { - destination[ThreadIds.XYZ] = source[ThreadIds.XYZ]; + Assert.AreEqual(x, 0f); } } } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(128, -14253, 4)] + [Data(128, -1, 4)] + [Data(0, -4314, 4)] + [Data(-14, -53, 4)] + [Data(12, 12, -1)] + [Data(2, 4, ushort.MaxValue + 1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height, int depth) + { + using Texture3D texture = device.Get().AllocateTexture3D(textureType, width, height, depth); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(12, 12, 4)] + [Data(2, 12, 4)] + [Data(64, 64, 1)] + [Data(64, 27, 3)] + public void Allocate_FromArray(Device device, Type textureType, int width, int height, int depth) + { + float[] data = Enumerable.Range(0, width * height * depth).Select(static i => (float)i).ToArray(); + + using Texture3D texture = device.Get().AllocateTexture3D(textureType, data, width, height, depth); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, width); + Assert.AreEqual(texture.Height, height); + Assert.AreEqual(texture.Depth, depth); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + float[,,] result = texture.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(result.GetLength(0), depth); + Assert.AreEqual(result.GetLength(1), height); + Assert.AreEqual(result.GetLength(2), width); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result.Cast())); + + Array.Clear(result, 0, result.Length); + + float[] flat = new float[result.Length]; + + texture.CopyTo(flat); + + CollectionAssert.AreEqual(flat, data); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type textureType) + { + using Texture3D texture = device.Get().AllocateTexture3D(textureType, 10, 10, 4); + + texture.Dispose(); + + _ = texture.ToArray(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + public void DisposeAfterDevice(Device device, Type textureType) + { + GraphicsDevice? gpu = device switch + { + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), + _ => throw new ArgumentException(nameof(device)) + }; + + if (gpu is null) + { + Assert.Inconclusive(); + + return; + } + + Texture3D texture = gpu.AllocateTexture3D(textureType, 10, 10, 4); + + gpu.Dispose(); + texture.Dispose(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(0, 0, 0, 64, 64, 3)] + [Data(0, 14, 0, 64, 50, 3)] + [Data(0, 14, 1, 64, 50, 2)] + [Data(14, 0, 1, 50, 64, 2)] + [Data(10, 10, 2, 54, 54, 1)] + [Data(20, 20, 0, 32, 27, 3)] + [Data(60, 0, 0, 4, 64, 3)] + [Data(0, 60, 2, 64, 4, 1)] + [Data(63, 2, 0, 1, 60, 2)] + [Data(2, 63, 1, 60, 1, 2)] + public void GetData_RangeToVoid_Ok(Device device, Type textureType, int x, int y, int z, int width, int height, int depth) + { + int[,,] array = new int[3, 64, 64]; + + foreach (var item in array.AsSpan().Enumerate()) + item.Value = item.Index; + + using Texture3D texture = device.Get().AllocateTexture3D(textureType, array); + + int[,,] result = new int[depth, height, width]; + + texture.CopyTo(result.AsSpan(), x, y, z, width, height, depth); + + for (int k = 0; k < depth; k++) + { + Span2D + source = array.AsSpan2D(z + k).Slice(y, x, height, width), + destination = result.AsSpan2D(k); + + CollectionAssert.AreEqual(source.ToArray(), destination.ToArray()); + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(0, -1, 0, 50, 50, 2)] + [Data(-1, 0, 0, 50, 50, 3)] + [Data(12, 0, 0, -1, 50, 1)] + [Data(12, 0, 0, 20, 50, 0)] + [Data(12, 0, 1, 20, -1, 2)] + [Data(12, 20, 2, 20, 50, 1)] + [Data(12, 20, 0, 60, 20, 3)] + [Data(80, 20, 2, 40, 20, 1)] + [Data(0, 80, 2, 40, 20, 1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void GetData_RangeToVoid_Fail(Device device, Type textureType, int x, int y, int z, int width, int height, int depth) + { + float[] array = Enumerable.Range(0, 64 * 64 * 3).Select(static i => (float)i).ToArray(); + + using Texture3D texture = device.Get().AllocateTexture3D(textureType, array, 64, 64, 3); + + float[] result = new float[array.Length]; + + texture.CopyTo(result, x, y, z, width, height, depth); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadOnlyTexture3D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32 * 3).ToArray(); + + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(data, 32, 32, 3); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Width, source.Height, source.Depth, new ReadOnlyTexture3DKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadOnlyTexture3DKernel : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.Z * 32 * 32 + ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XYZ]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadWriteTexture2D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32 * 3).ToArray(); + + using ReadWriteTexture3D source = device.Get().AllocateReadWriteTexture3D(data, 32, 32, 3); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(32, 32, 3); + + device.Get().For(source.Width, source.Height, source.Depth, new ReadWriteTexture3DKernel(source, destination)); + + int[] result = new int[data.Length]; + + destination.CopyTo(result); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadWriteTexture3DKernel : IComputeShader + { + public readonly ReadWriteTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = source[ThreadIds.XYZ]; + } + } } diff --git a/tests/ComputeSharp.Tests/TransferBufferTests.cs b/tests/ComputeSharp.Tests/TransferBufferTests.cs index c35afee1..d3fb5e34 100644 --- a/tests/ComputeSharp.Tests/TransferBufferTests.cs +++ b/tests/ComputeSharp.Tests/TransferBufferTests.cs @@ -7,167 +7,166 @@ using ComputeSharp.Tests.Extensions; using Microsoft.Toolkit.HighPerformance; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("TransferBuffer")] +public partial class TransferBufferTests { - [TestClass] - [TestCategory("TransferBuffer")] - public partial class TransferBufferTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + [Data(AllocationMode.Default)] + [Data(AllocationMode.Clear)] + public unsafe void Allocate_Uninitialized_Ok(Device device, Type bufferType, AllocationMode allocationMode) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadBuffer<>))] - [Resource(typeof(ReadBackBuffer<>))] - [Data(AllocationMode.Default)] - [Data(AllocationMode.Clear)] - public unsafe void Allocate_Uninitialized_Ok(Device device, Type bufferType, AllocationMode allocationMode) + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128, allocationMode); + + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Length, 128); + Assert.AreEqual(buffer.Memory.Length, 128); + Assert.AreEqual(buffer.Span.Length, 128); + Assert.IsTrue(Unsafe.AreSame(ref buffer.Memory.Span[0], ref buffer.Span[0])); + Assert.IsTrue(Unsafe.AreSame(ref *(float*)buffer.Memory.Pin().Pointer, ref buffer.Span[0])); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); + + if (allocationMode == AllocationMode.Clear) { - using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128, allocationMode); - - Assert.IsNotNull(buffer); - Assert.AreEqual(buffer.Length, 128); - Assert.AreEqual(buffer.Memory.Length, 128); - Assert.AreEqual(buffer.Span.Length, 128); - Assert.IsTrue(Unsafe.AreSame(ref buffer.Memory.Span[0], ref buffer.Span[0])); - Assert.IsTrue(Unsafe.AreSame(ref *(float*)buffer.Memory.Pin().Pointer, ref buffer.Span[0])); - Assert.AreSame(buffer.GraphicsDevice, device.Get()); - - if (allocationMode == AllocationMode.Clear) + foreach (float x in buffer.Span) { - foreach (float x in buffer.Span) - { - Assert.AreEqual(x, 0f); - } + Assert.AreEqual(x, 0f); } } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadBuffer<>))] - [Resource(typeof(ReadBackBuffer<>))] - [Data(-247824)] - [Data(-1)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int length) + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + [Data(-247824)] + [Data(-1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int length) + { + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, length); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type bufferType) + { + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128); + + buffer.Dispose(); + + _ = buffer.Span; + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + public void DisposeAfterDevice(Device device, Type bufferType) + { + GraphicsDevice? gpu = device switch { - using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, length); - } + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), + _ => throw new ArgumentException(nameof(device)) + }; - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadBuffer<>))] - [Resource(typeof(ReadBackBuffer<>))] - [ExpectedException(typeof(ObjectDisposedException))] - public void UsageAfterDispose(Device device, Type bufferType) + if (gpu is null) { - using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128); + Assert.Inconclusive(); - buffer.Dispose(); - - _ = buffer.Span; + return; } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadBuffer<>))] - [Resource(typeof(ReadBackBuffer<>))] - public void DisposeAfterDevice(Device device, Type bufferType) - { - GraphicsDevice? gpu = device switch - { - Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), - Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => throw new ArgumentException(nameof(device)) - }; - - if (gpu is null) - { - Assert.Inconclusive(); - return; - } + TransferBuffer buffer = gpu.AllocateTransferBuffer(bufferType, 128); - TransferBuffer buffer = gpu.AllocateTransferBuffer(bufferType, 128); - - gpu.Dispose(); - buffer.Dispose(); - } + gpu.Dispose(); + buffer.Dispose(); + } - [CombinatorialTestMethod] - [AllDevices] - public void Allocate_UploadBuffer_Copy_Full(Device device) - { - using UploadBuffer uploadBuffer = device.Get().AllocateUploadBuffer(4096); + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_UploadBuffer_Copy_Full(Device device) + { + using UploadBuffer uploadBuffer = device.Get().AllocateUploadBuffer(4096); - new Random(42).NextBytes(uploadBuffer.Span.AsBytes()); + new Random(42).NextBytes(uploadBuffer.Span.AsBytes()); - using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(uploadBuffer.Length); + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(uploadBuffer.Length); - uploadBuffer.CopyTo(readOnlyBuffer); + uploadBuffer.CopyTo(readOnlyBuffer); - int[] result = readOnlyBuffer.ToArray(); + int[] result = readOnlyBuffer.ToArray(); - Assert.AreEqual(uploadBuffer.Length, result.Length); - Assert.IsTrue(uploadBuffer.Span.SequenceEqual(result)); - } + Assert.AreEqual(uploadBuffer.Length, result.Length); + Assert.IsTrue(uploadBuffer.Span.SequenceEqual(result)); + } - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 0, 4096)] - [Data(128, 0, 2048)] - [Data(0, 128, 2048)] - [Data(97, 33, 512)] - public void Allocate_UploadBuffer_Copy_Range(Device device, int destinationOffset, int bufferOffset, int count) - { - using UploadBuffer uploadBuffer = device.Get().AllocateUploadBuffer(4096); + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 4096)] + [Data(128, 0, 2048)] + [Data(0, 128, 2048)] + [Data(97, 33, 512)] + public void Allocate_UploadBuffer_Copy_Range(Device device, int destinationOffset, int bufferOffset, int count) + { + using UploadBuffer uploadBuffer = device.Get().AllocateUploadBuffer(4096); - new Random(42).NextBytes(uploadBuffer.Span.AsBytes()); + new Random(42).NextBytes(uploadBuffer.Span.AsBytes()); - using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(uploadBuffer.Length); + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(uploadBuffer.Length); - uploadBuffer.CopyTo(readOnlyBuffer, destinationOffset, bufferOffset, count); + uploadBuffer.CopyTo(readOnlyBuffer, destinationOffset, bufferOffset, count); - int[] result = readOnlyBuffer.ToArray(destinationOffset, count); + int[] result = readOnlyBuffer.ToArray(destinationOffset, count); - Assert.AreEqual(result.Length, count); - Assert.IsTrue(uploadBuffer.Span.Slice(bufferOffset, count).SequenceEqual(result)); - } + Assert.AreEqual(result.Length, count); + Assert.IsTrue(uploadBuffer.Span.Slice(bufferOffset, count).SequenceEqual(result)); + } - [CombinatorialTestMethod] - [AllDevices] - public void Allocate_ReadBackBuffer_Copy_Full(Device device) - { - int[] source = new int[4096]; + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_ReadBackBuffer_Copy_Full(Device device) + { + int[] source = new int[4096]; - new Random(42).NextBytes(source.AsSpan().AsBytes()); + new Random(42).NextBytes(source.AsSpan().AsBytes()); - using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(source); - using ReadBackBuffer readBackBuffer = device.Get().AllocateReadBackBuffer(readOnlyBuffer.Length); + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(source); + using ReadBackBuffer readBackBuffer = device.Get().AllocateReadBackBuffer(readOnlyBuffer.Length); - readOnlyBuffer.CopyTo(readBackBuffer); + readOnlyBuffer.CopyTo(readBackBuffer); - Assert.AreEqual(source.Length, readBackBuffer.Length); - Assert.IsTrue(source.AsSpan().SequenceEqual(readBackBuffer.Span)); - } + Assert.AreEqual(source.Length, readBackBuffer.Length); + Assert.IsTrue(source.AsSpan().SequenceEqual(readBackBuffer.Span)); + } - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 0, 4096)] - [Data(128, 0, 2048)] - [Data(0, 128, 2048)] - [Data(97, 33, 512)] - public void Allocate_ReadBackBuffer_Copy_Range(Device device, int destinationOffset, int bufferOffset, int count) - { - int[] source = new int[4096]; + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 4096)] + [Data(128, 0, 2048)] + [Data(0, 128, 2048)] + [Data(97, 33, 512)] + public void Allocate_ReadBackBuffer_Copy_Range(Device device, int destinationOffset, int bufferOffset, int count) + { + int[] source = new int[4096]; - new Random(42).NextBytes(source.AsSpan().AsBytes()); + new Random(42).NextBytes(source.AsSpan().AsBytes()); - using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(source); - using ReadBackBuffer readBackBuffer = device.Get().AllocateReadBackBuffer(readOnlyBuffer.Length); + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(source); + using ReadBackBuffer readBackBuffer = device.Get().AllocateReadBackBuffer(readOnlyBuffer.Length); - readOnlyBuffer.CopyTo(readBackBuffer, destinationOffset, bufferOffset, count); + readOnlyBuffer.CopyTo(readBackBuffer, destinationOffset, bufferOffset, count); - Assert.AreEqual(source.Length, readBackBuffer.Length); - Assert.IsTrue(source.AsSpan(bufferOffset, count).SequenceEqual(readBackBuffer.Span.Slice(destinationOffset, count))); - } + Assert.AreEqual(source.Length, readBackBuffer.Length); + Assert.IsTrue(source.AsSpan(bufferOffset, count).SequenceEqual(readBackBuffer.Span.Slice(destinationOffset, count))); } } diff --git a/tests/ComputeSharp.Tests/TransferTexture2DTests.cs b/tests/ComputeSharp.Tests/TransferTexture2DTests.cs index 2a413ecf..be4dda0d 100644 --- a/tests/ComputeSharp.Tests/TransferTexture2DTests.cs +++ b/tests/ComputeSharp.Tests/TransferTexture2DTests.cs @@ -6,203 +6,202 @@ using ComputeSharp.Tests.Extensions; using Microsoft.Toolkit.HighPerformance; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("TransferTexture2D")] +public partial class TransferTexture2DTests { - [TestClass] - [TestCategory("TransferTexture2D")] - public partial class TransferTexture2DTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + [Data(AllocationMode.Default)] + [Data(AllocationMode.Clear)] + public unsafe void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture2D<>))] - [Resource(typeof(ReadBackTexture2D<>))] - [Data(AllocationMode.Default)] - [Data(AllocationMode.Clear)] - public unsafe void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) + using TransferTexture2D texture = device.Get().AllocateTransferTexture2D(textureType, 128, 256, allocationMode); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 256); + Assert.AreEqual(texture.View.Width, 128); + Assert.AreEqual(texture.View.Height, 256); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (allocationMode == AllocationMode.Clear) { - using TransferTexture2D texture = device.Get().AllocateTransferTexture2D(textureType, 128, 256, allocationMode); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 128); - Assert.AreEqual(texture.Height, 256); - Assert.AreEqual(texture.View.Width, 128); - Assert.AreEqual(texture.View.Height, 256); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - if (allocationMode == AllocationMode.Clear) + for (int y = 0; y < texture.Height; y++) { - for (int y = 0; y < texture.Height; y++) + foreach (float x in texture.View.GetRowSpan(y)) { - foreach (float x in texture.View.GetRowSpan(y)) - { - Assert.AreEqual(x, 0f); - } + Assert.AreEqual(x, 0f); } } } + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture2D<>))] - [Resource(typeof(ReadBackTexture2D<>))] - [Data(128, -14253)] - [Data(128, -1)] - [Data(0, -4314)] - [Data(-14, -53)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height) + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + [Data(128, -14253)] + [Data(128, -1)] + [Data(0, -4314)] + [Data(-14, -53)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height) + { + using TransferTexture2D texture = device.Get().AllocateTransferTexture2D(textureType, width, height); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type textureType) + { + using TransferTexture2D texture = device.Get().AllocateTransferTexture2D(textureType, 32, 32); + + texture.Dispose(); + + _ = texture.View; + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + public void DisposeAfterDevice(Device device, Type textureType) + { + GraphicsDevice? gpu = device switch { - using TransferTexture2D texture = device.Get().AllocateTransferTexture2D(textureType, width, height); + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), + _ => throw new ArgumentException(nameof(device)) + }; + + if (gpu is null) + { + Assert.Inconclusive(); + + return; } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture2D<>))] - [Resource(typeof(ReadBackTexture2D<>))] - [ExpectedException(typeof(ObjectDisposedException))] - public void UsageAfterDispose(Device device, Type textureType) + TransferTexture2D texture = gpu.AllocateTransferTexture2D(textureType, 32, 32); + + gpu.Dispose(); + texture.Dispose(); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_UploadTexture2D_Copy_Full(Device device) + { + using UploadTexture2D uploadTexture2D = device.Get().AllocateUploadTexture2D(256, 256); + + for (int i = 0; i < uploadTexture2D.Height; i++) { - using TransferTexture2D texture = device.Get().AllocateTransferTexture2D(textureType, 32, 32); - - texture.Dispose(); - - _ = texture.View; + new Random(i).NextBytes(uploadTexture2D.View.GetRowSpan(i).AsBytes()); } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture2D<>))] - [Resource(typeof(ReadBackTexture2D<>))] - public void DisposeAfterDevice(Device device, Type textureType) + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(uploadTexture2D.Width, uploadTexture2D.Height); + + uploadTexture2D.CopyTo(readOnlyTexture2D); + + int[,] result = readOnlyTexture2D.ToArray(); + + Assert.AreEqual(uploadTexture2D.Width, result.GetLength(1)); + Assert.AreEqual(uploadTexture2D.Height, result.GetLength(0)); + + for (int i = 0; i < uploadTexture2D.Height; i++) { - GraphicsDevice? gpu = device switch - { - Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), - Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => throw new ArgumentException(nameof(device)) - }; + Assert.IsTrue(uploadTexture2D.View.GetRowSpan(i).SequenceEqual(result.GetRowSpan(i))); + } + } - if (gpu is null) - { - Assert.Inconclusive(); + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 2048, 2048)] + [Data(128, 0, 1813, 2048)] + [Data(0, 128, 2000, 944)] + [Data(97, 33, 512, 794)] + public void Allocate_UploadTexture2D_Copy_Range(Device device, int x, int y, int width, int height) + { + using UploadTexture2D uploadTexture2D = device.Get().AllocateUploadTexture2D(2048, 2048); - return; - } - - TransferTexture2D texture = gpu.AllocateTransferTexture2D(textureType, 32, 32); - - gpu.Dispose(); - texture.Dispose(); + for (int i = 0; i < uploadTexture2D.Height; i++) + { + new Random(i).NextBytes(uploadTexture2D.View.GetRowSpan(i).AsBytes()); } - [CombinatorialTestMethod] - [AllDevices] - public void Allocate_UploadTexture2D_Copy_Full(Device device) + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(uploadTexture2D.Width, uploadTexture2D.Height); + + uploadTexture2D.CopyTo(readOnlyTexture2D, x, y, width, height); + + int[,] result = readOnlyTexture2D.ToArray(); + + for (int i = 0; i < height; i++) { - using UploadTexture2D uploadTexture2D = device.Get().AllocateUploadTexture2D(256, 256); + Span sourceRow = uploadTexture2D.View.GetRowSpan(i + y).Slice(x, width); + Span destinationRow = result.GetRowSpan(i).Slice(0, width); - for (int i = 0; i < uploadTexture2D.Height; i++) - { - new Random(i).NextBytes(uploadTexture2D.View.GetRowSpan(i).AsBytes()); - } + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } - using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(uploadTexture2D.Width, uploadTexture2D.Height); + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_ReadBackTexture2D_Copy_Full(Device device) + { + int[,] source = new int[256, 256]; - uploadTexture2D.CopyTo(readOnlyTexture2D); - - int[,] result = readOnlyTexture2D.ToArray(); - - Assert.AreEqual(uploadTexture2D.Width, result.GetLength(1)); - Assert.AreEqual(uploadTexture2D.Height, result.GetLength(0)); - - for (int i = 0; i < uploadTexture2D.Height; i++) - { - Assert.IsTrue(uploadTexture2D.View.GetRowSpan(i).SequenceEqual(result.GetRowSpan(i))); - } + for (int i = 0; i < 256; i++) + { + new Random(42).NextBytes(source.GetRowSpan(i).AsBytes()); } - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 0, 2048, 2048)] - [Data(128, 0, 1813, 2048)] - [Data(0, 128, 2000, 944)] - [Data(97, 33, 512, 794)] - public void Allocate_UploadTexture2D_Copy_Range(Device device, int x, int y, int width, int height) + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(source); + using ReadBackTexture2D readBackTexture2D = device.Get().AllocateReadBackTexture2D(256, 256); + + readOnlyTexture2D.CopyTo(readBackTexture2D); + + Assert.AreEqual(readBackTexture2D.Width, 256); + Assert.AreEqual(readBackTexture2D.Height, 256); + + for (int i = 0; i < readBackTexture2D.Height; i++) { - using UploadTexture2D uploadTexture2D = device.Get().AllocateUploadTexture2D(2048, 2048); + Assert.IsTrue(readBackTexture2D.View.GetRowSpan(i).SequenceEqual(source.GetRowSpan(i))); + } + } - for (int i = 0; i < uploadTexture2D.Height; i++) - { - new Random(i).NextBytes(uploadTexture2D.View.GetRowSpan(i).AsBytes()); - } + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 2048, 2048)] + [Data(128, 0, 1813, 2048)] + [Data(0, 128, 2000, 944)] + [Data(97, 33, 512, 794)] + public void Allocate_ReadBackTexture2D_Copy_Range(Device device, int x, int y, int width, int height) + { + int[,] source = new int[2048, 2048]; - using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(uploadTexture2D.Width, uploadTexture2D.Height); - - uploadTexture2D.CopyTo(readOnlyTexture2D, x, y, width, height); - - int[,] result = readOnlyTexture2D.ToArray(); - - for (int i = 0; i < height; i++) - { - Span sourceRow = uploadTexture2D.View.GetRowSpan(i + y).Slice(x, width); - Span destinationRow = result.GetRowSpan(i).Slice(0, width); - - Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); - } + for (int i = 0; i < 2048; i++) + { + new Random(42).NextBytes(source.GetRowSpan(i).AsBytes()); } - [CombinatorialTestMethod] - [AllDevices] - public void Allocate_ReadBackTexture2D_Copy_Full(Device device) + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(source); + using ReadBackTexture2D readBackTexture2D = device.Get().AllocateReadBackTexture2D(2048, 2048); + + readOnlyTexture2D.CopyTo(readBackTexture2D, x, y, width, height); + + for (int i = 0; i < height; i++) { - int[,] source = new int[256, 256]; + Span sourceRow = source.GetRowSpan(i + y).Slice(x, width); + Span destinationRow = readBackTexture2D.View.GetRowSpan(i).Slice(0, width); - for (int i = 0; i < 256; i++) - { - new Random(42).NextBytes(source.GetRowSpan(i).AsBytes()); - } - - using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(source); - using ReadBackTexture2D readBackTexture2D = device.Get().AllocateReadBackTexture2D(256, 256); - - readOnlyTexture2D.CopyTo(readBackTexture2D); - - Assert.AreEqual(readBackTexture2D.Width, 256); - Assert.AreEqual(readBackTexture2D.Height, 256); - - for (int i = 0; i < readBackTexture2D.Height; i++) - { - Assert.IsTrue(readBackTexture2D.View.GetRowSpan(i).SequenceEqual(source.GetRowSpan(i))); - } - } - - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 0, 2048, 2048)] - [Data(128, 0, 1813, 2048)] - [Data(0, 128, 2000, 944)] - [Data(97, 33, 512, 794)] - public void Allocate_ReadBackTexture2D_Copy_Range(Device device, int x, int y, int width, int height) - { - int[,] source = new int[2048, 2048]; - - for (int i = 0; i < 2048; i++) - { - new Random(42).NextBytes(source.GetRowSpan(i).AsBytes()); - } - - using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(source); - using ReadBackTexture2D readBackTexture2D = device.Get().AllocateReadBackTexture2D(2048, 2048); - - readOnlyTexture2D.CopyTo(readBackTexture2D, x, y, width, height); - - for (int i = 0; i < height; i++) - { - Span sourceRow = source.GetRowSpan(i + y).Slice(x, width); - Span destinationRow = readBackTexture2D.View.GetRowSpan(i).Slice(0, width); - - Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); - } + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); } } } diff --git a/tests/ComputeSharp.Tests/TransferTexture3DTests.cs b/tests/ComputeSharp.Tests/TransferTexture3DTests.cs index 302198d0..c28bb6c6 100644 --- a/tests/ComputeSharp.Tests/TransferTexture3DTests.cs +++ b/tests/ComputeSharp.Tests/TransferTexture3DTests.cs @@ -6,243 +6,242 @@ using ComputeSharp.Tests.Extensions; using Microsoft.Toolkit.HighPerformance; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace ComputeSharp.Tests +namespace ComputeSharp.Tests; + +[TestClass] +[TestCategory("TransferTexture3D")] +public partial class TransferTexture3DTests { - [TestClass] - [TestCategory("TransferTexture3D")] - public partial class TransferTexture3DTests + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + [Data(AllocationMode.Default)] + [Data(AllocationMode.Clear)] + public unsafe void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) { - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture3D<>))] - [Resource(typeof(ReadBackTexture3D<>))] - [Data(AllocationMode.Default)] - [Data(AllocationMode.Clear)] - public unsafe void Allocate_Uninitialized_Ok(Device device, Type textureType, AllocationMode allocationMode) + using TransferTexture3D texture = device.Get().AllocateTransferTexture3D(textureType, 128, 256, 32, allocationMode); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 256); + Assert.AreEqual(texture.Depth, 32); + Assert.AreEqual(texture.View.Width, 128); + Assert.AreEqual(texture.View.Height, 256); + Assert.AreEqual(texture.View.Depth, 32); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (allocationMode == AllocationMode.Clear) { - using TransferTexture3D texture = device.Get().AllocateTransferTexture3D(textureType, 128, 256, 32, allocationMode); - - Assert.IsNotNull(texture); - Assert.AreEqual(texture.Width, 128); - Assert.AreEqual(texture.Height, 256); - Assert.AreEqual(texture.Depth, 32); - Assert.AreEqual(texture.View.Width, 128); - Assert.AreEqual(texture.View.Height, 256); - Assert.AreEqual(texture.View.Depth, 32); - Assert.AreSame(texture.GraphicsDevice, device.Get()); - - if (allocationMode == AllocationMode.Clear) + for (int z = 0; z < texture.Depth; z++) { - for (int z = 0; z < texture.Depth; z++) + for (int y = 0; y < texture.Height; y++) { - for (int y = 0; y < texture.Height; y++) + foreach (float x in texture.View.GetRowSpan(y, z)) { - foreach (float x in texture.View.GetRowSpan(y, z)) - { - Assert.AreEqual(x, 0f); - } + Assert.AreEqual(x, 0f); } } } } + } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture3D<>))] - [Resource(typeof(ReadBackTexture3D<>))] - [Data(128, -14253, 4)] - [Data(128, -1, 4)] - [Data(0, -4314, 4)] - [Data(-14, -53, 4)] - [Data(12, 12, -1)] - [Data(2, 4, ushort.MaxValue + 1)] - [ExpectedException(typeof(ArgumentOutOfRangeException))] - public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height, int depth) + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + [Data(128, -14253, 4)] + [Data(128, -1, 4)] + [Data(0, -4314, 4)] + [Data(-14, -53, 4)] + [Data(12, 12, -1)] + [Data(2, 4, ushort.MaxValue + 1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height, int depth) + { + using TransferTexture3D texture = device.Get().AllocateTransferTexture3D(textureType, width, height, depth); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type textureType) + { + using TransferTexture3D texture = device.Get().AllocateTransferTexture3D(textureType, 32, 32, 16); + + texture.Dispose(); + + _ = texture.View; + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + public void DisposeAfterDevice(Device device, Type textureType) + { + GraphicsDevice? gpu = device switch { - using TransferTexture3D texture = device.Get().AllocateTransferTexture3D(textureType, width, height, depth); + Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), + Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), + _ => throw new ArgumentException(nameof(device)) + }; + + if (gpu is null) + { + Assert.Inconclusive(); + + return; } - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture3D<>))] - [Resource(typeof(ReadBackTexture3D<>))] - [ExpectedException(typeof(ObjectDisposedException))] - public void UsageAfterDispose(Device device, Type textureType) + TransferTexture3D texture = gpu.AllocateTransferTexture3D(textureType, 32, 32, 16); + + gpu.Dispose(); + texture.Dispose(); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_UploadTexture3D_Copy_Full(Device device) + { + using UploadTexture3D uploadTexture3D = device.Get().AllocateUploadTexture3D(256, 256, 16); + + for (int i = 0; i < uploadTexture3D.Depth; i++) { - using TransferTexture3D texture = device.Get().AllocateTransferTexture3D(textureType, 32, 32, 16); - - texture.Dispose(); - - _ = texture.View; - } - - [CombinatorialTestMethod] - [AllDevices] - [Resource(typeof(UploadTexture3D<>))] - [Resource(typeof(ReadBackTexture3D<>))] - public void DisposeAfterDevice(Device device, Type textureType) - { - GraphicsDevice? gpu = device switch + for (int j = 0; j < uploadTexture3D.Height; j++) { - Device.Discrete => Gpu.QueryDevices(info => info.IsHardwareAccelerated).FirstOrDefault(), - Device.Warp => Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(), - _ => throw new ArgumentException(nameof(device)) - }; - - if (gpu is null) - { - Assert.Inconclusive(); - - return; - } - - TransferTexture3D texture = gpu.AllocateTransferTexture3D(textureType, 32, 32, 16); - - gpu.Dispose(); - texture.Dispose(); - } - - [CombinatorialTestMethod] - [AllDevices] - public void Allocate_UploadTexture3D_Copy_Full(Device device) - { - using UploadTexture3D uploadTexture3D = device.Get().AllocateUploadTexture3D(256, 256, 16); - - for (int i = 0; i < uploadTexture3D.Depth; i++) - { - for (int j = 0; j < uploadTexture3D.Height; j++) - { - new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes()); - } - } - - using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(uploadTexture3D.Width, uploadTexture3D.Height, uploadTexture3D.Depth); - - uploadTexture3D.CopyTo(readOnlyTexture3D); - - int[,,] result = readOnlyTexture3D.ToArray(); - - Assert.AreEqual(uploadTexture3D.Width, result.GetLength(2)); - Assert.AreEqual(uploadTexture3D.Height, result.GetLength(1)); - Assert.AreEqual(uploadTexture3D.Depth, result.GetLength(0)); - - for (int i = 0; i < uploadTexture3D.Depth; i++) - { - for (int j = 0; j < uploadTexture3D.Height; j++) - { - Span sourceRow = uploadTexture3D.View.GetRowSpan(j, i); - Span destinationRow = result.AsSpan2D(i).GetRowSpan(j); - - Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); - } + new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes()); } } - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 0, 0, 256, 256, 16)] - [Data(128, 0, 0, 72, 256, 16)] - [Data(0, 128, 0, 189, 67, 8)] - [Data(0, 0, 15, 32, 64, 1)] - [Data(97, 33, 4, 128, 99, 7)] - public void Allocate_UploadTexture3D_Copy_Range(Device device, int x, int y, int z, int width, int height, int depth) + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(uploadTexture3D.Width, uploadTexture3D.Height, uploadTexture3D.Depth); + + uploadTexture3D.CopyTo(readOnlyTexture3D); + + int[,,] result = readOnlyTexture3D.ToArray(); + + Assert.AreEqual(uploadTexture3D.Width, result.GetLength(2)); + Assert.AreEqual(uploadTexture3D.Height, result.GetLength(1)); + Assert.AreEqual(uploadTexture3D.Depth, result.GetLength(0)); + + for (int i = 0; i < uploadTexture3D.Depth; i++) { - using UploadTexture3D uploadTexture3D = device.Get().AllocateUploadTexture3D(256, 256, 16); - - for (int i = 0; i < uploadTexture3D.Depth; i++) + for (int j = 0; j < uploadTexture3D.Height; j++) { - for (int j = 0; j < uploadTexture3D.Height; j++) - { - new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes()); - } + Span sourceRow = uploadTexture3D.View.GetRowSpan(j, i); + Span destinationRow = result.AsSpan2D(i).GetRowSpan(j); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); } + } + } - using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(uploadTexture3D.Width, uploadTexture3D.Height, uploadTexture3D.Depth); + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 0, 256, 256, 16)] + [Data(128, 0, 0, 72, 256, 16)] + [Data(0, 128, 0, 189, 67, 8)] + [Data(0, 0, 15, 32, 64, 1)] + [Data(97, 33, 4, 128, 99, 7)] + public void Allocate_UploadTexture3D_Copy_Range(Device device, int x, int y, int z, int width, int height, int depth) + { + using UploadTexture3D uploadTexture3D = device.Get().AllocateUploadTexture3D(256, 256, 16); - uploadTexture3D.CopyTo(readOnlyTexture3D, x, y, z, width, height, depth); - - int[,,] result = readOnlyTexture3D.ToArray(); - - for (int i = 0; i < depth; i++) + for (int i = 0; i < uploadTexture3D.Depth; i++) + { + for (int j = 0; j < uploadTexture3D.Height; j++) { - for (int j = 0; j < height; j++) - { - Span sourceRow = uploadTexture3D.View.GetRowSpan(j + y, i + z).Slice(x, width); - Span destinationRow = result.AsSpan2D(i).GetRowSpan(j).Slice(0, width); - - Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); - } + new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes()); } } - [CombinatorialTestMethod] - [AllDevices] - public void Allocate_ReadBackTexture3D_Copy_Full(Device device) + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(uploadTexture3D.Width, uploadTexture3D.Height, uploadTexture3D.Depth); + + uploadTexture3D.CopyTo(readOnlyTexture3D, x, y, z, width, height, depth); + + int[,,] result = readOnlyTexture3D.ToArray(); + + for (int i = 0; i < depth; i++) { - int[,,] source = new int[16, 256, 256]; - - for (int i = 0; i < 16; i++) + for (int j = 0; j < height; j++) { - for (int j = 0; j < 256; j++) - { - new Random(i * 5381 + j).NextBytes(source.AsSpan2D(i).GetRowSpan(j).AsBytes()); - } + Span sourceRow = uploadTexture3D.View.GetRowSpan(j + y, i + z).Slice(x, width); + Span destinationRow = result.AsSpan2D(i).GetRowSpan(j).Slice(0, width); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); } + } + } - using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(source); - using ReadBackTexture3D readBackTexture3D = device.Get().AllocateReadBackTexture3D(256, 256, 16); + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_ReadBackTexture3D_Copy_Full(Device device) + { + int[,,] source = new int[16, 256, 256]; - readOnlyTexture3D.CopyTo(readBackTexture3D); - - Assert.AreEqual(readBackTexture3D.Width, 256); - Assert.AreEqual(readBackTexture3D.Height, 256); - Assert.AreEqual(readBackTexture3D.Depth, 16); - - for (int i = 0; i < readBackTexture3D.Depth; i++) + for (int i = 0; i < 16; i++) + { + for (int j = 0; j < 256; j++) { - for (int j = 0; j < readBackTexture3D.Height; j++) - { - Span sourceRow = source.AsSpan2D(i).GetRowSpan(j); - Span destinationRow = readBackTexture3D.View.GetRowSpan(j, i); - - Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); - } + new Random(i * 5381 + j).NextBytes(source.AsSpan2D(i).GetRowSpan(j).AsBytes()); } } - [CombinatorialTestMethod] - [AllDevices] - [Data(0, 0, 0, 256, 256, 16)] - [Data(128, 0, 0, 72, 256, 16)] - [Data(0, 128, 0, 189, 67, 8)] - [Data(0, 0, 15, 32, 64, 1)] - [Data(97, 33, 4, 128, 99, 7)] - public void Allocate_ReadBackTexture3D_Copy_Range(Device device, int x, int y, int z, int width, int height, int depth) + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(source); + using ReadBackTexture3D readBackTexture3D = device.Get().AllocateReadBackTexture3D(256, 256, 16); + + readOnlyTexture3D.CopyTo(readBackTexture3D); + + Assert.AreEqual(readBackTexture3D.Width, 256); + Assert.AreEqual(readBackTexture3D.Height, 256); + Assert.AreEqual(readBackTexture3D.Depth, 16); + + for (int i = 0; i < readBackTexture3D.Depth; i++) { - int[,,] source = new int[16, 256, 256]; - - for (int i = 0; i < 16; i++) + for (int j = 0; j < readBackTexture3D.Height; j++) { - for (int j = 0; j < 256; j++) - { - new Random(i * 5381 + j).NextBytes(source.AsSpan2D(i).GetRowSpan(j).AsBytes()); - } + Span sourceRow = source.AsSpan2D(i).GetRowSpan(j); + Span destinationRow = readBackTexture3D.View.GetRowSpan(j, i); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); } + } + } - using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(source); - using ReadBackTexture3D readBackTexture3D = device.Get().AllocateReadBackTexture3D(256, 256, 16); + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 0, 256, 256, 16)] + [Data(128, 0, 0, 72, 256, 16)] + [Data(0, 128, 0, 189, 67, 8)] + [Data(0, 0, 15, 32, 64, 1)] + [Data(97, 33, 4, 128, 99, 7)] + public void Allocate_ReadBackTexture3D_Copy_Range(Device device, int x, int y, int z, int width, int height, int depth) + { + int[,,] source = new int[16, 256, 256]; - readOnlyTexture3D.CopyTo(readBackTexture3D, x, y, z, width, height, depth); - - for (int i = 0; i < depth; i++) + for (int i = 0; i < 16; i++) + { + for (int j = 0; j < 256; j++) { - for (int j = 0; j < height; j++) - { - Span sourceRow = source.AsSpan2D(i + z).GetRowSpan(j + y).Slice(x, width); - Span destinationRow = readBackTexture3D.View.GetRowSpan(j, i).Slice(0, width); + new Random(i * 5381 + j).NextBytes(source.AsSpan2D(i).GetRowSpan(j).AsBytes()); + } + } - Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); - } + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(source); + using ReadBackTexture3D readBackTexture3D = device.Get().AllocateReadBackTexture3D(256, 256, 16); + + readOnlyTexture3D.CopyTo(readBackTexture3D, x, y, z, width, height, depth); + + for (int i = 0; i < depth; i++) + { + for (int j = 0; j < height; j++) + { + Span sourceRow = source.AsSpan2D(i + z).GetRowSpan(j + y).Slice(x, width); + Span destinationRow = readBackTexture3D.View.GetRowSpan(j, i).Slice(0, width); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); } } }